diff --git a/.vscode/launch.json b/.vscode/launch.json index db3efb7177c52a..b247df823c7b55 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "Debug test", "type": "node", "request": "launch", - "program": "${workspaceRoot}/scripts/executors/debug-test.js", + "program": "${workspaceRoot}/scripts/executors/src/debug-test.js", "cwd": "${fileDirname}", "stopOnEntry": false, "args": ["-i", "--watch"], @@ -22,7 +22,7 @@ "name": "Debug current open test", "type": "node", "request": "launch", - "program": "${workspaceRoot}/scripts/executors/debug-test.js", + "program": "${workspaceRoot}/scripts/executors/src/debug-test.js", "cwd": "${fileDirname}", "stopOnEntry": false, "args": ["-i", "--testPathPattern=\\b${fileBasenameNoExtension}", "--watch"], @@ -39,7 +39,7 @@ "name": "Debug current open test (v0)", "type": "node", "request": "launch", - "program": "${workspaceRoot}/scripts/executors/debug-test.js", + "program": "${workspaceRoot}/scripts/executors/src/debug-test.js", "cwd": "${fileDirname}", "stopOnEntry": false, "args": ["-i", "--testPathPattern=\\b${fileBasenameNoExtension}", "--watch"], @@ -128,7 +128,7 @@ "protocol": "inspector", "cwd": "${workspaceRoot}", "args": [ - "${workspaceRoot}/scripts/update-release-notes/index.ts", + "${workspaceRoot}/scripts/update-release-notes/src/index.ts", "--token", // For local testing, generate a personal access token (https://github.com/settings/tokens) // and replace "your token here" with the token. DO NOT COMMIT YOUR TOKEN! @@ -137,7 +137,7 @@ "--age", "10" ], - "runtimeArgs": ["--nolazy", "--inspect", "-r", "${workspaceRoot}/scripts/ts-node/register"], + "runtimeArgs": ["--nolazy", "--inspect", "-r", "${workspaceRoot}/scripts/ts-node/src/register"], "env": { "NODE_ENV": "development" }, diff --git a/azure-pipelines.release-vnext-nightly.yml b/azure-pipelines.release-vnext-nightly.yml index 9d4a074013a1c8..2f672d7c092d9c 100644 --- a/azure-pipelines.release-vnext-nightly.yml +++ b/azure-pipelines.release-vnext-nightly.yml @@ -97,7 +97,7 @@ extends: displayName: yarn build - script: | - yarn publish:beachball -n $(npmToken) --no-push --tag nightly --config scripts/beachball/release-vNext.config.js + yarn publish:beachball -n $(npmToken) --no-push --tag nightly --config scripts/beachball/src/release-vNext.config.js git reset --hard origin/master displayName: Publish changes and bump versions diff --git a/azure-pipelines.release-vnext.yml b/azure-pipelines.release-vnext.yml index 014cf998f57196..03d9d4d061d984 100644 --- a/azure-pipelines.release-vnext.yml +++ b/azure-pipelines.release-vnext.yml @@ -84,14 +84,14 @@ extends: displayName: yarn build - script: | - yarn publish:beachball -n $(npmToken) --config scripts/beachball/release-vNext.config.js + yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-vNext.config.js git reset --hard origin/master env: GITHUB_PAT: $(githubPAT) displayName: Publish changes and bump versions - script: | - node -r ./scripts/ts-node/register scripts/executors/tag-react-components.ts --token $(npmToken) + node -r ./scripts/ts-node/src/register scripts/executors/src/tag-react-components.ts --token $(npmToken) displayName: Tag prelease packages with prerelease tag continueOnError: true @@ -102,7 +102,7 @@ extends: # TODO update release notes script for v9 # - script: | - # node -r ./scripts/ts-node/register ./scripts/update-release-notes/index.ts --token=$(githubPAT) --apply --debug + # node -r ./scripts/ts-node/src/register ./scripts/update-release-notes/src/index.ts --token=$(githubPAT) --apply --debug # displayName: 'Update github release notes' # This would usually be run automatically (via a pipeline decorator from an extension), but the diff --git a/azure-pipelines.release.web-components.yml b/azure-pipelines.release.web-components.yml index 7a41f66b0b2d3e..2a1e4b04e4e612 100644 --- a/azure-pipelines.release.web-components.yml +++ b/azure-pipelines.release.web-components.yml @@ -75,7 +75,7 @@ extends: displayName: Build, [test], Lint - script: | - yarn publish:beachball -n $(npmToken) --config scripts/beachball/release-web-components.config.js + yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-web-components.config.js git reset --hard origin/master env: GITHUB_PAT: $(githubPAT) diff --git a/azure-pipelines.release.yml b/azure-pipelines.release.yml index d4110dc1ae6b8a..fd51c5c9039671 100644 --- a/azure-pipelines.release.yml +++ b/azure-pipelines.release.yml @@ -120,7 +120,7 @@ extends: displayName: yarn bundle - script: | - yarn publish:beachball -n $(npmToken) --config scripts/beachball/release-v8.config.js + yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-v8.config.js git reset --hard origin/master env: GITHUB_PAT: $(githubPAT) @@ -155,7 +155,7 @@ extends: # Run this near the end because it's more likely to fail than the artifact upload tasks, and its # failure doesn't need to block anything else - script: | - node -r ./scripts/ts-node/register ./scripts/update-release-notes/index.ts --token=$(githubPAT) --apply --debug + node -r ./scripts/ts-node/src/register ./scripts/update-release-notes/src/index.ts --token=$(githubPAT) --apply --debug displayName: 'Update github release notes' - template: .devops/templates/cleanup.yml@self diff --git a/change/@fluentui-react-27671eeb-1fa7-49ce-8068-e6150048b1fa.json b/change/@fluentui-react-27671eeb-1fa7-49ce-8068-e6150048b1fa.json new file mode 100644 index 00000000000000..b7caa2b3530514 --- /dev/null +++ b/change/@fluentui-react-27671eeb-1fa7-49ce-8068-e6150048b1fa.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: normalize all scripts source to live under /src", + "packageName": "@fluentui/react", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-react-charting-6f19b95b-48d2-4551-8a48-3d536dabf40f.json b/change/@fluentui-react-charting-6f19b95b-48d2-4551-8a48-3d536dabf40f.json new file mode 100644 index 00000000000000..59b8984dbf2b1b --- /dev/null +++ b/change/@fluentui-react-charting-6f19b95b-48d2-4551-8a48-3d536dabf40f.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: normalize all scripts source to live under /src", + "packageName": "@fluentui/react-charting", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/change/@fluentui-tokens-15117ef6-b2bf-4271-9818-c5f7ede5a743.json b/change/@fluentui-tokens-15117ef6-b2bf-4271-9818-c5f7ede5a743.json new file mode 100644 index 00000000000000..02f5ebf2acdfeb --- /dev/null +++ b/change/@fluentui-tokens-15117ef6-b2bf-4271-9818-c5f7ede5a743.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: normalize all scripts source to live under /src", + "packageName": "@fluentui/tokens", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "none" +} diff --git a/docs/react-v9/contributing/rfcs/shared/build-system/08-type-checking-perf-improvements.md b/docs/react-v9/contributing/rfcs/shared/build-system/08-type-checking-perf-improvements.md index bb987f26c0e7d3..a1f7940a3b52e0 100644 --- a/docs/react-v9/contributing/rfcs/shared/build-system/08-type-checking-perf-improvements.md +++ b/docs/react-v9/contributing/rfcs/shared/build-system/08-type-checking-perf-improvements.md @@ -107,7 +107,7 @@ This dts generation can be done in 2 ways: > EXAMPLE PR: https://github.com/microsoft/fluentui/pull/28002 ```yml -- script: node ./scripts/executors/type-check-ci-hack.js --base $(targetBranch) +- script: node ./scripts/executors/src/type-check-ci-hack.js --base $(targetBranch) displayName: type-check perf preparation - script: yarn buildci $(sinceArg) ``` diff --git a/lint-staged.config.js b/lint-staged.config.js index 93243d88b17b22..39d0b6f62b71a3 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -10,7 +10,7 @@ const commands = { * - respect ignore files (which eslint doesn't do by default when passed a specific file path) * - match the set of files that are linted by the package's normal `lint` command */ - lint: 'node ./scripts/lint-staged/eslint', + lint: 'node ./scripts/lint-staged/src/eslint', }; // https://www.npmjs.com/package/lint-staged diff --git a/package.json b/package.json index 21c0bb1f89ab46..a3dbbf8b98a4b0 100644 --- a/package.json +++ b/package.json @@ -20,24 +20,24 @@ "bundle": "lage bundle --verbose", "change": "beachball change --no-commit", "check:change": "beachball check", - "check:modified-files": "node -r ./scripts/ts-node/register ./scripts/executors/check-for-modified-files", - "check:affected": "node ./scripts/executors/checkIfPackagesAffected.js", + "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", - "codepen": "cd packages/react && node ../../scripts/executors/local-codepen.js", - "copy-notices": "node scripts/generators/copy-notices.js", + "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", - "format": "node scripts/executors/format.js", - "generate-version-files": "node -r ./scripts/ts-node/register ./scripts/generators/generate-version-files", + "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:log": "FORCE_COLOR=0 yarn lint > lint.log 2>&1", - "postinstall": "node ./scripts/package-manager/postinstall.js", - "preinstall": "node ./scripts/package-manager/use-yarn-please.js", + "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/invalidate-just-cache.js && yarn build --reset-cache", + "rebuild": "node ./scripts/executors/src/invalidate-just-cache.js && yarn build --reset-cache", "northstar:release": "northstar-release", "northstar:build:docs": "yarn workspace @fluentui/docs build", "northstar:start": "yarn workspace @fluentui/docs start", @@ -45,10 +45,10 @@ "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", - "scrub": "node ./scripts/executors/scrub.js", - "start": "node ./scripts/executors/start.js", + "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" }, diff --git a/packages/react-charting/package.json b/packages/react-charting/package.json index 549957fc6bee74..1feedaf58cbbb9 100644 --- a/packages/react-charting/package.json +++ b/packages/react-charting/package.json @@ -20,7 +20,7 @@ "test": "cross-env TZ=UTC just-scripts test", "just": "just-scripts", "clean": "just-scripts clean", - "codepen": "node ../../scripts/executors/local-codepen.js", + "codepen": "node ../../scripts/executors/src/local-codepen.js", "code-style": "just-scripts code-style", "start": "just-scripts dev:storybook", "start:legacy": "just-scripts dev", diff --git a/packages/react/package.json b/packages/react/package.json index 48ab9394ea73d4..bdb5667ab9f938 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -21,7 +21,7 @@ "build-storybook": "cross-env NODE_OPTIONS=--max-old-space-size=3072 just-scripts storybook:build", "clean": "just-scripts clean", "code-style": "just-scripts code-style", - "codepen": "node ../../scripts/executors/local-codepen.js", + "codepen": "node ../../scripts/executors/src/local-codepen.js", "e2e": "yarn workspace @fluentui/react-examples cypress run --component", "e2e:local": "yarn workspace @fluentui/react-examples cypress open --component", "just": "just-scripts", diff --git a/packages/tokens/package.json b/packages/tokens/package.json index efb192c2c2570d..1843bfc5dcb072 100644 --- a/packages/tokens/package.json +++ b/packages/tokens/package.json @@ -18,7 +18,7 @@ "just": "just-scripts", "lint": "just-scripts lint", "test": "jest --passWithNoTests", - "token-pipeline": "node -r ../../scripts/ts-node/register ../../scripts/generators/token-pipeline.ts", + "token-pipeline": "node -r ../../scripts/ts-node/src/register ../../scripts/generators/src/token-pipeline.ts", "type-check": "just-scripts type-check", "generate-api": "just-scripts generate-api" }, diff --git a/scripts/generators/create-package/plop-templates-node/just.config.ts b/scripts/api-extractor/just.config.ts similarity index 100% rename from scripts/generators/create-package/plop-templates-node/just.config.ts rename to scripts/api-extractor/just.config.ts diff --git a/scripts/api-extractor/package.json b/scripts/api-extractor/package.json index 9fb9a1cc4c8135..6c28f0b3cc5b69 100644 --- a/scripts/api-extractor/package.json +++ b/scripts/api-extractor/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/api-extractor/src/index.js b/scripts/api-extractor/src/index.js new file mode 100644 index 00000000000000..f053ebf7976e37 --- /dev/null +++ b/scripts/api-extractor/src/index.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/scripts/api-extractor/tsconfig.lib.json b/scripts/api-extractor/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/api-extractor/tsconfig.lib.json +++ b/scripts/api-extractor/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/babel/just.config.ts b/scripts/babel/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/babel/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/babel/package.json b/scripts/babel/package.json index ea74f8fb70bf0b..0a1449c953cb96 100644 --- a/scripts/babel/package.json +++ b/scripts/babel/package.json @@ -2,13 +2,28 @@ "name": "@fluentui/scripts-babel", "version": "0.0.1", "private": true, - "main": "index.js", + "main": "src/index.js", "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {}, + "exports": { + ".": { + "require": "./src/index.js", + "import": "./src/index.js" + }, + "./register": { + "require": "./register.js", + "import": "./register.js" + }, + "./preset-v9": { + "require": "./src/preset-v9.js", + "import": "./src/preset-v9.js" + } + } } diff --git a/scripts/babel/project.json b/scripts/babel/project.json index 406b4756629ade..40bf1bf6f1f304 100644 --- a/scripts/babel/project.json +++ b/scripts/babel/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-babel", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/babel", + "sourceRoot": "scripts/babel/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/babel/index.js b/scripts/babel/src/index.js similarity index 95% rename from scripts/babel/index.js rename to scripts/babel/src/index.js index 7363e8579669ec..79cb6a797daaef 100644 --- a/scripts/babel/index.js +++ b/scripts/babel/src/index.js @@ -1,3 +1,7 @@ +/** + * This files is used solely for react-northstar projects. Please don't any new logic here + */ + /** @typedef {import('@babel/core').TransformOptions['caller']} Caller */ const isNodeCaller = (/** @type {Caller}*/ caller) => { diff --git a/scripts/babel/preset-v9.js b/scripts/babel/src/preset-v9.js similarity index 100% rename from scripts/babel/preset-v9.js rename to scripts/babel/src/preset-v9.js diff --git a/scripts/babel/preset-v9.spec.ts b/scripts/babel/src/preset-v9.spec.ts similarity index 100% rename from scripts/babel/preset-v9.spec.ts rename to scripts/babel/src/preset-v9.spec.ts diff --git a/scripts/babel/types.ts b/scripts/babel/src/types.ts similarity index 100% rename from scripts/babel/types.ts rename to scripts/babel/src/types.ts diff --git a/scripts/babel/tsconfig.lib.json b/scripts/babel/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/babel/tsconfig.lib.json +++ b/scripts/babel/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/beachball/just.config.ts b/scripts/beachball/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/beachball/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/beachball/package.json b/scripts/beachball/package.json index a1bc631431ae88..b341eb3c4b4785 100644 --- a/scripts/beachball/package.json +++ b/scripts/beachball/package.json @@ -2,17 +2,18 @@ "name": "@fluentui/scripts-beachball", "version": "0.0.1", "private": true, - "main": "index.js", + "main": "src/index.js", "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-github": "*", "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-ts-node": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/beachball/project.json b/scripts/beachball/project.json index 02da59d7eaffbc..d38c5b2dcb36be 100644 --- a/scripts/beachball/project.json +++ b/scripts/beachball/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-beachball", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/beachball", + "sourceRoot": "scripts/beachball/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/beachball/config.test.ts b/scripts/beachball/src/config.test.ts similarity index 100% rename from scripts/beachball/config.test.ts rename to scripts/beachball/src/config.test.ts diff --git a/scripts/beachball/customRenderers.ts b/scripts/beachball/src/customRenderers.ts similarity index 100% rename from scripts/beachball/customRenderers.ts rename to scripts/beachball/src/customRenderers.ts diff --git a/scripts/beachball/index.ts b/scripts/beachball/src/index.ts similarity index 100% rename from scripts/beachball/index.ts rename to scripts/beachball/src/index.ts diff --git a/scripts/beachball/register.js b/scripts/beachball/src/register.js similarity index 81% rename from scripts/beachball/register.js rename to scripts/beachball/src/register.js index a3c902866714a1..9c824b0374994a 100644 --- a/scripts/beachball/register.js +++ b/scripts/beachball/src/register.js @@ -6,6 +6,6 @@ exports.register = register; function register() { if (process.env.NODE_ENV !== 'test') { // @ts-expect-error - ts-node/register doesn't provide types so this would error - require('@fluentui/scripts-ts-node/register'); + require('@fluentui/scripts-ts-node/src/register'); } } diff --git a/scripts/beachball/release-v8.config.js b/scripts/beachball/src/release-v8.config.js similarity index 100% rename from scripts/beachball/release-v8.config.js rename to scripts/beachball/src/release-v8.config.js diff --git a/scripts/beachball/release-vNext.config.js b/scripts/beachball/src/release-vNext.config.js similarity index 100% rename from scripts/beachball/release-vNext.config.js rename to scripts/beachball/src/release-vNext.config.js diff --git a/scripts/beachball/release-web-components.config.js b/scripts/beachball/src/release-web-components.config.js similarity index 100% rename from scripts/beachball/release-web-components.config.js rename to scripts/beachball/src/release-web-components.config.js diff --git a/scripts/beachball/shared.config.ts b/scripts/beachball/src/shared.config.ts similarity index 86% rename from scripts/beachball/shared.config.ts rename to scripts/beachball/src/shared.config.ts index 5df8edb9c271d4..b28cc12ba5df36 100644 --- a/scripts/beachball/shared.config.ts +++ b/scripts/beachball/src/shared.config.ts @@ -6,8 +6,8 @@ import type { BeachballConfig } from 'beachball'; import { renderEntry, renderHeader } from './customRenderers'; -const baseConfig: typeof import('./base.config.json') = JSON.parse( - fs.readFileSync(path.resolve(__dirname, 'base.config.json'), { encoding: 'utf8' }), +const baseConfig: typeof import('../base.config.json') = JSON.parse( + fs.readFileSync(path.resolve(__dirname, '../base.config.json'), { encoding: 'utf8' }), ); export const config: typeof baseConfig & Required> = { diff --git a/scripts/beachball/utils.ts b/scripts/beachball/src/utils.ts similarity index 100% rename from scripts/beachball/utils.ts rename to scripts/beachball/src/utils.ts diff --git a/scripts/beachball/tsconfig.lib.json b/scripts/beachball/tsconfig.lib.json index b0d445627391c9..040fb0e3c58a11 100644 --- a/scripts/beachball/tsconfig.lib.json +++ b/scripts/beachball/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node", "jest"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/cypress/just.config.ts b/scripts/cypress/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/cypress/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/cypress/package.json b/scripts/cypress/package.json index 0586fda1189c57..68dffb5b04b1c3 100644 --- a/scripts/cypress/package.json +++ b/scripts/cypress/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/dangerjs/just.config.ts b/scripts/dangerjs/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/dangerjs/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/dangerjs/package.json b/scripts/dangerjs/package.json index 30d815601f9b3c..93c5d4c05b7e01 100644 --- a/scripts/dangerjs/package.json +++ b/scripts/dangerjs/package.json @@ -6,12 +6,13 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-utils": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/executors/just.config.ts b/scripts/executors/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/executors/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/executors/package.json b/scripts/executors/package.json index 28f29ec7cc3122..96edc32a3945ee 100644 --- a/scripts/executors/package.json +++ b/scripts/executors/package.json @@ -6,13 +6,14 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-utils": "*", "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-prettier": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/executors/project.json b/scripts/executors/project.json index 0c5ee26727f6a9..86d3fdb7f7a5b4 100644 --- a/scripts/executors/project.json +++ b/scripts/executors/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-executors", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/executors", + "sourceRoot": "scripts/executors/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/executors/check-for-modified-files.ts b/scripts/executors/src/check-for-modified-files.ts similarity index 100% rename from scripts/executors/check-for-modified-files.ts rename to scripts/executors/src/check-for-modified-files.ts diff --git a/scripts/executors/checkIfPackagesAffected.js b/scripts/executors/src/checkIfPackagesAffected.js similarity index 100% rename from scripts/executors/checkIfPackagesAffected.js rename to scripts/executors/src/checkIfPackagesAffected.js diff --git a/scripts/executors/debug-test.js b/scripts/executors/src/debug-test.js similarity index 100% rename from scripts/executors/debug-test.js rename to scripts/executors/src/debug-test.js diff --git a/scripts/executors/format.js b/scripts/executors/src/format.js similarity index 100% rename from scripts/executors/format.js rename to scripts/executors/src/format.js diff --git a/scripts/executors/invalidate-just-cache.js b/scripts/executors/src/invalidate-just-cache.js similarity index 100% rename from scripts/executors/invalidate-just-cache.js rename to scripts/executors/src/invalidate-just-cache.js diff --git a/scripts/executors/local-codepen.js b/scripts/executors/src/local-codepen.js similarity index 100% rename from scripts/executors/local-codepen.js rename to scripts/executors/src/local-codepen.js diff --git a/scripts/executors/runPublished.js b/scripts/executors/src/runPublished.js similarity index 100% rename from scripts/executors/runPublished.js rename to scripts/executors/src/runPublished.js diff --git a/scripts/executors/runPublished.spec.ts b/scripts/executors/src/runPublished.spec.ts similarity index 100% rename from scripts/executors/runPublished.spec.ts rename to scripts/executors/src/runPublished.spec.ts diff --git a/scripts/executors/scrub.js b/scripts/executors/src/scrub.js similarity index 100% rename from scripts/executors/scrub.js rename to scripts/executors/src/scrub.js diff --git a/scripts/executors/start.js b/scripts/executors/src/start.js similarity index 100% rename from scripts/executors/start.js rename to scripts/executors/src/start.js diff --git a/scripts/executors/tag-react-components.ts b/scripts/executors/src/tag-react-components.ts similarity index 100% rename from scripts/executors/tag-react-components.ts rename to scripts/executors/src/tag-react-components.ts diff --git a/scripts/executors/tsconfig.lib.json b/scripts/executors/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/executors/tsconfig.lib.json +++ b/scripts/executors/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/fluentui-publish/just.config.ts b/scripts/fluentui-publish/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/fluentui-publish/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/fluentui-publish/package.json b/scripts/fluentui-publish/package.json index 97ae2abb08ae4b..69d7985ff26141 100644 --- a/scripts/fluentui-publish/package.json +++ b/scripts/fluentui-publish/package.json @@ -8,11 +8,12 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src ./bin", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/generators/just.config.ts b/scripts/generators/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/generators/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/generators/package.json b/scripts/generators/package.json index d49423bff685b8..4ac5fe354ff18d 100644 --- a/scripts/generators/package.json +++ b/scripts/generators/package.json @@ -6,12 +6,13 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js --ignore-pattern plop-templates-* .", + "lint": "eslint --ext .ts,.js --ignore-pattern plop-templates-* ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-projects-test": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/generators/project.json b/scripts/generators/project.json index 75e6575cf52940..06057165859170 100644 --- a/scripts/generators/project.json +++ b/scripts/generators/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-generators", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/generators", + "sourceRoot": "scripts/generators/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/generators/copy-notices.js b/scripts/generators/src/copy-notices.js similarity index 100% rename from scripts/generators/copy-notices.js rename to scripts/generators/src/copy-notices.js diff --git a/scripts/generators/create-package/index.ts b/scripts/generators/src/create-package/index.ts similarity index 100% rename from scripts/generators/create-package/index.ts rename to scripts/generators/src/create-package/index.ts diff --git a/scripts/generators/create-package/plop-templates-node/.eslintrc.json b/scripts/generators/src/create-package/plop-templates-node/.eslintrc.json similarity index 100% rename from scripts/generators/create-package/plop-templates-node/.eslintrc.json rename to scripts/generators/src/create-package/plop-templates-node/.eslintrc.json diff --git a/scripts/generators/create-package/plop-templates-node/README.md b/scripts/generators/src/create-package/plop-templates-node/README.md similarity index 100% rename from scripts/generators/create-package/plop-templates-node/README.md rename to scripts/generators/src/create-package/plop-templates-node/README.md diff --git a/scripts/generators/create-package/plop-templates-node/jest.config.js b/scripts/generators/src/create-package/plop-templates-node/jest.config.js similarity index 100% rename from scripts/generators/create-package/plop-templates-node/jest.config.js rename to scripts/generators/src/create-package/plop-templates-node/jest.config.js diff --git a/scripts/generators/src/create-package/plop-templates-node/just.config.ts b/scripts/generators/src/create-package/plop-templates-node/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/generators/src/create-package/plop-templates-node/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/generators/create-package/plop-templates-node/package.json.hbs b/scripts/generators/src/create-package/plop-templates-node/package.json.hbs similarity index 100% rename from scripts/generators/create-package/plop-templates-node/package.json.hbs rename to scripts/generators/src/create-package/plop-templates-node/package.json.hbs diff --git a/scripts/generators/create-package/plop-templates-node/src/index.ts b/scripts/generators/src/create-package/plop-templates-node/src/index.ts similarity index 100% rename from scripts/generators/create-package/plop-templates-node/src/index.ts rename to scripts/generators/src/create-package/plop-templates-node/src/index.ts diff --git a/scripts/generators/create-package/plop-templates-node/tsconfig.json b/scripts/generators/src/create-package/plop-templates-node/tsconfig.json similarity index 100% rename from scripts/generators/create-package/plop-templates-node/tsconfig.json rename to scripts/generators/src/create-package/plop-templates-node/tsconfig.json diff --git a/scripts/generators/create-package/plop-templates/.npmignore b/scripts/generators/src/create-package/plop-templates/.npmignore similarity index 100% rename from scripts/generators/create-package/plop-templates/.npmignore rename to scripts/generators/src/create-package/plop-templates/.npmignore diff --git a/scripts/generators/create-package/plop-templates/LICENSE b/scripts/generators/src/create-package/plop-templates/LICENSE similarity index 100% rename from scripts/generators/create-package/plop-templates/LICENSE rename to scripts/generators/src/create-package/plop-templates/LICENSE diff --git a/scripts/generators/generate-package-manifest.js b/scripts/generators/src/generate-package-manifest.js similarity index 100% rename from scripts/generators/generate-package-manifest.js rename to scripts/generators/src/generate-package-manifest.js diff --git a/scripts/generators/generate-version-files.spec.ts b/scripts/generators/src/generate-version-files.spec.ts similarity index 100% rename from scripts/generators/generate-version-files.spec.ts rename to scripts/generators/src/generate-version-files.spec.ts diff --git a/scripts/generators/generate-version-files.ts b/scripts/generators/src/generate-version-files.ts similarity index 100% rename from scripts/generators/generate-version-files.ts rename to scripts/generators/src/generate-version-files.ts diff --git a/scripts/generators/rename-package.ts b/scripts/generators/src/rename-package.ts similarity index 100% rename from scripts/generators/rename-package.ts rename to scripts/generators/src/rename-package.ts diff --git a/scripts/generators/token-pipeline.ts b/scripts/generators/src/token-pipeline.ts similarity index 100% rename from scripts/generators/token-pipeline.ts rename to scripts/generators/src/token-pipeline.ts diff --git a/scripts/generators/tsconfig.lib.json b/scripts/generators/tsconfig.lib.json index 7d62e63759a565..bfb749f339c504 100644 --- a/scripts/generators/tsconfig.lib.json +++ b/scripts/generators/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/plop-templates/**", "**/plop-templates-node/**"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/github/just.config.ts b/scripts/github/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/github/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/github/package.json b/scripts/github/package.json index 299723d60f2198..a83368bb81cf3d 100644 --- a/scripts/github/package.json +++ b/scripts/github/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/gulp/just.config.ts b/scripts/gulp/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/gulp/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/gulp/package.json b/scripts/gulp/package.json index 036d7e9e1587d7..aade6af315a29f 100644 --- a/scripts/gulp/package.json +++ b/scripts/gulp/package.json @@ -6,16 +6,16 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-utils": "*", "@fluentui/scripts-prettier": "*", "@fluentui/scripts-puppeteer": "*", - "@fluentui/scripts-babel": "*", "@fluentui/scripts-projects-test": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/babel/plugins/index.ts b/scripts/gulp/src/babel-plugins/index.ts similarity index 100% rename from scripts/babel/plugins/index.ts rename to scripts/gulp/src/babel-plugins/index.ts diff --git a/scripts/babel/plugins/transform-star-import-plugin.ts b/scripts/gulp/src/babel-plugins/transform-star-import-plugin.ts similarity index 99% rename from scripts/babel/plugins/transform-star-import-plugin.ts rename to scripts/gulp/src/babel-plugins/transform-star-import-plugin.ts index 7be63202b299ff..cc07260008e08f 100644 --- a/scripts/babel/plugins/transform-star-import-plugin.ts +++ b/scripts/gulp/src/babel-plugins/transform-star-import-plugin.ts @@ -1,4 +1,5 @@ import * as T from '@babel/types'; + import type { BabelPlugin } from './types'; /** diff --git a/scripts/babel/plugins/types.ts b/scripts/gulp/src/babel-plugins/types.ts similarity index 100% rename from scripts/babel/plugins/types.ts rename to scripts/gulp/src/babel-plugins/types.ts index a08b89da8b3e7e..2b4196aabe1247 100644 --- a/scripts/babel/plugins/types.ts +++ b/scripts/gulp/src/babel-plugins/types.ts @@ -1,5 +1,5 @@ -import * as T from '@babel/types'; import { NodePath } from '@babel/traverse'; +import * as T from '@babel/types'; export type BabelPluginArguments = { types: typeof T; diff --git a/scripts/gulp/src/plugins/gulp-example-source.ts b/scripts/gulp/src/plugins/gulp-example-source.ts index 20f4c70d5c07f2..e7f5f08d92df85 100644 --- a/scripts/gulp/src/plugins/gulp-example-source.ts +++ b/scripts/gulp/src/plugins/gulp-example-source.ts @@ -1,11 +1,12 @@ import * as Babel from '@babel/core'; -import { transformStarImportPlugin } from '@fluentui/scripts-babel/plugins'; import { CLIEngine } from 'eslint'; import gutil from 'gulp-util'; import prettier from 'prettier'; import through from 'through2'; import Vinyl from 'vinyl'; +import { transformStarImportPlugin } from '../babel-plugins'; + import { getRelativePathToSourceFile } from './util'; import { ExampleSource } from './util/docs-types'; diff --git a/scripts/jest/just.config.ts b/scripts/jest/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/jest/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/jest/package.json b/scripts/jest/package.json index da1ecf67f30947..a504f0fe9ccdab 100644 --- a/scripts/jest/package.json +++ b/scripts/jest/package.json @@ -6,12 +6,13 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-utils": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/lint-staged/just.config.ts b/scripts/lint-staged/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/lint-staged/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/lint-staged/package.json b/scripts/lint-staged/package.json index 6201ad5a1d5583..6857f424079351 100644 --- a/scripts/lint-staged/package.json +++ b/scripts/lint-staged/package.json @@ -6,11 +6,12 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/lint-staged/project.json b/scripts/lint-staged/project.json index 75f25449c3c7f5..59c39db6114f9d 100644 --- a/scripts/lint-staged/project.json +++ b/scripts/lint-staged/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-lint-staged", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/lint-staged", + "sourceRoot": "scripts/lint-staged/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/lint-staged/eslint-for-package.js b/scripts/lint-staged/src/eslint-for-package.js similarity index 100% rename from scripts/lint-staged/eslint-for-package.js rename to scripts/lint-staged/src/eslint-for-package.js diff --git a/scripts/lint-staged/eslint.js b/scripts/lint-staged/src/eslint.js similarity index 100% rename from scripts/lint-staged/eslint.js rename to scripts/lint-staged/src/eslint.js diff --git a/scripts/lint-staged/tsconfig.lib.json b/scripts/lint-staged/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/lint-staged/tsconfig.lib.json +++ b/scripts/lint-staged/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/monorepo/just.config.ts b/scripts/monorepo/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/monorepo/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/monorepo/package.json b/scripts/monorepo/package.json index 14f6173dce95ed..6263f3d7119074 100644 --- a/scripts/monorepo/package.json +++ b/scripts/monorepo/package.json @@ -6,11 +6,12 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-utils": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/monorepo/src/eslint-constants.js b/scripts/monorepo/src/eslint-constants.js index 6e132278f87ee8..b5ec79c2ce74b5 100644 --- a/scripts/monorepo/src/eslint-constants.js +++ b/scripts/monorepo/src/eslint-constants.js @@ -1,4 +1,4 @@ -/** Constants used by the eslint task and scripts/lint-staged/eslint-for-package.js */ +/** Constants used by the eslint task and {@link file://./../../lint-staged/src/eslint-for-package.js } */ module.exports = { /** List of file extensions to lint, in format used by eslint (comma-separated, with leading .) */ extensions: '.ts,.tsx,.js,.jsx', diff --git a/scripts/package-manager/just.config.ts b/scripts/package-manager/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/package-manager/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/package-manager/package.json b/scripts/package-manager/package.json index 2e7928990bc885..ca4f315e7d9fe5 100644 --- a/scripts/package-manager/package.json +++ b/scripts/package-manager/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/package-manager/project.json b/scripts/package-manager/project.json index 1847216e1515ba..2c99ec85115b75 100644 --- a/scripts/package-manager/project.json +++ b/scripts/package-manager/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-package-manager", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/package-manager", + "sourceRoot": "scripts/package-manager/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/package-manager/postinstall.js b/scripts/package-manager/src/postinstall.js similarity index 100% rename from scripts/package-manager/postinstall.js rename to scripts/package-manager/src/postinstall.js diff --git a/scripts/package-manager/use-yarn-please.js b/scripts/package-manager/src/use-yarn-please.js similarity index 100% rename from scripts/package-manager/use-yarn-please.js rename to scripts/package-manager/src/use-yarn-please.js diff --git a/scripts/package-manager/tsconfig.lib.json b/scripts/package-manager/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/package-manager/tsconfig.lib.json +++ b/scripts/package-manager/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/perf-test-flamegrill/just.config.ts b/scripts/perf-test-flamegrill/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/perf-test-flamegrill/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/perf-test-flamegrill/package.json b/scripts/perf-test-flamegrill/package.json index 1edc441192a4f4..b2521b7752f0d3 100644 --- a/scripts/perf-test-flamegrill/package.json +++ b/scripts/perf-test-flamegrill/package.json @@ -6,9 +6,9 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "peerDependencies": { "@types/react": ">=16.8.0 <19.0.0", @@ -16,5 +16,6 @@ "react": ">=16.8.0 <19.0.0", "react-dom": ">=16.8.0 <19.0.0", "webpack": "^5.75.0" - } + }, + "devDependencies": {} } diff --git a/scripts/perf-test-flamegrill/tsconfig.lib.json b/scripts/perf-test-flamegrill/tsconfig.lib.json index 5354d98dbfac2c..f21721b5ee0d16 100644 --- a/scripts/perf-test-flamegrill/tsconfig.lib.json +++ b/scripts/perf-test-flamegrill/tsconfig.lib.json @@ -8,5 +8,5 @@ "types": ["webpack-env"] }, "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"], - "include": ["./**/*.ts", "./**/*.tsx", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.js"] } diff --git a/scripts/prettier/just.config.ts b/scripts/prettier/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/prettier/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/prettier/package.json b/scripts/prettier/package.json index 75e0bd645066d3..3981f1e130f40f 100644 --- a/scripts/prettier/package.json +++ b/scripts/prettier/package.json @@ -6,11 +6,12 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/projects-test/just.config.ts b/scripts/projects-test/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/projects-test/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/projects-test/package.json b/scripts/projects-test/package.json index a1a0f399dded6c..56ae23c50c3d7e 100644 --- a/scripts/projects-test/package.json +++ b/scripts/projects-test/package.json @@ -6,13 +6,14 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-utils": "*", "@fluentui/scripts-puppeteer": "*", "@fluentui/scripts-monorepo": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/puppeteer/just.config.ts b/scripts/puppeteer/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/puppeteer/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/puppeteer/package.json b/scripts/puppeteer/package.json index f291bcace4db2a..4df4c8c5c50ddd 100644 --- a/scripts/puppeteer/package.json +++ b/scripts/puppeteer/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/storybook/just.config.ts b/scripts/storybook/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/storybook/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/storybook/package.json b/scripts/storybook/package.json index 708b97b2b442dc..750977293baaf9 100644 --- a/scripts/storybook/package.json +++ b/scripts/storybook/package.json @@ -6,11 +6,12 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/tasks/just.config.ts b/scripts/tasks/just.config.ts new file mode 100644 index 00000000000000..a4bf107346901c --- /dev/null +++ b/scripts/tasks/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from './src/presets'; + +preset(); diff --git a/scripts/tasks/package.json b/scripts/tasks/package.json index a994fd70eb5501..a23299553f523c 100644 --- a/scripts/tasks/package.json +++ b/scripts/tasks/package.json @@ -6,14 +6,16 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-utils": "*", "@fluentui/scripts-prettier": "*", - "flamegrill": "0.2.0" - } + "flamegrill": "0.2.0", + "just-scripts": "1.8.2" + }, + "devDependencies": {} } diff --git a/scripts/test-ssr/just.config.ts b/scripts/test-ssr/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/test-ssr/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/test-ssr/package.json b/scripts/test-ssr/package.json index 060f8751eda3ae..15469b6a6c52f7 100644 --- a/scripts/test-ssr/package.json +++ b/scripts/test-ssr/package.json @@ -8,12 +8,13 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src ./bin", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-puppeteer": "*", "@fluentui/scripts-ts-node": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/triage-bot/just.config.ts b/scripts/triage-bot/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/triage-bot/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/triage-bot/package.json b/scripts/triage-bot/package.json index 1829964422bd1c..1dd5e52e094a34 100644 --- a/scripts/triage-bot/package.json +++ b/scripts/triage-bot/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/ts-node/just.config.ts b/scripts/ts-node/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/ts-node/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/ts-node/package.json b/scripts/ts-node/package.json index 6f7f9b18c49c6f..b70faff7654112 100644 --- a/scripts/ts-node/package.json +++ b/scripts/ts-node/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/ts-node/project.json b/scripts/ts-node/project.json index e8ad5a577aa309..0cd3de132ffeac 100644 --- a/scripts/ts-node/project.json +++ b/scripts/ts-node/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-ts-node", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/ts-node", + "sourceRoot": "scripts/ts-node/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/ts-node/src/index.js b/scripts/ts-node/src/index.js new file mode 100644 index 00000000000000..f053ebf7976e37 --- /dev/null +++ b/scripts/ts-node/src/index.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/scripts/ts-node/register.js b/scripts/ts-node/src/register.js similarity index 100% rename from scripts/ts-node/register.js rename to scripts/ts-node/src/register.js diff --git a/scripts/ts-node/tsconfig.lib.json b/scripts/ts-node/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/ts-node/tsconfig.lib.json +++ b/scripts/ts-node/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/update-release-notes/just.config.ts b/scripts/update-release-notes/just.config.ts new file mode 100644 index 00000000000000..926f3bd3c7e154 --- /dev/null +++ b/scripts/update-release-notes/just.config.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/update-release-notes/package.json b/scripts/update-release-notes/package.json index be0ecfd7814677..bd5881cdf198a1 100644 --- a/scripts/update-release-notes/package.json +++ b/scripts/update-release-notes/package.json @@ -6,12 +6,13 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-github": "*", "@fluentui/scripts-monorepo": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/update-release-notes/project.json b/scripts/update-release-notes/project.json index 8e8b4d82b2dc7b..c1075c7c6d2884 100644 --- a/scripts/update-release-notes/project.json +++ b/scripts/update-release-notes/project.json @@ -1,7 +1,7 @@ { "name": "@fluentui/scripts-update-release-notes", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "scripts/update-release-notes", + "sourceRoot": "scripts/update-release-notes/src", "projectType": "library", "tags": ["tools"] } diff --git a/scripts/update-release-notes/changelogsAndTags.ts b/scripts/update-release-notes/src/changelogsAndTags.ts similarity index 100% rename from scripts/update-release-notes/changelogsAndTags.ts rename to scripts/update-release-notes/src/changelogsAndTags.ts diff --git a/scripts/update-release-notes/index.ts b/scripts/update-release-notes/src/index.ts similarity index 100% rename from scripts/update-release-notes/index.ts rename to scripts/update-release-notes/src/index.ts diff --git a/scripts/update-release-notes/init.ts b/scripts/update-release-notes/src/init.ts similarity index 100% rename from scripts/update-release-notes/init.ts rename to scripts/update-release-notes/src/init.ts diff --git a/scripts/update-release-notes/markdown.ts b/scripts/update-release-notes/src/markdown.ts similarity index 100% rename from scripts/update-release-notes/markdown.ts rename to scripts/update-release-notes/src/markdown.ts diff --git a/scripts/update-release-notes/pullRequests.ts b/scripts/update-release-notes/src/pullRequests.ts similarity index 100% rename from scripts/update-release-notes/pullRequests.ts rename to scripts/update-release-notes/src/pullRequests.ts diff --git a/scripts/update-release-notes/releases.ts b/scripts/update-release-notes/src/releases.ts similarity index 100% rename from scripts/update-release-notes/releases.ts rename to scripts/update-release-notes/src/releases.ts diff --git a/scripts/update-release-notes/types.ts b/scripts/update-release-notes/src/types.ts similarity index 100% rename from scripts/update-release-notes/types.ts rename to scripts/update-release-notes/src/types.ts diff --git a/scripts/update-release-notes/tsconfig.lib.json b/scripts/update-release-notes/tsconfig.lib.json index bc31fef6f9184f..f513783ef5307a 100644 --- a/scripts/update-release-notes/tsconfig.lib.json +++ b/scripts/update-release-notes/tsconfig.lib.json @@ -7,5 +7,5 @@ "types": ["node"] }, "exclude": ["**/*.spec.ts", "**/*.test.ts"], - "include": ["./**/*.ts", "./**/*.js"] + "include": ["./src/**/*.ts", "./src/**/*.js"] } diff --git a/scripts/utils/just.config.ts b/scripts/utils/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/utils/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/utils/package.json b/scripts/utils/package.json index 462171a6d6b6b8..22f7489499c0c8 100644 --- a/scripts/utils/package.json +++ b/scripts/utils/package.json @@ -6,9 +6,10 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, - "dependencies": {} + "dependencies": {}, + "devDependencies": {} } diff --git a/scripts/webpack/just.config.ts b/scripts/webpack/just.config.ts new file mode 100644 index 00000000000000..b10db31a6aca51 --- /dev/null +++ b/scripts/webpack/just.config.ts @@ -0,0 +1,3 @@ +import { preset } from '@fluentui/scripts-tasks'; + +preset(); diff --git a/scripts/webpack/package.json b/scripts/webpack/package.json index a29c602cf9c1d3..f02e85a0e7a93a 100644 --- a/scripts/webpack/package.json +++ b/scripts/webpack/package.json @@ -6,12 +6,13 @@ "scripts": { "format": "prettier -w --ignore-path ../../.prettierignore .", "format:check": "yarn format -c", - "lint": "eslint --ext .ts,.js .", + "lint": "eslint --ext .ts,.js ./src", "test": "jest --passWithNoTests", - "type-check": "tsc -b tsconfig.json" + "type-check": "just-scripts type-check" }, "dependencies": { "@fluentui/scripts-monorepo": "*", "@fluentui/scripts-utils": "*" - } + }, + "devDependencies": {} } diff --git a/scripts/webpack/tsconfig.spec.json b/scripts/webpack/tsconfig.spec.json index 4d20fc98b71dd4..3a1444e6467a1f 100644 --- a/scripts/webpack/tsconfig.spec.json +++ b/scripts/webpack/tsconfig.spec.json @@ -5,5 +5,6 @@ "outDir": "dist", "types": ["jest", "node"] }, - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"], + "files": ["../../typings/ignore-not-found-export-webpack-plugin/index.d.ts"] } diff --git a/tools/workspace-plugin/package.json b/tools/workspace-plugin/package.json index 51cc71fe73fae4..99a87655055b9d 100644 --- a/tools/workspace-plugin/package.json +++ b/tools/workspace-plugin/package.json @@ -6,7 +6,11 @@ "generators": "./generators.json", "scripts": { "test": "nx run @fluentui/workspace-plugin:test", - "type-check": "nx run @fluentui/workspace-plugin:type-check", + "type-check": "node ./scripts/type-check.mjs", "lint": "eslint --ext .ts,.js,.json ." - } + }, + "dependencies": { + "@nx/devkit": "^17.3.2" + }, + "devDependencies": {} } diff --git a/tools/workspace-plugin/scripts/type-check.mjs b/tools/workspace-plugin/scripts/type-check.mjs new file mode 100644 index 00000000000000..f214c9fa1a81c6 --- /dev/null +++ b/tools/workspace-plugin/scripts/type-check.mjs @@ -0,0 +1,61 @@ +// @ts-check + +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import path from 'node:path'; +import { promisify } from 'node:util'; +import { exec } from 'node:child_process'; +import { exit } from 'node:process'; + +const asyncExec = promisify(exec); + +main().catch(err => { + console.error(err); + exit(1); +}); + +/** + * Copied from ${@link 'file://./../../../scripts/tasks/src/type-check.ts'} + */ +async function main() { + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); + const rootConfig = JSON.parse(fs.readFileSync(path.join(__dirname, '../tsconfig.json'), 'utf-8')); + + const tsConfigsRefs = getTsConfigs(rootConfig, { spec: false, e2e: false }); + + const asyncQueue = []; + + for (const ref of tsConfigsRefs) { + const program = `tsc -p ${ref} --pretty --noEmit --baseUrl .`; + asyncQueue.push(asyncExec(program)); + } + + return Promise.all(asyncQueue).catch(err => { + console.error(err.stdout); + exit(1); + }); +} + +/** + * @param {{references?: Array<{ path: string }>;}} solutionConfig + * @param {{ spec: boolean, e2e: boolean }} exclude + */ +function getTsConfigs(solutionConfig, exclude) { + const refs = solutionConfig.references ?? []; + /** @type {string[]} */ + const refsPaths = []; + + for (const ref of refs) { + if (exclude.spec && ref.path.includes('spec')) { + continue; + } + if (exclude.e2e && ref.path.includes('cy')) { + continue; + } + + refsPaths.push(ref.path); + } + + return refsPaths; +} diff --git a/tools/workspace-plugin/src/generators/migrate-v8-pkg/index.spec.ts b/tools/workspace-plugin/src/generators/migrate-v8-pkg/index.spec.ts index 30905f3a4fe49f..45600a9aa3af53 100644 --- a/tools/workspace-plugin/src/generators/migrate-v8-pkg/index.spec.ts +++ b/tools/workspace-plugin/src/generators/migrate-v8-pkg/index.spec.ts @@ -175,7 +175,7 @@ function setupDummyPackage( 'build-storybook': 'cross-env NODE_OPTIONS=--max-old-space-size=3072 just-scripts storybook:build', clean: 'just-scripts clean', 'code-style': 'just-scripts code-style', - codepen: 'node ../../scripts/executors/local-codepen.js', + codepen: 'node ../../scripts/executors/src/local-codepen.js', e2e: 'yarn workspace @fluentui/react-examples e2e --package react', just: 'just-scripts', lint: 'just-scripts lint', diff --git a/yarn.lock b/yarn.lock index b127c1f3db60f3..40328bf4374eef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2824,7 +2824,7 @@ dependencies: "@nx/workspace" "17.3.2" -"@nx/devkit@17.3.2": +"@nx/devkit@17.3.2", "@nx/devkit@^17.3.2": version "17.3.2" resolved "https://registry.yarnpkg.com/@nx/devkit/-/devkit-17.3.2.tgz#c10b3e5f9bc642881c24aa2e3878ca4290994a80" integrity sha512-gbOIhwrZKCSSFFbh6nE6LLCvAU7mhSdBSnRiS14YBwJJMu4CRJ0IcaFz58iXqGWZefMivKtkNFtx+zqwUC4ziw==