diff --git a/.devops/templates/build-test-lint.yml b/.devops/templates/build-test-lint.yml index 0b8c3a467d94f5..4c05e5a672cee1 100644 --- a/.devops/templates/build-test-lint.yml +++ b/.devops/templates/build-test-lint.yml @@ -18,8 +18,8 @@ steps: # @fluentui/api-docs is used within apps/public-docsite-resources/just.config.ts, # @fluentui/digest is used within packages/fluentui/perf-test-northstar/just.config.ts, thus it needs to be build in advance # - # NOTE: we are running this via lage in order to get cache hits later on - yarn lage build --to @fluentui/api-docs @fluentui/digest --verbose + # NOTE: we are running this via nx in order to get cache hits later on + yarn nx run-many -t build -p api-docs digest yarn tsc -p ./tsconfig.just-scripts-configs.json displayName: Type-check just.config.ts files diff --git a/.devops/templates/deployE2E.yml b/.devops/templates/deployE2E.yml index e6a58698e05eeb..cc2761180aba05 100644 --- a/.devops/templates/deployE2E.yml +++ b/.devops/templates/deployE2E.yml @@ -16,16 +16,16 @@ steps: # this also builds FUI N* docs if appropriate - script: | - yarn bundle $(sinceArg) + yarn nx affected -t bundle --nxBail $(sinceArg) displayName: bundle - script: | - yarn lage build-storybook --verbose $(sinceArg) + yarn nx affected -t build-storybook --nxBail $(sinceArg) displayName: build Storybooks ## This runs regardless of scope, the app will adapt to the scope as well - script: | - yarn workspace @fluentui/pr-deploy-site generate:site + yarn nx run pr-deploy-site:generate:site displayName: generate PR Deploy Site - task: AzureCLI@2 @@ -53,8 +53,9 @@ steps: # This MUST have a trailing slash, or the links to PR deploy site assets won't work githubTargetLink: $(deployUrl)/ + # TODO: once https://github.com/nrwl/nx/issues/26903 will be fixed we can remove NX_PARALLEL=1 override via env variable - script: | - yarn e2e $(sinceArg) + NX_PARALLEL=1 yarn nx affected -t e2e --nxBail --parallel 1 $(sinceArg) displayName: Cypress E2E tests - template: cleanup.yml diff --git a/.devops/templates/runpublishvrscreenshot.yml b/.devops/templates/runpublishvrscreenshot.yml index e8bd3cef37ff01..ae663d975dd89f 100644 --- a/.devops/templates/runpublishvrscreenshot.yml +++ b/.devops/templates/runpublishvrscreenshot.yml @@ -4,7 +4,7 @@ parameters: default: v8 - name: vrTestPackageName type: string - default: '@fluentui/vr-tests' + default: vr-tests' - name: vrTestPackagePath type: string default: 'apps/vr-tests' @@ -33,7 +33,7 @@ steps: echo $isPR echo "##vso[task.setvariable variable=isPR;]$isPR" if [[ $isPR == true ]]; then - packageAffected=$(yarn --silent check:affected --package ${{ parameters.vrTestPackageName }}) + packageAffected=$(yarn --silent check:affected --project ${{ parameters.vrTestPackageName }}) if [[ $packageAffected == false ]]; then echo "In PR pipeline but NOT affecting test package. Skipping test run" echo "##vso[task.setvariable variable=vrTestSkip;]yes" @@ -48,7 +48,7 @@ steps: displayName: Check if vrTests should be skipped - script: | - yarn lage test-vr --to ${{ parameters.vrTestPackageName }} --verbose + yarn nx run ${{ parameters.vrTestPackageName }}:test-vr --nxBail displayName: 'Run VR tests' condition: eq(variables['vrTestSkip'], 'no') diff --git a/.devops/templates/variables.yml b/.devops/templates/variables.yml index 98a88e1def59a1..a72a48c528ab88 100644 --- a/.devops/templates/variables.yml +++ b/.devops/templates/variables.yml @@ -16,6 +16,10 @@ variables: # Prevents failures on CI when "caniuse-lite" becomes outdated BROWSERSLIST_IGNORE_OLD_DATA: true + NX_PARALLEL: 8 + NX_PREFER_TS_NODE: true + NX_VERBOSE_LOGGING: true + # Also accessed as process.env.DEPLOYHOST deployHost: 'fluentuipr.z22.web.core.windows.net' diff --git a/.github/actions/build-to/action.yml b/.github/actions/build-to/action.yml index d9ad0d14d64d39..a1aaf51cd51b27 100644 --- a/.github/actions/build-to/action.yml +++ b/.github/actions/build-to/action.yml @@ -1,3 +1,5 @@ +# TODO: Remove or replace with NX cache - we don't use lage(backfill) anymore + name: 'Build workspaces' description: 'Runs the build command for specific workspaces.' inputs: diff --git a/.github/policies/botRules.yml b/.github/policies/botRules.yml index 59debbee956afe..3cd5afdb542751 100644 --- a/.github/policies/botRules.yml +++ b/.github/policies/botRules.yml @@ -336,7 +336,6 @@ configuration: files: - package.json - scripts - - rush.json - apps/vr-tests/screener.config.js - apps/vr-tests/screener.local.config.js - apps/pr-deploy-site @@ -348,7 +347,7 @@ configuration: - packages/codemods - packages/monaco-editor - packages/eslint-plugin - - lage.config.js + - nx.json - tools excludedFiles: - change diff --git a/.github/workflows/docsite-publish-chromatic.yml b/.github/workflows/docsite-publish-chromatic.yml index 98996527dc860e..bed2c04bf2c440 100644 --- a/.github/workflows/docsite-publish-chromatic.yml +++ b/.github/workflows/docsite-publish-chromatic.yml @@ -44,12 +44,9 @@ jobs: run: yarn install --frozen-lockfile - name: Build dependencies - uses: ./.github/actions/build-to - with: - workspaces: '@fluentui/public-docsite-v9' - backfill-cache-provider-options: ${{ secrets.BACKFILL_CACHE_PROVIDER_OPTIONS }} + run: yarn nx run public-docsite-v9:build --nxBail - name: Publish to Chromatic - run: yarn workspace @fluentui/public-docsite-v9 chromatic + run: yarn nx run public-docsite-v9:chromatic --nxBail env: CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} diff --git a/.github/workflows/docsite-publish-ghpages.yml b/.github/workflows/docsite-publish-ghpages.yml index 7e624f0c19312b..b047fafda844ad 100644 --- a/.github/workflows/docsite-publish-ghpages.yml +++ b/.github/workflows/docsite-publish-ghpages.yml @@ -44,13 +44,10 @@ jobs: run: yarn install --frozen-lockfile - name: Build dependencies - uses: ./.github/actions/build-to - with: - workspaces: '@fluentui/public-docsite-v9' - backfill-cache-provider-options: ${{ secrets.BACKFILL_CACHE_PROVIDER_OPTIONS }} + run: yarn nx run public-docsite-v9:build --nxBail - name: Build storybook - run: yarn workspace @fluentui/public-docsite-v9 build-storybook + run: yarn nx run public-docsite-v9:build-storybook --nxBail env: STORYBOOK_APPINSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.STORYBOOK_APPINSIGHTS_INSTRUMENTATION_KEY }} diff --git a/.storybook/main.js b/.storybook/main.js index 9be6245c184eb9..0eb69a5ce4d826 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -80,7 +80,7 @@ module.exports = /** @type {Omit} */ ({ webpackFinal: config => { registerTsPaths({ config, configFile: tsConfigPath }); - if ((process.env.CI || process.env.TF_BUILD || process.env.LAGE_PACKAGE_NAME) && config.plugins) { + if ((process.env.CI || process.env.TF_BUILD) && config.plugins) { // Disable ProgressPlugin in PR/CI builds to reduce log verbosity (warnings and errors are still logged) config.plugins = config.plugins.filter(value => value && value.constructor.name !== 'ProgressPlugin'); } diff --git a/apps/perf-test-react-components/project.json b/apps/perf-test-react-components/project.json index f166ea5b740b6a..1f3556a239ba5c 100644 --- a/apps/perf-test-react-components/project.json +++ b/apps/perf-test-react-components/project.json @@ -5,6 +5,7 @@ "implicitDependencies": [], "tags": ["vNext"], "targets": { + "test-perf": { "dependsOn": ["bundle"] }, "bundle": { "dependsOn": [] } } } diff --git a/apps/perf-test/project.json b/apps/perf-test/project.json index d1929ba87c84a1..359d0496a7d89f 100644 --- a/apps/perf-test/project.json +++ b/apps/perf-test/project.json @@ -5,8 +5,7 @@ "implicitDependencies": [], "tags": ["v8"], "targets": { - "bundle": { - "dependsOn": [] - } + "test-perf": { "dependsOn": ["bundle"] }, + "bundle": { "dependsOn": [] } } } diff --git a/apps/public-docsite-resources/project.json b/apps/public-docsite-resources/project.json index 4c47928401e90b..3e2fd9316813c6 100644 --- a/apps/public-docsite-resources/project.json +++ b/apps/public-docsite-resources/project.json @@ -1,7 +1,7 @@ { "name": "public-docsite-resources", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", + "projectType": "library", "implicitDependencies": [], "tags": ["v8"] } diff --git a/apps/public-docsite/README.md b/apps/public-docsite/README.md index efe407d55acc13..5203ba729d3e2a 100644 --- a/apps/public-docsite/README.md +++ b/apps/public-docsite/README.md @@ -12,10 +12,9 @@ Once your repo is set up, run the following to start a local copy of the website ``` yarn -yarn buildto public-docsite -cd apps -cd public-docsite -yarn start +yarn nx run public-docsite:build + +yarn nx run public-docsite:start ``` -`yarn start` will open your operating system's default web browser with the website. You can make changes to the code which will automatically build and refresh the page using live-reload. +`yarn nx run public-docsite:start` will open your operating system's default web browser with the website. You can make changes to the code which will automatically build and refresh the page using live-reload. diff --git a/apps/react-18-tests-v8/README.md b/apps/react-18-tests-v8/README.md index 6d59da1dd1c467..f4c1733a1cd6ed 100644 --- a/apps/react-18-tests-v8/README.md +++ b/apps/react-18-tests-v8/README.md @@ -31,10 +31,10 @@ For that purpose we use `tsconfig.react-compat-check.json` as target for `type-c **Local machine flow:** ```sh -lage build --to @fluentui/react-18-tests-v8 -yarn workspace @fluentui/react-18-tests-v8 type-check +yarn nx run react-18-tests-v8:build +yarn nx run react-18-tests-v8:type-check ``` **CI:** -lage defines `build` targets to be executed prior to `type-check`. +nx defines `build` targets to be executed prior to `type-check`. diff --git a/apps/react-18-tests-v9/README.md b/apps/react-18-tests-v9/README.md index 1745f188f14ca3..468f1699e2a617 100644 --- a/apps/react-18-tests-v9/README.md +++ b/apps/react-18-tests-v9/README.md @@ -1,6 +1,6 @@ # @fluentui/react-18-tests-v9 -**Tests for React 18 compatability in [Fluent UI React v9](https://react.fluentui.dev)**. +**Tests for React 18 compatibility in [Fluent UI React v9](https://react.fluentui.dev)**. ## Usage @@ -31,11 +31,11 @@ For that purpose we use `tsconfig.react-compat-check.json` as target for `type-c **Local machine flow:** ```sh -lage build --to @fluentui/react-18-tests-v9 +yarn nx run react-18-tests-v9:build -yarn workspace @fluentui/react-18-tests-v9 type-check +yarn nx run react-18-tests-v9:type-check ``` **CI:** -lage defines `build` targets to be executed prior to `type-check`. +nx defines `build` targets to be executed prior to `type-check`. diff --git a/apps/ssr-tests/project.json b/apps/ssr-tests/project.json index a93dc6f58a1daa..98400ef5e75183 100644 --- a/apps/ssr-tests/project.json +++ b/apps/ssr-tests/project.json @@ -5,6 +5,9 @@ "implicitDependencies": [], "tags": ["v8"], "targets": { - "test-ssr": { "dependsOn": ["bundle", "^bundle"] } + "test-ssr": { + "dependsOn": ["bundle"] + }, + "bundle": { "dependsOn": ["^build"] } } } diff --git a/apps/vr-tests-web-components/.storybook/main.cjs b/apps/vr-tests-web-components/.storybook/main.cjs index 82c0ad9281effa..3d6a7366d32f83 100644 --- a/apps/vr-tests-web-components/.storybook/main.cjs +++ b/apps/vr-tests-web-components/.storybook/main.cjs @@ -75,7 +75,7 @@ module.exports = /** @type {import('../../../.storybook/types').StorybookBaseCon ); // Disable ProgressPlugin which logs verbose webpack build progress. Warnings and Errors are still logged. - if (process.env.TF_BUILD || process.env.LAGE_PACKAGE_NAME) { + if (process.env.TF_BUILD) { config.plugins = config.plugins.filter(({ constructor }) => constructor.name !== 'ProgressPlugin'); } diff --git a/azure-pipelines-pr.yml b/azure-pipelines-pr.yml index 50459ff3ee73f5..9f3fe471c221b9 100644 --- a/azure-pipelines-pr.yml +++ b/azure-pipelines-pr.yml @@ -8,7 +8,7 @@ trigger: none variables: - ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}: - name: sinceArg - value: --since $(targetBranch) + value: --base $(targetBranch) - group: fabric-variables diff --git a/azure-pipelines.bundlesize.yml b/azure-pipelines.bundlesize.yml index dda75d1e32a2bc..be7c54d6e6d53b 100644 --- a/azure-pipelines.bundlesize.yml +++ b/azure-pipelines.bundlesize.yml @@ -7,7 +7,7 @@ trigger: variables: - ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}: - name: sinceArg - value: --since $(targetBranch) + value: --base $(targetBranch) - template: .devops/templates/variables.yml @@ -25,7 +25,7 @@ jobs: displayName: yarn - script: | - yarn lage bundle-size --verbose $(sinceArg) + yarn nx affected -t bundle-size --nxBail $(sinceArg) displayName: build packages & create reports - script: | diff --git a/azure-pipelines.hotfix.yml b/azure-pipelines.hotfix.yml index c0814563af48ce..0468472c4c864f 100644 --- a/azure-pipelines.hotfix.yml +++ b/azure-pipelines.hotfix.yml @@ -67,7 +67,7 @@ extends: displayName: 'Manually set package version' - script: | - yarn buildto @fluentui/react --production + yarn nx run react:build --production displayName: yarn build to FUIR (Create production build) - script: yarn workspace @fluentui/react bundle --production diff --git a/azure-pipelines.perf-test.yml b/azure-pipelines.perf-test.yml index ec9795be047672..f7e5718372b0fb 100644 --- a/azure-pipelines.perf-test.yml +++ b/azure-pipelines.perf-test.yml @@ -21,9 +21,9 @@ jobs: displayName: yarn - script: | - NorthstarAffected=$(yarn --silent check:affected --package @fluentui/react-northstar) - V8Affected=$(yarn --silent check:affected --package @fluentui/react) - ReactComponentsAffected=$(yarn --silent check:affected --package @fluentui/react-components) + NorthstarAffected=$(yarn --silent check:affected --project react-northstar) + V8Affected=$(yarn --silent check:affected --project react) + ReactComponentsAffected=$(yarn --silent check:affected --project react-components) if [[ $NorthstarAffected == true ]]; then echo "##vso[task.setvariable variable=NorthstarPackageAffected;isOutput=true]true" fi @@ -51,12 +51,12 @@ jobs: displayName: yarn - script: | - yarn lage test-perf --to perf-test-northstar --base --verbose + yarn nx run perf-test-northstar:test-perf --base condition: eq(variables.isPR, false) displayName: Run Perf Test Base (Northstar) - script: | - yarn lage test-perf --to perf-test-northstar --verbose + yarn nx run perf-test-northstar:test-perf condition: eq(variables.isPR, true) displayName: Run Perf Test (Northstar) @@ -120,7 +120,7 @@ jobs: displayName: yarn - script: | - yarn lage test-perf --to perf-test --verbose + yarn nx run perf-test:test-perf condition: eq(variables.isPR, true) displayName: Run Perf Test @@ -166,7 +166,7 @@ jobs: displayName: yarn - script: | - yarn lage test-perf --to @fluentui/perf-test-react-components --verbose + yarn nx run perf-test-react-components:test-perf condition: eq(variables.isPR, true) displayName: Run Perf Test diff --git a/azure-pipelines.release-fluentui.yml b/azure-pipelines.release-fluentui.yml index a4d2cf19b687f8..b992aadbfbaa5e 100644 --- a/azure-pipelines.release-fluentui.yml +++ b/azure-pipelines.release-fluentui.yml @@ -88,7 +88,7 @@ extends: displayName: build,test,lint northstar packages inputs: script: | - yarn nx run-many --targets=build,test,lint,type-check,test-ssr,verify-packaging --projects='packages/fluentui/*' --parallel $(getconf _NPROCESSORS_ONLN) --nxBail --verbose + yarn nx run-many --targets=build,test,lint,type-check,test-ssr,verify-packaging --projects='packages/fluentui/*' --nxBail - task: CmdLine@2 displayName: '[NPM] Publish to NPM' diff --git a/azure-pipelines.release-vnext-nightly.yml b/azure-pipelines.release-vnext-nightly.yml index 2f672d7c092d9c..6486a9ef66f01f 100644 --- a/azure-pipelines.release-vnext-nightly.yml +++ b/azure-pipelines.release-vnext-nightly.yml @@ -82,19 +82,17 @@ extends: yarn change --type prerelease --message "Release nightly v9" --dependent-change-type "prerelease" displayName: 'Bump and commit nightly versions' - # --only makes it only run tests (otherwise due to the missing --production arg, lage would re-run the build) - # https://github.com/microsoft/fluentui/issues/21686 - script: | - yarn lage test --to @fluentui/react-components - displayName: yarn test + yarn nx run react-components:build --nxBai + displayName: build - script: | - yarn lage lint --to @fluentui/react-components - displayName: yarn lint + yarn nx run react-components:lint --nxBai + displayName: lint - script: | - yarn lage build --to @fluentui/react-components - displayName: yarn build + yarn nx run react-components:test --nxBai + displayName: test - script: | yarn publish:beachball -n $(npmToken) --no-push --tag nightly --config scripts/beachball/src/release-vNext.config.js diff --git a/azure-pipelines.release-vnext.yml b/azure-pipelines.release-vnext.yml index cc43097d3c3e04..73c57ca9404ad3 100644 --- a/azure-pipelines.release-vnext.yml +++ b/azure-pipelines.release-vnext.yml @@ -69,19 +69,17 @@ extends: filePath: yarn-ci.sh displayName: yarn - # --only makes it only run tests (otherwise due to the missing --production arg, lage would re-run the build) - # https://github.com/microsoft/fluentui/issues/21686 - script: | - yarn run:published test - displayName: yarn test + yarn nx run-many -t build -p tag:vNext --exclude 'tag:tools,apps/**' --nxBail --production + displayName: build - script: | - yarn run:published lint - displayName: yarn lint + yarn nx run-many -t test -p tag:vNext --exclude 'tag:tools,apps/**' --nxBail + displayName: test - script: | - yarn run:published build --production - displayName: yarn build + yarn nx run-many -t lint -p tag:vNext --exclude 'tag:tools,apps/**' --nxBail + displayName: lint - script: | yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-vNext.config.js --message 'release: applying package updates - react-components' diff --git a/azure-pipelines.release.tools.yml b/azure-pipelines.release.tools.yml index 987a6a2425f029..4bbf06a112c8c2 100644 --- a/azure-pipelines.release.tools.yml +++ b/azure-pipelines.release.tools.yml @@ -58,19 +58,17 @@ extends: filePath: yarn-ci.sh displayName: yarn - # --only makes it only run tests (otherwise due to the missing --production arg, lage would re-run the build) - # https://github.com/microsoft/fluentui/issues/21686 - script: | - yarn run:published test - displayName: yarn test + yarn nx run-many -t build -p tag:tools --exclude 'apps/**' --nxBail --production + displayName: build - script: | - yarn run:published lint - displayName: yarn lint + yarn nx run-many -t test -p tag:tools --exclude 'apps/**' --nxBail + displayName: test - script: | - yarn run:published build --production - displayName: yarn build + yarn nx run-many -t lint -p tag:tools --exclude 'apps/**' --nxBail + displayName: lint - script: | yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-tools.config.js --message 'release: applying package updates - tools' diff --git a/azure-pipelines.release.web-components.yml b/azure-pipelines.release.web-components.yml index a5771fac424b25..7ff0c44032afa9 100644 --- a/azure-pipelines.release.web-components.yml +++ b/azure-pipelines.release.web-components.yml @@ -68,11 +68,9 @@ extends: filePath: yarn-ci.sh displayName: yarn - # --only makes it only run tests (otherwise due to the missing --production arg, lage would re-run the build) - # https://github.com/microsoft/fluentui/issues/21686 - script: | - yarn lage format:check lint test build --to @fluentui/web-components - displayName: Build, [test], Lint + yarn nx run-many -t format:check lint test build -p web-components --nxBail + displayName: Build, Test, Lint - script: | yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-web-components.config.js --message 'release: applying package updates - web-components' diff --git a/azure-pipelines.release.yml b/azure-pipelines.release.yml index ee40a2be060a6a..e9d71826936fb8 100644 --- a/azure-pipelines.release.yml +++ b/azure-pipelines.release.yml @@ -102,22 +102,16 @@ extends: displayName: Generate version files - script: | - yarn run:published build --production - displayName: yarn build + yarn nx run-many -t build bundle -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail --production + displayName: build,bundle - # --only makes it only run tests (otherwise due to the missing --production arg, lage would re-run the build) - # https://github.com/microsoft/fluentui/issues/21686 - script: | - yarn run:published test --only - displayName: yarn [test] + yarn nx run-many -t test -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail + displayName: test - script: | - yarn run:published lint --only - displayName: yarn lint - - - script: | - yarn run:published bundle --only --production - displayName: yarn bundle + yarn nx run-many -t lint -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail + displayName: lint - script: | yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-v8.config.js --message 'release: applying package updates - react v8' diff --git a/azure-pipelines.vrt-baseline.yml b/azure-pipelines.vrt-baseline.yml index 2c319f768e0209..f500f5599bee29 100644 --- a/azure-pipelines.vrt-baseline.yml +++ b/azure-pipelines.vrt-baseline.yml @@ -25,7 +25,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: webcomponents - vrTestPackageName: '@fluentui/vr-tests-web-components' + vrTestPackageName: 'vr-tests-web-components' vrTestPackagePath: 'apps/vr-tests-web-components' - task: AzureCLI@2 @@ -56,7 +56,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: v9 - vrTestPackageName: '@fluentui/vr-tests-react-components' + vrTestPackageName: 'vr-tests-react-components' vrTestPackagePath: 'apps/vr-tests-react-components' - task: AzureCLI@2 @@ -87,7 +87,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: v8 - vrTestPackageName: '@fluentui/vr-tests' + vrTestPackageName: 'vr-tests' vrTestPackagePath: 'apps/vr-tests' - task: AzureCLI@2 @@ -117,7 +117,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: v0 - vrTestPackageName: '@fluentui/docs' + vrTestPackageName: 'docs' vrTestPackagePath: 'packages/fluentui/docs' - task: AzureCLI@2 diff --git a/azure-pipelines.vrt-pr.yml b/azure-pipelines.vrt-pr.yml index 54a0bfed17430f..0d7f89d62954ac 100644 --- a/azure-pipelines.vrt-pr.yml +++ b/azure-pipelines.vrt-pr.yml @@ -30,7 +30,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: webcomponents - vrTestPackageName: '@fluentui/vr-tests-web-components' + vrTestPackageName: 'vr-tests-web-components' vrTestPackagePath: 'apps/vr-tests-web-components' locationPrefix: 'FluentUI-web-components' locationPostfix: 'vrscreenshotwebcomponents' @@ -52,7 +52,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: v9 - vrTestPackageName: '@fluentui/vr-tests-react-components' + vrTestPackageName: 'vr-tests-react-components' vrTestPackagePath: 'apps/vr-tests-react-components' locationPrefix: 'fluentuiv9' locationPostfix: 'vrscreenshotv9' @@ -73,7 +73,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: v8 - vrTestPackageName: '@fluentui/vr-tests' + vrTestPackageName: 'vr-tests' vrTestPackagePath: 'apps/vr-tests' locationPrefix: 'fluentuiv8' locationPostfix: 'vrscreenshotv8' @@ -95,7 +95,7 @@ jobs: - template: .devops/templates/runpublishvrscreenshot.yml parameters: fluentVersion: v0 - vrTestPackageName: '@fluentui/docs' + vrTestPackageName: 'docs' vrTestPackagePath: 'packages/fluentui/docs' locationPrefix: 'FluentUI-v0' locationPostfix: 'vrscreenshotv0' diff --git a/change/@fluentui-common-styles-59859a9b-2959-4c41-9ad8-a3c47dd0db96.json b/change/@fluentui-common-styles-59859a9b-2959-4c41-9ad8-a3c47dd0db96.json new file mode 100644 index 00000000000000..191bb50861f171 --- /dev/null +++ b/change/@fluentui-common-styles-59859a9b-2959-4c41-9ad8-a3c47dd0db96.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/common-styles", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-dom-utilities-8d0df67b-7ff4-43bb-94d2-ed581e77b8bd.json b/change/@fluentui-dom-utilities-8d0df67b-7ff4-43bb-94d2-ed581e77b8bd.json new file mode 100644 index 00000000000000..a8958494b34e4f --- /dev/null +++ b/change/@fluentui-dom-utilities-8d0df67b-7ff4-43bb-94d2-ed581e77b8bd.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/dom-utilities", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-keyboard-key-b3731189-7bdd-40db-98de-15ecf0b0d4d3.json b/change/@fluentui-keyboard-key-b3731189-7bdd-40db-98de-15ecf0b0d4d3.json new file mode 100644 index 00000000000000..a81d0ccd315ae8 --- /dev/null +++ b/change/@fluentui-keyboard-key-b3731189-7bdd-40db-98de-15ecf0b0d4d3.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/keyboard-key", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-monaco-editor-2177a223-b575-4825-9a5b-502630a9f4e5.json b/change/@fluentui-monaco-editor-2177a223-b575-4825-9a5b-502630a9f4e5.json new file mode 100644 index 00000000000000..8e874a666f0a4a --- /dev/null +++ b/change/@fluentui-monaco-editor-2177a223-b575-4825-9a5b-502630a9f4e5.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/monaco-editor", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-public-docsite-setup-f3bdb114-f5e6-4cd2-a723-7ae05f7409cd.json b/change/@fluentui-public-docsite-setup-f3bdb114-f5e6-4cd2-a723-7ae05f7409cd.json new file mode 100644 index 00000000000000..ec0282a97ac506 --- /dev/null +++ b/change/@fluentui-public-docsite-setup-f3bdb114-f5e6-4cd2-a723-7ae05f7409cd.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/public-docsite-setup", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-d680603c-b944-4079-98a5-4f02e1192a5a.json b/change/@fluentui-react-d680603c-b944-4079-98a5-4f02e1192a5a.json new file mode 100644 index 00000000000000..1fe056d1e125aa --- /dev/null +++ b/change/@fluentui-react-d680603c-b944-4079-98a5-4f02e1192a5a.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/react", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-window-provider-3cd72585-086b-49b8-b6aa-f090fa5ade10.json b/change/@fluentui-react-window-provider-3cd72585-086b-49b8-b6aa-f090fa5ade10.json new file mode 100644 index 00000000000000..de7c70c2dfe236 --- /dev/null +++ b/change/@fluentui-react-window-provider-3cd72585-086b-49b8-b6aa-f090fa5ade10.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: add project.json tags", + "packageName": "@fluentui/react-window-provider", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/docs/react-v9/contributing/command-cheat-sheet.md b/docs/react-v9/contributing/command-cheat-sheet.md index f36dbef9932259..34595107c54c11 100644 --- a/docs/react-v9/contributing/command-cheat-sheet.md +++ b/docs/react-v9/contributing/command-cheat-sheet.md @@ -82,22 +82,33 @@ Primary source of our generators lives in [workspace-plugin](../../../tools//wor > > `` is project name without `@npmScope` +> [!NOTE] +> +> Following commands should be invoked from monorepo root ! + ```shell +# dependencies yarn # installs everything. It fixes many things. -yarn buildto package-name # Does a yarn build scoped to a specific package and its dependencies for faster speeds vs building the whole repo. -yarn test # runs a test suite. It is slightly different from the test suite in the CI/CD test suite. Can be run from inside a given package to run faster. +yarn run dedupe # dedupes dependencies - necessary to run after any kind of package bump/changes + +# generators yarn create-package # scaffolds a new package yarn create-component # scaffolds a new component yarn change # creates a new change file, if needed -yarn clean # tidies any cached dependencies + +# NOTE: following tasks will be executed against all monorepo projects ( avoid = SLOW ) +yarn clean # tidies any cached dependencies in all packages yarn build # generates and relinks all packages and temporary files, this can be a good option if you see errors unrelated to the packages you are working on yarn start # runs a package. You can select the package of choice. -yarn update-snapshots # updates snapshot tests -yarn run dedupe # dedupes dependencies - necessary to run after any kind of package bump/changes -yarn nx run :generate-api # updates API files +yarn update-snapshots # updates snapshot tests in whole monorepo + +# running project tasks yarn nx run : # runs tasks within a package. [More help here](https://nx.dev/features/run-tasks#running-tasks) +yarn nx run :build # Does a yarn build scoped to a specific package and its dependencies for faster speeds vs building the whole repo. +yarn nx run :test # runs a test suite. It is slightly different from the test suite in the CI/CD test suite. +yarn nx run :generate-api # updates API files yarn nx run :type-check # quickly runs type checks and associated linting -yarn lage build --to react # build v8 so intellisense works. +yarn nx run react:build # build v8 so intellisense works. ``` ```shell diff --git a/docs/react-v9/contributing/dev-workflow.md b/docs/react-v9/contributing/dev-workflow.md index d8d16d7eeece35..f91d7eaa601c5c 100644 --- a/docs/react-v9/contributing/dev-workflow.md +++ b/docs/react-v9/contributing/dev-workflow.md @@ -75,13 +75,13 @@ Creating _draft_ pull requests is often an easy way to keep track of your work w In other cases, such as before checking in or running tests, you may need to run a full build (or build up to a certain package): -- `yarn lage build --since master` - build everything. You shouldn't need to do this for regular work flow. -- `yarn buildto package-name` - build up to a package. It is good to run this weekly, or anytime you start a new project off master. - - `yarn buildto @fluentui/react` +- `yarn nx run-many -t build` - build everything. You shouldn't need to do this for regular work flow. +- `yarn nx run :build` - build package with all it's dependencies. It is good to run this weekly, or anytime you start a new project off master. + - `yarn nx run react:build` ### Making a pull request -Make sure all your changes are committed, and run `yarn nx run react-components:build` or `yarn buildto @fluentui/react-components` for changes to the v9 components. This will compare your changes and detect if the publicly facing API has changed, and update our API docs accordingly. Commit this file change. +Make sure all your changes are committed, and run `yarn nx run react-components:build` for changes to the v9 components. This will compare your changes and detect if the publicly facing API has changed, and update our API docs accordingly. Commit this file change. Note: If you encounter build errors here (especially on non-\*nix systems) a 'yarn build' to ensure packages are correctly updated and linked may be necessary. Some of our tests make use of DOM snapshot tests. If your branch makes any changes or additions to the DOM, you may need to run `yarn nx run :test -u` or `yarn workspace @fluentui/ test --updateSnapshot`. This will update any necessary files used by our snapshot tests. diff --git a/docs/react-v9/contributing/testing-with-jest.md b/docs/react-v9/contributing/testing-with-jest.md index 8b3682e9ce2e2f..ca3334707ff42f 100644 --- a/docs/react-v9/contributing/testing-with-jest.md +++ b/docs/react-v9/contributing/testing-with-jest.md @@ -13,7 +13,10 @@ We use various libraries on top of Jest for rendering and interacting with React ## Running tests From your Terminal invoke one of following commands: -`yarn nx run :test` or `yarn lage test --to ` + +```sh +yarn nx run :test +``` > New packages (v9) don't require build step before, which is not true for old fluent libraries like v8. > Until v8 lives within our main branch we cannot remove `build` dependency from target task graph thus you'll experience build step even for new packages. diff --git a/docs/react-v9/contributing/using-local-unpublished-version-of-the-lib-with-a-local-React-app.md b/docs/react-v9/contributing/using-local-unpublished-version-of-the-lib-with-a-local-React-app.md index e6d7b0eda524a0..530822be8af72f 100644 --- a/docs/react-v9/contributing/using-local-unpublished-version-of-the-lib-with-a-local-React-app.md +++ b/docs/react-v9/contributing/using-local-unpublished-version-of-the-lib-with-a-local-React-app.md @@ -105,7 +105,7 @@ Now, whenever you make tweaks to the `fluentui` lib, you simply need to rebuild ``` $ cd fluentui -$ yarn buildto react +$ yarn nx run react:build ``` And the changes should be automatically picked up by the `app`. diff --git a/lage.config.js b/lage.config.js deleted file mode 100644 index 7850f95bcbd724..00000000000000 --- a/lage.config.js +++ /dev/null @@ -1,80 +0,0 @@ -// Configuration documentation: https://microsoft.github.io/lage/guide/config.html -module.exports = { - pipeline: { - build: ['^build'], - 'build:info': [], - bundle: ['build'], - 'bundle-size': ['build'], - 'build-storybook': [], - // adding temporary back until import plugin rule is resolved https://github.com/microsoft/fluentui/issues/27727 - lint: ['build'], - clean: [], - 'generate-api': ['^generate-api'], - test: ['build'], - 'test-integration': ['build'], - 'test-ssr': [], - 'test-vr': ['build-storybook'], - 'test-perf': ['bundle'], - 'type-check': ['build'], - 'code-style': [], - 'update-snapshots': ['^update-snapshots'], - '@fluentui/docs#bundle': ['@fluentui/react-northstar#build:info'], - 'verify-packaging': ['build'], - e2e: [], - '@fluentui/web-components#e2e': ['build-storybook'], - - '@fluentui/ssr-tests#test-ssr': ['bundle'], - // 🚨 antipattern: ssr-test (application) uses code from public-docsite-resources(application), thus we need to trigger application dependency "bundle" - '@fluentui/ssr-tests#bundle': ['^bundle'], - - '@fluentui/perf-test-react-components#bundle': [], - '@fluentui/perf-test-northstar#bundle': [], - '@fluentui/perf-test#bundle': [], - '@fluentui/perf#test-perf': [], - }, - - // Adds some ADO-specific logging commands for reporting failures - ...(process.env.TF_BUILD && { reporter: 'adoLog' }), - - // Ignores these minimatch patterns when considers what packages have changed for the --since flag - ignore: [ - 'change/**', - 'rfcs/**', - 'README.md', - '*.md', - '.vscode/**', - '.github/*.yml', - '.github/*.json', - '.github/*.md', - '.github/CODEOWNERS', - '.github/MAINTAINERS', - '.github/ISSUE_TEMPLATE/**', - '.github/policies/**', - '.devcontainer/**', - ], - - // All of these options are sent to `backfill`: https://github.com/microsoft/backfill/blob/master/README.md - cacheOptions: { - // These are the subset of files in the package directories that will be saved into the cache - outputGlob: [ - 'dist/**/*', - 'lib/**/*', - 'lib-commonjs/**/*', - 'lib-amd/**/*', - 'esm/**/*', - '**/*.source.json', - '**/*.info.json', - '**/dist.stats.json', - '**/*.tar.gz', - '!bower_components', - '!node_modules', - 'lib-es2015/**/*', - 'coverage/**/*', - 'src/**/*.scss.ts', - ], - - // These are relative to the git root, and affects the hash of the cache - // Any of these file changes will invalidate cache - environmentGlob: ['.devops/**/*', '*.js', '*.json', '*.yml', 'apps/pr-deploy-site'], - }, -}; diff --git a/nx.json b/nx.json index 9b78b43a3f4116..9fe8f18bf73792 100644 --- a/nx.json +++ b/nx.json @@ -11,12 +11,12 @@ }, "targetDefaults": { "bundle-size": { - "dependsOn": ["^build"], + "dependsOn": ["build", "^build"], "cache": true }, "bundle": { "cache": true, - "dependsOn": ["^build"] + "dependsOn": ["build", "^build"] }, "build": { "dependsOn": ["^build"], @@ -57,7 +57,7 @@ "cache": true }, "test-perf": { - "dependsOn": ["bundle"], + "dependsOn": [], "cache": true }, "e2e": { diff --git a/package.json b/package.json index f50311fb8a9e4a..d1c54d6b5d21cf 100644 --- a/package.json +++ b/package.json @@ -12,44 +12,41 @@ }, "scripts": { "dedupe": "npx yarn-deduplicate --strategy fewer", - "build": "lage build --verbose", - "buildci": "lage build test lint type-check test-ssr test-integration verify-packaging --verbose", - "builddemo": "yarn build --to public-docsite-resources", - "buildto": "lage build --verbose --to", - "bundle": "lage bundle --verbose", + "build": "nx run-many -t build --nxBail --verbose", + "buildci": "nx affected -t build test lint type-check test-ssr test-integration verify-packaging --nxBail --verbose", + "buildto": "nx build --nxBail", "change": "beachball change --no-commit", "check:change": "beachball check", "check:modified-files": "node -r ./scripts/ts-node/src/register ./scripts/executors/src/check-for-modified-files", "check:affected": "node ./scripts/executors/src/checkIfPackagesAffected.js", "check:installed-dependencies-versions": "satisfied --no-peers --skip-invalid", - "clean": "lage clean --verbose", - "code-style": "lage code-style --verbose", + "clean": "nx run-many -t clean --verbose", + "code-style": "nx run-many -t code-style --verbose", "codepen": "cd packages/react && node ../../scripts/executors/src/local-codepen.js", "copy-notices": "node scripts/generators/src/copy-notices.js", "create-component": "yarn nx g @fluentui/workspace-plugin:react-component", "create-package": "yarn nx g @fluentui/workspace-plugin:react-library", - "e2e": "lage e2e --verbose --concurrency=1", + "e2e": "nx run-many -t e2e --verbose --parallel=1", "format": "node scripts/executors/src/format.js", "generate-version-files": "node -r ./scripts/ts-node/src/register ./scripts/generators/src/generate-version-files", - "lint": "lage lint --verbose", + "lint": "nx run-many -t lint --verbose", "lint:log": "FORCE_COLOR=0 yarn lint > lint.log 2>&1", "postinstall": "node ./scripts/package-manager/src/postinstall.js", "preinstall": "node ./scripts/package-manager/src/use-yarn-please.js", "publish:beachball": "beachball publish -b origin/master --access public -y", "rebuild": "node ./scripts/executors/src/invalidate-just-cache.js && yarn build --reset-cache", "northstar:release": "northstar-release", - "northstar:build:docs": "yarn lage bundle --to @fluentui/docs", + "northstar:build:docs": "yarn nx run docs:bundle", "northstar:start": "yarn workspace @fluentui/docs start", - "northstar:perf": "yarn lage test-perf --to @fluentui/perf", + "northstar:perf": "yarn nx run perf:test-perf", "northstar:stats:build": "gulp stats", "northstar:stats:save": "gulp stats:save", "northstar:test:circulars": "gulp test:circulars:run", "rename-package": "node -r ./scripts/ts-node/src/register ./scripts/generators/src/rename-package.ts", - "run:published": "node ./scripts/executors/src/runPublished.js", "scrub": "node ./scripts/executors/src/scrub.js", "start": "node ./scripts/executors/src/start.js", - "test": "lage test --verbose", - "update-snapshots": "lage update-snapshots --verbose" + "test": "nx run-many -t test --verbose", + "update-snapshots": "nx run-many -t update-snapshots --verbose" }, "devDependencies": { "@actions/core": "1.9.1", @@ -268,7 +265,6 @@ "json-stable-stringify-without-jsonify": "1.0.1", "jsonc-eslint-parser": "2.3.0", "just-scripts": "1.8.2", - "lage": "1.10.0", "license-webpack-plugin": "4.0.2", "lint-staged": "10.2.10", "loader-utils": "2.0.4", diff --git a/packages/common-styles/project.json b/packages/common-styles/project.json index 5595f7068f1160..75e04e616fcd40 100644 --- a/packages/common-styles/project.json +++ b/packages/common-styles/project.json @@ -2,5 +2,6 @@ "name": "common-styles", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "tags": ["v8"] } diff --git a/packages/dom-utilities/project.json b/packages/dom-utilities/project.json index ee16ffd8cc5507..8a74780c993441 100644 --- a/packages/dom-utilities/project.json +++ b/packages/dom-utilities/project.json @@ -2,5 +2,6 @@ "name": "dom-utilities", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", + "tags": ["v8"], "implicitDependencies": [] } diff --git a/packages/fluentui/docs/package.json b/packages/fluentui/docs/package.json index 8d864465a52f41..9ce33e5328eb1a 100644 --- a/packages/fluentui/docs/package.json +++ b/packages/fluentui/docs/package.json @@ -67,13 +67,14 @@ }, "scripts": { "bundle": "gulp build:docs", - "prebuild-storybook": "lage build:info --to react-northstar react-component-ref react-bindings", + "prepare-storybook": "nx run-many -t build:info -p react-northstar react-component-ref react-bindings --nxBail", + "prebuild-storybook": "yarn run prepare-storybook --verbose", "build-storybook": "build-storybook --no-manager-cache -o dist/storybook", "lint": "eslint --ext .js,.ts,.tsx .", "lint:fix": "yarn lint --fix", "start": "gulp docs", "start:profile": "cross-env NODE_ENV=production PERF=true gulp docs", - "prestart:storybook": "lage build:info --to react-northstar react-component-ref react-bindings", + "prestart:storybook": "yarn run prepare-storybook", "start:storybook": "start-storybook", "test-vr": "storywright --browsers chromium --url dist/storybook --destpath dist/screenshots --waitTimeScreenshot 500 --concurrency 4 --headless true" } diff --git a/packages/fluentui/local-sandbox/README.md b/packages/fluentui/local-sandbox/README.md index 8c82ad5a509654..0d3f6fd7d08775 100644 --- a/packages/fluentui/local-sandbox/README.md +++ b/packages/fluentui/local-sandbox/README.md @@ -7,10 +7,10 @@ Production build without hot reload. Primary purpose of this application is to m ## Usage ``` -yarn lage bundle --to local-sandbox +yarn nx run local-sandbox:bundle yarn serve ``` ## Measuring bundle size -This package can be also used to analyze bundle size. After running `yarn lage bundle --to local-sandbox`, bundle size report is stored to **dist/report.html**. +This package can be also used to analyze bundle size. After running `yarn nx run local-sandbox:bundle`, bundle size report is stored to **dist/report.html**. diff --git a/packages/fluentui/perf-test-northstar/package.json b/packages/fluentui/perf-test-northstar/package.json index bcb1ab99d8b150..1d3a327185e4fe 100644 --- a/packages/fluentui/perf-test-northstar/package.json +++ b/packages/fluentui/perf-test-northstar/package.json @@ -5,7 +5,7 @@ "private": true, "scripts": { "type-check": "tsc -p . --noEmit", - "prebundle": "lage build --to digest --verbose", + "prebundle": "nx run digest:build --nxBail --verbose", "bundle": "just-scripts perf-test:bundle", "clean": "just-scripts clean", "test-perf": "just-scripts perf-test:run" diff --git a/packages/fluentui/perf-test-northstar/project.json b/packages/fluentui/perf-test-northstar/project.json index 6d9c5fa3b28227..71e09d83b8f27f 100644 --- a/packages/fluentui/perf-test-northstar/project.json +++ b/packages/fluentui/perf-test-northstar/project.json @@ -5,6 +5,7 @@ "implicitDependencies": [], "tags": ["react-northstar"], "targets": { + "test-perf": { "dependsOn": ["bundle"] }, "bundle": { "dependsOn": ["prebundle"] } } } diff --git a/packages/fluentui/perf/project.json b/packages/fluentui/perf/project.json index 00dd0e7f7d7360..392bb39323c6a3 100644 --- a/packages/fluentui/perf/project.json +++ b/packages/fluentui/perf/project.json @@ -3,8 +3,5 @@ "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "implicitDependencies": [], - "tags": ["react-northstar"], - "targets": { - "test-perf": { "dependsOn": [] } - } + "tags": ["react-northstar"] } diff --git a/packages/keyboard-key/project.json b/packages/keyboard-key/project.json index 1aa50c289605b2..e3829ee4d4af8f 100644 --- a/packages/keyboard-key/project.json +++ b/packages/keyboard-key/project.json @@ -2,5 +2,6 @@ "name": "keyboard-key", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", + "tags": ["v8"], "implicitDependencies": [] } diff --git a/packages/monaco-editor/project.json b/packages/monaco-editor/project.json index 4accc9a9080324..bfa3f4251ef20f 100644 --- a/packages/monaco-editor/project.json +++ b/packages/monaco-editor/project.json @@ -2,5 +2,6 @@ "name": "monaco-editor", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", + "tags": ["v8"], "implicitDependencies": [] } diff --git a/packages/public-docsite-setup/project.json b/packages/public-docsite-setup/project.json index f18dd92cfd8d01..50c99f1508f897 100644 --- a/packages/public-docsite-setup/project.json +++ b/packages/public-docsite-setup/project.json @@ -2,5 +2,6 @@ "name": "public-docsite-setup", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", + "tags": ["v8"], "implicitDependencies": [] } diff --git a/packages/react-components/babel-preset-storybook-full-source/project.json b/packages/react-components/babel-preset-storybook-full-source/project.json index 8a625c8d0b63ee..70684291bb6c88 100644 --- a/packages/react-components/babel-preset-storybook-full-source/project.json +++ b/packages/react-components/babel-preset-storybook-full-source/project.json @@ -4,5 +4,5 @@ "projectType": "library", "implicitDependencies": [], "sourceRoot": "packages/react-components/babel-preset-storybook-full-source/src", - "tags": ["vNext", "platform:node"] + "tags": ["vNext", "platform:node", "tools"] } diff --git a/packages/react-components/react-storybook-addon-export-to-sandbox/project.json b/packages/react-components/react-storybook-addon-export-to-sandbox/project.json index 1116445aa9adb4..e22c0cb0745869 100644 --- a/packages/react-components/react-storybook-addon-export-to-sandbox/project.json +++ b/packages/react-components/react-storybook-addon-export-to-sandbox/project.json @@ -4,5 +4,5 @@ "projectType": "library", "implicitDependencies": [], "sourceRoot": "packages/react-components/react-storybook-addon-export-to-sandbox/src", - "tags": ["vNext", "platform:any"] + "tags": ["vNext", "platform:any", "tools"] } diff --git a/packages/react-components/react-storybook-addon/project.json b/packages/react-components/react-storybook-addon/project.json index fc1bf34a60b41f..ce319c6d9e9109 100644 --- a/packages/react-components/react-storybook-addon/project.json +++ b/packages/react-components/react-storybook-addon/project.json @@ -3,6 +3,6 @@ "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "sourceRoot": "packages/react-components/react-storybook-addon/src", - "tags": ["vNext", "platform:any"], + "tags": ["vNext", "platform:any", "tools"], "implicitDependencies": [] } diff --git a/packages/react-window-provider/project.json b/packages/react-window-provider/project.json index c11fa7584ea68c..26405f46526e62 100644 --- a/packages/react-window-provider/project.json +++ b/packages/react-window-provider/project.json @@ -2,5 +2,6 @@ "name": "react-window-provider", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", + "tags": ["v8"], "implicitDependencies": [] } diff --git a/packages/react/package.json b/packages/react/package.json index 8a8dcecea2831c..b7106349311194 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -21,7 +21,7 @@ "clean": "just-scripts clean", "code-style": "just-scripts code-style", "codepen": "node ../../scripts/executors/src/local-codepen.js", - "e2e": "yarn lage e2e --to @fluentui/react-examples --verbose", + "e2e": "yarn nx run react-examples:e2e --verbose", "e2e:local": "yarn workspace @fluentui/react-examples e2e:local", "just": "just-scripts", "lint": "just-scripts lint", diff --git a/packages/storybook/project.json b/packages/storybook/project.json index fd6f011c690e15..a133dfd35584ca 100644 --- a/packages/storybook/project.json +++ b/packages/storybook/project.json @@ -3,5 +3,5 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "implicitDependencies": [], - "tags": ["v8", "platform:web"] + "tags": ["v8", "platform:web", "tools"] } diff --git a/packages/web-components/.storybook/main.cjs b/packages/web-components/.storybook/main.cjs index b87d7865c36cd9..6c6321ef08bde0 100644 --- a/packages/web-components/.storybook/main.cjs +++ b/packages/web-components/.storybook/main.cjs @@ -72,7 +72,7 @@ module.exports = ); // Disable ProgressPlugin which logs verbose webpack build progress. Warnings and Errors are still logged. - if (process.env.TF_BUILD || process.env.LAGE_PACKAGE_NAME) { + if (process.env.TF_BUILD) { config.plugins = config.plugins.filter(value => value && value.constructor.name !== 'ProgressPlugin'); } diff --git a/scripts/executors/src/checkIfPackagesAffected.js b/scripts/executors/src/checkIfPackagesAffected.js index ec09a15f7096bc..70732596edd9ab 100644 --- a/scripts/executors/src/checkIfPackagesAffected.js +++ b/scripts/executors/src/checkIfPackagesAffected.js @@ -2,12 +2,12 @@ const { getAffectedPackages } = require('@fluentui/scripts-monorepo'); const yargs = require('yargs'); const args = yargs - .option('package', { + .option('project', { alias: 'p', type: 'array', // eslint-disable-next-line @typescript-eslint/naming-convention string: true, - description: 'Package to check modified files from', + description: 'project to check modified files from', demandOption: false, }) .option('base', { @@ -15,15 +15,16 @@ const args = yargs description: 'Base of the current branch (usually main or master)', default: 'origin/master', }) + .strict(true) .version(false).argv; const isPackageAffected = () => { - const { package: packages, base } = args; + const { project: projects, base } = args; const affectedPackages = getAffectedPackages(base); - if (packages) { - for (const pkg of packages) { - if (affectedPackages.has(pkg)) { + if (projects) { + for (const pkg of projects) { + if (affectedPackages.has(normalizeProjectName(pkg))) { return true; } } @@ -33,6 +34,10 @@ const isPackageAffected = () => { return affectedPackages; }; +function normalizeProjectName(/** @type {string} */ value) { + return value.replace('@fluentui/', ''); +} + function main() { /** * In order for pipeline to capture and save the return value from a node script, diff --git a/scripts/executors/src/runPublished.js b/scripts/executors/src/runPublished.js deleted file mode 100644 index d0292c136c36b0..00000000000000 --- a/scripts/executors/src/runPublished.js +++ /dev/null @@ -1,113 +0,0 @@ -const { spawnSync } = require('child_process'); - -const { getAllPackageInfo, isConvergedPackage } = require('@fluentui/scripts-monorepo'); -const lageBin = require.resolve('lage/bin/lage.js'); - -/** - * @typedef {{argv:string[]; workspacePackagesMetadata:ReturnType;}} Options - */ - -const isExecutedFromCli = require.main === module; - -if (isExecutedFromCli) { - const argv = process.argv.slice(2); - main({ argv, workspacePackagesMetadata: getAllPackageInfo() }); -} - -module.exports = main; - -/** - * - * @param {Options} options - */ -function main(options) { - if (!(isExecutedFromCli || process.env.NODE_ENV === 'test')) { - throw new Error('This is NOT supposed to be used as API only via direct node execution'); - } - if (!assertArgs(options.argv)) { - return; - } - - const lageArgs = getLageArgs(options); - - const result = spawnSync(process.execPath, [lageBin, ...lageArgs], { - stdio: 'inherit', - maxBuffer: 500 * 1024 * 1024, - }); - - process.exit(result.status ?? undefined); -} - -/** - * - * @param {string[]} args - */ -function assertArgs(args) { - if (args.length < 1) { - console.log(`Usage: - - yarn run:published