chore: migrate from Lerna to NX Release with Version Plans#3254
chore: migrate from Lerna to NX Release with Version Plans#3254jakemhiller merged 38 commits intomainfrom
Conversation
|
0bf6120 to
a521830
Compare
|
View your CI Pipeline Execution ↗ for commit 86f8119 ☁️ Nx Cloud last updated this comment at |
a521830 to
85ce914
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ccaa986 to
3606fad
Compare
3d2892d to
26c082e
Compare
| // This is effectively a duplicate of the `MockGamutProvider` in `gamut-tests` | ||
| // Because gamut-tests depends on gamut-styles, it creates a circular dependency. |
There was a problem hiding this comment.
explanation for this duplication :/
| "homepage": "https://github.com/Codecademy/gamut#readme", | ||
| "license": "MIT", | ||
| "main": "lib", | ||
| "publishConfig": { |
There was a problem hiding this comment.
macros is only used in the styleguide, but we were publishing it. it caused some publishing issues so i disabled that.
There was a problem hiding this comment.
we should mark this as deprecated
| > { | ||
| const flatColors = flattenScale(colors); | ||
| const { variables, tokens } = serializeTokens( | ||
| flatColors, |
There was a problem hiding this comment.
wanted to upgrade typescript for the release script, so i had to make this one type change
|
@copilot update the PR description to reflect the current changes |
- Introduced a new testUtils.tsx file to encapsulate the setupRtl function with a mock GamutProvider. - Updated AssetProvider.test.tsx and GamutProvider.test.tsx to use the new setupRtl from testUtils, improving test consistency.
- Introduced a new "verify" command in project.json to run TypeScript checks without emitting output. - Updated the createTheme function to cast flattened color scales to a more compatible type for TypeScript 5.9+, ensuring better type safety.
- Created a new version plan to address internal TypeScript upgrade issues and circular dependencies in nx related to gamut-tests. - Specified patch levels for gamut-styles and variance.
- Updated the alpha release script to destructure the `preid` from parsed arguments for improved readability. - Added an ESLint directive to disable console warnings in the script.
- Introduced a new ESLint rule to permit the use of void expressions as statements, enhancing code flexibility and adherence to coding standards.
- Introduced a new `alpha-publish-manifest.json` file to track published package versions. - Enhanced the alpha release script to support manifest generation, allowing users to specify a custom path or use the default. - Added the `commander` package for improved command-line argument parsing in the release script.
…ting - Modified the alpha publish workflow to generate a publish manifest and list published package versions using a GitHub script. - Replaced the previous shell script with a more robust JavaScript implementation that checks for the existence of the manifest and formats the output as a markdown table. - Added the `--manifest` flag to the release command to enable manifest generation.
- Updated the alpha publish workflow to generate a markdown table that includes a "Diff" column for package version comparisons. - Added links to the npm package and version pages, as well as a diff link for previous versions when available, improving visibility of changes in published packages.
- Updated the publish manifest entry to include a `previousVersion` field, allowing for better tracking of package version changes. - Modified the alpha publish workflow to generate a markdown table that now includes a "Diff" column with links to compare versions, improving visibility of changes in published packages.
…te files - Added entries for new alpha publish artifacts in .gitignore. - Updated README to reflect changes in the publishing process, including the use of version plans and CI checks. - Removed the alpha-publish-manifest.json file and automerge workflow as they are no longer needed. - Cleaned up unused workflow files and adjusted VSCode settings.
- Modified the markdown table in the alpha publish workflow to include an "npm" column with links to the npm package versions. - Adjusted the table header to reflect the new structure, improving clarity and accessibility of package version information.
- Added the @commander-js/extra-typings package to package.json and yarn.lock for improved type definitions. - Updated the import statement in main.ts to use the new typings package, enhancing type safety in the command-line interface implementation.
…ted instructions - Removed the CHANGELOG-DESCRIPTION comment tags to simplify the template. - Added a checklist item for version plan updates to ensure clarity on versioning. - Updated instructions regarding breaking changes to reference the repo README for better guidance.
… code style - Modified the markdown table in the alpha publish workflow to display package names and versions in code format, enhancing readability and clarity in the published output.
bb17f2d to
2c0a97a
Compare
|
📬 Published Alpha Packages:
|
|
🚀 Styleguide deploy preview ready! Preview URL: https://69c57a9c8eed63090584a2ed--gamut-preview.netlify.app |
Overview
Note: there are typescript type changes due to the TS upgrade in this PR, you can see them by looking at the
diffurls in the alpha release comment. I made a mono PR here to test those changes.Migrated package publishing from Lerna to NX Release with file-based versioning (Version Plans). Production releases use version plans configured in nx.json. Alpha releases use a custom NX library (
gamut-release) with the NX Release programmatic API to apply prerelease versioning without git operations.Configuration (
nx.json):versionPlans: true)projectsRelationship: "independent")styleguideandmacrospackages from releases (internal-only)Alpha Release System (
tools/gamut-release):releaseVersion()andreleasePublish()fromnx/releaseprereleasespecifier with custom preid (e.g.,alpha.abc123)gitCommit: false,gitTag: false,stageChanges: false)commanderfor CLI argument parsing--experimental-strip-types)Workflows:
publish-production.yml: Usesnx release -ywith version plans from nx.jsonpublish-alpha.yml: Usesnx run gamut-release:alpha --preid=alpha.{SHA} --manifestDependency Cleanup:
lerna,conventional-changelog-cli,conventional-changelog-conventionalcommitslerna.jsonyarn.lock(reduced by ~3000 lines)Version Plan Format:
Additional Changes:
variance/createThemePR Checklist
Testing Instructions
Test alpha script locally:
Test production release (dry run):
In CI:
alpha.{SHORT_SHA}(verified in comment above)PR Links and Envs
N/A - Infrastructure change, no application changes
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.