diff --git a/azure-pipelines.perf-test.yml b/azure-pipelines.perf-test.yml index 53e0f5cf97217..007470883b230 100644 --- a/azure-pipelines.perf-test.yml +++ b/azure-pipelines.perf-test.yml @@ -81,18 +81,18 @@ jobs: uniqueId: 'perfComment9424' - script: | - yarn stats:build + yarn northstar:stats:build condition: eq(variables.isPR, false) displayName: Bundle Statistics (master only) - script: | - yarn perf + yarn northstar:perf condition: eq(variables.isPR, false) displayName: Performance Tests (master only) # HEADS UP: also see tag-version-prefix in fluentui-publish.js - script: | - yarn stats:save --tag=`git tag --points-at HEAD | grep ^@fluentui/react-northstar_v | grep -o 'northstar_v.*'` + yarn northstar:stats:save --tag=`git tag --points-at HEAD | grep ^@fluentui/react-northstar_v | grep -o 'northstar_v.*'` condition: eq(variables.isPR, false) displayName: Save Statistics to DB (master only) env: diff --git a/azure-pipelines.release-fluentui.yml b/azure-pipelines.release-fluentui.yml index 7cdbf4052ef66..dc83af3dc76e0 100644 --- a/azure-pipelines.release-fluentui.yml +++ b/azure-pipelines.release-fluentui.yml @@ -103,7 +103,7 @@ extends: today=`date +%Y-%m-%d` echo date today $today echo "##vso[task.setvariable variable=date]$today" - yarn release:fluentui:pack-nightly + yarn northstar:release pack-nightly - task: AzureUpload@2 displayName: '[Nightly] Upload tarballs' @@ -132,9 +132,7 @@ extends: echo "registry=https://registry.npmjs.org/" >> packages/fluentui/.npmrc echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> packages/fluentui/.npmrc - yarn release:fluentui:$(releaseVersion) --yes - - yarn release:fluentui:post-validation + yarn northstar:release bump $(releaseVersion) --yes - template: .devops/templates/cleanup.yml@self @@ -203,7 +201,7 @@ extends: inputs: script: | echo deployBasePath $(deployBasePath) docsiteVersion $(docsiteVersion) nightlyReleaseDate $(nightlyReleaseDate) - NODE_ENV=production yarn build:fluentui:docs + NODE_ENV=production yarn northstar:build:docs - task: AzureUpload@2 displayName: Upload to Azure diff --git a/package.json b/package.json index 057639a2066a1..1322fc8fdc42d 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,9 @@ "dedupe": "npx yarn-deduplicate --strategy fewer", "build": "lage build --verbose", "build:codesandbox": "yarn build --to @fluentui/react --to @fluentui/react-components", - "build:fluentui:docs": "gulp build:docs", "buildci": "lage build test lint type-check test-ssr verify-packaging --verbose", "builddemo": "yarn build --to public-docsite-resources", "buildto": "lage build --verbose --to", - "buildto:lerna": "node ./scripts/executors/buildTo.js", "bundle": "lage bundle --verbose", "change": "beachball change --no-commit", "check:change": "beachball check", @@ -36,30 +34,22 @@ "generate-version-files": "node -r ./scripts/ts-node/register ./scripts/generators/generate-version-files", "lint": "lage lint --verbose", "lint:log": "FORCE_COLOR=0 yarn lint > lint.log 2>&1", - "lint:log:lerna": "FORCE_COLOR=0 lerna run lint --stream --no-bail > lint.log 2>&1", - "perf": "yarn workspace @fluentui/perf perf:test", - "perf:debug": "yarn workspace @fluentui/perf perf:test:debug", "postinstall": "node ./scripts/package-manager/postinstall.js", "preinstall": "node ./scripts/package-manager/use-yarn-please.js", "publish:beachball": "beachball publish -b origin/master --access public -y", "rebuild": "node ./scripts/executors/invalidate-just-cache.js && yarn build --reset-cache", - "release:fluentui:canary": "node -r ./scripts/ts-node/register ./scripts/fluentui-publish publish-canary", - "release:fluentui:minor": "node -r ./scripts/ts-node/register ./scripts/fluentui-publish publish-minor", - "release:fluentui:pack-nightly": "node -r ./scripts/ts-node/register ./scripts/fluentui-publish pack-nightly", - "release:fluentui:patch": "node -r ./scripts/ts-node/register ./scripts/fluentui-publish publish-patch", - "release:fluentui:post-validation": "node -r ./scripts/ts-node/register ./scripts/fluentui-publish post-publish", + "northstar:release": "node ./scripts/fluentui-publish", + "northstar:build:docs": "yarn workspace @fluentui/docs build", + "northstar:start": "yarn workspace @fluentui/docs start", + "northstar:perf": "yarn workspace @fluentui/perf perf:test", + "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/register ./scripts/generators/rename-package.ts", "run:published": "node ./scripts/executors/runPublished.js", - "runto:lerna": "node ./scripts/executors/runTo.js", "scrub": "node ./scripts/executors/scrub.js", "start": "node ./scripts/executors/start.js", - "start:northstar": "yarn workspace @fluentui/docs start", - "stats:build": "gulp stats", - "stats:save": "gulp stats:save", "test": "lage test --verbose", - "test:fluentui:circulars": "gulp test:circulars:run", - "test:fluentui:e2e": "yarn workspace @fluentui/e2e test", - "test:fluentui:projects": "yarn workspace @fluentui/projects-test test", "update-snapshots": "lage update-snapshots --verbose" }, "devDependencies": { diff --git a/packages/fluentui/CONTRIBUTING.md b/packages/fluentui/CONTRIBUTING.md index 143c1ff5b52e4..a432e64adb881 100644 --- a/packages/fluentui/CONTRIBUTING.md +++ b/packages/fluentui/CONTRIBUTING.md @@ -35,16 +35,16 @@ To contribute to packages in this folder, follow [these setup instructions](setu From repo root: ```sh -yarn start # start doc site: choose `@fluentui/docs` +yarn northstar:start # start doc site: choose `@fluentui/docs` yarn test # run all packages' tests once yarn build # build all packages -yarn build:fluentui:docs # build docs +yarn northstar:build:docs # build docs yarn lint # lint all packages -yarn prettier # run prettier on changed files +yarn format # run prettier on changed files ``` From an individual under `packages/fluentui`, such as `packages/fluentui/react-northstar`: diff --git a/packages/fluentui/test-a-feature.md b/packages/fluentui/test-a-feature.md index bda972aeeee5b..80f22093ebadc 100644 --- a/packages/fluentui/test-a-feature.md +++ b/packages/fluentui/test-a-feature.md @@ -280,10 +280,10 @@ Finding the right number of `iterations` is a balancing act between having a fas Run test and watch: ``` -yarn perf:test +yarn northstar:perf ``` -After running `perf:test`, results can be viewed in the `packages/fluentui/perf-test-northstar/dist` folder with the main entry file being `packages/fluentui/perf-test-northstar/dist/perfCounts.html`. +After running `northstar:perf`, results can be viewed in the `packages/fluentui/perf-test-northstar/dist` folder with the main entry file being `packages/fluentui/perf-test-northstar/dist/perfCounts.html`. There are more detailed commands as well (these must be run from `packages/fluentui/perf-test-northstar` directory): diff --git a/scripts/executors/buildTo.js b/scripts/executors/buildTo.js deleted file mode 100644 index 2f256d756f8ef..0000000000000 --- a/scripts/executors/buildTo.js +++ /dev/null @@ -1,31 +0,0 @@ -const { runTo } = require('./runTo'); - -const isExecutedFromCli = require.main === module; - -function main() { - const argv = process.argv.slice(2); - - // Display a usage message when there are no projects specified - if (argv.length < 1) { - console.log(`Usage: - - yarn buildto [ ...] [] - -This command builds all packages up to and including "packagename1" (and "packagename2" etc). -The package name can be a substring. -If multiple packages match a pattern, they will all be built (along with their dependencies). -`); - - process.exit(0); - } - - const restIndex = argv.findIndex(arg => arg.startsWith('--')); - const projects = restIndex === -1 ? argv : argv.slice(0, restIndex); - const rest = restIndex === -1 ? [] : argv.slice(argv[restIndex] === '--' ? restIndex + 1 : restIndex); - - runTo('build', projects, rest); -} - -if (isExecutedFromCli) { - main(); -} diff --git a/scripts/executors/runTo.js b/scripts/executors/runTo.js deleted file mode 100644 index 87314390da8b2..0000000000000 --- a/scripts/executors/runTo.js +++ /dev/null @@ -1,101 +0,0 @@ -const { spawnSync } = require('child_process'); -const lernaBin = require.resolve('lerna/cli.js'); -const os = require('os'); - -const { getAllPackageInfo } = require('@fluentui/scripts-monorepo'); - -const isExecutedFromCli = require.main === module; - -/** - * @param {string} script - Script to run - * @param {string[]} projects - Projects to run in - * @param {string[]} rest - Args to pass on - * @returns {void} - */ -function runTo(script, projects, rest) { - // This script matches substrings of the input for one more many projects - const allPackages = getAllPackageInfo(); - - const foundProjects = /** @type {string[]} */ ([]); - - for (const project of projects) { - if (allPackages[project]) { - foundProjects.push(project); - } else { - const packagesForProject = Object.keys(allPackages).filter(name => name.includes(project)); - if (packagesForProject.length === 0) { - console.log(`There is no project matching "${project}" in this repo`); - } else if (packagesForProject.length > 1) { - console.log(`More than one project matched: "${packagesForProject.join('", "')}"`); - } else { - console.log(`Found a matching project named "${packagesForProject[0]}"`); - } - foundProjects.push(...packagesForProject); - } - } - - /** - * @type {string[]} - */ - const scopes = []; - foundProjects.forEach(projectName => { - // --scope limits build to a specified package - scopes.push('--scope'); - scopes.push(projectName); - }); - - // --include-filtered-Dependencies makes the build include dependencies - // --stream allows the build to proceed in parallel but still in order - const result = spawnSync( - process.execPath, - [ - lernaBin, - 'run', - script, - ...scopes, - '--include-filtered-dependencies', // makes the build include dependencies - '--stream', // run in parallel but still in order - // Except when running in PR/CI, reduce concurrency so the computer is usable while building - ...(process.env.TF_BUILD ? [] : ['--concurrency=' + (os.cpus().length - 2)]), - '--', - ...rest, - ], - { - stdio: 'inherit', - }, - ); - - if (result.status !== 0) { - process.exit(result.status ?? undefined); - } -} - -function main() { - const argv = process.argv.slice(2); - // Display a usage message when there are no projects specified - if (argv.length < 2) { - console.log(`Usage: - - yarn runto