- 
                Notifications
    
You must be signed in to change notification settings  - Fork 235
 
chore(tooling): adapt publishing workflow for new monorepo structure #5851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ucture Refactors the publishing and release management workflow to support the dual-generation monorepo architecture: - Update Changesets configuration to recognize both 1st-gen and 2nd-gen workspaces, enabling independent versioning strategies - Refactor release scripts to delegate to generation-specific publishing workflows rather than operating on a flat package structure - Update CI/CD publishing jobs to build, test, and publish both generations with appropriate dependency handling for the shared Core library - Preserve existing 1st-gen package publishing behavior to avoid disruption to current consumers This workflow enables continuous delivery of improvements to 1st-gen customers while supporting independent 2nd-gen package releases.
          
 | 
    
          📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs: 
 Deployed to Azure Blob Storage:  If the changes are expected, update the   | 
    
          Tachometer resultsCurrently, no packages are changed by this PR...  | 
    
| @@ -1 +1 @@ | |||
| 20.13.1 No newline at end of file | |||
| 20.19.0 No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping minimum version for Storybook 10 compatibility.
| "build": "wireit", | ||
| "prebuild": "wireit", | ||
| "build:clear-cache": "rimraf packages/*/tsconfig.tsbuildinfo && rimraf tools/*/tsconfig.tsbuildinfo", | ||
| "build:clear-cache": "rimraf .wireit && rimraf packages/*/tsconfig.tsbuildinfo && rimraf tools/*/tsconfig.tsbuildinfo", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaning .wireit cache too.
| "postpack": "pinst --enable", | ||
| "postpublish": "yarn prepublish:react && yarn publish:react && yarn postpublish:react", | ||
| "postpublish:react": "git reset --hard HEAD^ && git prune && rimraf react", | ||
| "prebuild": "wireit", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not new, just got re-ordered.
| "chromatic": "chromatic --build-script-name storybook:build # note that --project-token must be set in your env variables", | ||
| "create-git-tag": "node --no-warnings ./scripts/create-git-tag.js", | ||
| "custom-element-json": "node ./scripts/custom-element-json.js", | ||
| "dev:core": "yarn workspace @spectrum-web-components/core dev", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not new, just got re-ordered.
| "@changesets/cli": "2.29.7", | ||
| "@commitlint/cli": "19.8.1", | ||
| "@commitlint/config-conventional": "^19.8.1", | ||
| "@commitlint/config-conventional": "19.8.1", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinning versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to stay!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify documentation which will eventually live under Contributing Docs, but this clean version can be useful if you are navigating the GitHub UI and open this folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated commands to consistently run with npm-run-all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple Readme to be shown either in GitHub or npm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update documentation around releasing to be in sync with new publish script
| "engines": { | ||
| "node": ">=20", | ||
| "yarn": ">=4.6.0" | ||
| }, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to remove this?
| // Generated by genversion. | ||
| export const version = '1.9.0'; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many consumers still uses this path to version check their packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-added it
        
          
                1st-gen/tools/base/test/base.test.ts
              
                Outdated
          
        
      | import { SpectrumElement } from '@spectrum-web-components/base'; | ||
| import { elementUpdated, expect, fixture, html } from '@open-wc/testing'; | ||
| import { version } from '@spectrum-web-components/base/src/version.js'; | ||
| import { version } from '@spectrum-web-components/core/shared/base/version.js'; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Downstream customers needs to update to the new path. Should surface this information up as a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to re-export the 2nd-gen one!
…5851) * chore: update and streamline publishing workflow for new monorepo structure Refactors the publishing and release management workflow to support the dual-generation monorepo architecture: - Update Changesets configuration to recognize both 1st-gen and 2nd-gen workspaces, enabling independent versioning strategies - Refactor release scripts to delegate to generation-specific publishing workflows rather than operating on a flat package structure - Update CI/CD publishing jobs to build, test, and publish both generations with appropriate dependency handling for the shared Core library - Preserve existing 1st-gen package publishing behavior to avoid disruption to current consumers This workflow enables continuous delivery of improvements to 1st-gen customers while supporting independent 2nd-gen package releases.
Description
This PR streamlines and fixes the publishing workflow for Spectrum Web Components after the monorepo restructure.
Most relevant changes
Unified publish script (
scripts/publish.js)Fixed global changelog generator
@spectrum-web-components/corechanges (previously looked for@swc/core).changeset versionto access changeset files before deletion.Updated build configuration aliases
@swc/core → @spectrum-web-components/corein:1st-gen/web-test-runner.config.js1st-gen/test/visual/rollup.config.js1st-gen/projects/documentation/rollup.config.jsFixed Yarn constraints for new monorepo structure
Updated glob patterns:
Fixed folder name extraction for component name resolution.
Added generation-specific rules:
main/module → ./src/index.jsmain/module → ./dist/index.jsEnsured both generations set
publishConfig.access: "public".Cleaned up obsolete scripts from
1st-gen/package.jsonRemoved:
changeset-publishchangeset-snapshot-publishprepublishOnly,postpublishprepublish:react,postpublish:react,publish:reactpush-to-remoteUpdated release documentation
CONTRIBUTOR-DOCS/01_contributor-guides/06_releasing-swc.mdnightly,beta, etc.).Motivation and context
After reorganizing the repository into 1st-gen/ and 2nd-gen/ subdirectories, the publishing workflow needed to be updated.
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
To be tested under the
barebonestesting and validation steps.