refactor(swc): target 2nd-gen swc components instead of 1st-gen#46
Merged
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
4591ba4 to
476e861
Compare
|
This was referenced May 26, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7c7f38a to
92e3995
Compare
auniverseaway
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrates the SWC component property extraction pipeline from 1st-gen (
@spectrum-web-components/sp-*) to 2nd-gen (@adobe/spectrum-wc+swc-*tags), adds extraction tests, and wires up a split test command so browser and Node tests don't step on each other.What changed and why
Extractor rewrite (
deps/swc/extract-cem-components.js,extract-cem-mixins.js): 1st-gen fetched a separate CEM per component package and manually walked inheritance chains + merged mixin data fromsp-mixins.json. 2nd-gen ships one shared CEM for all components, and inherited attributes are already flattened onto each component declaration. The extractor now reads a single manifest (local path currently, while the CEM is not published for a CDN), finds a declaration bytagName, and formats itsattributesarray directly. The mixin-merging and chain-walking logic is removed.components.json: Switched from a{ "sp-tag": "pkg-name" }map to a flat array ofswc-*tag names, matching 2nd-gen's single-manifest model.Data files: Removed 1st-gen
sp-action-button.json,sp-button.json, andsp-mixins.json. Generated 11 new 2nd-genswc-*.jsonfiles covering internal and pre-release components.Table block (
blocks/table/table.js): AddedEXCLUDED_COLUMNSto stripstatusandsincefrom the rendered API table. These fields are kept in the JSON for future use but aren't meaningful to component consumers today.CI (
extract-swc-properties.yml): Disabled the daily schedule with a comment to re-enable it once@adobe/spectrum-wcpublishescustom-elements.json. Manual dispatch is still available. This prevents daily CI failures while the CEM is unpublished.Test split (
package.json,web-test-runner.config.mjs): Extraction tests use Node built-ins (fs,process.argv) that aren't available in WTR's browser sandbox.npm testnow runstest:unit(WTR) andtest:extractions(Node test runner) separately. The WTR config explicitly excludestest/extractions/**.Docs (
deps/swc/README.md): Updated to reflect the 2nd-gen workflow, CEM location, manual vs. future automated extraction, and known limitations.Screenshots (if applicable)
Type of change
Related issue(s)
Validation steps
To Validate
URL for testing:
https://swc-s2--spectrum-hub--adobe.aem.page/platforms/swc/components/button
npm testand confirm all tests passnpm run lintand confirm no linting errorsaem upswc-buttonpage).statusorsincecolumnssp-*data no longer appears in any rendered tableextract-swc-properties.ymlhas the daily schedule commented out and the manual dispatch trigger still works in the Actions tabcdinto2nd-gen/packages/swc/.storybook/. Runyarn installandyarn analyzeto generate the new, local CEM.data/swc-*.json. Something like this worked for me when I had both this repo and SWC in the same workspace:node deps/swc/extract-cem-components.js ../spectrum-web-components/2nd-gen/packages/swc/.storybook/custom-elements.json. You should not see any changes.Accessibility testing checklist
The only user-facing change is that
statusandsincecolumns are excluded from the API data table. The table is static/non-interactive.statusorsincecolumn headers appear; no focus traps or unexpected tab stopsControl+Option+Shift+Down arrowto enter the table, thenControl+Option+Arrow keys) to move through the tableattribute,property,type,default,description) are announced correctly;statusandsinceare not announced as column headers; row data aligns with headersScreen.Recording.2026-05-27.at.9.51.14.AM.mov
Device review
Checklist: