Skip to content

fix(tools): support tagPrefix as an array of tags#3153

Open
zeroedin wants to merge 2 commits into
staging/pfv6from
fix/tag-prefix-array
Open

fix(tools): support tagPrefix as an array of tags#3153
zeroedin wants to merge 2 commits into
staging/pfv6from
fix/tag-prefix-array

Conversation

@zeroedin
Copy link
Copy Markdown
Collaborator

Summary

Adds support for tagPrefix as string | string[] in .pfe.config.json, enabling both pf-v5-* and pf-v6-* elements to coexist in the same repo during the v6 migration.

Previously, tagPrefix was a single string ("pf-v5"). The test runner middleware, docs pages, and manifest tooling all assumed a single prefix, so v6 elements couldn't get .js.ts redirects in tests,
correct prefix stripping in docs, or proper demo metadata.

Changes

  • .pfe.config.json — changed tagPrefix from "pf-v5" to ["pf-v5", "pf-v6"]
  • tools/pfe-tools/config.ts — updated PfeConfig.tagPrefix type to string | string[]; updated deslugify() to check all prefixes using [value].flat()
  • tools/pfe-tools/test/config.ts — normalized prefix to array; middleware now matches any prefix via .some()
  • tools/pfe-tools/11ty/DocsPage.ts — finds matching prefix for tagName from array
  • tools/pfe-tools/custom-elements-manifest/lib/Manifest.ts — same prefix-matching pattern for demo metadata
  • tools/pfe-tools/11ty/plugins/types.ts — updated DemoRecord.tagPrefix type to string | string[]

Known Issues

  • Permalink collisions: 11ty generates the same permalink for elements sharing a base name (e.g. pf-v5-spinner and pf-v6-spinner both map to /components/spinner/). Only one version should exist at a time
    — remove the v5 element when the v6 replacement is ready.
  • Cross-element dependencies: Some v5 elements import other v5 elements directly (e.g. pf-v5-button imports pf-v5-spinner). When a v5 element is replaced by its v6 version, any v5 elements that depend on
    it must also be updated to import the v6 replacement, or the old v5 element must remain until all its consumers are migrated.
  • docs/main.mjs manual updates: This file eagerly imports all elements for the 11ty docs site. When swapping a v5 element for its v6 replacement, the import must be manually updated.

Test plan

  • npm run build — no type errors
  • npx wtr elements/pf-v5-accordion/test/pf-accordion.spec.ts — v5 element tests still pass
  • Copy a pf-v6-* element into the repo and run its tests without pre-building — .js.ts redirect works
  • Dev server docs pages render correct element names for both prefixes

Testing Instructions

Notes to Reviewers

@zeroedin zeroedin requested a review from bennypowers May 19, 2026 20:00
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

🦋 Changeset detected

Latest commit: 8ad8929

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@patternfly/pfe-tools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "fix(tools): support tagPrefix as an array of tags"
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 2c4250b
😎 Deploy Preview https://deploy-preview-3153--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions Bot added the AT passed Automated testing has passed label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 172d1a0: Report

@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 2c4250b: Report

@bennypowers
Copy link
Copy Markdown
Member

  • Permalink collisions
  • Cross-element dependencies

Arguably, these are both legitimately error states. This is so specified in the skill files

  • docs/main.mjs manual updates

Ideally we'd import in situ instead of a big master barrel import. Could be done in a later pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants