Skip to content

Commit d8c728a

Browse files
authored
Merge pull request microsoft#3944 from iclanton/internal-node-rig
Use an internal node build rig for internal, non-cyclic projects and fix caching across the repo.
2 parents 6e382e1 + 4babaa2 commit d8c728a

File tree

365 files changed

+2310
-1407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

365 files changed

+2310
-1407
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ These GitHub repositories provide supplementary resources for Rush Stack:
180180
| [/repo-scripts/generate-api-docs](./repo-scripts/generate-api-docs/) | Used to generate API docs for the rushstack.io website |
181181
| [/repo-scripts/repo-toolbox](./repo-scripts/repo-toolbox/) | Used to execute various operations specific to this repo |
182182
| [/rush-plugins/rush-litewatch-plugin](./rush-plugins/rush-litewatch-plugin/) | An experimental alternative approach for multi-project watch mode |
183+
| [/rushstack-internal-rigs/heft-rushstack-internal-node-rig](./rushstack-internal-rigs/heft-rushstack-internal-node-rig/) | A rig package for Node.js projects that build using Heft inside the RushStack repository. |
183184
| [/vscode-extensions/rush-vscode-command-webview](./vscode-extensions/rush-vscode-command-webview/) | Part of the Rush Stack VSCode extension, provides a UI for invoking Rush commands |
184185
| [/vscode-extensions/rush-vscode-extension](./vscode-extensions/rush-vscode-extension/) | Enhanced experience for monorepos that use the Rush Stack toolchain |
185186
| [/webpack/webpack-deep-imports-plugin](./webpack/webpack-deep-imports-plugin/) | This plugin creates a bundle and commonJS files in a 'lib' folder mirroring modules in another 'lib' folder. |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "heft-rushstack-internal-node-rig/profiles/default/config/jest.config.json"
33
}

apps/api-documenter/config/rig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
44
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
55

6-
"rigPackageName": "@rushstack/heft-node-rig"
6+
"rigPackageName": "heft-rushstack-internal-node-rig"
77
}

apps/api-documenter/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
"devDependencies": {
3232
"@rushstack/eslint-config": "workspace:*",
3333
"@rushstack/heft": "workspace:*",
34-
"@rushstack/heft-node-rig": "workspace:*",
34+
"heft-rushstack-internal-node-rig": "workspace:*",
3535
"@types/js-yaml": "3.12.1",
36-
"@types/node": "18.17.15",
3736
"@types/resolve": "1.20.2"
3837
}
3938
}

apps/api-documenter/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
3-
"compilerOptions": {
4-
"resolveJsonModule": true
5-
}
2+
"extends": "./node_modules/heft-rushstack-internal-node-rig/profiles/default/tsconfig-base.json"
63
}
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3+
4+
// Enable code coverage for Jest
5+
"collectCoverage": true,
6+
"coverageDirectory": "<rootDir>/coverage",
7+
"coverageReporters": ["cobertura", "html"],
8+
9+
// Use v8 coverage provider to avoid Babel
10+
"coverageProvider": "v8"
311
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@rushstack/heft-node-rig/profiles/default/config/rush-project.json",
3+
4+
"operationSettings": [
5+
{
6+
"operationName": "_phase:build",
7+
"outputFolderNames": [".heft", "release"]
8+
},
9+
{
10+
"operationName": "_phase:test",
11+
"outputFolderNames": ["coverage"]
12+
}
13+
]
14+
}

apps/heft/config/jest.config.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3+
4+
// Enable code coverage for Jest
5+
"collectCoverage": true,
6+
"coverageDirectory": "<rootDir>/coverage",
7+
"coverageReporters": ["cobertura", "html"],
8+
9+
// Use v8 coverage provider to avoid Babel
10+
"coverageProvider": "v8"
311
}

apps/heft/config/rush-project.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@rushstack/heft-node-rig/profiles/default/config/rush-project.json",
3+
4+
"operationSettings": [
5+
{
6+
"operationName": "_phase:build",
7+
"outputFolderNames": [".heft", "release"]
8+
},
9+
{
10+
"operationName": "_phase:test",
11+
"outputFolderNames": ["coverage"]
12+
}
13+
]
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"extends": "@rushstack/heft-web-rig/profiles/app/config/jest.config.json",
33

4+
// Enable code coverage for Jest
5+
"collectCoverage": true,
6+
"coverageDirectory": "<rootDir>/coverage",
7+
"coverageReporters": ["cobertura", "html"],
8+
9+
// Use v8 coverage provider to avoid Babel
10+
"coverageProvider": "v8",
11+
412
// Load the initappcontext.js stub when running tests
513
"setupFiles": ["../lib-commonjs/stub/initappcontext.js"]
614
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@rushstack/heft-web-rig/profiles/app/config/rush-project.json",
3+
4+
"operationSettings": [
5+
{
6+
"operationName": "_phase:build",
7+
"outputFolderNames": [".heft", "release"]
8+
},
9+
{
10+
"operationName": "_phase:test",
11+
"outputFolderNames": ["coverage"]
12+
}
13+
]
14+
}

apps/lockfile-explorer/config/heft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Optionally specifies another JSON config file that this file extends from. This provides a way for standard
99
* settings to be shared across multiple projects.
1010
*/
11-
"extends": "@rushstack/heft-node-rig/profiles/default/config/heft.json",
11+
"extends": "heft-rushstack-internal-node-rig/profiles/default/config/heft.json",
1212

1313
"phasesByName": {
1414
"build": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "heft-rushstack-internal-node-rig/profiles/default/config/jest.config.json"
33
}

apps/lockfile-explorer/config/rig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* (Required) The name of the rig package to inherit from.
88
* It should be an NPM package name with the "-rig" suffix.
99
*/
10-
"rigPackageName": "@rushstack/heft-node-rig"
10+
"rigPackageName": "heft-rushstack-internal-node-rig"
1111

1212
/**
1313
* (Optional) Selects a config profile from the rig package. The name must consist of

apps/lockfile-explorer/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@
3939
"devDependencies": {
4040
"@microsoft/rush-lib": "workspace:*",
4141
"@rushstack/eslint-config": "workspace:*",
42-
"@rushstack/heft-node-rig": "workspace:*",
42+
"heft-rushstack-internal-node-rig": "workspace:*",
4343
"@rushstack/heft": "workspace:*",
4444
"@rushstack/lockfile-explorer-web": "workspace:*",
4545
"@types/cors": "~2.8.12",
4646
"@types/express": "4.17.13",
47-
"@types/heft-jest": "1.0.1",
4847
"@types/js-yaml": "3.12.1",
49-
"@types/node": "18.17.15",
5048
"@types/update-notifier": "~6.0.1"
5149
},
5250
"dependencies": {

apps/lockfile-explorer/src/start.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ import open from 'open';
1010
import updateNotifier from 'update-notifier';
1111
import { FileSystem, type IPackageJson, JsonFile, PackageJsonLookup } from '@rushstack/node-core-library';
1212
import type { IAppContext } from '@rushstack/lockfile-explorer-web/lib/AppContext';
13-
import packageJSON from '../package.json';
1413
import { init } from './init';
1514
import type { IAppState } from './state';
1615
import { AlreadyReportedError } from '@rushstack/node-core-library';
1716

1817
function startApp(debugMode: boolean): void {
1918
const lockfileExplorerProjectRoot: string = PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname)!;
20-
const appVersion: string = JsonFile.load(`${lockfileExplorerProjectRoot}/package.json`).version;
19+
const packageJson: IPackageJson = JsonFile.load(`${lockfileExplorerProjectRoot}/package.json`);
20+
const appVersion: string = packageJson.version;
2121

2222
console.log(
2323
colors.bold(`\nRush Lockfile Explorer ${appVersion}`) + colors.cyan(' - https://lfx.rushstack.io/\n')
2424
);
2525

2626
updateNotifier({
27-
pkg: packageJSON,
27+
pkg: packageJson,
2828
// Normally update-notifier waits a day or so before it starts displaying upgrade notices.
2929
// In debug mode, show the notice right away.
3030
updateCheckInterval: debugMode ? 0 : undefined

apps/lockfile-explorer/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
3-
"compilerOptions": {
4-
"types": ["heft-jest", "node"]
5-
}
2+
"extends": "./node_modules/heft-rushstack-internal-node-rig/profiles/default/tsconfig-base.json"
63
}

apps/rundown/config/rig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
44
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
55

6-
"rigPackageName": "@rushstack/heft-node-rig"
6+
"rigPackageName": "heft-rushstack-internal-node-rig"
77
}

apps/rundown/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
"devDependencies": {
2929
"@rushstack/eslint-config": "workspace:*",
3030
"@rushstack/heft": "workspace:*",
31-
"@rushstack/heft-node-rig": "workspace:*",
32-
"@types/heft-jest": "1.0.1",
33-
"@types/node": "18.17.15"
31+
"heft-rushstack-internal-node-rig": "workspace:*"
3432
}
3533
}

apps/rundown/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
3-
"compilerOptions": {
4-
"types": ["heft-jest", "node"]
5-
}
2+
"extends": "./node_modules/heft-rushstack-internal-node-rig/profiles/default/tsconfig-base.json"
63
}

apps/rush/config/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "heft-rushstack-internal-node-rig/profiles/default/config/jest.config.json"
33
}

apps/rush/config/rig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
44
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
55

6-
"rigPackageName": "@rushstack/heft-node-rig"
6+
"rigPackageName": "heft-rushstack-internal-node-rig"
77
}

apps/rush/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@
4444
"devDependencies": {
4545
"@rushstack/eslint-config": "workspace:*",
4646
"@rushstack/heft": "workspace:*",
47-
"@rushstack/heft-node-rig": "workspace:*",
47+
"heft-rushstack-internal-node-rig": "workspace:*",
4848
"@rushstack/rush-amazon-s3-build-cache-plugin": "workspace:*",
4949
"@rushstack/rush-azure-storage-build-cache-plugin": "workspace:*",
5050
"@rushstack/rush-http-build-cache-plugin": "workspace:*",
5151
"@types/heft-jest": "1.0.1",
52-
"@types/node": "18.17.15",
5352
"@types/semver": "7.5.0"
5453
}
5554
}

apps/rush/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
3-
"compilerOptions": {
4-
"types": ["heft-jest", "node"]
5-
}
2+
"extends": "./node_modules/heft-rushstack-internal-node-rig/profiles/default/tsconfig-base.json"
63
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "heft-rushstack-internal-node-rig/profiles/default/config/jest.config.json"
33
}

apps/trace-import/config/rig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
44
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
55

6-
"rigPackageName": "@rushstack/heft-node-rig"
6+
"rigPackageName": "heft-rushstack-internal-node-rig"
77
}

apps/trace-import/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
"devDependencies": {
2929
"@rushstack/eslint-config": "workspace:*",
3030
"@rushstack/heft": "workspace:*",
31-
"@rushstack/heft-node-rig": "workspace:*",
32-
"@types/heft-jest": "1.0.1",
33-
"@types/node": "18.17.15",
31+
"heft-rushstack-internal-node-rig": "workspace:*",
3432
"@types/resolve": "1.20.2",
3533
"@types/semver": "7.5.0"
3634
}

apps/trace-import/tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
3-
4-
"compilerOptions": {
5-
"types": ["heft-jest", "node"]
6-
}
2+
"extends": "./node_modules/heft-rushstack-internal-node-rig/profiles/default/tsconfig-base.json"
73
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
{
2-
"extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json"
2+
"extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json",
3+
4+
// These additional properties exist for caching purposes in the rushstack repo
5+
6+
// Enable code coverage for Jest
7+
"collectCoverage": true,
8+
"coverageDirectory": "<rootDir>/coverage",
9+
"coverageReporters": ["cobertura", "html"],
10+
11+
// Use v8 coverage provider to avoid Babel
12+
"coverageProvider": "v8"
313
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
// This file exists for caching purposes in the rushstack repo
12
{
23
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json",
34

45
"operationSettings": [
56
{
6-
"operationName": "build",
7-
"outputFolderNames": ["lib", "dist"]
7+
"operationName": "_phase:build",
8+
"outputFolderNames": [".heft", "lib", "dist"]
9+
},
10+
{
11+
"operationName": "_phase:test",
12+
"outputFolderNames": ["coverage"]
813
}
914
]
1015
}
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
{
22
"extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json",
3-
"collectCoverage": true,
3+
44
"coverageThreshold": {
55
"global": {
66
"branches": 50,
77
"functions": 50,
88
"lines": 50,
99
"statements": 50
1010
}
11-
}
11+
},
12+
13+
// These additional properties exist for caching purposes in the rushstack repo
14+
15+
// Enable code coverage for Jest
16+
"collectCoverage": true,
17+
"coverageDirectory": "<rootDir>/coverage",
18+
"coverageReporters": ["cobertura", "html"],
19+
20+
// Use v8 coverage provider to avoid Babel
21+
"coverageProvider": "v8"
1222
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
// This file exists for caching purposes in the rushstack repo
12
{
23
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json",
34

45
"operationSettings": [
56
{
6-
"operationName": "build",
7-
"outputFolderNames": ["lib", "dist"]
7+
"operationName": "_phase:build",
8+
"outputFolderNames": [".heft", "lib", "dist"]
9+
},
10+
{
11+
"operationName": "_phase:test",
12+
"outputFolderNames": ["coverage"]
813
}
914
]
1015
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
{
2-
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
2+
"extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3+
4+
// These additional properties exist for caching purposes in the rushstack repo
5+
6+
// Enable code coverage for Jest
7+
"collectCoverage": true,
8+
"coverageDirectory": "<rootDir>/coverage",
9+
"coverageReporters": ["cobertura", "html"],
10+
11+
// Use v8 coverage provider to avoid Babel
12+
"coverageProvider": "v8"
313
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file exists for caching purposes in the rushstack repo
2+
{
3+
"extends": "@rushstack/heft-node-rig/profiles/default/config/rush-project.json",
4+
5+
"operationSettings": [
6+
{
7+
"operationName": "_phase:build",
8+
"outputFolderNames": [".heft", "release"]
9+
},
10+
{
11+
"operationName": "_phase:test",
12+
"outputFolderNames": ["coverage"]
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)