Skip to content

feat: migrate releases to Nx version plans and new decoupled release flow #281

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/ci-change.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:

- run: yarn check-dependencies

- name: 'Check version plans'
run: yarn nx release plan:check
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nx is used for releases, so we need it to be installed -> removing artificial ci-change workflow


- name: Install Playwright Browsers
run: npx playwright install --with-deps

Expand Down
5 changes: 5 additions & 0 deletions .nx/version-plans/version-plan-1737046335811.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
react-shadow: patch
---
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


new api added yay
66 changes: 61 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
pr: none
trigger: none

parameters:
- name: dry_run
displayName: Dry run mode
type: boolean
default: true
# Projects to include within release. (comma/space delimited project names and/or patterns). See `--project` flag for more details https://nx.dev/nx-api/nx/documents/release#publish
- name: projects
displayName: Projects to release (defaults to all)
type: string
default: ''

variables:
- name: NX_PARALLEL
value: 8
Expand Down Expand Up @@ -33,6 +44,7 @@ extends:
- stage: main
jobs:
- job: Release
displayName: 'Release New Version'
pool:
name: '1ES-Host-Ubuntu'
image: '1ES-PT-Ubuntu-20.04'
Expand All @@ -54,24 +66,68 @@ extends:
echo "##vso[task.setvariable variable=shellopts]braceexpand:hashall:interactive-comments:errexit:errtrace"
displayName: Force exit on error (bash)

- task: NodeTool@0
- task: UseNode@1
inputs:
versionSpec: '20.x'
checkLatest: true
checkLatest: false
displayName: 'Install Node.js'

- script: yarn install --frozen-lockfile
displayName: Install dependencies

- script: |
yarn nx run-many -t build,test,lint,type-check -p ${{ parameters.projects }} --nxBail
condition: eq(parameters.dry_run, false)
displayName: Verify publishable Assets

- script: |
git config user.name "Fluent UI Build"
git config user.email "[email protected]"
git remote set-url origin https://$(githubUser):$(githubPAT)@github.com/microsoft/fluentui-contrib.git
condition: eq(parameters.dry_run, false)
displayName: Authenticate git for pushes

- script: |
yarn beachball publish -b origin/main --access public -y -n $(npmToken)
git reset --hard origin/main
yarn nx release --skip-publish -p ${{ parameters.projects }} --dry-run ${{ parameters.dry_run }} --verbose
displayName: Bump versions and generate Changelogs

# NOTE: this step needs PAT - needs different release flow to avoid PATs completely
- script:
| # TODO: remove this step once https://github.com/nrwl/nx/issues/30551 is resolved
git push origin && git push origin --tags
condition: eq(parameters.dry_run, false)
displayName: Propagate Release to GitHub
env:
GITHUB_PAT: $(githubPAT)
displayName: Publish to NPM & bump versions

- job: PublishToNPM
displayName: 'Publish to NPM'
dependsOn: Release
condition: succeeded('Release')
pool:
name: '1ES-Host-Ubuntu'
image: '1ES-PT-Ubuntu-20.04'
os: linux
workspace:
clean: all
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/packages
artifactName: output
steps:
- task: UseNode@1
inputs:
versionSpec: '20.x'
checkLatest: false
displayName: 'Install Node.js'

- script: yarn install --frozen-lockfile
displayName: Install dependencies

# NOTE: `nx release publish` executes `nx-release-publish` target and all its dependents
- script: |
yarn nx release publish -p ${{ parameters.projects }} --dry-run ${{ parameters.dry_run }}
displayName: Publish to NPM
env:
NODE_AUTH_TOKEN: $(npmToken)
75 changes: 52 additions & 23 deletions migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,70 @@
"name": "update-19-6-0-add-nx-packages"
},
{
"version": "20.0.0-beta.7",
"description": "Migration for v20.0.0-beta.7",
"implementation": "./src/migrations/update-20-0-0/move-use-daemon-process",
"version": "21.0.0-beta.8",
"description": "Removes the legacy cache configuration from nx.json",
"implementation": "./src/migrations/update-21-0-0/remove-legacy-cache",
"package": "nx",
"name": "move-use-daemon-process"
"name": "remove-legacy-cache"
},
{
"version": "20.2.0-beta.5",
"description": "Update TypeScript ESLint packages to v8.13.0 if they are already on v8",
"implementation": "./src/migrations/update-20-2-0/update-typescript-eslint-v8-13-0",
"package": "@nx/eslint",
"name": "update-typescript-eslint-v8.13.0"
"version": "21.0.0-beta.8",
"description": "Removes the legacy cache configuration from nx.json",
"implementation": "./src/migrations/update-21-0-0/remove-custom-tasks-runner",
"package": "nx",
"name": "remove-custom-tasks-runner"
},
{
"version": "21.0.0-beta.11",
"description": "Updates release version config based on the breaking changes in Nx v21",
"implementation": "./src/migrations/update-21-0-0/release-version-config-changes",
"package": "nx",
"name": "release-version-config-changes"
},
{
"version": "21.0.0-beta.11",
"description": "Updates release changelog config based on the breaking changes in Nx v21",
"implementation": "./src/migrations/update-21-0-0/release-changelog-config-changes",
"package": "nx",
"name": "release-changelog-config-changes"
},
{
"version": "20.3.0-beta.1",
"description": "Update ESLint flat config to include .cjs, .mjs, .cts, and .mts files in overrides (if needed)",
"implementation": "./src/migrations/update-20-3-0/add-file-extensions-to-overrides",
"package": "@nx/eslint",
"name": "add-file-extensions-to-overrides"
"version": "21.1.0-beta.2",
"description": "Adds **/nx-rules.mdc and **/nx.instructions.md to .gitignore if not present",
"implementation": "./src/migrations/update-21-1-0/add-gitignore-entry",
"package": "nx",
"name": "21-1-0-add-ignore-entries-for-nx-rule-files"
},
{
"cli": "nx",
"version": "20.3.0-beta.2",
"description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
"factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package",
"package": "@nx/react",
"name": "ensure-nx-module-federation-package"
"version": "21.0.0-beta.11",
"description": "Remove isolatedConfig option for @nx/webpack:webpack",
"implementation": "./src/migrations/update-21-0-0/remove-isolated-config",
"package": "@nx/webpack",
"name": "update-21-0-0-remove-isolated-config"
},
{
"cli": "nx",
"version": "21.0.0-beta.9",
"description": "Replace usage of `getJestProjects` with `getJestProjectsAsync`.",
"implementation": "./src/migrations/update-21-0-0/replace-getJestProjects-with-getJestProjectsAsync",
"package": "@nx/jest",
"name": "replace-getJestProjects-with-getJestProjectsAsync-v21"
},
{
"version": "21.0.0-beta.10",
"description": "Remove the previously deprecated and unused `tsConfig` option from the `@nx/jest:jest` executor.",
"implementation": "./src/migrations/update-21-0-0/remove-tsconfig-option-from-jest-executor",
"package": "@nx/jest",
"name": "remove-tsconfig-option-from-jest-executor"
},
{
"cli": "nx",
"version": "20.4.0-beta.0",
"description": "Add NX_MF_DEV_REMOTES to inputs for task hashing when '@nx/webpack:webpack' or '@nx/rspack:rspack' is used for Module Federation.",
"factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults",
"version": "21.0.0-beta.11",
"description": "Replaces `classProperties.loose` option with `loose`.",
"factory": "./src/migrations/update-21-0-0/update-babel-loose",
"package": "@nx/react",
"name": "add-mf-env-var-to-target-defaults"
"name": "update-21-0-0-update-babel-loose"
}
]
}
15 changes: 8 additions & 7 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"cache": true
},
"nx-release-publish": {
"dependsOn": ["build"],
"options": {
"access": "public",
"packageRoot": "dist/packages/{projectName}"
}
}
Expand Down Expand Up @@ -66,10 +68,9 @@
}
},
"version": {
"generatorOptions": {
"versionPrefix": "auto",
"currentVersionResolver": "disk"
}
"currentVersionResolver": "disk",
"versionPrefix": "auto",
"preserveLocalDependencyProtocols": false
},
"versionPlans": {
"ignorePatternsForPlanCheck": [
Expand All @@ -86,7 +87,8 @@
"**/*.md",
"**/*.babelrc",
"**/playwright/**",
"**/.storybook/**"
"**/.storybook/**",
"**/stories/**"
]
},
"projectsRelationship": "independent"
Expand All @@ -97,6 +99,5 @@
},
"parallel": 3,
"defaultBase": "main",
"useInferencePlugins": false,
"useLegacyCache": true
"useInferencePlugins": false
}
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"scripts": {
"build": "nx affected --target=build",
"change": "beachball change",
"change": "nx release plan",
"check-dependencies": "syncpack list-mismatches",
"lint": "nx affected --target=lint",
"test": "nx affected --target=test",
Expand Down Expand Up @@ -35,18 +35,18 @@
"@fluentui/react-shared-contexts": "^9.7.2",
"@fluentui/scheme-utilities": "^8.3.58",
"@griffel/shadow-dom": "~0.2.0",
"@nx/devkit": "20.8.2",
"@nx/eslint": "20.8.2",
"@nx/eslint-plugin": "20.8.2",
"@nx/jest": "20.8.2",
"@nx/js": "20.8.2",
"@nx/playwright": "20.8.2",
"@nx/plugin": "20.8.2",
"@nx/react": "20.8.2",
"@nx/storybook": "20.8.2",
"@nx/web": "20.8.2",
"@nx/webpack": "20.8.2",
"@nx/workspace": "20.8.2",
"@nx/devkit": "21.1.2",
"@nx/eslint": "21.1.2",
"@nx/eslint-plugin": "21.1.2",
"@nx/jest": "21.1.2",
"@nx/js": "21.1.2",
"@nx/playwright": "21.1.2",
"@nx/plugin": "21.1.2",
"@nx/react": "21.1.2",
"@nx/storybook": "21.1.2",
"@nx/web": "21.1.2",
"@nx/webpack": "21.1.2",
"@nx/workspace": "21.1.2",
"@playwright/experimental-ct-react": "^1.49.1",
"@rnx-kit/eslint-plugin": "0.8.6",
"@storybook/addon-docs": "7.6.20",
Expand Down Expand Up @@ -83,7 +83,7 @@
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jsonc-eslint-parser": "2.4.0",
"nx": "20.8.2",
"nx": "21.1.2",
"parsel-js": "^1.1.2",
"patch-package": "^7.0.0",
"prettier": "^2.6.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/nx-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"generators": "./generators.json",
"executors": "./executors.json",
"dependencies": {
"@nx/devkit": "^20",
"@nx/storybook": "^20",
"@nx/js": "^20",
"@nx/playwright": "^20",
"@nx/devkit": "^21",
"@nx/storybook": "^21",
"@nx/js": "^21",
"@nx/playwright": "^21",
"semver": "^7.5.2",
"tslib": "^2.3.0"
},
"peerDependencies": {
"@playwright/experimental-ct-react": "^1.49.1",
"nx": "^20"
"nx": "^21"
}
}
2 changes: 2 additions & 0 deletions packages/react-shadow/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { createRoot, root } from './root';

export const apiV2 = 'noop';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Loading