diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8761fb0e6ab..c13a7f38b30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,17 +51,9 @@ jobs: - name: Rush retest (install-run-rush) run: node common/scripts/install-run-rush.js retest --verbose --production - env: - # Prevent time-based browserslist update warning - # See https://github.com/microsoft/rushstack/issues/2981 - BROWSERSLIST_IGNORE_OLD_DATA: 1 - name: Ensure repo README is up-to-date run: node repo-scripts/repo-toolbox/lib/start.js readme --verify - name: Rush test (rush-lib) run: node apps/rush/lib/start-dev.js test --verbose --production --timeline - env: - # Prevent time-based browserslist update warning - # See https://github.com/microsoft/rushstack/issues/2981 - BROWSERSLIST_IGNORE_OLD_DATA: 1 diff --git a/apps/api-documenter/CHANGELOG.json b/apps/api-documenter/CHANGELOG.json index 8af81cc4b4b..37fb79c0ca4 100644 --- a/apps/api-documenter/CHANGELOG.json +++ b/apps/api-documenter/CHANGELOG.json @@ -1,6 +1,128 @@ { "name": "@microsoft/api-documenter", "entries": [ + { + "version": "7.23.27", + "tag": "@microsoft/api-documenter_v7.23.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.12`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "7.23.26", + "tag": "@microsoft/api-documenter_v7.23.26", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "7.23.25", + "tag": "@microsoft/api-documenter_v7.23.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.11`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "7.23.24", + "tag": "@microsoft/api-documenter_v7.23.24", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.10`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.17.2`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "7.23.23", + "tag": "@microsoft/api-documenter_v7.23.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.9`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "7.23.22", + "tag": "@microsoft/api-documenter_v7.23.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "7.23.21", + "tag": "@microsoft/api-documenter_v7.23.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "7.23.20", "tag": "@microsoft/api-documenter_v7.23.20", diff --git a/apps/api-documenter/CHANGELOG.md b/apps/api-documenter/CHANGELOG.md index fab78211360..5b15dc773f5 100644 --- a/apps/api-documenter/CHANGELOG.md +++ b/apps/api-documenter/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @microsoft/api-documenter -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 7.23.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 7.23.26 +Tue, 20 Feb 2024 16:10:52 GMT + +_Version update only_ + +## 7.23.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 7.23.24 +Sat, 17 Feb 2024 06:24:34 GMT + +### Patches + +- Fix broken link to API documentation + +## 7.23.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 7.23.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 7.23.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 7.23.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/apps/api-documenter/README.md b/apps/api-documenter/README.md index a3109a3cb00..ad3ecfd0e25 100644 --- a/apps/api-documenter/README.md +++ b/apps/api-documenter/README.md @@ -14,6 +14,6 @@ documentation. - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/apps/api-documenter/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/api-documenter/) +- [API Reference](https://api.rushstack.io/pages/api-documenter/) API Documenter is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/apps/api-documenter/package.json b/apps/api-documenter/package.json index a312ddfc04d..b7022150a3f 100644 --- a/apps/api-documenter/package.json +++ b/apps/api-documenter/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/api-documenter", - "version": "7.23.20", + "version": "7.23.27", "description": "Read JSON files from api-extractor, generate documentation pages", "repository": { "type": "git", diff --git a/apps/api-extractor/CHANGELOG.json b/apps/api-extractor/CHANGELOG.json index d883182b370..f72fba6d740 100644 --- a/apps/api-extractor/CHANGELOG.json +++ b/apps/api-extractor/CHANGELOG.json @@ -1,6 +1,104 @@ { "name": "@microsoft/api-extractor", "entries": [ + { + "version": "7.40.4", + "tag": "@microsoft/api-extractor_v7.40.4", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.12`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + } + ] + } + }, + { + "version": "7.40.3", + "tag": "@microsoft/api-extractor_v7.40.3", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.11`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + } + ] + } + }, + { + "version": "7.40.2", + "tag": "@microsoft/api-extractor_v7.40.2", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.10`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/rig-package\" to `0.5.2`" + }, + { + "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.17.2`" + } + ] + } + }, + { + "version": "7.40.1", + "tag": "@microsoft/api-extractor_v7.40.1", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.9`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + } + ] + } + }, + { + "version": "7.40.0", + "tag": "@microsoft/api-extractor_v7.40.0", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "minor": [ + { + "comment": "Classify arrow functions as `function` kind in the doc model export." + } + ] + } + }, + { + "version": "7.39.5", + "tag": "@microsoft/api-extractor_v7.39.5", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.28.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + } + ] + } + }, { "version": "7.39.4", "tag": "@microsoft/api-extractor_v7.39.4", diff --git a/apps/api-extractor/CHANGELOG.md b/apps/api-extractor/CHANGELOG.md index a58340ecdb6..0e7faddddd7 100644 --- a/apps/api-extractor/CHANGELOG.md +++ b/apps/api-extractor/CHANGELOG.md @@ -1,6 +1,40 @@ # Change Log - @microsoft/api-extractor -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 7.40.4 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 7.40.3 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 7.40.2 +Sat, 17 Feb 2024 06:24:34 GMT + +### Patches + +- Fix broken link to API documentation + +## 7.40.1 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 7.40.0 +Wed, 07 Feb 2024 01:11:18 GMT + +### Minor changes + +- Classify arrow functions as `function` kind in the doc model export. + +## 7.39.5 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 7.39.4 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/apps/api-extractor/README.md b/apps/api-extractor/README.md index 1f3ebfa7c14..69c1846fc1d 100644 --- a/apps/api-extractor/README.md +++ b/apps/api-extractor/README.md @@ -46,6 +46,6 @@ For more details and support resources, please visit: https://api-extractor.com/ - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/apps/api-extractor/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/api-extractor/) +- [API Reference](https://api.rushstack.io/pages/api-extractor/) API Extractor is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/apps/api-extractor/package.json b/apps/api-extractor/package.json index 813251a422d..ecc1a1edd01 100644 --- a/apps/api-extractor/package.json +++ b/apps/api-extractor/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/api-extractor", - "version": "7.39.4", + "version": "7.40.4", "description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups", "keywords": [ "typescript", diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index 06eb2828fbe..9dec797310b 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -250,7 +250,14 @@ export class ApiModelGenerator { break; case ts.SyntaxKind.VariableDeclaration: - this._processApiVariable(astDeclaration, context); + // check for arrow functions in variable declaration + const functionDeclaration: ts.FunctionDeclaration | undefined = + this._tryFindFunctionDeclaration(astDeclaration); + if (functionDeclaration) { + this._processApiFunction(astDeclaration, context, functionDeclaration); + } else { + this._processApiVariable(astDeclaration, context); + } break; default: @@ -258,6 +265,13 @@ export class ApiModelGenerator { } } + private _tryFindFunctionDeclaration(astDeclaration: AstDeclaration): ts.FunctionDeclaration | undefined { + const children: ts.Node[] = astDeclaration.declaration.getChildren( + astDeclaration.declaration.getSourceFile() + ); + return children.find(ts.isFunctionTypeNode) as ts.FunctionDeclaration | undefined; + } + private _processChildDeclarations(astDeclaration: AstDeclaration, context: IProcessAstEntityContext): void { for (const childDeclaration of astDeclaration.children) { this._processDeclaration(childDeclaration, { @@ -544,7 +558,11 @@ export class ApiModelGenerator { } } - private _processApiFunction(astDeclaration: AstDeclaration, context: IProcessAstEntityContext): void { + private _processApiFunction( + astDeclaration: AstDeclaration, + context: IProcessAstEntityContext, + altFunctionDeclaration?: ts.FunctionDeclaration + ): void { const { name, isExported, parentApiItem } = context; const overloadIndex: number = this._collector.getOverloadIndex(astDeclaration); @@ -554,7 +572,7 @@ export class ApiModelGenerator { if (apiFunction === undefined) { const functionDeclaration: ts.FunctionDeclaration = - astDeclaration.declaration as ts.FunctionDeclaration; + altFunctionDeclaration ?? (astDeclaration.declaration as ts.FunctionDeclaration); const nodesToCapture: IExcerptBuilderNodeToCapture[] = []; diff --git a/apps/heft/CHANGELOG.json b/apps/heft/CHANGELOG.json index 478096f035e..cecb3146c51 100644 --- a/apps/heft/CHANGELOG.json +++ b/apps/heft/CHANGELOG.json @@ -1,6 +1,160 @@ { "name": "@rushstack/heft", "entries": [ + { + "version": "0.65.1", + "tag": "@rushstack/heft_v0.65.1", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "patch": [ + { + "comment": "Fix a recent regression causing `Error: Cannot find module 'colors/safe'` (GitHub #4525)" + }, + { + "comment": "Remove a no longer needed dependency on the `chokidar` package" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.12`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/operation-graph\" to `0.2.11`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.4`" + } + ] + } + }, + { + "version": "0.65.0", + "tag": "@rushstack/heft_v0.65.0", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "minor": [ + { + "comment": "Add a built-in `set-environment-variables-plugin` task plugin to set environment variables." + } + ] + } + }, + { + "version": "0.64.8", + "tag": "@rushstack/heft_v0.64.8", + "date": "Mon, 19 Feb 2024 21:54:26 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.11`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/operation-graph\" to `0.2.10`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.3`" + } + ] + } + }, + { + "version": "0.64.7", + "tag": "@rushstack/heft_v0.64.7", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.10`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/operation-graph\" to `0.2.9`" + }, + { + "comment": "Updating dependency \"@rushstack/rig-package\" to `0.5.2`" + }, + { + "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.17.2`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.2`" + } + ] + } + }, + { + "version": "0.64.6", + "tag": "@rushstack/heft_v0.64.6", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.9`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/operation-graph\" to `0.2.8`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.1`" + } + ] + } + }, + { + "version": "0.64.5", + "tag": "@rushstack/heft_v0.64.5", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.0`" + } + ] + } + }, + { + "version": "0.64.4", + "tag": "@rushstack/heft_v0.64.4", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/operation-graph\" to `0.2.7`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.39.5`" + } + ] + } + }, { "version": "0.64.3", "tag": "@rushstack/heft_v0.64.3", diff --git a/apps/heft/CHANGELOG.md b/apps/heft/CHANGELOG.md index 585c79edd43..99dc07d39c1 100644 --- a/apps/heft/CHANGELOG.md +++ b/apps/heft/CHANGELOG.md @@ -1,6 +1,48 @@ # Change Log - @rushstack/heft -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.65.1 +Tue, 20 Feb 2024 21:45:10 GMT + +### Patches + +- Fix a recent regression causing `Error: Cannot find module 'colors/safe'` (GitHub #4525) +- Remove a no longer needed dependency on the `chokidar` package + +## 0.65.0 +Tue, 20 Feb 2024 16:10:52 GMT + +### Minor changes + +- Add a built-in `set-environment-variables-plugin` task plugin to set environment variables. + +## 0.64.8 +Mon, 19 Feb 2024 21:54:26 GMT + +_Version update only_ + +## 0.64.7 +Sat, 17 Feb 2024 06:24:34 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.64.6 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.64.5 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.64.4 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.64.3 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/apps/heft/README.md b/apps/heft/README.md index 515c2a82e48..fd224141575 100644 --- a/apps/heft/README.md +++ b/apps/heft/README.md @@ -85,6 +85,6 @@ the Rush Stack website. - [UPGRADING.md]( https://github.com/microsoft/rushstack/blob/main/apps/heft/UPGRADING.md) - Instructions for migrating existing projects to use a newer version of Heft -- [API Reference](https://rushstack.io/pages/api/heft/) +- [API Reference](https://api.rushstack.io/pages/heft/) Heft is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/apps/heft/heft-plugin.json b/apps/heft/heft-plugin.json index 3c27920d8bd..d7c161a404f 100644 --- a/apps/heft/heft-plugin.json +++ b/apps/heft/heft-plugin.json @@ -30,6 +30,11 @@ "pluginName": "run-script-plugin", "entryPoint": "./lib/plugins/RunScriptPlugin", "optionsSchema": "./lib/schemas/run-script-options.schema.json" + }, + { + "entryPoint": "./lib/plugins/SetEnvironmentVariablesPlugin", + "pluginName": "set-environment-variables-plugin", + "optionsSchema": "./lib/schemas/set-environment-variables-plugin.schema.json" } ] } diff --git a/apps/heft/package.json b/apps/heft/package.json index e2598d5ad28..e1b1c055143 100644 --- a/apps/heft/package.json +++ b/apps/heft/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft", - "version": "0.64.3", + "version": "0.65.1", "description": "Build all your JavaScript projects the same way: A way that works.", "keywords": [ "toolchain", @@ -38,9 +38,9 @@ "@rushstack/node-core-library": "workspace:*", "@rushstack/operation-graph": "workspace:*", "@rushstack/rig-package": "workspace:*", + "@rushstack/terminal": "workspace:*", "@rushstack/ts-command-line": "workspace:*", "@types/tapable": "1.0.6", - "chokidar": "~3.4.0", "fast-glob": "~3.3.1", "git-repo-info": "~2.1.0", "ignore": "~5.1.6", diff --git a/apps/heft/src/cli/HeftActionRunner.ts b/apps/heft/src/cli/HeftActionRunner.ts index f32b1fe84ed..b6bb1757caa 100644 --- a/apps/heft/src/cli/HeftActionRunner.ts +++ b/apps/heft/src/cli/HeftActionRunner.ts @@ -5,14 +5,8 @@ import { performance } from 'perf_hooks'; import { createInterface, type Interface as ReadlineInterface } from 'readline'; import os from 'os'; -import { - AlreadyReportedError, - Colors, - ConsoleTerminalProvider, - InternalError, - type ITerminal, - type IPackageJson -} from '@rushstack/node-core-library'; +import { AlreadyReportedError, InternalError, type IPackageJson } from '@rushstack/node-core-library'; +import { Colorize, ConsoleTerminalProvider, type ITerminal } from '@rushstack/terminal'; import { type IOperationExecutionOptions, type IWatchLoopState, @@ -93,7 +87,7 @@ export function ensureCliAbortSignal(terminal: ITerminal): AbortSignal { process.exit(1); } else { terminal.writeLine( - Colors.yellow(Colors.bold(`Canceling... Press Ctrl+C again to forcibly terminate.`)) + Colorize.yellow(Colorize.bold(`Canceling... Press Ctrl+C again to forcibly terminate.`)) ); } @@ -150,8 +144,8 @@ export async function runWithLoggingAsync( const durationSeconds: number = Math.round(duration) / 1000; const finishedLoggingLine: string = `-------------------- ${finishedLoggingWord} (${durationSeconds}s) --------------------`; terminal.writeLine( - Colors.bold( - (encounteredError ? Colors.red : encounteredWarnings ? Colors.yellow : Colors.green)( + Colorize.bold( + (encounteredError ? Colorize.red : encounteredWarnings ? Colorize.yellow : Colorize.green)( finishedLoggingLine ) ) @@ -313,7 +307,7 @@ export class HeftActionRunner { await watchLoop.runIPCAsync(); } else { await watchLoop.runUntilAbortedAsync(cliAbortSignal, () => { - terminal.writeLine(Colors.bold('Waiting for changes. Press CTRL + C to exit...')); + terminal.writeLine(Colorize.bold('Waiting for changes. Press CTRL + C to exit...')); terminal.writeLine(''); }); } @@ -336,16 +330,16 @@ export class HeftActionRunner { // Write an empty line to the terminal for separation between iterations. We've already iterated // at this point, so log out that we're about to start a new run. terminal.writeLine(''); - terminal.writeLine(Colors.bold('Starting incremental build...')); + terminal.writeLine(Colorize.bold('Starting incremental build...')); }, executeAsync: (state: IWatchLoopState): Promise => { return this._executeOnceAsync(executionManager, state.abortSignal, state.requestRun); }, onRequestRun: (requestor?: string) => { - terminal.writeLine(Colors.bold(`New run requested by ${requestor || 'unknown task'}`)); + terminal.writeLine(Colorize.bold(`New run requested by ${requestor || 'unknown task'}`)); }, onAbort: () => { - terminal.writeLine(Colors.bold(`Cancelling incremental build...`)); + terminal.writeLine(Colorize.bold(`Cancelling incremental build...`)); } }); return watchLoop; @@ -392,7 +386,7 @@ export class HeftActionRunner { // Only write once, and write with yellow to make it stand out without writing a warning to stderr hasWarnedAboutSkippedPhases = true; this._terminal.writeLine( - Colors.bold( + Colorize.bold( 'The provided list of phases does not contain all phase dependencies. You may need to run the ' + 'excluded phases manually.' ) diff --git a/apps/heft/src/cli/HeftCommandLineParser.ts b/apps/heft/src/cli/HeftCommandLineParser.ts index fa34482423b..38eb3495ad4 100644 --- a/apps/heft/src/cli/HeftCommandLineParser.ts +++ b/apps/heft/src/cli/HeftCommandLineParser.ts @@ -7,13 +7,8 @@ import { type CommandLineFlagParameter, type CommandLineAction } from '@rushstack/ts-command-line'; -import { - Terminal, - InternalError, - ConsoleTerminalProvider, - AlreadyReportedError, - type ITerminal -} from '@rushstack/node-core-library'; +import { InternalError, AlreadyReportedError } from '@rushstack/node-core-library'; +import { Terminal, ConsoleTerminalProvider, type ITerminal } from '@rushstack/terminal'; import { MetricsCollector } from '../metrics/MetricsCollector'; import { HeftConfiguration } from '../configuration/HeftConfiguration'; diff --git a/apps/heft/src/cli/actions/AliasAction.ts b/apps/heft/src/cli/actions/AliasAction.ts index adb3a7c100c..7371bc94fc6 100644 --- a/apps/heft/src/cli/actions/AliasAction.ts +++ b/apps/heft/src/cli/actions/AliasAction.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { AliasCommandLineAction, type IAliasCommandLineActionOptions, diff --git a/apps/heft/src/cli/actions/CleanAction.ts b/apps/heft/src/cli/actions/CleanAction.ts index db0a7db7a7b..33c6fa9be16 100644 --- a/apps/heft/src/cli/actions/CleanAction.ts +++ b/apps/heft/src/cli/actions/CleanAction.ts @@ -6,7 +6,7 @@ import { type CommandLineFlagParameter, type CommandLineStringListParameter } from '@rushstack/ts-command-line'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { OperationStatus } from '@rushstack/operation-graph'; import type { IHeftAction, IHeftActionOptions } from './IHeftAction'; diff --git a/apps/heft/src/cli/actions/IHeftAction.ts b/apps/heft/src/cli/actions/IHeftAction.ts index 5925bfb503e..ad4a91468da 100644 --- a/apps/heft/src/cli/actions/IHeftAction.ts +++ b/apps/heft/src/cli/actions/IHeftAction.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { CommandLineAction } from '@rushstack/ts-command-line'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { HeftConfiguration } from '../../configuration/HeftConfiguration'; import type { MetricsCollector } from '../../metrics/MetricsCollector'; diff --git a/apps/heft/src/cli/actions/RunAction.ts b/apps/heft/src/cli/actions/RunAction.ts index abdba41e2a2..b21a1542cbe 100644 --- a/apps/heft/src/cli/actions/RunAction.ts +++ b/apps/heft/src/cli/actions/RunAction.ts @@ -6,7 +6,8 @@ import { type CommandLineParameterProvider, type CommandLineStringListParameter } from '@rushstack/ts-command-line'; -import { AlreadyReportedError, type ITerminal } from '@rushstack/node-core-library'; +import { AlreadyReportedError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { Selection } from '../../utilities/Selection'; import { HeftActionRunner } from '../HeftActionRunner'; diff --git a/apps/heft/src/configuration/HeftConfiguration.ts b/apps/heft/src/configuration/HeftConfiguration.ts index cec42d85483..4e19d5d435b 100644 --- a/apps/heft/src/configuration/HeftConfiguration.ts +++ b/apps/heft/src/configuration/HeftConfiguration.ts @@ -2,14 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { - Terminal, - type ITerminalProvider, - type IPackageJson, - PackageJsonLookup, - InternalError, - type ITerminal -} from '@rushstack/node-core-library'; +import { type IPackageJson, PackageJsonLookup, InternalError } from '@rushstack/node-core-library'; +import { Terminal, type ITerminalProvider, type ITerminal } from '@rushstack/terminal'; import { trueCasePathSync } from 'true-case-path'; import { type IRigConfig, RigConfig } from '@rushstack/rig-package'; diff --git a/apps/heft/src/configuration/RigPackageResolver.ts b/apps/heft/src/configuration/RigPackageResolver.ts index 73dc2017020..bd40e3937e2 100644 --- a/apps/heft/src/configuration/RigPackageResolver.ts +++ b/apps/heft/src/configuration/RigPackageResolver.ts @@ -5,10 +5,10 @@ import * as path from 'path'; import { PackageJsonLookup, Import, - type ITerminal, type INodePackageJson, type IPackageJson } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IRigConfig } from '@rushstack/rig-package'; /** diff --git a/apps/heft/src/pluginFramework/HeftPluginHost.ts b/apps/heft/src/pluginFramework/HeftPluginHost.ts index e82425d2f73..a6dc607feb1 100644 --- a/apps/heft/src/pluginFramework/HeftPluginHost.ts +++ b/apps/heft/src/pluginFramework/HeftPluginHost.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import { SyncHook } from 'tapable'; -import { InternalError, type ITerminal } from '@rushstack/node-core-library'; +import { InternalError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { HeftPluginDefinitionBase } from '../configuration/HeftPluginDefinition'; import type { IHeftPlugin } from './IHeftPlugin'; diff --git a/apps/heft/src/pluginFramework/logging/LoggingManager.ts b/apps/heft/src/pluginFramework/logging/LoggingManager.ts index a4b34aabca0..c3601902870 100644 --- a/apps/heft/src/pluginFramework/logging/LoggingManager.ts +++ b/apps/heft/src/pluginFramework/logging/LoggingManager.ts @@ -5,10 +5,9 @@ import { ScopedLogger } from './ScopedLogger'; import { FileError, type FileLocationStyle, - type ITerminalProvider, type IFileErrorFormattingOptions } from '@rushstack/node-core-library'; - +import type { ITerminalProvider } from '@rushstack/terminal'; export interface ILoggingManagerOptions { terminalProvider: ITerminalProvider; } diff --git a/apps/heft/src/pluginFramework/logging/MockScopedLogger.ts b/apps/heft/src/pluginFramework/logging/MockScopedLogger.ts index 03173b01b40..1ffe5ec6c3d 100644 --- a/apps/heft/src/pluginFramework/logging/MockScopedLogger.ts +++ b/apps/heft/src/pluginFramework/logging/MockScopedLogger.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IScopedLogger } from './ScopedLogger'; diff --git a/apps/heft/src/pluginFramework/logging/ScopedLogger.ts b/apps/heft/src/pluginFramework/logging/ScopedLogger.ts index b93f5b87367..357289ecc5d 100644 --- a/apps/heft/src/pluginFramework/logging/ScopedLogger.ts +++ b/apps/heft/src/pluginFramework/logging/ScopedLogger.ts @@ -6,7 +6,7 @@ import { Terminal, type ITerminalProvider, type ITerminal -} from '@rushstack/node-core-library'; +} from '@rushstack/terminal'; import { LoggingManager } from './LoggingManager'; diff --git a/apps/heft/src/plugins/CopyFilesPlugin.ts b/apps/heft/src/plugins/CopyFilesPlugin.ts index 08a9621dc0e..e887452531b 100644 --- a/apps/heft/src/plugins/CopyFilesPlugin.ts +++ b/apps/heft/src/plugins/CopyFilesPlugin.ts @@ -3,7 +3,8 @@ import type * as fs from 'fs'; import * as path from 'path'; -import { AlreadyExistsBehavior, FileSystem, Async, type ITerminal } from '@rushstack/node-core-library'; +import { AlreadyExistsBehavior, FileSystem, Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { Constants } from '../utilities/Constants'; import { diff --git a/apps/heft/src/plugins/DeleteFilesPlugin.ts b/apps/heft/src/plugins/DeleteFilesPlugin.ts index 93bad98d3ba..36bb7f19ff3 100644 --- a/apps/heft/src/plugins/DeleteFilesPlugin.ts +++ b/apps/heft/src/plugins/DeleteFilesPlugin.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import type * as fs from 'fs'; -import { FileSystem, Async, type ITerminal } from '@rushstack/node-core-library'; +import { FileSystem, Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { Constants } from '../utilities/Constants'; import { diff --git a/apps/heft/src/plugins/SetEnvironmentVariablesPlugin.ts b/apps/heft/src/plugins/SetEnvironmentVariablesPlugin.ts new file mode 100644 index 00000000000..fb83903b83b --- /dev/null +++ b/apps/heft/src/plugins/SetEnvironmentVariablesPlugin.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import type { HeftConfiguration } from '../configuration/HeftConfiguration'; +import type { IHeftTaskSession } from '../pluginFramework/HeftTaskSession'; +import type { IHeftTaskPlugin } from '../pluginFramework/IHeftPlugin'; + +export const PLUGIN_NAME: string = 'set-environment-variables-plugin'; + +export interface ISetEnvironmentVariablesPluginOptions { + environmentVariablesToSet: Record; +} + +export default class SetEnvironmentVariablesPlugin + implements IHeftTaskPlugin +{ + public apply( + taskSession: IHeftTaskSession, + heftConfiguration: HeftConfiguration, + { environmentVariablesToSet }: ISetEnvironmentVariablesPluginOptions + ): void { + taskSession.hooks.run.tap( + { + name: PLUGIN_NAME, + stage: Number.MIN_SAFE_INTEGER + }, + () => { + for (const [key, value] of Object.entries(environmentVariablesToSet)) { + taskSession.logger.terminal.writeLine(`Setting environment variable ${key}=${value}`); + process.env[key] = value; + } + } + ); + } +} diff --git a/apps/heft/src/schemas/set-environment-variables-plugin.schema.json b/apps/heft/src/schemas/set-environment-variables-plugin.schema.json new file mode 100644 index 00000000000..d16b9a3a824 --- /dev/null +++ b/apps/heft/src/schemas/set-environment-variables-plugin.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "CopyFiles Heft Task Event Options", + "description": "Defines configuration used by the \"copyFiles\" Heft task event.", + "type": "object", + + "additionalProperties": false, + "required": ["environmentVariablesToSet"], + + "properties": { + "environmentVariablesToSet": { + "type": "object", + "pattern": ".+", + "additionalProperties": { + "type": "string" + } + } + } +} diff --git a/apps/heft/src/startWithVersionSelector.ts b/apps/heft/src/startWithVersionSelector.ts index 3385251b258..d78da294bbe 100644 --- a/apps/heft/src/startWithVersionSelector.ts +++ b/apps/heft/src/startWithVersionSelector.ts @@ -11,8 +11,6 @@ import type { IPackageJson } from '@rushstack/node-core-library'; import { getToolParameterNamesFromArgs } from './utilities/CliUtilities'; import { Constants } from './utilities/Constants'; -const HEFT_PACKAGE_NAME: string = '@rushstack/heft'; - // Excerpted from PackageJsonLookup.tryGetPackageFolderFor() function tryGetPackageFolderFor(resolvedFileOrFolderPath: string): string | undefined { // Two lookups are required, because get() cannot distinguish the undefined value @@ -82,8 +80,8 @@ function tryStartLocalHeft(): boolean { // Does package.json have a dependency on Heft? if ( - !(packageJson.dependencies && packageJson.dependencies[HEFT_PACKAGE_NAME]) && - !(packageJson.devDependencies && packageJson.devDependencies[HEFT_PACKAGE_NAME]) + !(packageJson.dependencies && packageJson.dependencies[Constants.heftPackageName]) && + !(packageJson.devDependencies && packageJson.devDependencies[Constants.heftPackageName]) ) { // No explicit dependency on Heft return false; @@ -91,7 +89,7 @@ function tryStartLocalHeft(): boolean { // To avoid a loading the "resolve" NPM package, let's assume that the Heft dependency must be // installed as "/node_modules/@rushstack/heft". - const heftFolder: string = path.join(projectFolder, 'node_modules', HEFT_PACKAGE_NAME); + const heftFolder: string = path.join(projectFolder, 'node_modules', Constants.heftPackageName); heftEntryPoint = path.join(heftFolder, 'lib', 'start.js'); if (!fs.existsSync(heftEntryPoint)) { diff --git a/apps/heft/src/utilities/Constants.ts b/apps/heft/src/utilities/Constants.ts index b7b794ae91a..60e929519e6 100644 --- a/apps/heft/src/utilities/Constants.ts +++ b/apps/heft/src/utilities/Constants.ts @@ -33,4 +33,6 @@ export class Constants { public static verboseParameterShortName: string = '-v'; public static maxParallelism: number = 100; + + public static heftPackageName: string = '@rushstack/heft'; } diff --git a/apps/heft/src/utilities/CoreConfigFiles.ts b/apps/heft/src/utilities/CoreConfigFiles.ts index b745a95fc2e..a593353bfce 100644 --- a/apps/heft/src/utilities/CoreConfigFiles.ts +++ b/apps/heft/src/utilities/CoreConfigFiles.ts @@ -8,7 +8,8 @@ import { PathResolutionMethod, type IJsonPathMetadataResolverOptions } from '@rushstack/heft-config-file'; -import { Import, PackageJsonLookup, type ITerminal, InternalError } from '@rushstack/node-core-library'; +import { Import, PackageJsonLookup, InternalError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IRigConfig } from '@rushstack/rig-package'; import type { IDeleteOperation } from '../plugins/DeleteFilesPlugin'; @@ -76,23 +77,28 @@ export class CoreConfigFiles { rigConfig?: IRigConfig | undefined ): Promise { if (!CoreConfigFiles._heftConfigFileLoader) { + let heftPluginPackageFolder: string | undefined; + const pluginPackageResolver: ( options: IJsonPathMetadataResolverOptions ) => string = (options: IJsonPathMetadataResolverOptions) => { const { propertyValue, configurationFilePath } = options; - if (propertyValue === '@rushstack/heft') { + if (propertyValue === Constants.heftPackageName) { // If the value is "@rushstack/heft", then resolve to the Heft package that is // installed in the project folder. This avoids issues with mismatched versions // between the project and the globally installed Heft. Use the PackageJsonLookup // class to find the package folder to avoid hardcoding the path for compatibility // with bundling. - const pluginPackageFolder: string | undefined = - PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname); - if (!pluginPackageFolder) { + if (!heftPluginPackageFolder) { + heftPluginPackageFolder = PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname); + } + + if (!heftPluginPackageFolder) { // This should never happen throw new InternalError('Unable to find the @rushstack/heft package folder'); } - return pluginPackageFolder; + + return heftPluginPackageFolder; } else { const configurationFileDirectory: string = path.dirname(configurationFilePath); return Import.resolvePackage({ diff --git a/apps/lockfile-explorer-web/package.json b/apps/lockfile-explorer-web/package.json index 57f16732269..58198d94123 100644 --- a/apps/lockfile-explorer-web/package.json +++ b/apps/lockfile-explorer-web/package.json @@ -12,7 +12,6 @@ "_phase:test": "heft run --only test -- --clean" }, "dependencies": { - "@fluentui/react": "^8.96.1", "react": "~17.0.2", "react-dom": "~17.0.2", "@lifaon/path": "~2.1.0", diff --git a/apps/lockfile-explorer/CHANGELOG.json b/apps/lockfile-explorer/CHANGELOG.json index 2bb97f2c4ee..a82e05aca83 100644 --- a/apps/lockfile-explorer/CHANGELOG.json +++ b/apps/lockfile-explorer/CHANGELOG.json @@ -1,6 +1,105 @@ { "name": "@rushstack/lockfile-explorer", "entries": [ + { + "version": "1.2.27", + "tag": "@rushstack/lockfile-explorer_v1.2.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "1.2.26", + "tag": "@rushstack/lockfile-explorer_v1.2.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "1.2.25", + "tag": "@rushstack/lockfile-explorer_v1.2.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "1.2.24", + "tag": "@rushstack/lockfile-explorer_v1.2.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "1.2.23", + "tag": "@rushstack/lockfile-explorer_v1.2.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "1.2.22", + "tag": "@rushstack/lockfile-explorer_v1.2.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "1.2.21", + "tag": "@rushstack/lockfile-explorer_v1.2.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "1.2.20", "tag": "@rushstack/lockfile-explorer_v1.2.20", diff --git a/apps/lockfile-explorer/CHANGELOG.md b/apps/lockfile-explorer/CHANGELOG.md index 89b1f9ec876..4a7983eed81 100644 --- a/apps/lockfile-explorer/CHANGELOG.md +++ b/apps/lockfile-explorer/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/lockfile-explorer -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 1.2.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 1.2.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 1.2.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 1.2.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 1.2.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 1.2.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 1.2.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 1.2.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/apps/lockfile-explorer/package.json b/apps/lockfile-explorer/package.json index 4dfe89457b3..752f0b4ee79 100644 --- a/apps/lockfile-explorer/package.json +++ b/apps/lockfile-explorer/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/lockfile-explorer", - "version": "1.2.20", + "version": "1.2.27", "description": "Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo", "keywords": [ "conflict", diff --git a/apps/rundown/CHANGELOG.json b/apps/rundown/CHANGELOG.json index f975a65ed3c..315cb28e258 100644 --- a/apps/rundown/CHANGELOG.json +++ b/apps/rundown/CHANGELOG.json @@ -1,6 +1,108 @@ { "name": "@rushstack/rundown", "entries": [ + { + "version": "1.1.27", + "tag": "@rushstack/rundown_v1.1.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "1.1.26", + "tag": "@rushstack/rundown_v1.1.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "1.1.25", + "tag": "@rushstack/rundown_v1.1.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "1.1.24", + "tag": "@rushstack/rundown_v1.1.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.17.2`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "1.1.23", + "tag": "@rushstack/rundown_v1.1.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "1.1.22", + "tag": "@rushstack/rundown_v1.1.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "1.1.21", + "tag": "@rushstack/rundown_v1.1.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "1.1.20", "tag": "@rushstack/rundown_v1.1.20", diff --git a/apps/rundown/CHANGELOG.md b/apps/rundown/CHANGELOG.md index 18c8c181863..4b8979803e8 100644 --- a/apps/rundown/CHANGELOG.md +++ b/apps/rundown/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/rundown -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 1.1.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 1.1.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 1.1.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 1.1.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 1.1.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 1.1.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 1.1.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 1.1.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/apps/rundown/package.json b/apps/rundown/package.json index 7576d0c0a29..fb041ddf321 100644 --- a/apps/rundown/package.json +++ b/apps/rundown/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rundown", - "version": "1.1.20", + "version": "1.1.27", "description": "Detect load time regressions by running an app, tracing require() calls, and generating a deterministic report", "repository": { "type": "git", diff --git a/apps/rush/CHANGELOG.json b/apps/rush/CHANGELOG.json index 2c66bef0f78..1b3e6afdd12 100644 --- a/apps/rush/CHANGELOG.json +++ b/apps/rush/CHANGELOG.json @@ -1,6 +1,78 @@ { "name": "@microsoft/rush", "entries": [ + { + "version": "5.114.0", + "tag": "@microsoft/rush_v5.114.0", + "date": "Mon, 19 Feb 2024 21:54:44 GMT", + "comments": { + "none": [ + { + "comment": "(EXPERIMENTAL) Add `enablePnpmSyncForInjectedDependenciesMeta` to experiments.json; it is part of an upcoming feature for managing PNPM \"injected\" dependencies: https://www.npmjs.com/package/pnpm-sync" + }, + { + "comment": "Include a `pnpmPatchesCommonFolderName` constant for the folder name \"pnpm-patches\" that gets placed under \"common\"." + }, + { + "comment": "Add a feature to generate a `project-impact-graph.yaml` file in the repo root. This feature is gated under the new `generateProjectImpactGraphDuringRushUpdate` experiment." + }, + { + "comment": "Fix a formatting issue with the LICENSE." + }, + { + "comment": "Fix an issue with filtered installs when the experimental subspaces feature is enabled" + } + ] + } + }, + { + "version": "5.113.4", + "tag": "@microsoft/rush_v5.113.4", + "date": "Wed, 31 Jan 2024 22:49:17 GMT", + "comments": { + "none": [ + { + "comment": "Introduce an explicit warning message during `rush install` or `rush update` about `dependenciesMeta` not being up-to-date." + } + ] + } + }, + { + "version": "5.113.3", + "tag": "@microsoft/rush_v5.113.3", + "date": "Wed, 31 Jan 2024 22:25:55 GMT", + "comments": { + "none": [ + { + "comment": "Fix an issue where `rush update` would sometimes not correctly sync the `pnpm-lock.yaml` file back to `common/config/rush/` after a project's `package.json` has been updated." + } + ] + } + }, + { + "version": "5.113.2", + "tag": "@microsoft/rush_v5.113.2", + "date": "Wed, 31 Jan 2024 18:45:33 GMT", + "comments": { + "none": [ + { + "comment": "Fix some minor issues when the experimental subspaces feature is enabled" + } + ] + } + }, + { + "version": "5.113.1", + "tag": "@microsoft/rush_v5.113.1", + "date": "Wed, 31 Jan 2024 07:07:50 GMT", + "comments": { + "none": [ + { + "comment": "(EXPERIMENTAL) Enable filtered installs of subspaces and add a \"preventSelectingAllSubspaces\" setting" + } + ] + } + }, { "version": "5.113.0", "tag": "@microsoft/rush_v5.113.0", diff --git a/apps/rush/CHANGELOG.md b/apps/rush/CHANGELOG.md index 1b2ffe56bda..7456d79be82 100644 --- a/apps/rush/CHANGELOG.md +++ b/apps/rush/CHANGELOG.md @@ -1,6 +1,45 @@ # Change Log - @microsoft/rush -This log was last generated on Tue, 30 Jan 2024 22:58:52 GMT and should not be manually modified. +This log was last generated on Mon, 19 Feb 2024 21:54:44 GMT and should not be manually modified. + +## 5.114.0 +Mon, 19 Feb 2024 21:54:44 GMT + +### Updates + +- (EXPERIMENTAL) Add `enablePnpmSyncForInjectedDependenciesMeta` to experiments.json; it is part of an upcoming feature for managing PNPM "injected" dependencies: https://www.npmjs.com/package/pnpm-sync +- Include a `pnpmPatchesCommonFolderName` constant for the folder name "pnpm-patches" that gets placed under "common". +- Add a feature to generate a `project-impact-graph.yaml` file in the repo root. This feature is gated under the new `generateProjectImpactGraphDuringRushUpdate` experiment. +- Fix a formatting issue with the LICENSE. +- Fix an issue with filtered installs when the experimental subspaces feature is enabled + +## 5.113.4 +Wed, 31 Jan 2024 22:49:17 GMT + +### Updates + +- Introduce an explicit warning message during `rush install` or `rush update` about `dependenciesMeta` not being up-to-date. + +## 5.113.3 +Wed, 31 Jan 2024 22:25:55 GMT + +### Updates + +- Fix an issue where `rush update` would sometimes not correctly sync the `pnpm-lock.yaml` file back to `common/config/rush/` after a project's `package.json` has been updated. + +## 5.113.2 +Wed, 31 Jan 2024 18:45:33 GMT + +### Updates + +- Fix some minor issues when the experimental subspaces feature is enabled + +## 5.113.1 +Wed, 31 Jan 2024 07:07:50 GMT + +### Updates + +- (EXPERIMENTAL) Enable filtered installs of subspaces and add a "preventSelectingAllSubspaces" setting ## 5.113.0 Tue, 30 Jan 2024 22:58:52 GMT diff --git a/apps/rush/package.json b/apps/rush/package.json index 8cea78b7c1a..68d43c42ec3 100644 --- a/apps/rush/package.json +++ b/apps/rush/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/rush", - "version": "5.113.0", + "version": "5.114.0", "description": "A professional solution for consolidating all your JavaScript projects in one Git repo", "keywords": [ "install", @@ -39,7 +39,8 @@ "@microsoft/rush-lib": "workspace:*", "@rushstack/node-core-library": "workspace:*", "colors": "~1.2.1", - "semver": "~7.5.4" + "semver": "~7.5.4", + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "@rushstack/heft": "workspace:*", diff --git a/apps/rush/src/start-dev-docs.ts b/apps/rush/src/start-dev-docs.ts index 9a6e162ef26..be5089d5130 100644 --- a/apps/rush/src/start-dev-docs.ts +++ b/apps/rush/src/start-dev-docs.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Colors, ConsoleTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { Colorize, ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; const terminal: Terminal = new Terminal(new ConsoleTerminalProvider()); terminal.writeLine('For instructions on debugging Rush, please see this documentation:'); -terminal.writeLine(Colors.bold('https://rushjs.io/pages/contributing/debugging/')); +terminal.writeLine(Colorize.bold('https://rushjs.io/pages/contributing/debugging/')); diff --git a/apps/rush/src/start.ts b/apps/rush/src/start.ts index 5f84d56070f..fb56a08d9af 100644 --- a/apps/rush/src/start.ts +++ b/apps/rush/src/start.ts @@ -22,12 +22,8 @@ import colors from 'colors/safe'; import * as os from 'os'; import * as semver from 'semver'; -import { - ConsoleTerminalProvider, - Text, - PackageJsonLookup, - type ITerminalProvider -} from '@rushstack/node-core-library'; +import { Text, PackageJsonLookup } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, type ITerminalProvider } from '@rushstack/terminal'; import { EnvironmentVariableNames } from '@microsoft/rush-lib'; import * as rushLib from '@microsoft/rush-lib'; diff --git a/apps/trace-import/CHANGELOG.json b/apps/trace-import/CHANGELOG.json index d6b66396729..0d53e7e8a04 100644 --- a/apps/trace-import/CHANGELOG.json +++ b/apps/trace-import/CHANGELOG.json @@ -1,6 +1,108 @@ { "name": "@rushstack/trace-import", "entries": [ + { + "version": "0.3.27", + "tag": "@rushstack/trace-import_v0.3.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.3.26", + "tag": "@rushstack/trace-import_v0.3.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.3.25", + "tag": "@rushstack/trace-import_v0.3.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.3.24", + "tag": "@rushstack/trace-import_v0.3.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/ts-command-line\" to `4.17.2`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.3.23", + "tag": "@rushstack/trace-import_v0.3.23", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.3.22", + "tag": "@rushstack/trace-import_v0.3.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.3.21", + "tag": "@rushstack/trace-import_v0.3.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.3.20", "tag": "@rushstack/trace-import_v0.3.20", diff --git a/apps/trace-import/CHANGELOG.md b/apps/trace-import/CHANGELOG.md index 068f6734777..7bbb3210211 100644 --- a/apps/trace-import/CHANGELOG.md +++ b/apps/trace-import/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/trace-import -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.3.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.3.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.3.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.3.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.3.23 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.3.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.3.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.3.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/apps/trace-import/package.json b/apps/trace-import/package.json index dc935f66ed8..dd6913b1b30 100644 --- a/apps/trace-import/package.json +++ b/apps/trace-import/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/trace-import", - "version": "0.3.20", + "version": "0.3.27", "description": "CLI tool for understanding how require() and \"import\" statements get resolved", "repository": { "type": "git", diff --git a/build-tests-samples/heft-storybook-react-tutorial-app/config/rush-project.json b/build-tests-samples/heft-storybook-react-tutorial-app/config/rush-project.json new file mode 100644 index 00000000000..b0ee347694e --- /dev/null +++ b/build-tests-samples/heft-storybook-react-tutorial-app/config/rush-project.json @@ -0,0 +1,11 @@ +// This file exists for caching purposes in the rushstack repo +{ + "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json", + + "operationSettings": [ + { + "operationName": "_phase:build", + "outputFolderNames": ["dist"] + } + ] +} diff --git a/build-tests-samples/heft-storybook-react-tutorial-app/package.json b/build-tests-samples/heft-storybook-react-tutorial-app/package.json index ac0b725d710..4de772bbf20 100644 --- a/build-tests-samples/heft-storybook-react-tutorial-app/package.json +++ b/build-tests-samples/heft-storybook-react-tutorial-app/package.json @@ -5,7 +5,7 @@ "private": true, "scripts": { "build": "heft build --clean --storybook", - "_phase:build": "heft run --only build -- --clean", + "_phase:build": "heft run --only build -- --clean --storybook", "_phase:test": "" }, "dependencies": { diff --git a/build-tests/api-extractor-d-cts-test/config/rush-project.json b/build-tests/api-extractor-d-cts-test/config/rush-project.json index 2af7036b0ef..514e557d5eb 100644 --- a/build-tests/api-extractor-d-cts-test/config/rush-project.json +++ b/build-tests/api-extractor-d-cts-test/config/rush-project.json @@ -3,7 +3,7 @@ "operationSettings": [ { - "operationName": "build", + "operationName": "_phase:build", "outputFolderNames": ["lib", "dist"] } ] diff --git a/build-tests/api-extractor-d-mts-test/config/rush-project.json b/build-tests/api-extractor-d-mts-test/config/rush-project.json index 2af7036b0ef..514e557d5eb 100644 --- a/build-tests/api-extractor-d-mts-test/config/rush-project.json +++ b/build-tests/api-extractor-d-mts-test/config/rush-project.json @@ -3,7 +3,7 @@ "operationSettings": [ { - "operationName": "build", + "operationName": "_phase:build", "outputFolderNames": ["lib", "dist"] } ] diff --git a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json index d5b2da9ff7c..b09660a4142 100644 --- a/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json @@ -173,27 +173,28 @@ "preserveMemberOrder": false, "members": [ { - "kind": "Variable", - "canonicalReference": "api-extractor-scenarios!defaultFunctionStatement:var", + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!defaultFunctionStatement:function(1)", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", - "text": "defaultFunctionStatement: " + "text": "defaultFunctionStatement: () => " }, { "kind": "Content", - "text": "() => void" + "text": "void" } ], "fileUrlPath": "src/defaultExportOfEntryPoint2/index.ts", - "isReadonly": true, - "releaseTag": "Public", - "name": "defaultFunctionStatement", - "variableTypeTokenRange": { + "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 - } + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "defaultFunctionStatement" } ] } diff --git a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json index 5315cb39238..6b0f70e844d 100644 --- a/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/spanSorting/api-extractor-scenarios.api.json @@ -375,27 +375,45 @@ "implementsTokenRanges": [] }, { - "kind": "Variable", - "canonicalReference": "api-extractor-scenarios!exampleD:var", + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!exampleD:function(1)", "docComment": "/**\n * Outer description\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", - "text": "exampleD: " + "text": "exampleD: (o: " }, { "kind": "Content", - "text": "(o: {\n a: number;\n b(): string;\n}) => void" + "text": "{\n a: number;\n b(): string;\n}" + }, + { + "kind": "Content", + "text": ") => " + }, + { + "kind": "Content", + "text": "void" } ], "fileUrlPath": "src/spanSorting/index.ts", - "isReadonly": true, + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, "releaseTag": "Public", - "name": "exampleD", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "o", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "exampleD" } ] } diff --git a/build-tests/heft-sass-test/config/heft.json b/build-tests/heft-sass-test/config/heft.json index 309c903d475..a47a18a0505 100644 --- a/build-tests/heft-sass-test/config/heft.json +++ b/build-tests/heft-sass-test/config/heft.json @@ -10,7 +10,23 @@ "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-commonjs", "temp"] }], "tasksByName": { + "set-browserslist-ignore-old-data-env-var": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "set-environment-variables-plugin", + "options": { + "environmentVariablesToSet": { + // Suppress the "Browserslist: caniuse-lite is outdated" warning. Although the warning is + // potentially useful, the check is performed in a way that is nondeterministic and can cause + // Rush pipelines to fail. Moreover, the outdated version is often irrelevant and/or nontrivial + // to upgrade. See this thread for details: https://github.com/microsoft/rushstack/issues/2981 + "BROWSERSLIST_IGNORE_OLD_DATA": "1" + } + } + } + }, "sass": { + "taskDependencies": ["set-browserslist-ignore-old-data-env-var"], "taskPlugin": { "pluginPackage": "@rushstack/heft-sass-plugin" } diff --git a/build-tests/install-test-workspace/build.js b/build-tests/install-test-workspace/build.js index 43bfa168771..62674aae519 100644 --- a/build-tests/install-test-workspace/build.js +++ b/build-tests/install-test-workspace/build.js @@ -1,4 +1,3 @@ -const path = require('path'); const { RushConfiguration } = require('@microsoft/rush-lib'); const { Executable, FileSystem, JsonFile } = require('@rushstack/node-core-library'); @@ -44,9 +43,11 @@ if (!currentProject) { const allDependencyProjects = new Set(); collect(currentProject); -const tarballFolder = path.join(__dirname, 'temp/tarballs'); +const tempFolderPath = `${__dirname}/temp`; +const tarballFolder = `${tempFolderPath}/tarballs`; if (!skipPack) { + FileSystem.ensureEmptyFolder(tempFolderPath); FileSystem.ensureEmptyFolder(tarballFolder); const tarballsJson = {}; @@ -55,7 +56,7 @@ if (!skipPack) { if (project.versionPolicy || project.shouldPublish) { console.log('Invoking "pnpm pack" in ' + project.publishFolder); - const packageJsonFilename = path.join(project.projectFolder, 'package.json'); + const packageJsonFilename = `${project.projectFolder}/package.json`; const packageJson = FileSystem.readFile(packageJsonFilename); let result; @@ -79,14 +80,14 @@ if (!skipPack) { if (!tarballFilename) { throw new Error('Failed to parse "pnpm pack" output'); } - const tarballPath = path.join(project.publishFolder, tarballFilename); + const tarballPath = `${project.publishFolder}/${tarballFilename}`; if (!FileSystem.exists(tarballPath)) { throw new Error('Expecting a tarball: ' + tarballPath); } tarballsJson[project.packageName] = tarballFilename; - const targetPath = path.join(tarballFolder, tarballFilename); + const targetPath = `${tarballFolder}/${tarballFilename}`; FileSystem.move({ sourcePath: tarballPath, destinationPath: targetPath, @@ -95,28 +96,28 @@ if (!skipPack) { } } - JsonFile.save(tarballsJson, path.join(tarballFolder, 'tarballs.json')); + JsonFile.save(tarballsJson, `${tarballFolder}/tarballs.json`); } // Look for folder names like this: // local+C++Git+rushstack+build-tests+install-test-wo_7efa61ad1cd268a0ef451c2450ca0351 // // This caches the tarball contents, ignoring the integrity hashes. -const dotPnpmFolderPath = path.resolve(__dirname, 'workspace/node_modules/.pnpm'); +const dotPnpmFolderPath = `${__dirname}/workspace/node_modules/.pnpm`; console.log('\nCleaning cached tarballs...'); if (FileSystem.exists(dotPnpmFolderPath)) { for (const filename of FileSystem.readFolderItemNames(dotPnpmFolderPath)) { if (filename.startsWith('local+')) { - const filePath = path.join(dotPnpmFolderPath, filename); + const filePath = `${dotPnpmFolderPath}/${filename}`; console.log(' Deleting ' + filePath); FileSystem.deleteFolder(filePath); } } } -const pnpmLockBeforePath = path.join(__dirname, 'workspace/common/pnpm-lock.yaml'); -const pnpmLockAfterPath = path.join(__dirname, 'workspace/pnpm-lock.yaml'); +const pnpmLockBeforePath = `${__dirname}/workspace/common/pnpm-lock.yaml`; +const pnpmLockAfterPath = `${__dirname}/workspace/pnpm-lock.yaml`; let pnpmLockBeforeContent = ''; if (FileSystem.exists(pnpmLockBeforePath)) { @@ -134,7 +135,7 @@ if (FileSystem.exists(pnpmLockBeforePath)) { const pnpmInstallArgs = [ 'install', '--store', - rushConfiguration.pnpmOptions.pnpmStorePath, + `${__dirname}/temp/pnpm-store`, '--strict-peer-dependencies', '--recursive', '--link-workspace-packages=false', @@ -151,7 +152,7 @@ console.log(' pnpm ' + pnpmInstallArgs.join(' ')); checkSpawnResult( Executable.spawnSync(rushConfiguration.packageManagerToolFilename, pnpmInstallArgs, { - currentWorkingDirectory: path.join(__dirname, 'workspace'), + currentWorkingDirectory: `${__dirname}/workspace`, stdio: ['ignore', 'inherit', 'inherit'] }), 'pnpm install' @@ -190,7 +191,7 @@ console.log('\nBuilding projects...\n'); checkSpawnResult( Executable.spawnSync(rushConfiguration.packageManagerToolFilename, ['run', '--recursive', 'build'], { - currentWorkingDirectory: path.join(__dirname, 'workspace'), + currentWorkingDirectory: `${__dirname}/workspace`, stdio: ['ignore', 'inherit', 'inherit'] }), 'pnpm run' diff --git a/build-tests/install-test-workspace/package.json b/build-tests/install-test-workspace/package.json index 6a994fe8341..ecf6f697176 100644 --- a/build-tests/install-test-workspace/package.json +++ b/build-tests/install-test-workspace/package.json @@ -10,6 +10,7 @@ "devDependencies": { "@microsoft/rush-lib": "workspace:*", "@rushstack/node-core-library": "workspace:*", - "@rushstack/rush-sdk": "workspace:*" + "@rushstack/rush-sdk": "workspace:*", + "@rushstack/terminal": "workspace:*" } } diff --git a/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml b/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml index 3b1e84e837e..5f2d30d4259 100644 --- a/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml +++ b/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml @@ -11,8 +11,8 @@ importers: rush-lib-test: dependencies: '@microsoft/rush-lib': - specifier: file:microsoft-rush-lib-5.112.2.tgz - version: file:../temp/tarballs/microsoft-rush-lib-5.112.2.tgz(@types/node@18.17.15) + specifier: file:microsoft-rush-lib-5.114.0.tgz + version: file:../temp/tarballs/microsoft-rush-lib-5.114.0.tgz(@types/node@18.17.15) colors: specifier: ^1.4.0 version: 1.4.0 @@ -30,15 +30,15 @@ importers: rush-sdk-test: dependencies: '@rushstack/rush-sdk': - specifier: file:rushstack-rush-sdk-5.112.2.tgz - version: file:../temp/tarballs/rushstack-rush-sdk-5.112.2.tgz(@types/node@18.17.15) + specifier: file:rushstack-rush-sdk-5.114.0.tgz + version: file:../temp/tarballs/rushstack-rush-sdk-5.114.0.tgz(@types/node@18.17.15) colors: specifier: ^1.4.0 version: 1.4.0 devDependencies: '@microsoft/rush-lib': - specifier: file:microsoft-rush-lib-5.112.2.tgz - version: file:../temp/tarballs/microsoft-rush-lib-5.112.2.tgz(@types/node@18.17.15) + specifier: file:microsoft-rush-lib-5.114.0.tgz + version: file:../temp/tarballs/microsoft-rush-lib-5.114.0.tgz(@types/node@18.17.15) '@types/node': specifier: 18.17.15 version: 18.17.15 @@ -52,17 +52,17 @@ importers: typescript-newest-test: devDependencies: '@rushstack/eslint-config': - specifier: file:rushstack-eslint-config-3.6.2.tgz - version: file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz(eslint@8.7.0)(typescript@5.3.3) + specifier: file:rushstack-eslint-config-3.6.4.tgz + version: file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz(eslint@8.7.0)(typescript@5.3.3) '@rushstack/heft': - specifier: file:rushstack-heft-0.64.3.tgz - version: file:../temp/tarballs/rushstack-heft-0.64.3.tgz + specifier: file:rushstack-heft-0.65.0.tgz + version: file:../temp/tarballs/rushstack-heft-0.65.0.tgz '@rushstack/heft-lint-plugin': - specifier: file:rushstack-heft-lint-plugin-0.3.3.tgz - version: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.3.tgz(@rushstack/heft@0.64.3) + specifier: file:rushstack-heft-lint-plugin-0.3.9.tgz + version: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.9.tgz(@rushstack/heft@0.65.0) '@rushstack/heft-typescript-plugin': - specifier: file:rushstack-heft-typescript-plugin-0.3.3.tgz - version: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.3.tgz(@rushstack/heft@0.64.3) + specifier: file:rushstack-heft-typescript-plugin-0.3.9.tgz + version: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.9.tgz(@rushstack/heft@0.65.0) eslint: specifier: ~8.7.0 version: 8.7.0 @@ -76,17 +76,17 @@ importers: typescript-v4-test: devDependencies: '@rushstack/eslint-config': - specifier: file:rushstack-eslint-config-3.6.2.tgz - version: file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz(eslint@8.7.0)(typescript@4.7.4) + specifier: file:rushstack-eslint-config-3.6.4.tgz + version: file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz(eslint@8.7.0)(typescript@4.7.4) '@rushstack/heft': - specifier: file:rushstack-heft-0.64.3.tgz - version: file:../temp/tarballs/rushstack-heft-0.64.3.tgz + specifier: file:rushstack-heft-0.65.0.tgz + version: file:../temp/tarballs/rushstack-heft-0.65.0.tgz '@rushstack/heft-lint-plugin': - specifier: file:rushstack-heft-lint-plugin-0.3.3.tgz - version: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.3.tgz(@rushstack/heft@0.64.3) + specifier: file:rushstack-heft-lint-plugin-0.3.9.tgz + version: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.9.tgz(@rushstack/heft@0.65.0) '@rushstack/heft-typescript-plugin': - specifier: file:rushstack-heft-typescript-plugin-0.3.3.tgz - version: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.3.tgz(@rushstack/heft@0.64.3) + specifier: file:rushstack-heft-typescript-plugin-0.3.9.tgz + version: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.9.tgz(@rushstack/heft@0.65.0) eslint: specifier: ~8.7.0 version: 8.7.0 @@ -234,7 +234,7 @@ packages: debug: 4.3.4 espree: 9.3.2 globals: 13.15.0 - ignore: 5.2.0 + ignore: 5.3.0 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -1201,7 +1201,7 @@ packages: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} /concat-map@0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} /configstore@5.0.1: resolution: {integrity: sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==} @@ -1649,7 +1649,7 @@ packages: dependencies: acorn: 8.7.1 acorn-jsx: 5.3.2(acorn@8.7.1) - eslint-visitor-keys: 3.3.0 + eslint-visitor-keys: 3.4.3 dev: true /esprima@4.0.1: @@ -1822,9 +1822,6 @@ packages: requiresBuild: true optional: true - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} @@ -2062,7 +2059,8 @@ packages: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: - function-bind: 1.1.1 + function-bind: 1.1.2 + dev: true /hasown@2.0.0: resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} @@ -2252,11 +2250,6 @@ packages: dependencies: ci-info: 2.0.0 - /is-core-module@2.11.0: - resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} - dependencies: - has: 1.0.3 - /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: @@ -2483,7 +2476,7 @@ packages: hasBin: true /json-buffer@3.0.0: - resolution: {integrity: sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=} + resolution: {integrity: sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==} /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} @@ -3183,6 +3176,9 @@ packages: dependencies: semver-compare: 1.0.0 + /pnpm-sync-lib@0.1.3: + resolution: {integrity: sha512-bNGuQmEnlIUSxrdtHTZHFt9JKEBqN39nU1QgTdMWjBeXIxCV7M99ylOoE4uH7KutHHacKlW7PD4+2ktApPUzog==} + /postcss@8.4.24: resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} engines: {node: ^10 || ^12 || >=14} @@ -3423,7 +3419,7 @@ packages: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true dependencies: - is-core-module: 2.11.0 + is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -4245,23 +4241,23 @@ packages: optionalDependencies: commander: 2.20.3 - file:../temp/tarballs/microsoft-rush-lib-5.112.2.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/microsoft-rush-lib-5.112.2.tgz} - id: file:../temp/tarballs/microsoft-rush-lib-5.112.2.tgz + file:../temp/tarballs/microsoft-rush-lib-5.114.0.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/microsoft-rush-lib-5.114.0.tgz} + id: file:../temp/tarballs/microsoft-rush-lib-5.114.0.tgz name: '@microsoft/rush-lib' - version: 5.112.2 + version: 5.114.0 engines: {node: '>=5.6.0'} dependencies: '@pnpm/dependency-path': 2.1.2 '@pnpm/link-bins': 5.3.25 - '@rushstack/heft-config-file': file:../temp/tarballs/rushstack-heft-config-file-0.14.4.tgz(@types/node@18.17.15) - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.63.0.tgz(@types/node@18.17.15) - '@rushstack/package-deps-hash': file:../temp/tarballs/rushstack-package-deps-hash-4.1.18.tgz(@types/node@18.17.15) - '@rushstack/package-extractor': file:../temp/tarballs/rushstack-package-extractor-0.6.20.tgz(@types/node@18.17.15) - '@rushstack/rig-package': file:../temp/tarballs/rushstack-rig-package-0.5.1.tgz - '@rushstack/stream-collator': file:../temp/tarballs/rushstack-stream-collator-4.1.21.tgz(@types/node@18.17.15) - '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.7.20.tgz(@types/node@18.17.15) - '@rushstack/ts-command-line': file:../temp/tarballs/rushstack-ts-command-line-4.17.1.tgz + '@rushstack/heft-config-file': file:../temp/tarballs/rushstack-heft-config-file-0.14.11.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) + '@rushstack/package-deps-hash': file:../temp/tarballs/rushstack-package-deps-hash-4.1.27.tgz(@types/node@18.17.15) + '@rushstack/package-extractor': file:../temp/tarballs/rushstack-package-extractor-0.6.29.tgz(@types/node@18.17.15) + '@rushstack/rig-package': file:../temp/tarballs/rushstack-rig-package-0.5.2.tgz + '@rushstack/stream-collator': file:../temp/tarballs/rushstack-stream-collator-4.1.27.tgz(@types/node@18.17.15) + '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15) + '@rushstack/ts-command-line': file:../temp/tarballs/rushstack-ts-command-line-4.17.2.tgz '@types/node-fetch': 2.6.2 '@yarnpkg/lockfile': 1.0.2 builtin-modules: 3.1.0 @@ -4277,9 +4273,9 @@ packages: inquirer: 7.3.3 js-yaml: 3.13.1 node-fetch: 2.6.7 - normalize-path: 3.0.0 npm-check: 6.0.1 npm-package-arg: 6.1.1 + pnpm-sync-lib: 0.1.3 read-package-tree: 5.1.6 rxjs: 6.6.7 semver: 7.5.4 @@ -4294,19 +4290,19 @@ packages: - encoding - supports-color - file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz(eslint@8.7.0)(typescript@4.7.4): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz} - id: file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz + file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz(eslint@8.7.0)(typescript@4.7.4): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz} + id: file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz name: '@rushstack/eslint-config' - version: 3.6.2 + version: 3.6.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 typescript: '>=4.7.0' dependencies: '@rushstack/eslint-patch': file:../temp/tarballs/rushstack-eslint-patch-1.7.2.tgz - '@rushstack/eslint-plugin': file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz(eslint@8.7.0)(typescript@4.7.4) - '@rushstack/eslint-plugin-packlets': file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz(eslint@8.7.0)(typescript@4.7.4) - '@rushstack/eslint-plugin-security': file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz(eslint@8.7.0)(typescript@4.7.4) + '@rushstack/eslint-plugin': file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz(eslint@8.7.0)(typescript@4.7.4) + '@rushstack/eslint-plugin-packlets': file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz(eslint@8.7.0)(typescript@4.7.4) + '@rushstack/eslint-plugin-security': file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz(eslint@8.7.0)(typescript@4.7.4) '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.7.0)(typescript@4.7.4) '@typescript-eslint/parser': 6.19.0(eslint@8.7.0)(typescript@4.7.4) '@typescript-eslint/typescript-estree': 6.19.0(typescript@4.7.4) @@ -4320,19 +4316,19 @@ packages: - supports-color dev: true - file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz(eslint@8.7.0)(typescript@5.3.3): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz} - id: file:../temp/tarballs/rushstack-eslint-config-3.6.2.tgz + file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz(eslint@8.7.0)(typescript@5.3.3): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz} + id: file:../temp/tarballs/rushstack-eslint-config-3.6.4.tgz name: '@rushstack/eslint-config' - version: 3.6.2 + version: 3.6.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 typescript: '>=4.7.0' dependencies: '@rushstack/eslint-patch': file:../temp/tarballs/rushstack-eslint-patch-1.7.2.tgz - '@rushstack/eslint-plugin': file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz(eslint@8.7.0)(typescript@5.3.3) - '@rushstack/eslint-plugin-packlets': file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz(eslint@8.7.0)(typescript@5.3.3) - '@rushstack/eslint-plugin-security': file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz(eslint@8.7.0)(typescript@5.3.3) + '@rushstack/eslint-plugin': file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz(eslint@8.7.0)(typescript@5.3.3) + '@rushstack/eslint-plugin-packlets': file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz(eslint@8.7.0)(typescript@5.3.3) + '@rushstack/eslint-plugin-security': file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz(eslint@8.7.0)(typescript@5.3.3) '@typescript-eslint/eslint-plugin': 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.7.0)(typescript@5.3.3) '@typescript-eslint/parser': 6.19.0(eslint@8.7.0)(typescript@5.3.3) '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) @@ -4352,15 +4348,15 @@ packages: version: 1.7.2 dev: true - file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz(eslint@8.7.0)(typescript@4.7.4): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz} - id: file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz + file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz(eslint@8.7.0)(typescript@4.7.4): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz} + id: file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz name: '@rushstack/eslint-plugin' - version: 0.14.0 + version: 0.15.1 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz + '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz '@typescript-eslint/utils': 6.19.0(eslint@8.7.0)(typescript@4.7.4) eslint: 8.7.0 transitivePeerDependencies: @@ -4368,15 +4364,15 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz(eslint@8.7.0)(typescript@5.3.3): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz} - id: file:../temp/tarballs/rushstack-eslint-plugin-0.14.0.tgz + file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz(eslint@8.7.0)(typescript@5.3.3): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz} + id: file:../temp/tarballs/rushstack-eslint-plugin-0.15.1.tgz name: '@rushstack/eslint-plugin' - version: 0.14.0 + version: 0.15.1 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz + '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz '@typescript-eslint/utils': 6.19.0(eslint@8.7.0)(typescript@5.3.3) eslint: 8.7.0 transitivePeerDependencies: @@ -4384,15 +4380,15 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz(eslint@8.7.0)(typescript@4.7.4): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz} - id: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz + file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz(eslint@8.7.0)(typescript@4.7.4): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz} + id: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz name: '@rushstack/eslint-plugin-packlets' - version: 0.9.0 + version: 0.9.1 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz + '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz '@typescript-eslint/utils': 6.19.0(eslint@8.7.0)(typescript@4.7.4) eslint: 8.7.0 transitivePeerDependencies: @@ -4400,15 +4396,15 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz(eslint@8.7.0)(typescript@5.3.3): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz} - id: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.0.tgz + file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz(eslint@8.7.0)(typescript@5.3.3): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz} + id: file:../temp/tarballs/rushstack-eslint-plugin-packlets-0.9.1.tgz name: '@rushstack/eslint-plugin-packlets' - version: 0.9.0 + version: 0.9.1 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz + '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz '@typescript-eslint/utils': 6.19.0(eslint@8.7.0)(typescript@5.3.3) eslint: 8.7.0 transitivePeerDependencies: @@ -4416,15 +4412,15 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz(eslint@8.7.0)(typescript@4.7.4): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz} - id: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz + file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz(eslint@8.7.0)(typescript@4.7.4): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz} + id: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz name: '@rushstack/eslint-plugin-security' - version: 0.8.0 + version: 0.8.1 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz + '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz '@typescript-eslint/utils': 6.19.0(eslint@8.7.0)(typescript@4.7.4) eslint: 8.7.0 transitivePeerDependencies: @@ -4432,15 +4428,15 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz(eslint@8.7.0)(typescript@5.3.3): - resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz} - id: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.0.tgz + file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz(eslint@8.7.0)(typescript@5.3.3): + resolution: {tarball: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz} + id: file:../temp/tarballs/rushstack-eslint-plugin-security-0.8.1.tgz name: '@rushstack/eslint-plugin-security' - version: 0.8.0 + version: 0.8.1 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz + '@rushstack/tree-pattern': file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz '@typescript-eslint/utils': 6.19.0(eslint@8.7.0)(typescript@5.3.3) eslint: 8.7.0 transitivePeerDependencies: @@ -4448,20 +4444,20 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-heft-0.64.3.tgz: - resolution: {tarball: file:../temp/tarballs/rushstack-heft-0.64.3.tgz} + file:../temp/tarballs/rushstack-heft-0.65.0.tgz: + resolution: {tarball: file:../temp/tarballs/rushstack-heft-0.65.0.tgz} name: '@rushstack/heft' - version: 0.64.3 + version: 0.65.0 engines: {node: '>=10.13.0'} hasBin: true dependencies: - '@rushstack/heft-config-file': file:../temp/tarballs/rushstack-heft-config-file-0.14.7.tgz(@types/node@18.17.15) - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) - '@rushstack/operation-graph': file:../temp/tarballs/rushstack-operation-graph-0.2.6.tgz - '@rushstack/rig-package': file:../temp/tarballs/rushstack-rig-package-0.5.1.tgz - '@rushstack/ts-command-line': file:../temp/tarballs/rushstack-ts-command-line-4.17.1.tgz + '@rushstack/heft-config-file': file:../temp/tarballs/rushstack-heft-config-file-0.14.11.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) + '@rushstack/operation-graph': file:../temp/tarballs/rushstack-operation-graph-0.2.10.tgz + '@rushstack/rig-package': file:../temp/tarballs/rushstack-rig-package-0.5.2.tgz + '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15) + '@rushstack/ts-command-line': file:../temp/tarballs/rushstack-ts-command-line-4.17.2.tgz '@types/tapable': 1.0.6 - chokidar: 3.4.3 fast-glob: 3.3.1 git-repo-info: 2.1.1 ignore: 5.1.9 @@ -4472,45 +4468,46 @@ packages: - '@types/node' dev: true - file:../temp/tarballs/rushstack-heft-config-file-0.14.7.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-heft-config-file-0.14.7.tgz} - id: file:../temp/tarballs/rushstack-heft-config-file-0.14.7.tgz + file:../temp/tarballs/rushstack-heft-config-file-0.14.11.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-heft-config-file-0.14.11.tgz} + id: file:../temp/tarballs/rushstack-heft-config-file-0.14.11.tgz name: '@rushstack/heft-config-file' - version: 0.14.7 + version: 0.14.11 engines: {node: '>=10.13.0'} dependencies: - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) - '@rushstack/rig-package': file:../temp/tarballs/rushstack-rig-package-0.5.1.tgz + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) + '@rushstack/rig-package': file:../temp/tarballs/rushstack-rig-package-0.5.2.tgz + '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15) jsonpath-plus: 4.0.0 transitivePeerDependencies: - '@types/node' - file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.3.tgz(@rushstack/heft@0.64.3): - resolution: {tarball: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.3.tgz} - id: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.3.tgz + file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.9.tgz(@rushstack/heft@0.65.0): + resolution: {tarball: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.9.tgz} + id: file:../temp/tarballs/rushstack-heft-lint-plugin-0.3.9.tgz name: '@rushstack/heft-lint-plugin' - version: 0.3.3 + version: 0.3.9 peerDependencies: '@rushstack/heft': '*' dependencies: - '@rushstack/heft': file:../temp/tarballs/rushstack-heft-0.64.3.tgz - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) + '@rushstack/heft': file:../temp/tarballs/rushstack-heft-0.65.0.tgz + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) semver: 7.5.4 transitivePeerDependencies: - '@types/node' dev: true - file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.3.tgz(@rushstack/heft@0.64.3): - resolution: {tarball: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.3.tgz} - id: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.3.tgz + file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.9.tgz(@rushstack/heft@0.65.0): + resolution: {tarball: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.9.tgz} + id: file:../temp/tarballs/rushstack-heft-typescript-plugin-0.3.9.tgz name: '@rushstack/heft-typescript-plugin' - version: 0.3.3 + version: 0.3.9 peerDependencies: '@rushstack/heft': '*' dependencies: - '@rushstack/heft': file:../temp/tarballs/rushstack-heft-0.64.3.tgz - '@rushstack/heft-config-file': file:../temp/tarballs/rushstack-heft-config-file-0.14.7.tgz(@types/node@18.17.15) - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) + '@rushstack/heft': file:../temp/tarballs/rushstack-heft-0.65.0.tgz + '@rushstack/heft-config-file': file:../temp/tarballs/rushstack-heft-config-file-0.14.11.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) '@types/tapable': 1.0.6 semver: 7.5.4 tapable: 1.1.3 @@ -4518,11 +4515,11 @@ packages: - '@types/node' dev: true - file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz} - id: file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz + file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz} + id: file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz name: '@rushstack/node-core-library' - version: 3.64.2 + version: 4.0.0 peerDependencies: '@types/node': '*' peerDependenciesMeta: @@ -4530,7 +4527,6 @@ packages: optional: true dependencies: '@types/node': 18.17.15 - colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 jju: 1.4.0 @@ -4538,38 +4534,39 @@ packages: semver: 7.5.4 z-schema: 5.0.3 - file:../temp/tarballs/rushstack-operation-graph-0.2.6.tgz: - resolution: {tarball: file:../temp/tarballs/rushstack-operation-graph-0.2.6.tgz} + file:../temp/tarballs/rushstack-operation-graph-0.2.10.tgz: + resolution: {tarball: file:../temp/tarballs/rushstack-operation-graph-0.2.10.tgz} name: '@rushstack/operation-graph' - version: 0.2.6 + version: 0.2.10 peerDependencies: '@types/node': '*' peerDependenciesMeta: '@types/node': optional: true dependencies: - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) + '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15) dev: true - file:../temp/tarballs/rushstack-package-deps-hash-4.1.18.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-package-deps-hash-4.1.18.tgz} - id: file:../temp/tarballs/rushstack-package-deps-hash-4.1.18.tgz + file:../temp/tarballs/rushstack-package-deps-hash-4.1.27.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-package-deps-hash-4.1.27.tgz} + id: file:../temp/tarballs/rushstack-package-deps-hash-4.1.27.tgz name: '@rushstack/package-deps-hash' - version: 4.1.18 + version: 4.1.27 dependencies: - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) transitivePeerDependencies: - '@types/node' - file:../temp/tarballs/rushstack-package-extractor-0.6.23.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-package-extractor-0.6.23.tgz} - id: file:../temp/tarballs/rushstack-package-extractor-0.6.23.tgz + file:../temp/tarballs/rushstack-package-extractor-0.6.29.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-package-extractor-0.6.29.tgz} + id: file:../temp/tarballs/rushstack-package-extractor-0.6.29.tgz name: '@rushstack/package-extractor' - version: 0.6.23 + version: 0.6.29 dependencies: '@pnpm/link-bins': 5.3.25 - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) - '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.7.20.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) + '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15) ignore: 5.1.9 jszip: 3.8.0 minimatch: 3.0.8 @@ -4578,62 +4575,63 @@ packages: transitivePeerDependencies: - '@types/node' - file:../temp/tarballs/rushstack-rig-package-0.5.1.tgz: - resolution: {tarball: file:../temp/tarballs/rushstack-rig-package-0.5.1.tgz} + file:../temp/tarballs/rushstack-rig-package-0.5.2.tgz: + resolution: {tarball: file:../temp/tarballs/rushstack-rig-package-0.5.2.tgz} name: '@rushstack/rig-package' - version: 0.5.1 + version: 0.5.2 dependencies: resolve: 1.22.1 strip-json-comments: 3.1.1 - file:../temp/tarballs/rushstack-rush-sdk-5.112.2.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-rush-sdk-5.112.2.tgz} - id: file:../temp/tarballs/rushstack-rush-sdk-5.112.2.tgz + file:../temp/tarballs/rushstack-rush-sdk-5.114.0.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-rush-sdk-5.114.0.tgz} + id: file:../temp/tarballs/rushstack-rush-sdk-5.114.0.tgz name: '@rushstack/rush-sdk' - version: 5.112.2 + version: 5.114.0 dependencies: - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) '@types/node-fetch': 2.6.2 tapable: 2.2.1 transitivePeerDependencies: - '@types/node' dev: false - file:../temp/tarballs/rushstack-stream-collator-4.1.21.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-stream-collator-4.1.21.tgz} - id: file:../temp/tarballs/rushstack-stream-collator-4.1.21.tgz + file:../temp/tarballs/rushstack-stream-collator-4.1.27.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-stream-collator-4.1.27.tgz} + id: file:../temp/tarballs/rushstack-stream-collator-4.1.27.tgz name: '@rushstack/stream-collator' - version: 4.1.21 + version: 4.1.27 dependencies: - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) - '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.7.20.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) + '@rushstack/terminal': file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15) transitivePeerDependencies: - '@types/node' - file:../temp/tarballs/rushstack-terminal-0.7.20.tgz(@types/node@18.17.15): - resolution: {tarball: file:../temp/tarballs/rushstack-terminal-0.7.20.tgz} - id: file:../temp/tarballs/rushstack-terminal-0.7.20.tgz + file:../temp/tarballs/rushstack-terminal-0.8.0.tgz(@types/node@18.17.15): + resolution: {tarball: file:../temp/tarballs/rushstack-terminal-0.8.0.tgz} + id: file:../temp/tarballs/rushstack-terminal-0.8.0.tgz name: '@rushstack/terminal' - version: 0.7.20 + version: 0.8.0 peerDependencies: '@types/node': '*' peerDependenciesMeta: '@types/node': optional: true dependencies: - '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-3.64.2.tgz(@types/node@18.17.15) + '@rushstack/node-core-library': file:../temp/tarballs/rushstack-node-core-library-4.0.0.tgz(@types/node@18.17.15) '@types/node': 18.17.15 + colors: 1.2.5 - file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz: - resolution: {tarball: file:../temp/tarballs/rushstack-tree-pattern-0.3.2.tgz} + file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz: + resolution: {tarball: file:../temp/tarballs/rushstack-tree-pattern-0.3.3.tgz} name: '@rushstack/tree-pattern' - version: 0.3.2 + version: 0.3.3 dev: true - file:../temp/tarballs/rushstack-ts-command-line-4.17.1.tgz: - resolution: {tarball: file:../temp/tarballs/rushstack-ts-command-line-4.17.1.tgz} + file:../temp/tarballs/rushstack-ts-command-line-4.17.2.tgz: + resolution: {tarball: file:../temp/tarballs/rushstack-ts-command-line-4.17.2.tgz} name: '@rushstack/ts-command-line' - version: 4.17.1 + version: 4.17.2 dependencies: '@types/argparse': 1.0.38 argparse: 1.0.10 diff --git a/build-tests/install-test-workspace/workspace/rush-lib-test/src/start.ts b/build-tests/install-test-workspace/workspace/rush-lib-test/src/start.ts index 7e5976bafb5..2e02d955beb 100644 --- a/build-tests/install-test-workspace/workspace/rush-lib-test/src/start.ts +++ b/build-tests/install-test-workspace/workspace/rush-lib-test/src/start.ts @@ -14,7 +14,7 @@ console.log('Calling an internal API...'); // Use a path-based import to access an internal API (do so at your own risk!) import { VersionMismatchFinder } from '@microsoft/rush-lib/lib/logic/versionMismatch/VersionMismatchFinder'; -import { ConsoleTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; const terminal = new Terminal(new ConsoleTerminalProvider()); VersionMismatchFinder.ensureConsistentVersions(config, terminal); diff --git a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json index 2adc03732ac..15830ed17fe 100644 --- a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json +++ b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/package.json @@ -20,5 +20,8 @@ "typescript": "~5.3.3", "http-proxy": "~1.18.1", "@types/http-proxy": "~1.17.8" + }, + "dependencies": { + "@rushstack/terminal": "workspace:*" } } diff --git a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/src/readObject.ts b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/src/readObject.ts index 46043b71d95..aaaa1927cfb 100644 --- a/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/src/readObject.ts +++ b/build-tests/rush-amazon-s3-build-cache-plugin-integration-test/src/readObject.ts @@ -3,7 +3,7 @@ import { AmazonS3Client } from '@rushstack/rush-amazon-s3-build-cache-plugin'; import { WebClient } from '@rushstack/rush-amazon-s3-build-cache-plugin'; -import { ConsoleTerminalProvider, type ITerminal, Terminal } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, type ITerminal, Terminal } from '@rushstack/terminal'; const webClient: WebClient = new WebClient(); diff --git a/build-tests/rush-project-change-analyzer-test/package.json b/build-tests/rush-project-change-analyzer-test/package.json index d77b512f73b..de59108be39 100644 --- a/build-tests/rush-project-change-analyzer-test/package.json +++ b/build-tests/rush-project-change-analyzer-test/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@microsoft/rush-lib": "workspace:*", - "@rushstack/node-core-library": "workspace:*" + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "@rushstack/heft": "workspace:*", diff --git a/build-tests/rush-project-change-analyzer-test/src/start.ts b/build-tests/rush-project-change-analyzer-test/src/start.ts index 2b4305f34da..b26893d81a3 100644 --- a/build-tests/rush-project-change-analyzer-test/src/start.ts +++ b/build-tests/rush-project-change-analyzer-test/src/start.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import { RushConfiguration, ProjectChangeAnalyzer, type RushConfigurationProject } from '@microsoft/rush-lib'; -import { Terminal, ConsoleTerminalProvider } from '@rushstack/node-core-library'; +import { Terminal, ConsoleTerminalProvider } from '@rushstack/terminal'; async function runAsync(): Promise { const terminal: Terminal = new Terminal(new ConsoleTerminalProvider()); diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/package.json b/build-tests/rush-redis-cobuild-plugin-integration-test/package.json index fd6cee0b3c4..840f43d49e9 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/package.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/package.json @@ -15,6 +15,7 @@ "local-node-rig": "workspace:*", "@rushstack/node-core-library": "workspace:*", "@rushstack/rush-redis-cobuild-plugin": "workspace:*", + "@rushstack/terminal": "workspace:*", "@types/http-proxy": "~1.17.8", "@types/node": "18.17.15", "eslint": "~8.7.0", diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/src/testLockProvider.ts b/build-tests/rush-redis-cobuild-plugin-integration-test/src/testLockProvider.ts index eb18757ba75..1e685b22611 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/src/testLockProvider.ts +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/src/testLockProvider.ts @@ -5,7 +5,7 @@ import { RedisCobuildLockProvider, type IRedisCobuildLockProviderOptions } from '@rushstack/rush-redis-cobuild-plugin'; -import { ConsoleTerminalProvider } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider } from '@rushstack/terminal'; import { OperationStatus, type ICobuildContext, RushSession } from '@microsoft/rush-lib'; const options: IRedisCobuildLockProviderOptions = { diff --git a/build-tests/ts-command-line-test/README.md b/build-tests/ts-command-line-test/README.md index c85f938dbd0..513fc01061c 100644 --- a/build-tests/ts-command-line-test/README.md +++ b/build-tests/ts-command-line-test/README.md @@ -131,7 +131,7 @@ Console Title: Default title Arguments to be executed: ["1","2","3"] ``` -For more about environment variables, see the [IBaseCommandLineDefinition.environmentVariable](https://rushstack.io/pages/api/ts-command-line.ibasecommandlinedefinition.environmentvariable/) documentation. +For more about environment variables, see the [IBaseCommandLineDefinition.environmentVariable](https://api.rushstack.io/pages/ts-command-line.ibasecommandlinedefinition.environmentvariable/) documentation. ## More information diff --git a/common/changes/@microsoft/rush/octogonz-fix-package-deps_2024-02-20-21-19.json b/common/changes/@microsoft/rush/octogonz-fix-package-deps_2024-02-20-21-19.json new file mode 100644 index 00000000000..858c2f6e469 --- /dev/null +++ b/common/changes/@microsoft/rush/octogonz-fix-package-deps_2024-02-20-21-19.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Improve `rush scan` to analyze APIs such as `Import.lazy()` and `await import()`", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-plugin-packlets/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json b/common/changes/@rushstack/eslint-plugin-packlets/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json deleted file mode 100644 index ff918c1ad1d..00000000000 --- a/common/changes/@rushstack/eslint-plugin-packlets/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/eslint-plugin-packlets", - "comment": "", - "type": "none" - } - ], - "packageName": "@rushstack/eslint-plugin-packlets" -} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-plugin-security/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json b/common/changes/@rushstack/eslint-plugin-security/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json deleted file mode 100644 index a4477ef1a61..00000000000 --- a/common/changes/@rushstack/eslint-plugin-security/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/eslint-plugin-security", - "comment": "", - "type": "none" - } - ], - "packageName": "@rushstack/eslint-plugin-security" -} \ No newline at end of file diff --git a/common/changes/@rushstack/eslint-plugin/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json b/common/changes/@rushstack/eslint-plugin/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json deleted file mode 100644 index dcf93469653..00000000000 --- a/common/changes/@rushstack/eslint-plugin/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/eslint-plugin", - "comment": "", - "type": "none" - } - ], - "packageName": "@rushstack/eslint-plugin" -} \ No newline at end of file diff --git a/common/changes/@rushstack/localization-plugin/move-terminal_2022-01-20-19-34.json b/common/changes/@rushstack/localization-plugin/move-terminal_2022-01-20-19-34.json new file mode 100644 index 00000000000..c44c0f04e57 --- /dev/null +++ b/common/changes/@rushstack/localization-plugin/move-terminal_2022-01-20-19-34.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/localization-plugin", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/localization-plugin" +} \ No newline at end of file diff --git a/common/changes/@rushstack/rig-package/bump-cyclics_2023-09-27-01-48.json b/common/changes/@rushstack/rig-package/bump-cyclics_2023-09-27-01-48.json deleted file mode 100644 index c66505525a1..00000000000 --- a/common/changes/@rushstack/rig-package/bump-cyclics_2023-09-27-01-48.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "", - "type": "none", - "packageName": "@rushstack/rig-package" - } - ], - "packageName": "@rushstack/rig-package", - "email": "iclanton@users.noreply.github.com" -} \ No newline at end of file diff --git a/common/changes/@rushstack/rig-package/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json b/common/changes/@rushstack/rig-package/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json deleted file mode 100644 index 1c1df562afb..00000000000 --- a/common/changes/@rushstack/rig-package/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/rig-package", - "comment": "", - "type": "none" - } - ], - "packageName": "@rushstack/rig-package" -} \ No newline at end of file diff --git a/common/changes/@rushstack/tree-pattern/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json b/common/changes/@rushstack/tree-pattern/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json deleted file mode 100644 index 120c33a1f7e..00000000000 --- a/common/changes/@rushstack/tree-pattern/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/tree-pattern", - "comment": "", - "type": "none" - } - ], - "packageName": "@rushstack/tree-pattern" -} \ No newline at end of file diff --git a/common/changes/@rushstack/ts-command-line/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json b/common/changes/@rushstack/ts-command-line/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json deleted file mode 100644 index a03064b455f..00000000000 --- a/common/changes/@rushstack/ts-command-line/octogonz-upgrade-typescript-part-2_2024-01-16-19-07.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@rushstack/ts-command-line", - "comment": "", - "type": "none" - } - ], - "packageName": "@rushstack/ts-command-line" -} \ No newline at end of file diff --git a/common/config/azure-pipelines/templates/build.yaml b/common/config/azure-pipelines/templates/build.yaml index 843199f5832..cad6a034c82 100644 --- a/common/config/azure-pipelines/templates/build.yaml +++ b/common/config/azure-pipelines/templates/build.yaml @@ -27,18 +27,10 @@ steps: - script: 'node common/scripts/install-run-rush.js retest --verbose --production ${{ parameters.BuildParameters }}' displayName: 'Rush retest (install-run-rush)' - env: - # Prevent time-based browserslist update warning - # See https://github.com/microsoft/rushstack/issues/2981 - BROWSERSLIST_IGNORE_OLD_DATA: 1 - ${{ if eq(parameters.PerformValidation, true) }}: - script: 'node apps/rush/lib/start-dev.js test --verbose --production --timeline ${{ parameters.BuildParameters }}' displayName: 'Rush test (rush-lib)' - env: - # Prevent time-based browserslist update warning - # See https://github.com/microsoft/rushstack/issues/2981 - BROWSERSLIST_IGNORE_OLD_DATA: 1 - script: 'node repo-scripts/repo-toolbox/lib/start.js readme --verify' displayName: 'Ensure repo README is up-to-date' diff --git a/common/config/rush/nonbrowser-approved-packages.json b/common/config/rush/nonbrowser-approved-packages.json index e01b1e5a4a2..c37813e1c2e 100644 --- a/common/config/rush/nonbrowser-approved-packages.json +++ b/common/config/rush/nonbrowser-approved-packages.json @@ -240,7 +240,7 @@ }, { "name": "@rushstack/terminal", - "allowedCategories": [ "libraries" ] + "allowedCategories": [ "libraries", "tests", "vscode-extensions" ] }, { "name": "@rushstack/tree-pattern", @@ -722,6 +722,10 @@ "name": "package-extractor-test-03", "allowedCategories": [ "tests" ] }, + { + "name": "pnpm-sync-lib", + "allowedCategories": [ "libraries" ] + }, { "name": "postcss", "allowedCategories": [ "libraries", "tests" ] diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 4533a215d1b..0b7b97124e0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -134,15 +134,15 @@ importers: '@rushstack/rig-package': specifier: workspace:* version: link:../../libraries/rig-package + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@rushstack/ts-command-line': specifier: workspace:* version: link:../../libraries/ts-command-line '@types/tapable': specifier: 1.0.6 version: 1.0.6 - chokidar: - specifier: ~3.4.0 - version: 3.4.3 fast-glob: specifier: ~3.3.1 version: 3.3.1 @@ -238,9 +238,6 @@ importers: ../../apps/lockfile-explorer-web: dependencies: - '@fluentui/react': - specifier: ^8.96.1 - version: 8.110.12(@types/react-dom@17.0.25)(@types/react@17.0.74)(react-dom@17.0.2)(react@17.0.2) '@lifaon/path': specifier: ~2.1.0 version: 2.1.0 @@ -303,6 +300,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal colors: specifier: ~1.2.1 version: 1.2.5 @@ -1823,10 +1823,10 @@ importers: version: link:../../heft-plugins/heft-typescript-plugin '@types/jest': specifier: ts4.9 - version: 29.5.11 + version: 29.5.12 '@types/node': specifier: ts4.9 - version: 20.11.13 + version: 20.11.19 eslint: specifier: ~8.7.0 version: 8.7.0 @@ -1962,6 +1962,9 @@ importers: '@rushstack/rush-sdk': specifier: workspace:* version: link:../../libraries/rush-sdk + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal ../../build-tests/localization-plugin-test-01: dependencies: @@ -2118,6 +2121,10 @@ importers: version: link:../../libraries/node-core-library ../../build-tests/rush-amazon-s3-build-cache-plugin-integration-test: + dependencies: + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal devDependencies: '@rushstack/heft': specifier: workspace:* @@ -2171,9 +2178,9 @@ importers: '@microsoft/rush-lib': specifier: workspace:* version: link:../../libraries/rush-lib - '@rushstack/node-core-library': + '@rushstack/terminal': specifier: workspace:* - version: link:../../libraries/node-core-library + version: link:../../libraries/terminal devDependencies: '@rushstack/heft': specifier: workspace:* @@ -2199,6 +2206,9 @@ importers: '@rushstack/rush-redis-cobuild-plugin': specifier: workspace:* version: link:../../rush-plugins/rush-redis-cobuild-plugin + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/http-proxy': specifier: ~1.17.8 version: 1.17.11 @@ -2532,6 +2542,9 @@ importers: '@rushstack/heft-node-rig': specifier: 2.4.0 version: 2.4.0(@rushstack/heft@..+apps+heft)(@types/node@18.17.15)(jest-environment-jsdom@29.5.0) + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/heft-jest': specifier: 1.0.1 version: 1.0.1 @@ -2609,6 +2622,9 @@ importers: '@rushstack/heft-node-rig': specifier: 2.4.0 version: 2.4.0(@rushstack/heft@..+apps+heft)(@types/node@18.17.15)(jest-environment-jsdom@29.5.0) + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/heft-jest': specifier: 1.0.1 version: 1.0.1 @@ -2655,6 +2671,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../heft-typescript-plugin + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/eslint': specifier: 8.2.0 version: 8.2.0 @@ -2738,6 +2757,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal devDependencies: '@rushstack/heft': specifier: workspace:* @@ -2776,6 +2798,9 @@ importers: '@rushstack/heft-node-rig': specifier: 2.4.0 version: 2.4.0(@rushstack/heft@..+apps+heft)(@types/node@18.17.15)(jest-environment-jsdom@29.5.0) + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/node': specifier: 18.17.15 version: 18.17.15 @@ -2813,6 +2838,9 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/watchpack': specifier: 2.4.0 version: 2.4.0 @@ -2850,6 +2878,9 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/watchpack': specifier: 2.4.0 version: 2.4.0 @@ -2893,6 +2924,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../terminal node-forge: specifier: ~1.3.1 version: 1.3.1 @@ -2918,6 +2952,9 @@ importers: '@rushstack/rig-package': specifier: workspace:* version: link:../rig-package + '@rushstack/terminal': + specifier: workspace:* + version: link:../terminal jsonpath-plus: specifier: ~4.0.0 version: 4.0.0 @@ -2952,6 +2989,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../terminal '@rushstack/typings-generator': specifier: workspace:* version: link:../typings-generator @@ -2999,9 +3039,6 @@ importers: ../../libraries/node-core-library: dependencies: - colors: - specifier: ~1.2.1 - version: 1.2.5 fs-extra: specifier: ~7.0.1 version: 7.0.1 @@ -3054,6 +3091,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../terminal devDependencies: '@rushstack/heft': specifier: 0.64.0 @@ -3256,6 +3296,9 @@ importers: npm-package-arg: specifier: ~6.1.0 version: 6.1.1 + pnpm-sync-lib: + specifier: 0.1.3 + version: 0.1.3 read-package-tree: specifier: ~5.1.5 version: 5.1.6 @@ -3447,16 +3490,25 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../node-core-library - devDependencies: - '@rushstack/heft': - specifier: workspace:* - version: link:../../apps/heft colors: specifier: ~1.2.1 version: 1.2.5 - local-node-rig: + devDependencies: + '@rushstack/heft': + specifier: 0.64.0 + version: 0.64.0(@types/node@18.17.15) + '@rushstack/heft-node-rig': + specifier: 2.4.0 + version: 2.4.0(@rushstack/heft@0.64.0)(@types/node@18.17.15) + '@types/heft-jest': + specifier: 1.0.1 + version: 1.0.1 + '@types/node': + specifier: 18.17.15 + version: 18.17.15 + local-eslint-config: specifier: workspace:* - version: link:../../rigs/local-node-rig + version: link:../../eslint/local-eslint-config ../../libraries/tree-pattern: devDependencies: @@ -3518,6 +3570,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../terminal chokidar: specifier: ~3.4.0 version: 3.4.3 @@ -3589,6 +3644,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@rushstack/ts-command-line': specifier: workspace:* version: link:../../libraries/ts-command-line @@ -3802,6 +3860,9 @@ importers: '@rushstack/rush-sdk': specifier: workspace:* version: link:../../libraries/rush-sdk + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal https-proxy-agent: specifier: ~5.0.0 version: 5.0.1 @@ -3871,6 +3932,9 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/node-fetch': specifier: 2.6.2 version: 2.6.2 @@ -3886,6 +3950,9 @@ importers: '@rushstack/rush-sdk': specifier: workspace:* version: link:../../libraries/rush-sdk + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal devDependencies: '@rushstack/heft': specifier: workspace:* @@ -3912,6 +3979,9 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal local-node-rig: specifier: workspace:* version: link:../../rigs/local-node-rig @@ -3955,6 +4025,9 @@ importers: '@rushstack/heft': specifier: workspace:* version: link:../../apps/heft + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/compression': specifier: ~1.7.2 version: 1.7.2(@types/express@4.17.13) @@ -4049,6 +4122,9 @@ importers: '@rushstack/rush-vscode-command-webview': specifier: workspace:* version: link:../rush-vscode-command-webview + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@rushstack/ts-command-line': specifier: workspace:* version: link:../../libraries/ts-command-line @@ -4258,6 +4334,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal '@types/tapable': specifier: 1.0.6 version: 1.0.6 @@ -4359,6 +4438,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library + '@rushstack/terminal': + specifier: workspace:* + version: link:../../libraries/terminal devDependencies: '@rushstack/heft': specifier: workspace:* @@ -11474,8 +11556,8 @@ packages: expect: 29.6.2 pretty-format: 29.6.2 - /@types/jest@29.5.11: - resolution: {integrity: sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==} + /@types/jest@29.5.12: + resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} dependencies: expect: 29.6.2 pretty-format: 29.6.2 @@ -11587,8 +11669,8 @@ packages: /@types/node@18.17.15: resolution: {integrity: sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==} - /@types/node@20.11.13: - resolution: {integrity: sha512-5G4zQwdiQBSWYTDAH1ctw2eidqdhMJaNsiIDKHFr55ihz5Trl2qqR8fdrT732yPBho5gkNxXm67OxWFBqX9aPg==} + /@types/node@20.11.19: + resolution: {integrity: sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==} dependencies: undici-types: 5.26.5 dev: true @@ -21490,6 +21572,10 @@ packages: - typescript dev: true + /pnpm-sync-lib@0.1.3: + resolution: {integrity: sha512-bNGuQmEnlIUSxrdtHTZHFt9JKEBqN39nU1QgTdMWjBeXIxCV7M99ylOoE4uH7KutHHacKlW7PD4+2ktApPUzog==} + dev: false + /polished@4.2.2: resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==} engines: {node: '>=10'} diff --git a/common/config/rush/repo-state.json b/common/config/rush/repo-state.json index 0bd9fd4e74c..fe7247c66b3 100644 --- a/common/config/rush/repo-state.json +++ b/common/config/rush/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "9e8749c67bb8fa78ef1579fabdf8caf077a5dc55", + "pnpmShrinkwrapHash": "344755e7fb5f5c118ad3a25092abc999945ec3e0", "preferredVersionsHash": "40d4640a94cff77f7808a2f1960cc76231eb6f86" } diff --git a/common/config/rush/subspaces.json b/common/config/rush/subspaces.json new file mode 100644 index 00000000000..d3c3ae8c516 --- /dev/null +++ b/common/config/rush/subspaces.json @@ -0,0 +1,35 @@ +/** + * This configuration file manages the experimental "subspaces" feature for Rush, + * which allows multiple PNPM lockfiles to be used in a single Rush workspace. + * For full documentation, please see https://rushjs.io + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/subspaces.schema.json", + + /** + * Set this flag to "true" to enable usage of subspaces. + */ + "subspacesEnabled": false, + + /** + * (DEPRECATED) This is a temporary workaround for migrating from an earlier prototype + * of this feature: https://github.com/microsoft/rushstack/pull/3481 + * It allows subspaces with only one project to store their config files in the project folder. + */ + "splitWorkspaceCompatibility": false, + + /** + * When a command such as "rush update" is invoked without the "--subspace" or "--to" + * parameters, Rush will install all subspaces. In a huge monorepo with numerous subspaces, + * this would be extremely slow. Set "preventSelectingAllSubspaces" to true to avoid this + * mistake by always requiring selection parameters for commands such as "rush update". + */ + "preventSelectingAllSubspaces": false, + + /** + * The list of subspace names, which should be lowercase alphanumeric words separated by + * hyphens, for example "my-subspace". The corresponding config files will have paths + * such as "common/config/subspaces/my-subspace/package-lock.yaml". + */ + "subspaceNames": [] +} diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 08e0760911c..8e70fb46184 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -102,7 +102,7 @@ { "policyName": "rush", "definitionName": "lockStepVersion", - "version": "5.113.0", + "version": "5.114.0", "nextBump": "minor", "mainProject": "@microsoft/rush" } diff --git a/common/reviews/api/debug-certificate-manager.api.md b/common/reviews/api/debug-certificate-manager.api.md index 1bdac84b0a4..8f7ac612912 100644 --- a/common/reviews/api/debug-certificate-manager.api.md +++ b/common/reviews/api/debug-certificate-manager.api.md @@ -4,7 +4,7 @@ ```ts -import { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; // @public export class CertificateManager { diff --git a/common/reviews/api/heft-config-file.api.md b/common/reviews/api/heft-config-file.api.md index 77a4687a0de..5c62bb37ae0 100644 --- a/common/reviews/api/heft-config-file.api.md +++ b/common/reviews/api/heft-config-file.api.md @@ -5,7 +5,7 @@ ```ts import type { IRigConfig } from '@rushstack/rig-package'; -import { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; // @beta (undocumented) export class ConfigurationFile { diff --git a/common/reviews/api/heft-typescript-plugin.api.md b/common/reviews/api/heft-typescript-plugin.api.md index cd5698fc3ac..50b95f9b678 100644 --- a/common/reviews/api/heft-typescript-plugin.api.md +++ b/common/reviews/api/heft-typescript-plugin.api.md @@ -5,7 +5,7 @@ ```ts import type { HeftConfiguration } from '@rushstack/heft'; -import { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { SyncHook } from 'tapable'; import type * as TTypescript from 'typescript'; diff --git a/common/reviews/api/heft.api.md b/common/reviews/api/heft.api.md index f7706998a7c..3904afa51be 100644 --- a/common/reviews/api/heft.api.md +++ b/common/reviews/api/heft.api.md @@ -18,8 +18,8 @@ import { CommandLineStringListParameter } from '@rushstack/ts-command-line'; import { CommandLineStringParameter } from '@rushstack/ts-command-line'; import { IPackageJson } from '@rushstack/node-core-library'; import { IRigConfig } from '@rushstack/rig-package'; -import { ITerminal } from '@rushstack/node-core-library'; -import { ITerminalProvider } from '@rushstack/node-core-library'; +import { ITerminal } from '@rushstack/terminal'; +import { ITerminalProvider } from '@rushstack/terminal'; export { CommandLineChoiceListParameter } diff --git a/common/reviews/api/localization-utilities.api.md b/common/reviews/api/localization-utilities.api.md index 8496e99298c..02713d93b56 100644 --- a/common/reviews/api/localization-utilities.api.md +++ b/common/reviews/api/localization-utilities.api.md @@ -4,7 +4,7 @@ ```ts -import { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { ITypingsGeneratorBaseOptions } from '@rushstack/typings-generator'; import { NewlineKind } from '@rushstack/node-core-library'; import { StringValuesTypingsGenerator } from '@rushstack/typings-generator'; diff --git a/common/reviews/api/node-core-library.api.md b/common/reviews/api/node-core-library.api.md index 8c0d2cbf518..18639622a0b 100644 --- a/common/reviews/api/node-core-library.api.md +++ b/common/reviews/api/node-core-library.api.md @@ -8,8 +8,6 @@ import * as child_process from 'child_process'; import * as fs from 'fs'; -import { Writable } from 'stream'; -import { WritableOptions } from 'stream'; // @public export enum AlreadyExistsBehavior { @@ -26,12 +24,6 @@ export class AlreadyReportedError extends Error { } // @public -export class AnsiEscape { - static formatForTests(text: string, options?: IAnsiEscapeConvertForTestsOptions): string; - static removeCodes(text: string): string; -} - -// @beta export class Async { static forEachAsync(iterable: Iterable | AsyncIterable, callback: (entry: TEntry, arrayIndex: number) => Promise, options?: IAsyncParallelismOptions | undefined): Promise; static getSignal(): [Promise, () => void, (err: Error) => void]; @@ -53,92 +45,6 @@ export type Brand = T & { __brand: BrandTag; }; -// @beta -export class Colors { - // (undocumented) - static black(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static blackBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static blink(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static blue(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static blueBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static bold(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static cyan(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static cyanBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static dim(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static gray(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static grayBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static green(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static greenBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static hidden(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static invertColor(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static magenta(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static magentaBackground(text: string | IColorableSequence): IColorableSequence; - // @internal - static _normalizeStringOrColorableSequence(value: string | IColorableSequence): IColorableSequence; - // (undocumented) - static red(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static redBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static underline(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static white(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static whiteBackground(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static yellow(text: string | IColorableSequence): IColorableSequence; - // (undocumented) - static yellowBackground(text: string | IColorableSequence): IColorableSequence; -} - -// @beta -export enum ColorValue { - // (undocumented) - Black = 0, - // (undocumented) - Blue = 4, - // (undocumented) - Cyan = 6, - // (undocumented) - Gray = 8, - // (undocumented) - Green = 2, - // (undocumented) - Magenta = 5, - // (undocumented) - Red = 1, - // (undocumented) - White = 7, - // (undocumented) - Yellow = 3 -} - -// @beta -export class ConsoleTerminalProvider implements ITerminalProvider { - constructor(options?: Partial); - debugEnabled: boolean; - get eolCharacter(): string; - get supportsColor(): boolean; - verboseEnabled: boolean; - write(data: string, severity: TerminalProviderSeverity): void; -} - // @public export enum Encoding { // (undocumented) @@ -275,10 +181,6 @@ export class FileSystem { static readFileAsync(filePath: string, options?: IFileSystemReadFileOptions): Promise; static readFileToBuffer(filePath: string): Buffer; static readFileToBufferAsync(filePath: string): Promise; - // @deprecated (undocumented) - static readFolder(folderPath: string, options?: IFileSystemReadFolderOptions): string[]; - // @deprecated (undocumented) - static readFolderAsync(folderPath: string, options?: IFileSystemReadFolderOptions): Promise; static readFolderItemNames(folderPath: string, options?: IFileSystemReadFolderOptions): string[]; static readFolderItemNamesAsync(folderPath: string, options?: IFileSystemReadFolderOptions): Promise; static readFolderItems(folderPath: string, options?: IFileSystemReadFolderOptions): FolderItem[]; @@ -304,6 +206,7 @@ export type FileSystemStats = fs.Stats; export class FileWriter { close(): void; readonly filePath: string; + getStatistics(): FileSystemStats; static open(filePath: string, flags?: IFileWriterFlags): FileWriter; write(text: string): void; } @@ -318,35 +221,10 @@ export enum FolderConstants { export type FolderItem = fs.Dirent; // @public -export interface IAnsiEscapeConvertForTestsOptions { - encodeNewlines?: boolean; -} - -// @beta export interface IAsyncParallelismOptions { concurrency?: number; } -// @beta (undocumented) -export interface IColorableSequence { - // (undocumented) - backgroundColor?: ColorValue; - // (undocumented) - foregroundColor?: ColorValue; - // (undocumented) - isEol?: boolean; - // (undocumented) - text: string; - // (undocumented) - textAttributes?: TextAttribute[]; -} - -// @beta -export interface IConsoleTerminalProviderOptions { - debugEnabled: boolean; - verboseEnabled: boolean; -} - // @public export interface IDependenciesMetaTable { // (undocumented) @@ -355,11 +233,6 @@ export interface IDependenciesMetaTable { }; } -// @beta -export interface IDynamicPrefixProxyTerminalProviderOptions extends IPrefixProxyTerminalProviderOptionsBase { - getPrefix: () => string; -} - // @public export interface IEnvironmentEntry { name: string; @@ -658,14 +531,6 @@ export interface IPeerDependenciesMetaTable { }; } -// @beta (undocumented) -export type IPrefixProxyTerminalProviderOptions = IStaticPrefixProxyTerminalProviderOptions | IDynamicPrefixProxyTerminalProviderOptions; - -// @beta (undocumented) -export interface IPrefixProxyTerminalProviderOptionsBase { - terminalProvider: ITerminalProvider; -} - // @public export interface IProcessInfo { childProcessInfos: IProcessInfo[]; @@ -687,7 +552,7 @@ export interface IReadLinesFromIterableOptions { ignoreEmptyLines?: boolean; } -// @beta (undocumented) +// @public (undocumented) export interface IRunWithRetriesOptions { // (undocumented) action: () => Promise | TResult; @@ -697,16 +562,6 @@ export interface IRunWithRetriesOptions { retryDelayMs?: number; } -// @beta -export interface IStaticPrefixProxyTerminalProviderOptions extends IPrefixProxyTerminalProviderOptionsBase { - prefix: string; -} - -// @beta (undocumented) -export interface IStringBufferOutputOptions { - normalizeSpecialCharacters: boolean; -} - // @public export interface IStringBuilder { append(text: string): void; @@ -718,36 +573,6 @@ export interface ISubprocessOptions { detached: boolean; } -// @beta (undocumented) -export interface ITerminal { - registerProvider(provider: ITerminalProvider): void; - unregisterProvider(provider: ITerminalProvider): void; - write(...messageParts: (string | IColorableSequence)[]): void; - writeDebug(...messageParts: (string | IColorableSequence)[]): void; - writeDebugLine(...messageParts: (string | IColorableSequence)[]): void; - writeError(...messageParts: (string | IColorableSequence)[]): void; - writeErrorLine(...messageParts: (string | IColorableSequence)[]): void; - writeLine(...messageParts: (string | IColorableSequence)[]): void; - writeVerbose(...messageParts: (string | IColorableSequence)[]): void; - writeVerboseLine(...messageParts: (string | IColorableSequence)[]): void; - writeWarning(...messageParts: (string | IColorableSequence)[]): void; - writeWarningLine(...messageParts: (string | IColorableSequence)[]): void; -} - -// @beta -export interface ITerminalProvider { - eolCharacter: string; - supportsColor: boolean; - write(data: string, severity: TerminalProviderSeverity): void; -} - -// @beta -export interface ITerminalWritableOptions { - severity: TerminalProviderSeverity; - terminal: ITerminal; - writableOptions?: WritableOptions; -} - // @public export interface IWaitForExitOptions { encoding?: BufferEncoding | 'buffer'; @@ -824,8 +649,6 @@ export class LegacyAdapters { // (undocumented) static convertCallbackToPromise(fn: (arg1: TArg1, arg2: TArg2, arg3: TArg3, arg4: TArg4, cb: LegacyCallback) => void, arg1: TArg1, arg2: TArg2, arg3: TArg3, arg4: TArg4): Promise; static scrubError(error: Error | string | any): Error; - // @deprecated - static sortStable(array: T[], compare?: (a: T, b: T) => number): void; } // @public @@ -850,7 +673,7 @@ export class MapExtensions { }; } -// @beta +// @public export class MinimumHeap { constructor(comparator: (a: T, b: T) => number); peek(): T | undefined; @@ -933,17 +756,6 @@ export enum PosixModeBits { UserWrite = 128 } -// @beta -export class PrefixProxyTerminalProvider implements ITerminalProvider { - constructor(options: IPrefixProxyTerminalProviderOptions); - // @override (undocumented) - get eolCharacter(): string; - // @override (undocumented) - get supportsColor(): boolean; - // @override (undocumented) - write(data: string, severity: TerminalProviderSeverity): void; -} - // @public export class ProtectableMap { constructor(parameters: IProtectableMapParameters); @@ -968,19 +780,6 @@ export class Sort { static sortSetBy(set: Set, keySelector: (element: T) => any, keyComparer?: (x: T, y: T) => number): void; } -// @beta -export class StringBufferTerminalProvider implements ITerminalProvider { - constructor(supportsColor?: boolean); - get eolCharacter(): string; - getDebugOutput(options?: IStringBufferOutputOptions): string; - getErrorOutput(options?: IStringBufferOutputOptions): string; - getOutput(options?: IStringBufferOutputOptions): string; - getVerbose(options?: IStringBufferOutputOptions): string; - getWarningOutput(options?: IStringBufferOutputOptions): string; - get supportsColor(): boolean; - write(data: string, severity: TerminalProviderSeverity): void; -} - // @public export class StringBuilder implements IStringBuilder { constructor(); @@ -995,44 +794,6 @@ export class SubprocessTerminator { static readonly RECOMMENDED_OPTIONS: ISubprocessOptions; } -// @beta -export class Terminal implements ITerminal { - constructor(provider: ITerminalProvider); - registerProvider(provider: ITerminalProvider): void; - unregisterProvider(provider: ITerminalProvider): void; - write(...messageParts: (string | IColorableSequence)[]): void; - writeDebug(...messageParts: (string | IColorableSequence)[]): void; - writeDebugLine(...messageParts: (string | IColorableSequence)[]): void; - writeError(...messageParts: (string | IColorableSequence)[]): void; - writeErrorLine(...messageParts: (string | IColorableSequence)[]): void; - writeLine(...messageParts: (string | IColorableSequence)[]): void; - writeVerbose(...messageParts: (string | IColorableSequence)[]): void; - writeVerboseLine(...messageParts: (string | IColorableSequence)[]): void; - writeWarning(...messageParts: (string | IColorableSequence)[]): void; - writeWarningLine(...messageParts: (string | IColorableSequence)[]): void; -} - -// @beta -export enum TerminalProviderSeverity { - // (undocumented) - debug = 4, - // (undocumented) - error = 2, - // (undocumented) - log = 0, - // (undocumented) - verbose = 3, - // (undocumented) - warning = 1 -} - -// @beta -export class TerminalWritable extends Writable { - constructor(options: ITerminalWritableOptions); - // (undocumented) - _write(chunk: string | Buffer | Uint8Array, encoding: string, callback: (error?: Error | null) => void): void; -} - // @public export class Text { static convertTo(input: string, newlineKind: NewlineKind): string; @@ -1046,25 +807,10 @@ export class Text { static readLinesFromIterable(iterable: Iterable, options?: IReadLinesFromIterableOptions): Generator; static readLinesFromIterableAsync(iterable: AsyncIterable, options?: IReadLinesFromIterableOptions): AsyncGenerator; static replaceAll(input: string, searchValue: string, replaceValue: string): string; + static reverse(s: string): string; static truncateWithEllipsis(s: string, maximumLength: number): string; } -// @beta -export enum TextAttribute { - // (undocumented) - Blink = 3, - // (undocumented) - Bold = 0, - // (undocumented) - Dim = 1, - // (undocumented) - Hidden = 5, - // (undocumented) - InvertColor = 4, - // (undocumented) - Underline = 2 -} - // @public export class TypeUuid { static isInstanceOf(targetObject: unknown, typeUuid: string): boolean; diff --git a/common/reviews/api/operation-graph.api.md b/common/reviews/api/operation-graph.api.md index 879c1675b3c..e85f4bad9ed 100644 --- a/common/reviews/api/operation-graph.api.md +++ b/common/reviews/api/operation-graph.api.md @@ -6,7 +6,7 @@ /// -import { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; // @beta export type CommandMessageFromHost = ICancelCommandMessage | IExitCommandMessage | IRunCommandMessage | ISyncCommandMessage; diff --git a/common/reviews/api/package-extractor.api.md b/common/reviews/api/package-extractor.api.md index 0da92ed492d..75ce36ce25d 100644 --- a/common/reviews/api/package-extractor.api.md +++ b/common/reviews/api/package-extractor.api.md @@ -5,7 +5,7 @@ ```ts import { IPackageJson } from '@rushstack/node-core-library'; -import { ITerminal } from '@rushstack/node-core-library'; +import { ITerminal } from '@rushstack/terminal'; // @public export interface IExtractorDependencyConfiguration { diff --git a/common/reviews/api/rush-amazon-s3-build-cache-plugin.api.md b/common/reviews/api/rush-amazon-s3-build-cache-plugin.api.md index 230a9a429d3..af43e1c9946 100644 --- a/common/reviews/api/rush-amazon-s3-build-cache-plugin.api.md +++ b/common/reviews/api/rush-amazon-s3-build-cache-plugin.api.md @@ -8,7 +8,7 @@ import * as fetch from 'node-fetch'; import type { IRushPlugin } from '@rushstack/rush-sdk'; -import { ITerminal } from '@rushstack/node-core-library'; +import { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '@rushstack/rush-sdk'; import type { RushSession } from '@rushstack/rush-sdk'; diff --git a/common/reviews/api/rush-azure-storage-build-cache-plugin.api.md b/common/reviews/api/rush-azure-storage-build-cache-plugin.api.md index 2010fa47889..a8cbaf63e06 100644 --- a/common/reviews/api/rush-azure-storage-build-cache-plugin.api.md +++ b/common/reviews/api/rush-azure-storage-build-cache-plugin.api.md @@ -9,7 +9,7 @@ import { DeviceCodeCredential } from '@azure/identity'; import { DeviceCodeCredentialOptions } from '@azure/identity'; import type { ICredentialCacheEntry } from '@rushstack/rush-sdk'; import type { IRushPlugin } from '@rushstack/rush-sdk'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '@rushstack/rush-sdk'; import type { RushSession } from '@rushstack/rush-sdk'; diff --git a/common/reviews/api/rush-lib.api.md b/common/reviews/api/rush-lib.api.md index dd228f7cd48..b4c673f7441 100644 --- a/common/reviews/api/rush-lib.api.md +++ b/common/reviews/api/rush-lib.api.md @@ -14,13 +14,13 @@ import type { CollatedWriter } from '@rushstack/stream-collator'; import type { CommandLineParameter } from '@rushstack/ts-command-line'; import { HookMap } from 'tapable'; import { IPackageJson } from '@rushstack/node-core-library'; -import { ITerminal } from '@rushstack/node-core-library'; -import { ITerminalProvider } from '@rushstack/node-core-library'; +import { ITerminal } from '@rushstack/terminal'; +import type { ITerminalProvider } from '@rushstack/terminal'; import { JsonObject } from '@rushstack/node-core-library'; import { PackageNameParser } from '@rushstack/node-core-library'; import type { StdioSummarizer } from '@rushstack/terminal'; import { SyncHook } from 'tapable'; -import { Terminal } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; // @public export class ApprovedPackagesConfiguration { @@ -453,6 +453,7 @@ export interface IExperimentsJson { buildSkipWithAllowWarningsInSuccessfulBuild?: boolean; cleanInstallAfterNpmrcChanges?: boolean; forbidPhantomResolvableNodeModulesFolders?: boolean; + generateProjectImpactGraphDuringRushUpdate?: boolean; noChmodFieldInTarHeaderNormalization?: boolean; omitImportersFromPreventManualShrinkwrapChanges?: boolean; phasedCommands?: boolean; @@ -460,6 +461,7 @@ export interface IExperimentsJson { usePnpmFrozenLockfileForRushInstall?: boolean; usePnpmLockfileOnlyThenFrozenLockfileForRushUpdate?: boolean; usePnpmPreferFrozenLockfileForRushUpdate?: boolean; + usePnpmSyncForInjectedDependencies?: boolean; } // @beta @@ -1234,6 +1236,7 @@ export class RushConstants { static readonly experimentsFilename: string; static readonly globalCommandKind: 'global'; static readonly hashDelimiter: string; + static readonly mergeQueueIgnoreFileName: string; static readonly nodeModulesFolderName: string; static readonly nonbrowserApprovedPackagesFilename: string; static readonly npmShrinkwrapFilename: string; @@ -1245,8 +1248,10 @@ export class RushConstants { static readonly pnpmfileGlobalFilename: string; static readonly pnpmfileV1Filename: string; static readonly pnpmfileV6Filename: string; + static readonly pnpmPatchesCommonFolderName: string; static readonly pnpmPatchesFolderName: string; static readonly pnpmV3ShrinkwrapFilename: string; + static readonly projectImpactGraphFilename: string; static readonly projectRushFolderName: string; static readonly projectShrinkwrapFilename: string; static readonly rebuildCommandName: string; @@ -1375,13 +1380,15 @@ export class Subspace { export class SubspacesConfiguration { // @internal static _convertNameToEnvironmentVariable(subspaceName: string, splitWorkspaceCompatibility: boolean): string; - readonly enabled: boolean; static explainIfInvalidSubspaceName(subspaceName: string, splitWorkspaceCompatibility?: boolean): string | undefined; + readonly preventSelectingAllSubspaces: boolean; static requireValidSubspaceName(subspaceName: string, splitWorkspaceCompatibility?: boolean): void; readonly splitWorkspaceCompatibility: boolean; readonly subspaceJsonFilePath: string; readonly subspaceNames: ReadonlySet; // (undocumented) + readonly subspacesEnabled: boolean; + // (undocumented) static tryLoadFromConfigurationFile(subspaceJsonFilePath: string): SubspacesConfiguration | undefined; // (undocumented) static tryLoadFromDefaultLocation(rushConfiguration: RushConfiguration): SubspacesConfiguration | undefined; diff --git a/common/reviews/api/terminal.api.md b/common/reviews/api/terminal.api.md index f6927c03eb1..6827400e8fe 100644 --- a/common/reviews/api/terminal.api.md +++ b/common/reviews/api/terminal.api.md @@ -4,9 +4,20 @@ ```ts +/// + import type { Brand } from '@rushstack/node-core-library'; -import type { ITerminal } from '@rushstack/node-core-library'; import { NewlineKind } from '@rushstack/node-core-library'; +import { Writable } from 'stream'; +import { WritableOptions } from 'stream'; + +// @public +export class AnsiEscape { + static formatForTests(text: string, options?: IAnsiEscapeConvertForTestsOptions): string; + // (undocumented) + static getEscapeSequenceForAnsiCode(code: number): string; + static removeCodes(text: string): string; +} // @public export class CallbackWritable extends TerminalWritable { @@ -15,6 +26,68 @@ export class CallbackWritable extends TerminalWritable { protected onWriteChunk(chunk: ITerminalChunk): void; } +// @public +export class Colorize { + // (undocumented) + static black(text: string): string; + // (undocumented) + static blackBackground(text: string): string; + // (undocumented) + static blink(text: string): string; + // (undocumented) + static blue(text: string): string; + // (undocumented) + static blueBackground(text: string): string; + // (undocumented) + static bold(text: string): string; + // (undocumented) + static cyan(text: string): string; + // (undocumented) + static cyanBackground(text: string): string; + // (undocumented) + static dim(text: string): string; + // (undocumented) + static gray(text: string): string; + // (undocumented) + static grayBackground(text: string): string; + // (undocumented) + static green(text: string): string; + // (undocumented) + static greenBackground(text: string): string; + // (undocumented) + static hidden(text: string): string; + // (undocumented) + static invertColor(text: string): string; + // (undocumented) + static magenta(text: string): string; + // (undocumented) + static magentaBackground(text: string): string; + // (undocumented) + static red(text: string): string; + // (undocumented) + static redBackground(text: string): string; + // (undocumented) + static underline(text: string): string; + // (undocumented) + static white(text: string): string; + // (undocumented) + static whiteBackground(text: string): string; + // (undocumented) + static yellow(text: string): string; + // (undocumented) + static yellowBackground(text: string): string; +} + +// @beta +export class ConsoleTerminalProvider implements ITerminalProvider { + constructor(options?: Partial); + debugEnabled: boolean; + get eolCharacter(): string; + get supportsColor(): boolean; + verboseEnabled: boolean; + write(data: string, severity: TerminalProviderSeverity): void; +} + // @public export const DEFAULT_CONSOLE_WIDTH: number; @@ -25,27 +98,56 @@ export class DiscardStdoutTransform extends TerminalTransform { protected onWriteChunk(chunk: ITerminalChunk): void; } +// @public +export interface IAnsiEscapeConvertForTestsOptions { + encodeNewlines?: boolean; +} + // @public export interface ICallbackWritableOptions { // (undocumented) onWriteChunk: (chunk: ITerminalChunk) => void; } +// @beta +export interface IConsoleTerminalProviderOptions { + debugEnabled: boolean; + verboseEnabled: boolean; +} + // @beta export interface IDiscardStdoutTransformOptions extends ITerminalTransformOptions { } +// @beta +export interface IDynamicPrefixProxyTerminalProviderOptions extends IPrefixProxyTerminalProviderOptionsBase { + getPrefix: () => string; +} + // @public export interface INormalizeNewlinesTextRewriterOptions { ensureNewlineAtEnd?: boolean; newlineKind: NewlineKind; } +// @beta (undocumented) +export type IPrefixProxyTerminalProviderOptions = IStaticPrefixProxyTerminalProviderOptions | IDynamicPrefixProxyTerminalProviderOptions; + +// @beta (undocumented) +export interface IPrefixProxyTerminalProviderOptionsBase { + terminalProvider: ITerminalProvider; +} + // @public export interface ISplitterTransformOptions extends ITerminalWritableOptions { destinations: TerminalWritable[]; } +// @beta +export interface IStaticPrefixProxyTerminalProviderOptions extends IPrefixProxyTerminalProviderOptionsBase { + prefix: string; +} + // @beta export interface IStdioLineTransformOptions extends ITerminalTransformOptions { newlineKind?: NewlineKind; @@ -57,12 +159,47 @@ export interface IStdioSummarizerOptions { trailingLines?: number; } +// @beta (undocumented) +export interface IStringBufferOutputOptions { + normalizeSpecialCharacters: boolean; +} + +// @beta (undocumented) +export interface ITerminal { + registerProvider(provider: ITerminalProvider): void; + unregisterProvider(provider: ITerminalProvider): void; + write(...messageParts: TerminalWriteParameters): void; + writeDebug(...messageParts: TerminalWriteParameters): void; + writeDebugLine(...messageParts: TerminalWriteParameters): void; + writeError(...messageParts: TerminalWriteParameters): void; + writeErrorLine(...messageParts: TerminalWriteParameters): void; + writeLine(...messageParts: TerminalWriteParameters): void; + writeVerbose(...messageParts: TerminalWriteParameters): void; + writeVerboseLine(...messageParts: TerminalWriteParameters): void; + writeWarning(...messageParts: TerminalWriteParameters): void; + writeWarningLine(...messageParts: TerminalWriteParameters): void; +} + // @public export interface ITerminalChunk { kind: TerminalChunkKind; text: string; } +// @beta +export interface ITerminalProvider { + eolCharacter: string; + supportsColor: boolean; + write(data: string, severity: TerminalProviderSeverity): void; +} + +// @beta +export interface ITerminalStreamWritableOptions { + severity: TerminalProviderSeverity; + terminal: ITerminal; + writableOptions?: WritableOptions; +} + // @public export interface ITerminalTransformOptions extends ITerminalWritableOptions { destination: TerminalWritable; @@ -74,6 +211,11 @@ export interface ITerminalWritableOptions { preventAutoclose?: boolean; } +// @beta (undocumented) +export interface ITerminalWriteOptions { + doNotOverrideSgrCodes?: boolean; +} + // @public export interface ITextRewriterTransformOptions extends ITerminalTransformOptions { ensureNewlineAtEnd?: boolean; @@ -110,9 +252,21 @@ export class NormalizeNewlinesTextRewriter extends TextRewriter { process(unknownState: TextRewriterState, text: string): string; } +// @beta +export class PrefixProxyTerminalProvider implements ITerminalProvider { + constructor(options: IPrefixProxyTerminalProviderOptions); + // @override (undocumented) + get eolCharacter(): string; + // @override (undocumented) + get supportsColor(): boolean; + // @override (undocumented) + write(data: string, severity: TerminalProviderSeverity): void; +} + // @public export class PrintUtilities { static getConsoleWidth(): number | undefined; + // Warning: (ae-incompatible-release-tags) The symbol "printMessageInBox" is marked as @public, but its signature references "ITerminal" which is marked as @beta static printMessageInBox(message: string, terminal: ITerminal, boxWidth?: number): void; static wrapWords(text: string, maxLineLength?: number, indent?: number): string; static wrapWords(text: string, maxLineLength?: number, linePrefix?: string): string; @@ -170,12 +324,63 @@ export class StdioWritable extends TerminalWritable { protected onWriteChunk(chunk: ITerminalChunk): void; } +// @beta +export class StringBufferTerminalProvider implements ITerminalProvider { + constructor(supportsColor?: boolean); + get eolCharacter(): string; + getDebugOutput(options?: IStringBufferOutputOptions): string; + getErrorOutput(options?: IStringBufferOutputOptions): string; + getOutput(options?: IStringBufferOutputOptions): string; + getVerbose(options?: IStringBufferOutputOptions): string; + getWarningOutput(options?: IStringBufferOutputOptions): string; + get supportsColor(): boolean; + write(data: string, severity: TerminalProviderSeverity): void; +} + +// @beta +export class Terminal implements ITerminal { + constructor(provider: ITerminalProvider); + registerProvider(provider: ITerminalProvider): void; + unregisterProvider(provider: ITerminalProvider): void; + write(...messageParts: TerminalWriteParameters): void; + writeDebug(...messageParts: TerminalWriteParameters): void; + writeDebugLine(...messageParts: TerminalWriteParameters): void; + writeError(...messageParts: TerminalWriteParameters): void; + writeErrorLine(...messageParts: TerminalWriteParameters): void; + writeLine(...messageParts: TerminalWriteParameters): void; + writeVerbose(...messageParts: TerminalWriteParameters): void; + writeVerboseLine(...messageParts: TerminalWriteParameters): void; + writeWarning(...messageParts: TerminalWriteParameters): void; + writeWarningLine(...messageParts: TerminalWriteParameters): void; +} + // @public export const enum TerminalChunkKind { Stderr = "E", Stdout = "O" } +// @beta +export enum TerminalProviderSeverity { + // (undocumented) + debug = 4, + // (undocumented) + error = 2, + // (undocumented) + log = 0, + // (undocumented) + verbose = 3, + // (undocumented) + warning = 1 +} + +// @beta +export class TerminalStreamWritable extends Writable { + constructor(options: ITerminalStreamWritableOptions); + // (undocumented) + _write(chunk: string | Buffer | Uint8Array, encoding: string, callback: (error?: Error | null) => void): void; +} + // @public export abstract class TerminalTransform extends TerminalWritable { constructor(options: ITerminalTransformOptions); @@ -203,6 +408,9 @@ export abstract class TerminalWritable { writeChunk(chunk: ITerminalChunk): void; } +// @beta (undocumented) +export type TerminalWriteParameters = string[] | [...string[], ITerminalWriteOptions]; + // @public export abstract class TextRewriter { abstract close(state: TextRewriterState): string; diff --git a/common/reviews/api/typings-generator.api.md b/common/reviews/api/typings-generator.api.md index d3ce1c1ad9f..0b52f2023d5 100644 --- a/common/reviews/api/typings-generator.api.md +++ b/common/reviews/api/typings-generator.api.md @@ -4,7 +4,7 @@ ```ts -import { ITerminal } from '@rushstack/node-core-library'; +import { ITerminal } from '@rushstack/terminal'; // @public (undocumented) export interface IStringValuesTypingsGeneratorBaseOptions { diff --git a/common/reviews/api/webpack4-localization-plugin.api.md b/common/reviews/api/webpack4-localization-plugin.api.md index 23e854eeffb..9c8f51cc3ec 100644 --- a/common/reviews/api/webpack4-localization-plugin.api.md +++ b/common/reviews/api/webpack4-localization-plugin.api.md @@ -7,7 +7,7 @@ import type { IgnoreStringFunction } from '@rushstack/localization-utilities'; import { ILocalizationFile } from '@rushstack/localization-utilities'; import type { IPseudolocaleOptions } from '@rushstack/localization-utilities'; -import { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import * as Webpack from 'webpack'; // @public (undocumented) diff --git a/common/reviews/api/webpack5-localization-plugin.api.md b/common/reviews/api/webpack5-localization-plugin.api.md index fd968018aa4..52abce5b9b6 100644 --- a/common/reviews/api/webpack5-localization-plugin.api.md +++ b/common/reviews/api/webpack5-localization-plugin.api.md @@ -4,6 +4,8 @@ ```ts +/// + import type { Chunk } from 'webpack'; import type { Compiler } from 'webpack'; import { ILocalizationFile } from '@rushstack/localization-utilities'; @@ -45,6 +47,7 @@ export interface ILocalizationPluginOptions { localizationStats?: ILocalizationStatsOptions; localizedData: ILocalizedData; noStringsLocaleName?: string; + realContentHash?: boolean; runtimeLocaleExpression?: string; } @@ -125,6 +128,12 @@ export interface _IStringPlaceholder { valuesByLocale: Map; } +// @public (undocumented) +export interface ITrueHashPluginOptions { + hashFunction?: (contents: string | Buffer) => string; + stageOverride?: number; +} + // @public export class LocalizationPlugin implements WebpackPluginInstance { constructor(options: ILocalizationPluginOptions); @@ -135,10 +144,19 @@ export class LocalizationPlugin implements WebpackPluginInstance { getDataForSerialNumber(serialNumber: string): _IStringPlaceholder | undefined; // (undocumented) getPlaceholder(localizedFileKey: string, stringName: string): _IStringPlaceholder | undefined; + // @internal (undocumented) + readonly _options: ILocalizationPluginOptions; // (undocumented) readonly stringKeys: Map; } +// @public (undocumented) +export class TrueHashPlugin implements WebpackPluginInstance { + constructor(options?: ITrueHashPluginOptions); + // (undocumented) + apply(compiler: Compiler): void; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/common/scripts/install-run.js b/common/scripts/install-run.js index bf89cd2311a..11bb97c023b 100644 --- a/common/scripts/install-run.js +++ b/common/scripts/install-run.js @@ -42,12 +42,13 @@ __webpack_require__.r(__webpack_exports__); */ // create a global _combinedNpmrc for cache purpose const _combinedNpmrcMap = new Map(); -function _trimNpmrcFile(sourceNpmrcPath) { +function _trimNpmrcFile(sourceNpmrcPath, extraLines = []) { const combinedNpmrcFromCache = _combinedNpmrcMap.get(sourceNpmrcPath); if (combinedNpmrcFromCache !== undefined) { return combinedNpmrcFromCache; } let npmrcFileLines = fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(sourceNpmrcPath).toString().split('\n'); + npmrcFileLines.push(...extraLines); npmrcFileLines = npmrcFileLines.map((line) => (line || '').trim()); const resultLines = []; // This finds environment variable tokens that look like "${VAR_NAME}" @@ -106,10 +107,10 @@ function _trimNpmrcFile(sourceNpmrcPath) { * @returns * The text of the the .npmrc with lines containing undefined variables commented out. */ -function _copyAndTrimNpmrcFile(logger, sourceNpmrcPath, targetNpmrcPath) { +function _copyAndTrimNpmrcFile(logger, sourceNpmrcPath, targetNpmrcPath, extraLines) { logger.info(`Transforming ${sourceNpmrcPath}`); // Verbose logger.info(` --> "${targetNpmrcPath}"`); - const combinedNpmrc = _trimNpmrcFile(sourceNpmrcPath); + const combinedNpmrc = _trimNpmrcFile(sourceNpmrcPath, extraLines); fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(targetNpmrcPath, combinedNpmrc); return combinedNpmrc; } @@ -127,12 +128,16 @@ function syncNpmrc(sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, logger info: console.log, // eslint-disable-next-line no-console error: console.error -}) { +}, extraLines) { const sourceNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(sourceNpmrcFolder, !useNpmrcPublish ? '.npmrc' : '.npmrc-publish'); const targetNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(targetNpmrcFolder, '.npmrc'); try { if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(sourceNpmrcPath)) { - return _copyAndTrimNpmrcFile(logger, sourceNpmrcPath, targetNpmrcPath); + // Ensure the target folder exists + if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(targetNpmrcFolder)) { + fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(targetNpmrcFolder, { recursive: true }); + } + return _copyAndTrimNpmrcFile(logger, sourceNpmrcPath, targetNpmrcPath, extraLines); } else if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(targetNpmrcPath)) { // If the source .npmrc doesn't exist and there is one in the target, delete the one in the target diff --git a/eslint/eslint-bulk/CHANGELOG.json b/eslint/eslint-bulk/CHANGELOG.json index 4f3409fe362..95a9abc3099 100644 --- a/eslint/eslint-bulk/CHANGELOG.json +++ b/eslint/eslint-bulk/CHANGELOG.json @@ -1,6 +1,90 @@ { "name": "@rushstack/eslint-bulk", "entries": [ + { + "version": "0.1.17", + "tag": "@rushstack/eslint-bulk_v0.1.17", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.1.16", + "tag": "@rushstack/eslint-bulk_v0.1.16", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.1.15", + "tag": "@rushstack/eslint-bulk_v0.1.15", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.1.14", + "tag": "@rushstack/eslint-bulk_v0.1.14", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.1.13", + "tag": "@rushstack/eslint-bulk_v0.1.13", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.1.12", + "tag": "@rushstack/eslint-bulk_v0.1.12", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.1.11", + "tag": "@rushstack/eslint-bulk_v0.1.11", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.1.10", "tag": "@rushstack/eslint-bulk_v0.1.10", diff --git a/eslint/eslint-bulk/CHANGELOG.md b/eslint/eslint-bulk/CHANGELOG.md index ef2ae515ba8..89072ee8d3d 100644 --- a/eslint/eslint-bulk/CHANGELOG.md +++ b/eslint/eslint-bulk/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/eslint-bulk -This log was last generated on Thu, 25 Jan 2024 23:03:57 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.1.17 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.1.16 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.1.15 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.1.14 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.1.13 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.1.12 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.1.11 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.1.10 Thu, 25 Jan 2024 23:03:57 GMT diff --git a/eslint/eslint-bulk/package.json b/eslint/eslint-bulk/package.json index 21443ea5282..f3809fe0566 100755 --- a/eslint/eslint-bulk/package.json +++ b/eslint/eslint-bulk/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/eslint-bulk", - "version": "0.1.10", + "version": "0.1.17", "description": "Roll out new ESLint rules in a large monorepo without cluttering up your code with \"eslint-ignore-next-line\"", "main": "index.js", "license": "MIT", diff --git a/eslint/eslint-config/CHANGELOG.json b/eslint/eslint-config/CHANGELOG.json index 744b27e773d..a4d7ff3550e 100644 --- a/eslint/eslint-config/CHANGELOG.json +++ b/eslint/eslint-config/CHANGELOG.json @@ -1,6 +1,36 @@ { "name": "@rushstack/eslint-config", "entries": [ + { + "version": "3.6.4", + "tag": "@rushstack/eslint-config_v3.6.4", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/eslint-plugin\" to `0.15.1`" + }, + { + "comment": "Updating dependency \"@rushstack/eslint-plugin-packlets\" to `0.9.1`" + }, + { + "comment": "Updating dependency \"@rushstack/eslint-plugin-security\" to `0.8.1`" + } + ] + } + }, + { + "version": "3.6.3", + "tag": "@rushstack/eslint-config_v3.6.3", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/eslint-plugin\" to `0.15.0`" + } + ] + } + }, { "version": "3.6.2", "tag": "@rushstack/eslint-config_v3.6.2", diff --git a/eslint/eslint-config/CHANGELOG.md b/eslint/eslint-config/CHANGELOG.md index c276805eed6..2e07fe3fce3 100644 --- a/eslint/eslint-config/CHANGELOG.md +++ b/eslint/eslint-config/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log - @rushstack/eslint-config -This log was last generated on Thu, 25 Jan 2024 23:03:57 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:35 GMT and should not be manually modified. + +## 3.6.4 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 3.6.3 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ ## 3.6.2 Thu, 25 Jan 2024 23:03:57 GMT diff --git a/eslint/eslint-config/config/rush-project.json b/eslint/eslint-config/config/rush-project.json index 2af7036b0ef..514e557d5eb 100644 --- a/eslint/eslint-config/config/rush-project.json +++ b/eslint/eslint-config/config/rush-project.json @@ -3,7 +3,7 @@ "operationSettings": [ { - "operationName": "build", + "operationName": "_phase:build", "outputFolderNames": ["lib", "dist"] } ] diff --git a/eslint/eslint-config/package.json b/eslint/eslint-config/package.json index db00d1d1cf7..5aa6ef30013 100644 --- a/eslint/eslint-config/package.json +++ b/eslint/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/eslint-config", - "version": "3.6.2", + "version": "3.6.4", "description": "A TypeScript ESLint ruleset designed for large teams and projects", "license": "MIT", "repository": { diff --git a/eslint/eslint-plugin-packlets/CHANGELOG.json b/eslint/eslint-plugin-packlets/CHANGELOG.json index 1972950b4d2..3f16289ec27 100644 --- a/eslint/eslint-plugin-packlets/CHANGELOG.json +++ b/eslint/eslint-plugin-packlets/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@rushstack/eslint-plugin-packlets", "entries": [ + { + "version": "0.9.1", + "tag": "@rushstack/eslint-plugin-packlets_v0.9.1", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/tree-pattern\" to `0.3.3`" + } + ] + } + }, { "version": "0.9.0", "tag": "@rushstack/eslint-plugin-packlets_v0.9.0", diff --git a/eslint/eslint-plugin-packlets/CHANGELOG.md b/eslint/eslint-plugin-packlets/CHANGELOG.md index 181a4c6497d..db618d8dfb9 100644 --- a/eslint/eslint-plugin-packlets/CHANGELOG.md +++ b/eslint/eslint-plugin-packlets/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/eslint-plugin-packlets -This log was last generated on Tue, 16 Jan 2024 18:30:10 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:34 GMT and should not be manually modified. + +## 0.9.1 +Sat, 17 Feb 2024 06:24:34 GMT + +_Version update only_ ## 0.9.0 Tue, 16 Jan 2024 18:30:10 GMT diff --git a/eslint/eslint-plugin-packlets/package.json b/eslint/eslint-plugin-packlets/package.json index 66236f73ebf..f8e8836f414 100644 --- a/eslint/eslint-plugin-packlets/package.json +++ b/eslint/eslint-plugin-packlets/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/eslint-plugin-packlets", - "version": "0.9.0", + "version": "0.9.1", "description": "A lightweight alternative to NPM packages for organizing source files within a single project", "license": "MIT", "repository": { diff --git a/eslint/eslint-plugin-security/CHANGELOG.json b/eslint/eslint-plugin-security/CHANGELOG.json index 966cb0c4061..3a67a4007ee 100644 --- a/eslint/eslint-plugin-security/CHANGELOG.json +++ b/eslint/eslint-plugin-security/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@rushstack/eslint-plugin-security", "entries": [ + { + "version": "0.8.1", + "tag": "@rushstack/eslint-plugin-security_v0.8.1", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/tree-pattern\" to `0.3.3`" + } + ] + } + }, { "version": "0.8.0", "tag": "@rushstack/eslint-plugin-security_v0.8.0", diff --git a/eslint/eslint-plugin-security/CHANGELOG.md b/eslint/eslint-plugin-security/CHANGELOG.md index 7ac95b016a4..a7c86417070 100644 --- a/eslint/eslint-plugin-security/CHANGELOG.md +++ b/eslint/eslint-plugin-security/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log - @rushstack/eslint-plugin-security -This log was last generated on Tue, 16 Jan 2024 18:30:10 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:34 GMT and should not be manually modified. + +## 0.8.1 +Sat, 17 Feb 2024 06:24:34 GMT + +_Version update only_ ## 0.8.0 Tue, 16 Jan 2024 18:30:10 GMT diff --git a/eslint/eslint-plugin-security/package.json b/eslint/eslint-plugin-security/package.json index 371dfa200e8..550356f6faf 100644 --- a/eslint/eslint-plugin-security/package.json +++ b/eslint/eslint-plugin-security/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/eslint-plugin-security", - "version": "0.8.0", + "version": "0.8.1", "description": "An ESLint plugin providing rules that identify common security vulnerabilities for browser applications, Node.js tools, and Node.js services", "license": "MIT", "repository": { diff --git a/eslint/eslint-plugin/CHANGELOG.json b/eslint/eslint-plugin/CHANGELOG.json index f04e25c58f3..e15a27dc3c5 100644 --- a/eslint/eslint-plugin/CHANGELOG.json +++ b/eslint/eslint-plugin/CHANGELOG.json @@ -1,6 +1,35 @@ { "name": "@rushstack/eslint-plugin", "entries": [ + { + "version": "0.15.1", + "tag": "@rushstack/eslint-plugin_v0.15.1", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/tree-pattern\" to `0.3.3`" + } + ] + } + }, + { + "version": "0.15.0", + "tag": "@rushstack/eslint-plugin_v0.15.0", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "minor": [ + { + "comment": "Allow using `as const` in `typedef-var`" + } + ] + } + }, { "version": "0.14.0", "tag": "@rushstack/eslint-plugin_v0.14.0", diff --git a/eslint/eslint-plugin/CHANGELOG.md b/eslint/eslint-plugin/CHANGELOG.md index 7a22836d632..2e8b478fa98 100644 --- a/eslint/eslint-plugin/CHANGELOG.md +++ b/eslint/eslint-plugin/CHANGELOG.md @@ -1,6 +1,20 @@ # Change Log - @rushstack/eslint-plugin -This log was last generated on Tue, 16 Jan 2024 18:30:10 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:34 GMT and should not be manually modified. + +## 0.15.1 +Sat, 17 Feb 2024 06:24:34 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.15.0 +Wed, 07 Feb 2024 01:11:18 GMT + +### Minor changes + +- Allow using `as const` in `typedef-var` ## 0.14.0 Tue, 16 Jan 2024 18:30:10 GMT diff --git a/eslint/eslint-plugin/README.md b/eslint/eslint-plugin/README.md index d1ab3447e02..c259143b929 100644 --- a/eslint/eslint-plugin/README.md +++ b/eslint/eslint-plugin/README.md @@ -81,7 +81,7 @@ If you are designing a new JSON file format, it's a good idea to avoid `null` en there are better representations that convey more information about an item that is unknown, omitted, or disabled. If you do need to declare types for JSON structures containing `null`, rather than suppressing the lint rule, you can use a specialized -[JsonNull](https://rushstack.io/pages/api/node-core-library.jsonnull/) +[JsonNull](https://api.rushstack.io/pages/node-core-library.jsonnull/) type as provided by [@rushstack/node-core-library](https://www.npmjs.com/package/@rushstack/node-core-library). diff --git a/eslint/eslint-plugin/package.json b/eslint/eslint-plugin/package.json index ec263b5e62b..7470bd25e99 100644 --- a/eslint/eslint-plugin/package.json +++ b/eslint/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/eslint-plugin", - "version": "0.14.0", + "version": "0.15.1", "description": "An ESLint plugin providing supplementary rules for use with the @rushstack/eslint-config package", "license": "MIT", "repository": { diff --git a/eslint/eslint-plugin/src/test/typedef-var.test.ts b/eslint/eslint-plugin/src/test/typedef-var.test.ts index fb12ffe09ff..a873952faae 100644 --- a/eslint/eslint-plugin/src/test/typedef-var.test.ts +++ b/eslint/eslint-plugin/src/test/typedef-var.test.ts @@ -46,6 +46,15 @@ ruleTester.run('typedef-var', typedefVar, { { code: 'for (const x of []) { }' }, + { + code: 'const x = 1 as const;' + }, + { + code: 'const x: 1 = 1;' + }, + { + code: 'const x: number = 1;' + }, { // prettier-ignore code: [ diff --git a/eslint/eslint-plugin/src/typedef-var.ts b/eslint/eslint-plugin/src/typedef-var.ts index 33ed7cd1f57..6202d4d2844 100644 --- a/eslint/eslint-plugin/src/typedef-var.ts +++ b/eslint/eslint-plugin/src/typedef-var.ts @@ -50,6 +50,16 @@ const typedefVar: TSESLint.RuleModule = { return; } + if ( + node.init?.type === AST_NODE_TYPES.TSAsExpression && + node.init.typeAnnotation.type === AST_NODE_TYPES.TSTypeReference && + node.init.typeAnnotation.typeName.type === AST_NODE_TYPES.Identifier && + node.init.typeAnnotation.typeName.name === 'const' + ) { + // An `as const` type declaration was provided + return; + } + // These are @typescript-eslint/typedef exemptions if ( node.id.type === AST_NODE_TYPES.ArrayPattern /* ArrayDestructuring */ || diff --git a/heft-plugins/heft-api-extractor-plugin/CHANGELOG.json b/heft-plugins/heft-api-extractor-plugin/CHANGELOG.json index acaf6c0f51a..1639184a1e6 100644 --- a/heft-plugins/heft-api-extractor-plugin/CHANGELOG.json +++ b/heft-plugins/heft-api-extractor-plugin/CHANGELOG.json @@ -1,6 +1,165 @@ { "name": "@rushstack/heft-api-extractor-plugin", "entries": [ + { + "version": "0.3.10", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.10", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.12`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.65.0` to `0.65.1`" + } + ] + } + }, + { + "version": "0.3.9", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.9", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.8` to `0.65.0`" + } + ] + } + }, + { + "version": "0.3.8", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.8", + "date": "Mon, 19 Feb 2024 21:54:26 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.11`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.7` to `0.64.8`" + } + ] + } + }, + { + "version": "0.3.7", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.7", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.10`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.2`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.6` to `0.64.7`" + } + ] + } + }, + { + "version": "0.3.6", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.6", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.9`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.5` to `0.64.6`" + } + ] + } + }, + { + "version": "0.3.5", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.5", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.4` to `0.64.5`" + } + ] + } + }, + { + "version": "0.3.4", + "tag": "@rushstack/heft-api-extractor-plugin_v0.3.4", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.39.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.3` to `0.64.4`" + } + ] + } + }, { "version": "0.3.3", "tag": "@rushstack/heft-api-extractor-plugin_v0.3.3", diff --git a/heft-plugins/heft-api-extractor-plugin/CHANGELOG.md b/heft-plugins/heft-api-extractor-plugin/CHANGELOG.md index 6f942c85667..14bcdccdbf0 100644 --- a/heft-plugins/heft-api-extractor-plugin/CHANGELOG.md +++ b/heft-plugins/heft-api-extractor-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-api-extractor-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.3.10 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.3.9 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.3.8 +Mon, 19 Feb 2024 21:54:26 GMT + +_Version update only_ + +## 0.3.7 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.3.6 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.3.5 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.3.4 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.3.3 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/heft-plugins/heft-api-extractor-plugin/package.json b/heft-plugins/heft-api-extractor-plugin/package.json index 45c83352890..64519bed972 100644 --- a/heft-plugins/heft-api-extractor-plugin/package.json +++ b/heft-plugins/heft-api-extractor-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-api-extractor-plugin", - "version": "0.3.3", + "version": "0.3.10", "description": "A Heft plugin for API Extractor", "repository": { "type": "git", @@ -15,7 +15,7 @@ "_phase:build": "heft run --only build -- --clean" }, "peerDependencies": { - "@rushstack/heft": "0.64.3" + "@rushstack/heft": "0.65.1" }, "dependencies": { "@rushstack/heft-config-file": "workspace:*", @@ -27,6 +27,7 @@ "local-eslint-config": "workspace:*", "@rushstack/heft": "workspace:*", "@rushstack/heft-node-rig": "2.4.0", + "@rushstack/terminal": "workspace:*", "@types/heft-jest": "1.0.1", "@types/node": "18.17.15", "@types/semver": "7.5.0", diff --git a/heft-plugins/heft-api-extractor-plugin/src/ApiExtractorRunner.ts b/heft-plugins/heft-api-extractor-plugin/src/ApiExtractorRunner.ts index 0ce811cf99e..1e53d23f703 100644 --- a/heft-plugins/heft-api-extractor-plugin/src/ApiExtractorRunner.ts +++ b/heft-plugins/heft-api-extractor-plugin/src/ApiExtractorRunner.ts @@ -3,7 +3,8 @@ import * as semver from 'semver'; import type { IScopedLogger } from '@rushstack/heft'; -import { type ITerminal, FileError, InternalError } from '@rushstack/node-core-library'; +import { FileError, InternalError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type * as TApiExtractor from '@microsoft/api-extractor'; export interface IApiExtractorRunnerConfiguration { diff --git a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json index ac9b6133e8b..e392206c858 100644 --- a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json +++ b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.json @@ -1,6 +1,150 @@ { "name": "@rushstack/heft-dev-cert-plugin", "entries": [ + { + "version": "0.4.27", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.27`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "0.4.26", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.26", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "0.4.25", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.25`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "0.4.24", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.24`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.2`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "0.4.23", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.23`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "0.4.22", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.22`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "0.4.21", + "tag": "@rushstack/heft-dev-cert-plugin_v0.4.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/debug-certificate-manager\" to `1.3.21`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.39.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "0.4.20", "tag": "@rushstack/heft-dev-cert-plugin_v0.4.20", diff --git a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md index 1f1d26c9777..49c2bfa5216 100644 --- a/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md +++ b/heft-plugins/heft-dev-cert-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-dev-cert-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.4.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.4.26 +Tue, 20 Feb 2024 16:10:52 GMT + +_Version update only_ + +## 0.4.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.4.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.4.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.4.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.4.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.4.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/heft-plugins/heft-dev-cert-plugin/package.json b/heft-plugins/heft-dev-cert-plugin/package.json index 497fb564c15..6dd62df93ff 100644 --- a/heft-plugins/heft-dev-cert-plugin/package.json +++ b/heft-plugins/heft-dev-cert-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-dev-cert-plugin", - "version": "0.4.20", + "version": "0.4.27", "description": "A Heft plugin for generating and using local development certificates", "repository": { "type": "git", @@ -16,7 +16,7 @@ "_phase:test": "heft run --only test -- --clean" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3" + "@rushstack/heft": "^0.65.1" }, "dependencies": { "@rushstack/debug-certificate-manager": "workspace:*" diff --git a/heft-plugins/heft-jest-plugin/CHANGELOG.json b/heft-plugins/heft-jest-plugin/CHANGELOG.json index f5df3710329..f9cbe944d27 100644 --- a/heft-plugins/heft-jest-plugin/CHANGELOG.json +++ b/heft-plugins/heft-jest-plugin/CHANGELOG.json @@ -1,6 +1,147 @@ { "name": "@rushstack/heft-jest-plugin", "entries": [ + { + "version": "0.11.10", + "tag": "@rushstack/heft-jest-plugin_v0.11.10", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.12`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "0.11.9", + "tag": "@rushstack/heft-jest-plugin_v0.11.9", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "0.11.8", + "tag": "@rushstack/heft-jest-plugin_v0.11.8", + "date": "Mon, 19 Feb 2024 21:54:26 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.11`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "0.11.7", + "tag": "@rushstack/heft-jest-plugin_v0.11.7", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.10`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "0.11.6", + "tag": "@rushstack/heft-jest-plugin_v0.11.6", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.9`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "0.11.5", + "tag": "@rushstack/heft-jest-plugin_v0.11.5", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "0.11.4", + "tag": "@rushstack/heft-jest-plugin_v0.11.4", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "0.11.3", "tag": "@rushstack/heft-jest-plugin_v0.11.3", diff --git a/heft-plugins/heft-jest-plugin/CHANGELOG.md b/heft-plugins/heft-jest-plugin/CHANGELOG.md index f32599b683b..56c605420ab 100644 --- a/heft-plugins/heft-jest-plugin/CHANGELOG.md +++ b/heft-plugins/heft-jest-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-jest-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.11.10 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.11.9 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.11.8 +Mon, 19 Feb 2024 21:54:26 GMT + +_Version update only_ + +## 0.11.7 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.11.6 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.11.5 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.11.4 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.11.3 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/heft-plugins/heft-jest-plugin/package.json b/heft-plugins/heft-jest-plugin/package.json index 333d0d73b69..6c50a46377f 100644 --- a/heft-plugins/heft-jest-plugin/package.json +++ b/heft-plugins/heft-jest-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-jest-plugin", - "version": "0.11.3", + "version": "0.11.10", "description": "Heft plugin for Jest", "repository": { "type": "git", @@ -16,7 +16,7 @@ "_phase:test": "heft run --only test -- --clean" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3", + "@rushstack/heft": "^0.65.1", "jest-environment-jsdom": "^29.5.0", "jest-environment-node": "^29.5.0" }, @@ -44,6 +44,7 @@ "local-eslint-config": "workspace:*", "@rushstack/heft": "workspace:*", "@rushstack/heft-node-rig": "2.4.0", + "@rushstack/terminal": "workspace:*", "@types/heft-jest": "1.0.1", "@types/lodash": "4.14.116", "@types/node": "18.17.15", diff --git a/heft-plugins/heft-jest-plugin/src/HeftJestReporter.ts b/heft-plugins/heft-jest-plugin/src/HeftJestReporter.ts index 069337720b2..5d0ce0b6a4f 100644 --- a/heft-plugins/heft-jest-plugin/src/HeftJestReporter.ts +++ b/heft-plugins/heft-jest-plugin/src/HeftJestReporter.ts @@ -2,13 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { - type ITerminal, - Colors, - InternalError, - Text, - type IColorableSequence -} from '@rushstack/node-core-library'; +import { InternalError, Text } from '@rushstack/node-core-library'; +import { type ITerminal, Colorize } from '@rushstack/terminal'; import type { Reporter, Test, @@ -51,7 +46,7 @@ export default class HeftJestReporter implements Reporter { public async onTestStart(test: Test): Promise { this._terminal.writeLine( - Colors.whiteBackground(Colors.black('START')), + Colorize.whiteBackground(Colorize.black('START')), ` ${this._getTestPath(test.path)}` ); } @@ -80,11 +75,14 @@ export default class HeftJestReporter implements Reporter { `(duration: ${duration}, ${numPassingTests} passed, ${numFailingTests} failed${memUsage})`; if (numFailingTests > 0) { - this._terminal.writeLine(Colors.redBackground(Colors.black('FAIL')), message); + this._terminal.writeLine(Colorize.redBackground(Colorize.black('FAIL')), message); } else if (testExecError) { - this._terminal.writeLine(Colors.redBackground(Colors.black(`FAIL (${testExecError.type})`)), message); + this._terminal.writeLine( + Colorize.redBackground(Colorize.black(`FAIL (${testExecError.type})`)), + message + ); } else { - this._terminal.writeLine(Colors.greenBackground(Colors.black('PASS')), message); + this._terminal.writeLine(Colorize.greenBackground(Colorize.black('PASS')), message); } if (failureMessage) { @@ -169,7 +167,7 @@ export default class HeftJestReporter implements Reporter { const PAD_LENGTH: number = 13; // "console.error" is the longest label const paddedLabel: string = '|' + label.padStart(PAD_LENGTH) + '|'; - const prefix: IColorableSequence = debug ? Colors.yellow(paddedLabel) : Colors.cyan(paddedLabel); + const prefix: string = debug ? Colorize.yellow(paddedLabel) : Colorize.cyan(paddedLabel); for (const line of lines) { this._terminal.writeLine(prefix, ' ' + line); @@ -195,13 +193,13 @@ export default class HeftJestReporter implements Reporter { this._terminal.writeLine('Tests finished:'); const successesText: string = ` Successes: ${numPassedTests}`; - this._terminal.writeLine(numPassedTests > 0 ? Colors.green(successesText) : successesText); + this._terminal.writeLine(numPassedTests > 0 ? Colorize.green(successesText) : successesText); const failText: string = ` Failures: ${numFailedTests}`; - this._terminal.writeLine(numFailedTests > 0 ? Colors.red(failText) : failText); + this._terminal.writeLine(numFailedTests > 0 ? Colorize.red(failText) : failText); if (numRuntimeErrorTestSuites) { - this._terminal.writeLine(Colors.red(` Failed test suites: ${numRuntimeErrorTestSuites}`)); + this._terminal.writeLine(Colorize.red(` Failed test suites: ${numRuntimeErrorTestSuites}`)); } this._terminal.writeLine(` Total: ${numTotalTests}`); diff --git a/heft-plugins/heft-jest-plugin/src/JestPlugin.ts b/heft-plugins/heft-jest-plugin/src/JestPlugin.ts index f1b9770002b..e8f7274b773 100644 --- a/heft-plugins/heft-jest-plugin/src/JestPlugin.ts +++ b/heft-plugins/heft-jest-plugin/src/JestPlugin.ts @@ -30,14 +30,8 @@ import { InheritanceType, PathResolutionMethod } from '@rushstack/heft-config-file'; -import { - FileSystem, - Path, - Import, - JsonFile, - PackageName, - type ITerminal -} from '@rushstack/node-core-library'; +import { FileSystem, Path, Import, JsonFile, PackageName } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IHeftJestReporterOptions } from './HeftJestReporter'; import { jestResolve } from './JestUtils'; diff --git a/heft-plugins/heft-jest-plugin/src/TerminalWritableStream.ts b/heft-plugins/heft-jest-plugin/src/TerminalWritableStream.ts index 755d61d4544..12583bf5aa2 100644 --- a/heft-plugins/heft-jest-plugin/src/TerminalWritableStream.ts +++ b/heft-plugins/heft-jest-plugin/src/TerminalWritableStream.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { Writable } from 'stream'; // Regex to filter out screen clearing directives diff --git a/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts b/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts index 19905879cd0..33630934214 100644 --- a/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts +++ b/heft-plugins/heft-jest-plugin/src/test/JestPlugin.test.ts @@ -5,7 +5,8 @@ import * as path from 'path'; import type { Config } from '@jest/types'; import type { IHeftTaskSession, HeftConfiguration, CommandLineParameter } from '@rushstack/heft'; import type { ConfigurationFile } from '@rushstack/heft-config-file'; -import { Import, JsonFile, StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { Import, JsonFile } from '@rushstack/node-core-library'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { default as JestPlugin, type IHeftJestConfiguration } from '../JestPlugin'; diff --git a/heft-plugins/heft-lint-plugin/CHANGELOG.json b/heft-plugins/heft-lint-plugin/CHANGELOG.json index 6d21f3d0372..10d789d4f37 100644 --- a/heft-plugins/heft-lint-plugin/CHANGELOG.json +++ b/heft-plugins/heft-lint-plugin/CHANGELOG.json @@ -1,6 +1,153 @@ { "name": "@rushstack/heft-lint-plugin", "entries": [ + { + "version": "0.3.10", + "tag": "@rushstack/heft-lint-plugin_v0.3.10", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.65.0` to `0.65.1`" + } + ] + } + }, + { + "version": "0.3.9", + "tag": "@rushstack/heft-lint-plugin_v0.3.9", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.8` to `0.65.0`" + } + ] + } + }, + { + "version": "0.3.8", + "tag": "@rushstack/heft-lint-plugin_v0.3.8", + "date": "Mon, 19 Feb 2024 21:54:26 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.7` to `0.64.8`" + } + ] + } + }, + { + "version": "0.3.7", + "tag": "@rushstack/heft-lint-plugin_v0.3.7", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.6` to `0.64.7`" + } + ] + } + }, + { + "version": "0.3.6", + "tag": "@rushstack/heft-lint-plugin_v0.3.6", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.5` to `0.64.6`" + } + ] + } + }, + { + "version": "0.3.5", + "tag": "@rushstack/heft-lint-plugin_v0.3.5", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.4` to `0.64.5`" + } + ] + } + }, + { + "version": "0.3.4", + "tag": "@rushstack/heft-lint-plugin_v0.3.4", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `0.64.3` to `0.64.4`" + } + ] + } + }, { "version": "0.3.3", "tag": "@rushstack/heft-lint-plugin_v0.3.3", diff --git a/heft-plugins/heft-lint-plugin/CHANGELOG.md b/heft-plugins/heft-lint-plugin/CHANGELOG.md index 34b9c652e80..b10e0d6d66a 100644 --- a/heft-plugins/heft-lint-plugin/CHANGELOG.md +++ b/heft-plugins/heft-lint-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-lint-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.3.10 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.3.9 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.3.8 +Mon, 19 Feb 2024 21:54:26 GMT + +_Version update only_ + +## 0.3.7 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.3.6 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.3.5 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.3.4 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.3.3 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/heft-plugins/heft-lint-plugin/package.json b/heft-plugins/heft-lint-plugin/package.json index dacd216cd53..c0cfdb02864 100644 --- a/heft-plugins/heft-lint-plugin/package.json +++ b/heft-plugins/heft-lint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-lint-plugin", - "version": "0.3.3", + "version": "0.3.10", "description": "A Heft plugin for using ESLint or TSLint. Intended for use with @rushstack/heft-typescript-plugin", "repository": { "type": "git", @@ -15,7 +15,7 @@ "_phase:build": "heft run --only build -- --clean" }, "peerDependencies": { - "@rushstack/heft": "0.64.3" + "@rushstack/heft": "0.65.1" }, "dependencies": { "@rushstack/node-core-library": "workspace:*", @@ -26,6 +26,7 @@ "@rushstack/heft": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", "@rushstack/heft-node-rig": "2.4.0", + "@rushstack/terminal": "workspace:*", "@types/eslint": "8.2.0", "@types/heft-jest": "1.0.1", "@types/node": "18.17.15", diff --git a/heft-plugins/heft-lint-plugin/src/LinterBase.ts b/heft-plugins/heft-lint-plugin/src/LinterBase.ts index 0c3b0874ef3..89c3eb84e16 100644 --- a/heft-plugins/heft-lint-plugin/src/LinterBase.ts +++ b/heft-plugins/heft-lint-plugin/src/LinterBase.ts @@ -4,7 +4,8 @@ import * as path from 'path'; import { performance } from 'perf_hooks'; import { createHash, type Hash } from 'crypto'; -import { type ITerminal, FileSystem, JsonFile, Path } from '@rushstack/node-core-library'; +import { FileSystem, JsonFile, Path } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IScopedLogger } from '@rushstack/heft'; import type { IExtendedProgram, IExtendedSourceFile } from './internalTypings/TypeScriptInternals'; diff --git a/heft-plugins/heft-lint-plugin/src/Tslint.ts b/heft-plugins/heft-lint-plugin/src/Tslint.ts index b3dfb97f7f4..76250f8d08a 100644 --- a/heft-plugins/heft-lint-plugin/src/Tslint.ts +++ b/heft-plugins/heft-lint-plugin/src/Tslint.ts @@ -5,7 +5,8 @@ import * as path from 'path'; import * as crypto from 'crypto'; import type * as TTslint from 'tslint'; import type * as TTypescript from 'typescript'; -import { Import, JsonFile, FileError, FileSystem, type ITerminal } from '@rushstack/node-core-library'; +import { Import, JsonFile, FileError, FileSystem } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { LinterBase, type ILinterBaseOptions } from './LinterBase'; import type { IExtendedLinter } from './internalTypings/TslintInternals'; diff --git a/heft-plugins/heft-sass-plugin/CHANGELOG.json b/heft-plugins/heft-sass-plugin/CHANGELOG.json index 102121407d4..13738102121 100644 --- a/heft-plugins/heft-sass-plugin/CHANGELOG.json +++ b/heft-plugins/heft-sass-plugin/CHANGELOG.json @@ -1,6 +1,180 @@ { "name": "@rushstack/heft-sass-plugin", "entries": [ + { + "version": "0.13.13", + "tag": "@rushstack/heft-sass-plugin_v0.13.13", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.12`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.27`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "0.13.12", + "tag": "@rushstack/heft-sass-plugin_v0.13.12", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "0.13.11", + "tag": "@rushstack/heft-sass-plugin_v0.13.11", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.11`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.25`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "0.13.10", + "tag": "@rushstack/heft-sass-plugin_v0.13.10", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.10`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.24`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.2`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "0.13.9", + "tag": "@rushstack/heft-sass-plugin_v0.13.9", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.9`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.23`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "0.13.8", + "tag": "@rushstack/heft-sass-plugin_v0.13.8", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.22`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "0.13.7", + "tag": "@rushstack/heft-sass-plugin_v0.13.7", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-config-file\" to `0.14.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.21`" + }, + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.39.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "0.13.6", "tag": "@rushstack/heft-sass-plugin_v0.13.6", diff --git a/heft-plugins/heft-sass-plugin/CHANGELOG.md b/heft-plugins/heft-sass-plugin/CHANGELOG.md index a6807e2e3d9..a2d0abbfdfb 100644 --- a/heft-plugins/heft-sass-plugin/CHANGELOG.md +++ b/heft-plugins/heft-sass-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-sass-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.13.13 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.13.12 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.13.11 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.13.10 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.13.9 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.13.8 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.13.7 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.13.6 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/heft-plugins/heft-sass-plugin/package.json b/heft-plugins/heft-sass-plugin/package.json index adf573591bf..023d7ab6fb5 100644 --- a/heft-plugins/heft-sass-plugin/package.json +++ b/heft-plugins/heft-sass-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-sass-plugin", - "version": "0.13.6", + "version": "0.13.13", "description": "Heft plugin for SASS", "repository": { "type": "git", @@ -16,7 +16,7 @@ "_phase:test": "heft run --only test -- --clean" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3" + "@rushstack/heft": "^0.65.1" }, "dependencies": { "@rushstack/heft-config-file": "workspace:*", diff --git a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json index 3a924f52c5a..4166ab43565 100644 --- a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json +++ b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.json @@ -1,6 +1,168 @@ { "name": "@rushstack/heft-serverless-stack-plugin", "entries": [ + { + "version": "0.3.27", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "0.3.26", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.26", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "0.3.25", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "0.3.24", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "0.3.23", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "0.3.22", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "0.3.21", + "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "0.3.20", "tag": "@rushstack/heft-serverless-stack-plugin_v0.3.20", diff --git a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md index d860d95ea3b..6f1ceb2ac1b 100644 --- a/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md +++ b/heft-plugins/heft-serverless-stack-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-serverless-stack-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.3.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.3.26 +Tue, 20 Feb 2024 16:10:52 GMT + +_Version update only_ + +## 0.3.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.3.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.3.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.3.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.3.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.3.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/heft-plugins/heft-serverless-stack-plugin/package.json b/heft-plugins/heft-serverless-stack-plugin/package.json index b21d01908eb..8f080fbc0dd 100644 --- a/heft-plugins/heft-serverless-stack-plugin/package.json +++ b/heft-plugins/heft-serverless-stack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-serverless-stack-plugin", - "version": "0.3.20", + "version": "0.3.27", "description": "Heft plugin for building apps using the Serverless Stack (SST) framework", "repository": { "type": "git", @@ -15,7 +15,7 @@ "_phase:test": "heft run --only test -- --clean" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3" + "@rushstack/heft": "^0.65.1" }, "dependencies": { "@rushstack/node-core-library": "workspace:*" diff --git a/heft-plugins/heft-storybook-plugin/CHANGELOG.json b/heft-plugins/heft-storybook-plugin/CHANGELOG.json index 10438d535e1..782de6e062a 100644 --- a/heft-plugins/heft-storybook-plugin/CHANGELOG.json +++ b/heft-plugins/heft-storybook-plugin/CHANGELOG.json @@ -1,6 +1,189 @@ { "name": "@rushstack/heft-storybook-plugin", "entries": [ + { + "version": "0.6.4", + "tag": "@rushstack/heft-storybook-plugin_v0.6.4", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "0.6.3", + "tag": "@rushstack/heft-storybook-plugin_v0.6.3", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "0.6.2", + "tag": "@rushstack/heft-storybook-plugin_v0.6.2", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "0.6.1", + "tag": "@rushstack/heft-storybook-plugin_v0.6.1", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "0.6.0", + "tag": "@rushstack/heft-storybook-plugin_v0.6.0", + "date": "Mon, 12 Feb 2024 16:09:54 GMT", + "comments": { + "minor": [ + { + "comment": "Fix an issue where Webpack would run twice during static storybook builds." + }, + { + "comment": "Introduce a `captureWebpackStats` configuration option that, when enabled, will pass the `--webpack-stats-json` parameter to Storybook." + } + ] + } + }, + { + "version": "0.5.3", + "tag": "@rushstack/heft-storybook-plugin_v0.5.3", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "0.5.2", + "tag": "@rushstack/heft-storybook-plugin_v0.5.2", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "0.5.1", + "tag": "@rushstack/heft-storybook-plugin_v0.5.1", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack4-plugin\" to `0.10.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "0.5.0", "tag": "@rushstack/heft-storybook-plugin_v0.5.0", diff --git a/heft-plugins/heft-storybook-plugin/CHANGELOG.md b/heft-plugins/heft-storybook-plugin/CHANGELOG.md index 7b762664a11..e378b8f3b50 100644 --- a/heft-plugins/heft-storybook-plugin/CHANGELOG.md +++ b/heft-plugins/heft-storybook-plugin/CHANGELOG.md @@ -1,6 +1,49 @@ # Change Log - @rushstack/heft-storybook-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:29 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.6.4 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.6.3 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.6.2 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.6.1 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.6.0 +Mon, 12 Feb 2024 16:09:54 GMT + +### Minor changes + +- Fix an issue where Webpack would run twice during static storybook builds. +- Introduce a `captureWebpackStats` configuration option that, when enabled, will pass the `--webpack-stats-json` parameter to Storybook. + +## 0.5.3 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.5.2 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.5.1 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.5.0 Thu, 25 Jan 2024 01:09:29 GMT diff --git a/heft-plugins/heft-storybook-plugin/package.json b/heft-plugins/heft-storybook-plugin/package.json index afc4967d788..4061a22fe06 100644 --- a/heft-plugins/heft-storybook-plugin/package.json +++ b/heft-plugins/heft-storybook-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-storybook-plugin", - "version": "0.5.0", + "version": "0.6.4", "description": "Heft plugin for supporting UI development using Storybook", "repository": { "type": "git", @@ -16,10 +16,11 @@ "_phase:test": "heft run --only test -- --clean" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3" + "@rushstack/heft": "^0.65.1" }, "dependencies": { - "@rushstack/node-core-library": "workspace:*" + "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "@rushstack/heft": "workspace:*", diff --git a/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts b/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts index 68a11db2986..1b173303f7c 100644 --- a/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts +++ b/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts @@ -11,14 +11,12 @@ import { type IParsedPackageNameOrError, PackageName, SubprocessTerminator, - TerminalWritable, - type ITerminal, - TerminalProviderSeverity, FileConstants, type IPackageJson, InternalError, JsonFile } from '@rushstack/node-core-library'; +import { TerminalStreamWritable, type ITerminal, TerminalProviderSeverity } from '@rushstack/terminal'; import type { HeftConfiguration, IHeftTaskSession, @@ -152,6 +150,10 @@ export interface IStorybookPluginOptions { * `"cwdPackageName": "my-storybook-ui-library"` */ cwdPackageName?: string; + /** + * Specifies whether to capture the webpack stats for the storybook build by adding the `--webpack-stats-json` CLI flag. + */ + captureWebpackStats?: boolean; } interface IRunStorybookOptions { @@ -220,11 +222,11 @@ export default class StorybookPlugin implements IHeftTaskPlugin { - // Discard Webpack's configuration to prevent Webpack from running only when starting a storybook server if (accessor.parameters.isServeMode) { this._isServeMode = true; - accessor.hooks.onLoadConfiguration.tapPromise(PLUGIN_NAME, configureWebpackTap); } + // Discard Webpack's configuration to prevent Webpack from running only when performing Storybook build + accessor.hooks.onLoadConfiguration.tapPromise(PLUGIN_NAME, configureWebpackTap); } ); @@ -232,11 +234,11 @@ export default class StorybookPlugin implements IHeftTaskPlugin { - // Discard Webpack's configuration to prevent Webpack from running only when starting a storybook server if (accessor.parameters.isServeMode) { this._isServeMode = true; - accessor.hooks.onLoadConfiguration.tapPromise(PLUGIN_NAME, configureWebpackTap); } + // Discard Webpack's configuration to prevent Webpack from running only when performing Storybook build + accessor.hooks.onLoadConfiguration.tapPromise(PLUGIN_NAME, configureWebpackTap); } ); @@ -400,6 +402,9 @@ export default class StorybookPlugin implements IHeftTaskPlugin { const projectRoot: string = nodeJsPath.resolve(__dirname, '..', '..'); diff --git a/libraries/load-themed-styles/CHANGELOG.json b/libraries/load-themed-styles/CHANGELOG.json index cb61e75d46b..b796d8205cf 100644 --- a/libraries/load-themed-styles/CHANGELOG.json +++ b/libraries/load-themed-styles/CHANGELOG.json @@ -1,6 +1,90 @@ { "name": "@microsoft/load-themed-styles", "entries": [ + { + "version": "2.0.103", + "tag": "@microsoft/load-themed-styles_v2.0.103", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "2.0.102", + "tag": "@microsoft/load-themed-styles_v2.0.102", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "2.0.101", + "tag": "@microsoft/load-themed-styles_v2.0.101", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "2.0.100", + "tag": "@microsoft/load-themed-styles_v2.0.100", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "2.0.99", + "tag": "@microsoft/load-themed-styles_v2.0.99", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "2.0.98", + "tag": "@microsoft/load-themed-styles_v2.0.98", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "2.0.97", + "tag": "@microsoft/load-themed-styles_v2.0.97", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "2.0.96", "tag": "@microsoft/load-themed-styles_v2.0.96", diff --git a/libraries/load-themed-styles/CHANGELOG.md b/libraries/load-themed-styles/CHANGELOG.md index cb4541723f5..9c710d63d52 100644 --- a/libraries/load-themed-styles/CHANGELOG.md +++ b/libraries/load-themed-styles/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @microsoft/load-themed-styles -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 2.0.103 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 2.0.102 +Tue, 20 Feb 2024 16:10:52 GMT + +_Version update only_ + +## 2.0.101 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 2.0.100 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 2.0.99 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 2.0.98 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 2.0.97 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 2.0.96 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/load-themed-styles/package.json b/libraries/load-themed-styles/package.json index a550e19de47..5ac60a990a6 100644 --- a/libraries/load-themed-styles/package.json +++ b/libraries/load-themed-styles/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/load-themed-styles", - "version": "2.0.96", + "version": "2.0.103", "description": "Loads themed styles.", "license": "MIT", "repository": { diff --git a/libraries/localization-utilities/CHANGELOG.json b/libraries/localization-utilities/CHANGELOG.json index 358b84a8c11..53235e09dea 100644 --- a/libraries/localization-utilities/CHANGELOG.json +++ b/libraries/localization-utilities/CHANGELOG.json @@ -1,6 +1,132 @@ { "name": "@rushstack/localization-utilities", "entries": [ + { + "version": "0.9.27", + "tag": "@rushstack/localization-utilities_v0.9.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.9.26", + "tag": "@rushstack/localization-utilities_v0.9.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.9.25", + "tag": "@rushstack/localization-utilities_v0.9.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.9.24", + "tag": "@rushstack/localization-utilities_v0.9.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.9.23", + "tag": "@rushstack/localization-utilities_v0.9.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.9.22", + "tag": "@rushstack/localization-utilities_v0.9.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.9.21", + "tag": "@rushstack/localization-utilities_v0.9.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.9.20", "tag": "@rushstack/localization-utilities_v0.9.20", diff --git a/libraries/localization-utilities/CHANGELOG.md b/libraries/localization-utilities/CHANGELOG.md index bec82237ec0..1e129a5cf88 100644 --- a/libraries/localization-utilities/CHANGELOG.md +++ b/libraries/localization-utilities/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/localization-utilities -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.9.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.9.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.9.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.9.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.9.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.9.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.9.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.9.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/localization-utilities/package.json b/libraries/localization-utilities/package.json index 58df65d13bb..28983c26c8a 100644 --- a/libraries/localization-utilities/package.json +++ b/libraries/localization-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/localization-utilities", - "version": "0.9.20", + "version": "0.9.27", "description": "This plugin contains some useful functions for localization.", "main": "lib/index.js", "typings": "dist/localization-utilities.d.ts", @@ -17,6 +17,7 @@ }, "dependencies": { "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*", "@rushstack/typings-generator": "workspace:*", "pseudolocale": "~1.1.0", "xmldoc": "~1.1.2" diff --git a/libraries/localization-utilities/src/parsers/parseResx.ts b/libraries/localization-utilities/src/parsers/parseResx.ts index ed13b593190..2b06cda65df 100644 --- a/libraries/localization-utilities/src/parsers/parseResx.ts +++ b/libraries/localization-utilities/src/parsers/parseResx.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { type ITerminal, Text, type NewlineKind } from '@rushstack/node-core-library'; +import { Text, type NewlineKind } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { XmlDocument, type XmlElement } from 'xmldoc'; import type { ILocalizedString, ILocalizationFile, IParseFileOptions } from '../interfaces'; diff --git a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts index 145ac8fa0e0..a2b1c2dfcef 100644 --- a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts +++ b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts @@ -1,12 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { - FileSystem, - NewlineKind, - StringBufferTerminalProvider, - Terminal -} from '@rushstack/node-core-library'; +import { FileSystem, NewlineKind } from '@rushstack/node-core-library'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import type { IgnoreStringFunction } from '../../interfaces'; import { type IParseResxOptions, parseResx } from '../parseResx'; diff --git a/libraries/module-minifier/CHANGELOG.json b/libraries/module-minifier/CHANGELOG.json index 3953dc8f66f..786d7c3d515 100644 --- a/libraries/module-minifier/CHANGELOG.json +++ b/libraries/module-minifier/CHANGELOG.json @@ -1,6 +1,116 @@ { "name": "@rushstack/module-minifier", "entries": [ + { + "version": "0.4.27", + "tag": "@rushstack/module-minifier_v0.4.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.4.26", + "tag": "@rushstack/module-minifier_v0.4.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.4.25", + "tag": "@rushstack/module-minifier_v0.4.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.4.24", + "tag": "@rushstack/module-minifier_v0.4.24", + "date": "Sat, 17 Feb 2024 06:24:34 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.4.23", + "tag": "@rushstack/module-minifier_v0.4.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.4.22", + "tag": "@rushstack/module-minifier_v0.4.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.4.21", + "tag": "@rushstack/module-minifier_v0.4.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.4.20", "tag": "@rushstack/module-minifier_v0.4.20", diff --git a/libraries/module-minifier/CHANGELOG.md b/libraries/module-minifier/CHANGELOG.md index ce5d22f13a8..2a41ffcc637 100644 --- a/libraries/module-minifier/CHANGELOG.md +++ b/libraries/module-minifier/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @rushstack/module-minifier -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.4.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.4.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.4.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.4.24 +Sat, 17 Feb 2024 06:24:34 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.4.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.4.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.4.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.4.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/module-minifier/README.md b/libraries/module-minifier/README.md index bf2b247f59b..f532520ef55 100644 --- a/libraries/module-minifier/README.md +++ b/libraries/module-minifier/README.md @@ -7,6 +7,6 @@ This library wraps terser in convenient handles for parallelization. It powers @ - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/module-minifier/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/module-minifier/) +- [API Reference](https://api.rushstack.io/pages/module-minifier/) `@rushstack/module-minifier` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/module-minifier/package.json b/libraries/module-minifier/package.json index df283ed7bdb..3af5eaa0740 100644 --- a/libraries/module-minifier/package.json +++ b/libraries/module-minifier/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/module-minifier", - "version": "0.4.20", + "version": "0.4.27", "description": "Wrapper for terser to support bulk parallel minification.", "main": "lib/index.js", "typings": "dist/module-minifier.d.ts", diff --git a/libraries/node-core-library/CHANGELOG.json b/libraries/node-core-library/CHANGELOG.json index ec3e8ea3024..83bead7c8d4 100644 --- a/libraries/node-core-library/CHANGELOG.json +++ b/libraries/node-core-library/CHANGELOG.json @@ -1,6 +1,79 @@ { "name": "@rushstack/node-core-library", "entries": [ + { + "version": "4.0.1", + "tag": "@rushstack/node-core-library_v4.0.1", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "patch": [ + { + "comment": "Remove a no longer needed dependency on the `colors` package" + } + ] + } + }, + { + "version": "4.0.0", + "tag": "@rushstack/node-core-library_v4.0.0", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "major": [ + { + "comment": "(BREAKING CHANGE) Remove the Terminal and related APIs (Colors, AsciEscape, etc). These have been moved into the @rushstack/terminal package. See https://github.com/microsoft/rushstack/pull/3176 for details." + }, + { + "comment": "Remove deprecated `FileSystem.readFolder`, `FileSystem.readFolderAsync`, and `LegacyAdapters.sortStable` APIs." + } + ], + "minor": [ + { + "comment": "Graduate `Async` and `MinimumHeap` APIs from beta to public." + } + ] + } + }, + { + "version": "3.66.1", + "tag": "@rushstack/node-core-library_v3.66.1", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ] + } + }, + { + "version": "3.66.0", + "tag": "@rushstack/node-core-library_v3.66.0", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "patch": [ + { + "comment": "LockFile: prevent accidentaly deleting freshly created lockfile when multiple processes try to acquire the same lock on macOS/Linux" + } + ], + "minor": [ + { + "comment": "Add getStatistics() method to FileWriter instances" + } + ] + } + }, + { + "version": "3.65.0", + "tag": "@rushstack/node-core-library_v3.65.0", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "minor": [ + { + "comment": "Inclue a `Text.reverse` API for reversing a string." + } + ] + } + }, { "version": "3.64.2", "tag": "@rushstack/node-core-library_v3.64.2", diff --git a/libraries/node-core-library/CHANGELOG.md b/libraries/node-core-library/CHANGELOG.md index f35d7d1ec20..79f050fc2b8 100644 --- a/libraries/node-core-library/CHANGELOG.md +++ b/libraries/node-core-library/CHANGELOG.md @@ -1,6 +1,50 @@ # Change Log - @rushstack/node-core-library -This log was last generated on Thu, 25 Jan 2024 01:09:29 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 4.0.1 +Tue, 20 Feb 2024 21:45:10 GMT + +### Patches + +- Remove a no longer needed dependency on the `colors` package + +## 4.0.0 +Mon, 19 Feb 2024 21:54:27 GMT + +### Breaking changes + +- (BREAKING CHANGE) Remove the Terminal and related APIs (Colors, AsciEscape, etc). These have been moved into the @rushstack/terminal package. See https://github.com/microsoft/rushstack/pull/3176 for details. +- Remove deprecated `FileSystem.readFolder`, `FileSystem.readFolderAsync`, and `LegacyAdapters.sortStable` APIs. + +### Minor changes + +- Graduate `Async` and `MinimumHeap` APIs from beta to public. + +## 3.66.1 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 3.66.0 +Thu, 08 Feb 2024 01:09:21 GMT + +### Minor changes + +- Add getStatistics() method to FileWriter instances + +### Patches + +- LockFile: prevent accidentaly deleting freshly created lockfile when multiple processes try to acquire the same lock on macOS/Linux + +## 3.65.0 +Mon, 05 Feb 2024 23:46:52 GMT + +### Minor changes + +- Inclue a `Text.reverse` API for reversing a string. ## 3.64.2 Thu, 25 Jan 2024 01:09:29 GMT diff --git a/libraries/node-core-library/README.md b/libraries/node-core-library/README.md index ecdfac76aca..73e7901f785 100644 --- a/libraries/node-core-library/README.md +++ b/libraries/node-core-library/README.md @@ -33,6 +33,6 @@ demonstrated. If in doubt, create your own NPM package. - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/node-core-library/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/node-core-library/) +- [API Reference](https://api.rushstack.io/pages/node-core-library/) `@rushstack/node-core-library` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/node-core-library/package.json b/libraries/node-core-library/package.json index 864600f7dae..6e8438b6541 100644 --- a/libraries/node-core-library/package.json +++ b/libraries/node-core-library/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/node-core-library", - "version": "3.64.2", + "version": "4.0.1", "description": "Core libraries that every NodeJS toolchain project should use", "main": "lib/index.js", "typings": "dist/node-core-library.d.ts", @@ -16,7 +16,6 @@ "_phase:test": "heft run --only test -- --clean" }, "dependencies": { - "colors": "~1.2.1", "fs-extra": "~7.0.1", "import-lazy": "~4.0.0", "jju": "~1.4.0", diff --git a/libraries/node-core-library/src/Async.ts b/libraries/node-core-library/src/Async.ts index 1b3620e7082..c68f22240bb 100644 --- a/libraries/node-core-library/src/Async.ts +++ b/libraries/node-core-library/src/Async.ts @@ -7,7 +7,7 @@ * @remarks * Used with {@link Async.mapAsync} and {@link Async.forEachAsync}. * - * @beta + * @public */ export interface IAsyncParallelismOptions { /** @@ -21,7 +21,7 @@ export interface IAsyncParallelismOptions { * @remarks * Used with {@link Async.runWithRetriesAsync}. * - * @beta + * @public */ export interface IRunWithRetriesOptions { action: () => Promise | TResult; @@ -32,7 +32,7 @@ export interface IRunWithRetriesOptions { /** * Utilities for parallel asynchronous operations, for use with the system `Promise` APIs. * - * @beta + * @public */ export class Async { /** diff --git a/libraries/node-core-library/src/FileSystem.ts b/libraries/node-core-library/src/FileSystem.ts index 1fd59ecf3ff..a35f746718b 100644 --- a/libraries/node-core-library/src/FileSystem.ts +++ b/libraries/node-core-library/src/FileSystem.ts @@ -31,7 +31,7 @@ export type FolderItem = fs.Dirent; /* eslint-disable no-bitwise */ /** - * The options for {@link FileSystem.readFolder} + * The options for {@link FileSystem.readFolderItems} and {@link FileSystem.readFolderItemNames}. * @public */ export interface IFileSystemReadFolderOptions { @@ -595,25 +595,6 @@ export class FileSystem { }); } - /** - * @deprecated - * Use {@link FileSystem.readFolderItemNames} instead. - */ - public static readFolder(folderPath: string, options?: IFileSystemReadFolderOptions): string[] { - return FileSystem.readFolderItemNames(folderPath, options); - } - - /** - * @deprecated - * Use {@link FileSystem.readFolderItemNamesAsync} instead. - */ - public static async readFolderAsync( - folderPath: string, - options?: IFileSystemReadFolderOptions - ): Promise { - return await FileSystem.readFolderItemNamesAsync(folderPath, options); - } - /** * Reads the names of folder entries, not including "." or "..". * Behind the scenes it uses `fs.readdirSync()`. diff --git a/libraries/node-core-library/src/FileWriter.ts b/libraries/node-core-library/src/FileWriter.ts index 988c4c7a480..f7361582714 100644 --- a/libraries/node-core-library/src/FileWriter.ts +++ b/libraries/node-core-library/src/FileWriter.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import type { FileSystemStats } from './FileSystem'; import { Import } from './Import'; const fsx: typeof import('fs-extra') = Import.lazy('fs-extra', require); @@ -102,4 +103,16 @@ export class FileWriter { fsx.closeSync(fd); } } + + /** + * Gets the statistics for the given file handle. Throws if the file handle has been closed. + * Behind the scenes it uses `fs.statSync()`. + */ + public getStatistics(): FileSystemStats { + if (!this._fileDescriptor) { + throw new Error(`Cannot get file statistics, file descriptor has already been released.`); + } + + return fsx.fstatSync(this._fileDescriptor); + } } diff --git a/libraries/node-core-library/src/LegacyAdapters.ts b/libraries/node-core-library/src/LegacyAdapters.ts index d5edf1a3cec..ab9a4cd276b 100644 --- a/libraries/node-core-library/src/LegacyAdapters.ts +++ b/libraries/node-core-library/src/LegacyAdapters.ts @@ -96,17 +96,4 @@ export class LegacyAdapters { return errorObject; } } - - /** - * Prior to Node 11.x, the `Array.sort()` algorithm is not guaranteed to be stable. - * If you need a stable sort, you can use `sortStable()` as a workaround. - * - * @deprecated - * Use native Array.sort(), since Node < 14 is no longer supported - * @remarks - * On NodeJS 11.x and later, this method simply calls the native `Array.sort()`. - */ - public static sortStable(array: T[], compare?: (a: T, b: T) => number): void { - Array.prototype.sort.call(array, compare); - } } diff --git a/libraries/node-core-library/src/LockFile.ts b/libraries/node-core-library/src/LockFile.ts index 6684f945893..813be514e32 100644 --- a/libraries/node-core-library/src/LockFile.ts +++ b/libraries/node-core-library/src/LockFile.ts @@ -263,8 +263,7 @@ export class LockFile { // We should ideally maintain a dictionary of normalized acquired filenames lockFileHandle = FileWriter.open(pidLockFilePath); lockFileHandle.write(startTime); - - const currentBirthTimeMs: number = FileSystem.getStatistics(pidLockFilePath).birthtime.getTime(); + const currentBirthTimeMs: number = lockFileHandle.getStatistics().birthtime.getTime(); let smallestBirthTimeMs: number = currentBirthTimeMs; let smallestBirthTimePid: string = pid.toString(); @@ -297,8 +296,11 @@ export class LockFile { otherPidOldStartTime = FileSystem.readFile(fileInFolderPath); // check the timestamp of the file otherBirthtimeMs = FileSystem.getStatistics(fileInFolderPath).birthtime.getTime(); - } catch (err) { - // this means the file is probably deleted already + } catch (error) { + if (FileSystem.isNotExistError(error)) { + // the file is already deleted by other process, skip it + continue; + } } // if the otherPidOldStartTime is invalid, then we should look at the timestamp, diff --git a/libraries/node-core-library/src/MinimumHeap.ts b/libraries/node-core-library/src/MinimumHeap.ts index 587d5ddcb70..e7406619d65 100644 --- a/libraries/node-core-library/src/MinimumHeap.ts +++ b/libraries/node-core-library/src/MinimumHeap.ts @@ -5,7 +5,7 @@ * Implements a standard heap data structure for items of type T and a custom comparator. * The root will always be the minimum value as determined by the comparator. * - * @beta + * @public */ export class MinimumHeap { private readonly _items: T[] = []; diff --git a/libraries/node-core-library/src/Terminal/Colors.ts b/libraries/node-core-library/src/Terminal/Colors.ts deleted file mode 100644 index a1a10856b64..00000000000 --- a/libraries/node-core-library/src/Terminal/Colors.ts +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -/** - * @beta - */ -export interface IColorableSequence { - text: string; - isEol?: boolean; - foregroundColor?: ColorValue; - backgroundColor?: ColorValue; - textAttributes?: TextAttribute[]; -} - -export const eolSequence: IColorableSequence = { - isEol: true -} as IColorableSequence; - -/** - * Colors used with {@link IColorableSequence}. - * @beta - */ -export enum ColorValue { - Black, - Red, - Green, - Yellow, - Blue, - Magenta, - Cyan, - White, - Gray -} - -/** - * Text styles used with {@link IColorableSequence}. - * @beta - */ -export enum TextAttribute { - Bold, - Dim, - Underline, - Blink, - InvertColor, - Hidden -} - -export enum ConsoleColorCodes { - BlackForeground = 30, - RedForeground = 31, - GreenForeground = 32, - YellowForeground = 33, - BlueForeground = 34, - MagentaForeground = 35, - CyanForeground = 36, - WhiteForeground = 37, - GrayForeground = 90, - DefaultForeground = 39, - - BlackBackground = 40, - RedBackground = 41, - GreenBackground = 42, - YellowBackground = 43, - BlueBackground = 44, - MagentaBackground = 45, - CyanBackground = 46, - WhiteBackground = 47, - GrayBackground = 100, - DefaultBackground = 49, - - Bold = 1, - - // On Linux, the "BoldOff" code instead causes the text to be double-underlined: - // https://en.wikipedia.org/wiki/Talk:ANSI_escape_code#SGR_21%E2%80%94%60Bold_off%60_not_widely_supported - // Use "NormalColorOrIntensity" instead - // BoldOff = 21, - - Dim = 2, - NormalColorOrIntensity = 22, - Underline = 4, - UnderlineOff = 24, - Blink = 5, - BlinkOff = 25, - InvertColor = 7, - InvertColorOff = 27, - Hidden = 8, - HiddenOff = 28 -} - -/** - * The static functions on this class are used to produce colored text - * for use with the node-core-library terminal. - * - * @example - * terminal.writeLine(Colors.green('Green Text!'), ' ', Colors.blue('Blue Text!')); - * - * @beta - */ -export class Colors { - public static black(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Black - }; - } - - public static red(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Red - }; - } - - public static green(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Green - }; - } - - public static yellow(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Yellow - }; - } - - public static blue(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Blue - }; - } - - public static magenta(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Magenta - }; - } - - public static cyan(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Cyan - }; - } - - public static white(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.White - }; - } - - public static gray(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - foregroundColor: ColorValue.Gray - }; - } - - public static blackBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Black - }; - } - - public static redBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Red - }; - } - - public static greenBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Green - }; - } - - public static yellowBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Yellow - }; - } - - public static blueBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Blue - }; - } - - public static magentaBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Magenta - }; - } - - public static cyanBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Cyan - }; - } - - public static whiteBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.White - }; - } - - public static grayBackground(text: string | IColorableSequence): IColorableSequence { - return { - ...Colors._normalizeStringOrColorableSequence(text), - backgroundColor: ColorValue.Gray - }; - } - - public static bold(text: string | IColorableSequence): IColorableSequence { - return Colors._applyTextAttribute(text, TextAttribute.Bold); - } - - public static dim(text: string | IColorableSequence): IColorableSequence { - return Colors._applyTextAttribute(text, TextAttribute.Dim); - } - - public static underline(text: string | IColorableSequence): IColorableSequence { - return Colors._applyTextAttribute(text, TextAttribute.Underline); - } - - public static blink(text: string | IColorableSequence): IColorableSequence { - return Colors._applyTextAttribute(text, TextAttribute.Blink); - } - - public static invertColor(text: string | IColorableSequence): IColorableSequence { - return Colors._applyTextAttribute(text, TextAttribute.InvertColor); - } - - public static hidden(text: string | IColorableSequence): IColorableSequence { - return Colors._applyTextAttribute(text, TextAttribute.Hidden); - } - - /** - * If called with a string, returns the string wrapped in a {@link IColorableSequence}. - * If called with a {@link IColorableSequence}, returns the {@link IColorableSequence}. - * - * @internal - */ - public static _normalizeStringOrColorableSequence(value: string | IColorableSequence): IColorableSequence { - if (typeof value === 'string') { - return { - text: value - }; - } else { - return value; - } - } - - private static _applyTextAttribute( - text: string | IColorableSequence, - attribute: TextAttribute - ): IColorableSequence { - const sequence: IColorableSequence = Colors._normalizeStringOrColorableSequence(text); - if (!sequence.textAttributes) { - sequence.textAttributes = []; - } - - sequence.textAttributes.push(attribute); - return sequence; - } -} diff --git a/libraries/node-core-library/src/Terminal/Terminal.ts b/libraries/node-core-library/src/Terminal/Terminal.ts deleted file mode 100644 index 808d57c223d..00000000000 --- a/libraries/node-core-library/src/Terminal/Terminal.ts +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -import { type ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider'; -import { - type IColorableSequence, - ColorValue, - Colors, - eolSequence, - TextAttribute, - ConsoleColorCodes -} from './Colors'; -import type { ITerminal } from './ITerminal'; - -/** - * This class facilitates writing to a console. - * - * @beta - */ -export class Terminal implements ITerminal { - private _providers: Set; - - public constructor(provider: ITerminalProvider) { - this._providers = new Set(); - this._providers.add(provider); - } - - /** - * {@inheritdoc ITerminal.registerProvider} - */ - public registerProvider(provider: ITerminalProvider): void { - this._providers.add(provider); - } - - /** - * {@inheritdoc ITerminal.unregisterProvider} - */ - public unregisterProvider(provider: ITerminalProvider): void { - if (this._providers.has(provider)) { - this._providers.delete(provider); - } - } - - /** - * {@inheritdoc ITerminal.write} - */ - public write(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders(messageParts, TerminalProviderSeverity.log); - } - - /** - * {@inheritdoc ITerminal.writeLine} - */ - public writeLine(...messageParts: (string | IColorableSequence)[]): void { - this.write(...messageParts, eolSequence); - } - - /** - * {@inheritdoc ITerminal.writeWarning} - */ - public writeWarning(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders( - messageParts.map( - (part): IColorableSequence => ({ - ...Colors._normalizeStringOrColorableSequence(part), - foregroundColor: ColorValue.Yellow - }) - ), - TerminalProviderSeverity.warning - ); - } - - /** - * {@inheritdoc ITerminal.writeWarningLine} - */ - public writeWarningLine(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders( - [ - ...messageParts.map( - (part): IColorableSequence => ({ - ...Colors._normalizeStringOrColorableSequence(part), - foregroundColor: ColorValue.Yellow - }) - ), - eolSequence - ], - TerminalProviderSeverity.warning - ); - } - - /** - * {@inheritdoc ITerminal.writeError} - */ - public writeError(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders( - messageParts.map( - (part): IColorableSequence => ({ - ...Colors._normalizeStringOrColorableSequence(part), - foregroundColor: ColorValue.Red - }) - ), - TerminalProviderSeverity.error - ); - } - - /** - * {@inheritdoc ITerminal.writeErrorLine} - */ - public writeErrorLine(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders( - [ - ...messageParts.map( - (part): IColorableSequence => ({ - ...Colors._normalizeStringOrColorableSequence(part), - foregroundColor: ColorValue.Red - }) - ), - eolSequence - ], - TerminalProviderSeverity.error - ); - } - - /** - * {@inheritdoc ITerminal.writeVerbose} - */ - public writeVerbose(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders(messageParts, TerminalProviderSeverity.verbose); - } - - /** - * {@inheritdoc ITerminal.writeVerboseLine} - */ - public writeVerboseLine(...messageParts: (string | IColorableSequence)[]): void { - this.writeVerbose(...messageParts, eolSequence); - } - - /** - * {@inheritdoc ITerminal.writeDebug} - */ - public writeDebug(...messageParts: (string | IColorableSequence)[]): void { - this._writeSegmentsToProviders(messageParts, TerminalProviderSeverity.debug); - } - - /** - * {@inheritdoc ITerminal.writeDebugLine} - */ - public writeDebugLine(...messageParts: (string | IColorableSequence)[]): void { - this.writeDebug(...messageParts, eolSequence); - } - - private _writeSegmentsToProviders( - segments: (string | IColorableSequence)[], - severity: TerminalProviderSeverity - ): void { - const withColorText: { [eolChar: string]: string } = {}; - const withoutColorText: { [eolChar: string]: string } = {}; - let withColorLines: string[] | undefined; - let withoutColorLines: string[] | undefined; - - this._providers.forEach((provider) => { - const eol: string = provider.eolCharacter; - let textToWrite: string; - if (provider.supportsColor) { - if (!withColorLines) { - withColorLines = this._serializeFormattableTextSegments(segments, true); - } - - if (!withColorText[eol]) { - withColorText[eol] = withColorLines.join(eol); - } - - textToWrite = withColorText[eol]; - } else { - if (!withoutColorLines) { - withoutColorLines = this._serializeFormattableTextSegments(segments, false); - } - - if (!withoutColorText[eol]) { - withoutColorText[eol] = withoutColorLines.join(eol); - } - - textToWrite = withoutColorText[eol]; - } - - provider.write(textToWrite, severity); - }); - } - - private _serializeFormattableTextSegments( - segments: (string | IColorableSequence)[], - withColor: boolean - ): string[] { - const lines: string[] = []; - let segmentsToJoin: string[] = []; - let lastSegmentWasEol: boolean = false; - for (let i: number = 0; i < segments.length; i++) { - const segment: IColorableSequence = Colors._normalizeStringOrColorableSequence(segments[i]); - lastSegmentWasEol = !!segment.isEol; - if (lastSegmentWasEol) { - lines.push(segmentsToJoin.join('')); - segmentsToJoin = []; - } else { - if (withColor) { - const startColorCodes: number[] = []; - const endColorCodes: number[] = []; - switch (segment.foregroundColor) { - case ColorValue.Black: { - startColorCodes.push(ConsoleColorCodes.BlackForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Red: { - startColorCodes.push(ConsoleColorCodes.RedForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Green: { - startColorCodes.push(ConsoleColorCodes.GreenForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Yellow: { - startColorCodes.push(ConsoleColorCodes.YellowForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Blue: { - startColorCodes.push(ConsoleColorCodes.BlueForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Magenta: { - startColorCodes.push(ConsoleColorCodes.MagentaForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Cyan: { - startColorCodes.push(ConsoleColorCodes.CyanForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.White: { - startColorCodes.push(ConsoleColorCodes.WhiteForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - - case ColorValue.Gray: { - startColorCodes.push(ConsoleColorCodes.GrayForeground); - endColorCodes.push(ConsoleColorCodes.DefaultForeground); - break; - } - } - - switch (segment.backgroundColor) { - case ColorValue.Black: { - startColorCodes.push(ConsoleColorCodes.BlackBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Red: { - startColorCodes.push(ConsoleColorCodes.RedBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Green: { - startColorCodes.push(ConsoleColorCodes.GreenBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Yellow: { - startColorCodes.push(ConsoleColorCodes.YellowBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Blue: { - startColorCodes.push(ConsoleColorCodes.BlueBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Magenta: { - startColorCodes.push(ConsoleColorCodes.MagentaBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Cyan: { - startColorCodes.push(ConsoleColorCodes.CyanBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.White: { - startColorCodes.push(ConsoleColorCodes.WhiteBackground); - endColorCodes.push(ConsoleColorCodes.DefaultBackground); - break; - } - - case ColorValue.Gray: { - startColorCodes.push(ConsoleColorCodes.GrayBackground); - endColorCodes.push(49); - break; - } - } - - if (segment.textAttributes) { - for (const textAttribute of segment.textAttributes) { - switch (textAttribute) { - case TextAttribute.Bold: { - startColorCodes.push(ConsoleColorCodes.Bold); - endColorCodes.push(ConsoleColorCodes.NormalColorOrIntensity); - break; - } - - case TextAttribute.Dim: { - startColorCodes.push(ConsoleColorCodes.Dim); - endColorCodes.push(ConsoleColorCodes.NormalColorOrIntensity); - break; - } - - case TextAttribute.Underline: { - startColorCodes.push(ConsoleColorCodes.Underline); - endColorCodes.push(ConsoleColorCodes.UnderlineOff); - break; - } - - case TextAttribute.Blink: { - startColorCodes.push(ConsoleColorCodes.Blink); - endColorCodes.push(ConsoleColorCodes.BlinkOff); - break; - } - - case TextAttribute.InvertColor: { - startColorCodes.push(ConsoleColorCodes.InvertColor); - endColorCodes.push(ConsoleColorCodes.InvertColorOff); - break; - } - - case TextAttribute.Hidden: { - startColorCodes.push(ConsoleColorCodes.Hidden); - endColorCodes.push(ConsoleColorCodes.HiddenOff); - break; - } - } - } - } - - for (let j: number = 0; j < startColorCodes.length; j++) { - const code: number = startColorCodes[j]; - segmentsToJoin.push(...['\u001b[', code.toString(), 'm']); - } - - segmentsToJoin.push(segment.text); - - for (let j: number = endColorCodes.length - 1; j >= 0; j--) { - const code: number = endColorCodes[j]; - segmentsToJoin.push(...['\u001b[', code.toString(), 'm']); - } - } else { - segmentsToJoin.push(segment.text); - } - } - } - - if (segmentsToJoin.length > 0) { - lines.push(segmentsToJoin.join('')); - } - - if (lastSegmentWasEol) { - lines.push(''); - } - - return lines; - } -} diff --git a/libraries/node-core-library/src/Terminal/test/Colors.test.ts b/libraries/node-core-library/src/Terminal/test/Colors.test.ts deleted file mode 100644 index db9c79f92d3..00000000000 --- a/libraries/node-core-library/src/Terminal/test/Colors.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -import { Terminal } from '../Terminal'; -import { StringBufferTerminalProvider } from '../StringBufferTerminalProvider'; -import { createColorGrid } from './createColorGrid'; -import { AnsiEscape } from '../AnsiEscape'; -import { Colors } from '../Colors'; - -describe(Colors.name, () => { - let terminal: Terminal; - let provider: StringBufferTerminalProvider; - - beforeEach(() => { - provider = new StringBufferTerminalProvider(true); - terminal = new Terminal(provider); - }); - - test('writes color grid correctly', () => { - for (const line of createColorGrid()) { - terminal.writeLine(...line); - } - - expect(provider.getOutput()).toMatchSnapshot(); - }); - - test('correctly normalizes color codes for tests', () => { - for (const line of createColorGrid()) { - terminal.writeLine(...line); - } - - expect( - AnsiEscape.formatForTests(provider.getOutput({ normalizeSpecialCharacters: false })) - ).toMatchSnapshot(); - }); -}); diff --git a/libraries/node-core-library/src/Terminal/test/Terminal.test.ts b/libraries/node-core-library/src/Terminal/test/Terminal.test.ts deleted file mode 100644 index e59e52f4d77..00000000000 --- a/libraries/node-core-library/src/Terminal/test/Terminal.test.ts +++ /dev/null @@ -1,629 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -import { Terminal } from '../Terminal'; -import { StringBufferTerminalProvider } from '../StringBufferTerminalProvider'; -import { Colors } from '../Colors'; - -let terminal: Terminal; -let provider: StringBufferTerminalProvider; - -function verifyProvider(): void { - expect({ - log: provider.getOutput(), - warning: provider.getWarningOutput(), - error: provider.getErrorOutput(), - verbose: provider.getVerbose(), - debug: provider.getDebugOutput() - }).toMatchSnapshot(); -} - -describe('01 color enabled', () => { - beforeEach(() => { - provider = new StringBufferTerminalProvider(true); - terminal = new Terminal(provider); - }); - - describe('01 basic terminal functions', () => { - describe('01 write', () => { - test('01 writes a single message', () => { - terminal.write('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.write('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.write(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.write(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.write('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('02 writeLine', () => { - test('01 writes a single message', () => { - terminal.writeLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('03 writeWarning', () => { - test('01 writes a single message', () => { - terminal.writeWarning('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeWarning('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeWarning(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeWarning(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeWarning('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('04 writeWarningLine', () => { - test('01 writes a single message', () => { - terminal.writeWarningLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeWarningLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeWarningLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeWarningLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeWarningLine( - 'message 1', - Colors.green('message 2'), - 'message 3', - Colors.red('message 4') - ); - verifyProvider(); - }); - }); - - describe('05 writeError', () => { - test('01 writes a single message', () => { - terminal.writeError('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeError('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeError(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeError(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeError('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('06 writeErrorLine', () => { - test('01 writes a single message', () => { - terminal.writeErrorLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeErrorLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeErrorLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeErrorLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeErrorLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('07 writeVerbose', () => { - test('01 writes a single message', () => { - terminal.writeVerbose('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeVerbose('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeVerbose(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeVerbose(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeVerbose('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('08 writeVerboseLine', () => { - test('01 writes a single message', () => { - terminal.writeVerboseLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeVerboseLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeVerboseLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeVerboseLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeVerboseLine( - 'message 1', - Colors.green('message 2'), - 'message 3', - Colors.red('message 4') - ); - verifyProvider(); - }); - }); - }); - - test('05 writes to multiple streams', () => { - terminal.write('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeWarningLine('message 1', 'message 2'); - terminal.writeVerbose('test message'); - terminal.writeVerbose(Colors.green('message 1')); - terminal.writeLine(Colors.green('message 1')); - terminal.writeError('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeErrorLine('test message'); - terminal.writeVerboseLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeVerboseLine('test message'); - terminal.writeWarning(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarning('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeError('message 1', 'message 2'); - terminal.write(Colors.green('message 1')); - terminal.writeVerbose('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeErrorLine('message 1', 'message 2'); - terminal.write(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeVerbose('message 1', 'message 2'); - terminal.writeVerboseLine(Colors.green('message 1')); - terminal.writeLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeError(Colors.green('message 1')); - terminal.writeWarningLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.write('test message'); - terminal.writeWarningLine('test message'); - terminal.writeVerboseLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeVerboseLine('message 1', 'message 2'); - terminal.writeErrorLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeWarning('message 1', 'message 2'); - terminal.writeErrorLine(Colors.green('message 1')); - terminal.write('message 1', 'message 2'); - terminal.writeVerbose(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarning(Colors.green('message 1')); - terminal.writeLine('test message'); - terminal.writeError('test message'); - terminal.writeLine('message 1', 'message 2'); - terminal.writeErrorLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeError(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarningLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarningLine(Colors.green('message 1')); - verifyProvider(); - }); -}); - -describe('02 color disabled', () => { - beforeEach(() => { - provider = new StringBufferTerminalProvider(false); - terminal = new Terminal(provider); - }); - - describe('01 basic terminal functions', () => { - describe('01 write', () => { - test('01 writes a single message', () => { - terminal.write('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.write('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.write(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.write(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.write('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('02 writeLine', () => { - test('01 writes a single message', () => { - terminal.writeLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('03 writeWarning', () => { - test('01 writes a single message', () => { - terminal.writeWarning('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeWarning('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeWarning(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeWarning(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeWarning('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('04 writeWarningLine', () => { - test('01 writes a single message', () => { - terminal.writeWarningLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeWarningLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeWarningLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeWarningLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeWarningLine( - 'message 1', - Colors.green('message 2'), - 'message 3', - Colors.red('message 4') - ); - verifyProvider(); - }); - }); - - describe('05 writeError', () => { - test('01 writes a single message', () => { - terminal.writeError('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeError('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeError(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeError(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeError('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('06 writeErrorLine', () => { - test('01 writes a single message', () => { - terminal.writeErrorLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeErrorLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeErrorLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeErrorLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeErrorLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('07 writeVerbose', () => { - test('01 writes a single message', () => { - terminal.writeVerbose('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeVerbose('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeVerbose(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeVerbose(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeVerbose('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('08 writeVerboseLine', () => { - test('01 writes a single message', () => { - terminal.writeVerboseLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeVerboseLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeVerboseLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeVerboseLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeVerboseLine( - 'message 1', - Colors.green('message 2'), - 'message 3', - Colors.red('message 4') - ); - verifyProvider(); - }); - }); - - describe('09 writeDebug', () => { - test('01 writes a single message', () => { - terminal.writeDebug('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeDebug('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeDebug(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeDebug(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeDebug('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - - describe('10 writeDebugLine', () => { - test('01 writes a single message', () => { - terminal.writeDebugLine('test message'); - verifyProvider(); - }); - - test('02 writes multiple messages', () => { - terminal.writeDebugLine('message 1', 'message 2'); - verifyProvider(); - }); - - test('03 writes a message with colors', () => { - terminal.writeDebugLine(Colors.green('message 1')); - verifyProvider(); - }); - - test('04 writes a multiple messages with colors', () => { - terminal.writeDebugLine(Colors.green('message 1'), Colors.red('message 2')); - verifyProvider(); - }); - - test('05 writes a messages with colors interspersed with non-colored messages', () => { - terminal.writeDebugLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - verifyProvider(); - }); - }); - }); - - test('05 writes to multiple streams', () => { - terminal.write('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeWarningLine('message 1', 'message 2'); - terminal.writeVerbose('test message'); - terminal.writeVerbose(Colors.green('message 1')); - terminal.writeLine(Colors.green('message 1')); - terminal.writeError('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeErrorLine('test message'); - terminal.writeVerboseLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeVerboseLine('test message'); - terminal.writeWarning(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarning('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeError('message 1', 'message 2'); - terminal.write(Colors.green('message 1')); - terminal.writeVerbose('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeErrorLine('message 1', 'message 2'); - terminal.write(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeVerbose('message 1', 'message 2'); - terminal.writeVerboseLine(Colors.green('message 1')); - terminal.writeLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeError(Colors.green('message 1')); - terminal.writeWarningLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.write('test message'); - terminal.writeWarningLine('test message'); - terminal.writeVerboseLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeVerboseLine('message 1', 'message 2'); - terminal.writeErrorLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeLine('message 1', Colors.green('message 2'), 'message 3', Colors.red('message 4')); - terminal.writeWarning('message 1', 'message 2'); - terminal.writeErrorLine(Colors.green('message 1')); - terminal.write('message 1', 'message 2'); - terminal.writeVerbose(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarning(Colors.green('message 1')); - terminal.writeLine('test message'); - terminal.writeError('test message'); - terminal.writeLine('message 1', 'message 2'); - terminal.writeErrorLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeError(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarningLine(Colors.green('message 1'), Colors.red('message 2')); - terminal.writeWarningLine(Colors.green('message 1')); - verifyProvider(); - }); -}); diff --git a/libraries/node-core-library/src/Terminal/test/__snapshots__/Colors.test.ts.snap b/libraries/node-core-library/src/Terminal/test/__snapshots__/Colors.test.ts.snap deleted file mode 100644 index cdda0ea5d10..00000000000 --- a/libraries/node-core-library/src/Terminal/test/__snapshots__/Colors.test.ts.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Colors correctly normalizes color codes for tests 1`] = `"X[black]X[default][white]X[default][gray]X[default][magenta]X[default][red]X[default][yellow]X[default][green]X[default][cyan]X[default][blue]X[default][n][black-bg]X[default-bg][black][black-bg]X[default-bg][default][white][black-bg]X[default-bg][default][gray][black-bg]X[default-bg][default][magenta][black-bg]X[default-bg][default][red][black-bg]X[default-bg][default][yellow][black-bg]X[default-bg][default][green][black-bg]X[default-bg][default][cyan][black-bg]X[default-bg][default][blue][black-bg]X[default-bg][default][n][white-bg]X[default-bg][black][white-bg]X[default-bg][default][white][white-bg]X[default-bg][default][gray][white-bg]X[default-bg][default][magenta][white-bg]X[default-bg][default][red][white-bg]X[default-bg][default][yellow][white-bg]X[default-bg][default][green][white-bg]X[default-bg][default][cyan][white-bg]X[default-bg][default][blue][white-bg]X[default-bg][default][n][gray-bg]X[default-bg][black][gray-bg]X[default-bg][default][white][gray-bg]X[default-bg][default][gray][gray-bg]X[default-bg][default][magenta][gray-bg]X[default-bg][default][red][gray-bg]X[default-bg][default][yellow][gray-bg]X[default-bg][default][green][gray-bg]X[default-bg][default][cyan][gray-bg]X[default-bg][default][blue][gray-bg]X[default-bg][default][n][magenta-bg]X[default-bg][black][magenta-bg]X[default-bg][default][white][magenta-bg]X[default-bg][default][gray][magenta-bg]X[default-bg][default][magenta][magenta-bg]X[default-bg][default][red][magenta-bg]X[default-bg][default][yellow][magenta-bg]X[default-bg][default][green][magenta-bg]X[default-bg][default][cyan][magenta-bg]X[default-bg][default][blue][magenta-bg]X[default-bg][default][n][red-bg]X[default-bg][black][red-bg]X[default-bg][default][white][red-bg]X[default-bg][default][gray][red-bg]X[default-bg][default][magenta][red-bg]X[default-bg][default][red][red-bg]X[default-bg][default][yellow][red-bg]X[default-bg][default][green][red-bg]X[default-bg][default][cyan][red-bg]X[default-bg][default][blue][red-bg]X[default-bg][default][n][yellow-bg]X[default-bg][black][yellow-bg]X[default-bg][default][white][yellow-bg]X[default-bg][default][gray][yellow-bg]X[default-bg][default][magenta][yellow-bg]X[default-bg][default][red][yellow-bg]X[default-bg][default][yellow][yellow-bg]X[default-bg][default][green][yellow-bg]X[default-bg][default][cyan][yellow-bg]X[default-bg][default][blue][yellow-bg]X[default-bg][default][n][green-bg]X[default-bg][black][green-bg]X[default-bg][default][white][green-bg]X[default-bg][default][gray][green-bg]X[default-bg][default][magenta][green-bg]X[default-bg][default][red][green-bg]X[default-bg][default][yellow][green-bg]X[default-bg][default][green][green-bg]X[default-bg][default][cyan][green-bg]X[default-bg][default][blue][green-bg]X[default-bg][default][n][cyan-bg]X[default-bg][black][cyan-bg]X[default-bg][default][white][cyan-bg]X[default-bg][default][gray][cyan-bg]X[default-bg][default][magenta][cyan-bg]X[default-bg][default][red][cyan-bg]X[default-bg][default][yellow][cyan-bg]X[default-bg][default][green][cyan-bg]X[default-bg][default][cyan][cyan-bg]X[default-bg][default][blue][cyan-bg]X[default-bg][default][n][blue-bg]X[default-bg][black][blue-bg]X[default-bg][default][white][blue-bg]X[default-bg][default][gray][blue-bg]X[default-bg][default][magenta][blue-bg]X[default-bg][default][red][blue-bg]X[default-bg][default][yellow][blue-bg]X[default-bg][default][green][blue-bg]X[default-bg][default][cyan][blue-bg]X[default-bg][default][blue][blue-bg]X[default-bg][default][n]"`; - -exports[`Colors writes color grid correctly 1`] = `"X[black]X[default][white]X[default][gray]X[default][magenta]X[default][red]X[default][yellow]X[default][green]X[default][cyan]X[default][blue]X[default][n][black-bg]X[default-bg][black][black-bg]X[default-bg][default][white][black-bg]X[default-bg][default][gray][black-bg]X[default-bg][default][magenta][black-bg]X[default-bg][default][red][black-bg]X[default-bg][default][yellow][black-bg]X[default-bg][default][green][black-bg]X[default-bg][default][cyan][black-bg]X[default-bg][default][blue][black-bg]X[default-bg][default][n][white-bg]X[default-bg][black][white-bg]X[default-bg][default][white][white-bg]X[default-bg][default][gray][white-bg]X[default-bg][default][magenta][white-bg]X[default-bg][default][red][white-bg]X[default-bg][default][yellow][white-bg]X[default-bg][default][green][white-bg]X[default-bg][default][cyan][white-bg]X[default-bg][default][blue][white-bg]X[default-bg][default][n][gray-bg]X[default-bg][black][gray-bg]X[default-bg][default][white][gray-bg]X[default-bg][default][gray][gray-bg]X[default-bg][default][magenta][gray-bg]X[default-bg][default][red][gray-bg]X[default-bg][default][yellow][gray-bg]X[default-bg][default][green][gray-bg]X[default-bg][default][cyan][gray-bg]X[default-bg][default][blue][gray-bg]X[default-bg][default][n][magenta-bg]X[default-bg][black][magenta-bg]X[default-bg][default][white][magenta-bg]X[default-bg][default][gray][magenta-bg]X[default-bg][default][magenta][magenta-bg]X[default-bg][default][red][magenta-bg]X[default-bg][default][yellow][magenta-bg]X[default-bg][default][green][magenta-bg]X[default-bg][default][cyan][magenta-bg]X[default-bg][default][blue][magenta-bg]X[default-bg][default][n][red-bg]X[default-bg][black][red-bg]X[default-bg][default][white][red-bg]X[default-bg][default][gray][red-bg]X[default-bg][default][magenta][red-bg]X[default-bg][default][red][red-bg]X[default-bg][default][yellow][red-bg]X[default-bg][default][green][red-bg]X[default-bg][default][cyan][red-bg]X[default-bg][default][blue][red-bg]X[default-bg][default][n][yellow-bg]X[default-bg][black][yellow-bg]X[default-bg][default][white][yellow-bg]X[default-bg][default][gray][yellow-bg]X[default-bg][default][magenta][yellow-bg]X[default-bg][default][red][yellow-bg]X[default-bg][default][yellow][yellow-bg]X[default-bg][default][green][yellow-bg]X[default-bg][default][cyan][yellow-bg]X[default-bg][default][blue][yellow-bg]X[default-bg][default][n][green-bg]X[default-bg][black][green-bg]X[default-bg][default][white][green-bg]X[default-bg][default][gray][green-bg]X[default-bg][default][magenta][green-bg]X[default-bg][default][red][green-bg]X[default-bg][default][yellow][green-bg]X[default-bg][default][green][green-bg]X[default-bg][default][cyan][green-bg]X[default-bg][default][blue][green-bg]X[default-bg][default][n][cyan-bg]X[default-bg][black][cyan-bg]X[default-bg][default][white][cyan-bg]X[default-bg][default][gray][cyan-bg]X[default-bg][default][magenta][cyan-bg]X[default-bg][default][red][cyan-bg]X[default-bg][default][yellow][cyan-bg]X[default-bg][default][green][cyan-bg]X[default-bg][default][cyan][cyan-bg]X[default-bg][default][blue][cyan-bg]X[default-bg][default][n][blue-bg]X[default-bg][black][blue-bg]X[default-bg][default][white][blue-bg]X[default-bg][default][gray][blue-bg]X[default-bg][default][magenta][blue-bg]X[default-bg][default][red][blue-bg]X[default-bg][default][yellow][blue-bg]X[default-bg][default][green][blue-bg]X[default-bg][default][cyan][blue-bg]X[default-bg][default][blue][blue-bg]X[default-bg][default][n]"`; diff --git a/libraries/node-core-library/src/Terminal/test/__snapshots__/Terminal.test.ts.snap b/libraries/node-core-library/src/Terminal/test/__snapshots__/Terminal.test.ts.snap deleted file mode 100644 index f22a28ef5ff..00000000000 --- a/libraries/node-core-library/src/Terminal/test/__snapshots__/Terminal.test.ts.snap +++ /dev/null @@ -1,921 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`01 color enabled 01 basic terminal functions 01 write 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "test message", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 01 write 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 01 write 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "[green]message 1[default]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "[green]message 1[default][red]message 2[default]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1[green]message 2[default]message 3[red]message 4[default]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "test message[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "[green]message 1[default][n]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "[green]message 1[default][red]message 2[default][n]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1[green]message 2[default]message 3[red]message 4[default][n]", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 03 writeWarning 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]test message[default]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][yellow]message 2[default]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][yellow]message 2[default]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]test message[default][n]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][yellow]message 2[default][n]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][n]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][yellow]message 2[default][n]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "[yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", -} -`; - -exports[`01 color enabled 01 basic terminal functions 05 writeError 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "[red]test message[default]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 05 writeError 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 05 writeError 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "[red]test message[default][n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default][n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default][n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 07 writeVerbose 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "test message", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "[green]message 1[default]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "[green]message 1[default][red]message 2[default]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1[green]message 2[default]message 3[red]message 4[default]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "test message[n]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2[n]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "[green]message 1[default][n]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "[green]message 1[default][red]message 2[default][n]", - "warning": "", -} -`; - -exports[`01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1[green]message 2[default]message 3[red]message 4[default][n]", - "warning": "", -} -`; - -exports[`01 color enabled 05 writes to multiple streams 1`] = ` -Object { - "debug": "", - "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][red]test message[default][n][red]message 1[default][red]message 2[default][red]message 1[default][red]message 2[default][n][red]message 1[default][red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n][red]message 1[default][n][red]test message[default][red]message 1[default][red]message 2[default][n][red]message 1[default][red]message 2[default]", - "log": "message 1[green]message 2[default]message 3[red]message 4[default][green]message 1[default][n][green]message 1[default][green]message 1[default][red]message 2[default][green]message 1[default][red]message 2[default][n]test messagemessage 1[green]message 2[default]message 3[red]message 4[default][n]message 1message 2test message[n]message 1message 2[n]", - "verbose": "test message[green]message 1[default]message 1[green]message 2[default]message 3[red]message 4[default][n]test message[n]message 1[green]message 2[default]message 3[red]message 4[default]message 1message 2[green]message 1[default][n][green]message 1[default][red]message 2[default][n]message 1message 2[n][green]message 1[default][red]message 2[default]", - "warning": "[yellow]message 1[default][yellow]message 2[default][n][yellow]message 1[default][yellow]message 2[default][yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n][yellow]test message[default][n][yellow]message 1[default][yellow]message 2[default][yellow]message 1[default][yellow]message 1[default][yellow]message 2[default][n][yellow]message 1[default][n]", -} -`; - -exports[`02 color disabled 01 basic terminal functions 01 write 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "test message", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 01 write 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 01 write 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2message 3message 4", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "test message[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "message 1message 2message 3message 4[n]", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 03 writeWarning 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "test message", -} -`; - -exports[`02 color disabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1message 2", -} -`; - -exports[`02 color disabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1", -} -`; - -exports[`02 color disabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1message 2", -} -`; - -exports[`02 color disabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1message 2message 3message 4", -} -`; - -exports[`02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "test message[n]", -} -`; - -exports[`02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1message 2[n]", -} -`; - -exports[`02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1[n]", -} -`; - -exports[`02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1message 2[n]", -} -`; - -exports[`02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "", - "warning": "message 1message 2message 3message 4[n]", -} -`; - -exports[`02 color disabled 01 basic terminal functions 05 writeError 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "test message", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 05 writeError 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "message 1message 2", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 05 writeError 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "message 1", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "message 1message 2", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "message 1message 2message 3message 4", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "test message[n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "message 1message 2[n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "message 1[n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "message 1message 2[n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "message 1message 2message 3message 4[n]", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 07 writeVerbose 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "test message", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2message 3message 4", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "test message[n]", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2[n]", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1[n]", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2[n]", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "", - "error": "", - "log": "", - "verbose": "message 1message 2message 3message 4[n]", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 09 writeDebug 01 writes a single message 1`] = ` -Object { - "debug": "test message", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 09 writeDebug 02 writes multiple messages 1`] = ` -Object { - "debug": "message 1message 2", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 09 writeDebug 03 writes a message with colors 1`] = ` -Object { - "debug": "message 1", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 09 writeDebug 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "message 1message 2", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 09 writeDebug 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "message 1message 2message 3message 4", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message 1`] = ` -Object { - "debug": "test message[n]", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages 1`] = ` -Object { - "debug": "message 1message 2[n]", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors 1`] = ` -Object { - "debug": "message 1[n]", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors 1`] = ` -Object { - "debug": "message 1message 2[n]", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` -Object { - "debug": "message 1message 2message 3message 4[n]", - "error": "", - "log": "", - "verbose": "", - "warning": "", -} -`; - -exports[`02 color disabled 05 writes to multiple streams 1`] = ` -Object { - "debug": "", - "error": "message 1message 2message 3message 4test message[n]message 1message 2message 1message 2[n]message 1message 1message 2message 3message 4[n]message 1[n]test messagemessage 1message 2[n]message 1message 2", - "log": "message 1message 2message 3message 4message 1[n]message 1message 1message 2message 1message 2[n]test messagemessage 1message 2message 3message 4[n]message 1message 2test message[n]message 1message 2[n]", - "verbose": "test messagemessage 1message 1message 2message 3message 4[n]test message[n]message 1message 2message 3message 4message 1message 2message 1[n]message 1message 2[n]message 1message 2[n]message 1message 2", - "warning": "message 1message 2[n]message 1message 2message 1message 2message 3message 4message 1message 2message 3message 4[n]test message[n]message 1message 2message 1message 1message 2[n]message 1[n]", -} -`; diff --git a/libraries/node-core-library/src/Terminal/test/createColorGrid.ts b/libraries/node-core-library/src/Terminal/test/createColorGrid.ts deleted file mode 100644 index de6c3af465f..00000000000 --- a/libraries/node-core-library/src/Terminal/test/createColorGrid.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -/** - * This file is a little program that prints all of the colors to the console - */ - -import { Colors, type IColorableSequence } from '../../index'; - -export function createColorGrid( - attributeFunction?: (text: string | IColorableSequence) => IColorableSequence -): IColorableSequence[][] { - const foregroundFunctions: ((text: string | IColorableSequence) => IColorableSequence)[] = [ - (text) => Colors._normalizeStringOrColorableSequence(text), - Colors.black, - Colors.white, - Colors.gray, - Colors.magenta, - Colors.red, - Colors.yellow, - Colors.green, - Colors.cyan, - Colors.blue - ]; - - const backgroundFunctions: ((text: string | IColorableSequence) => IColorableSequence)[] = [ - (text) => Colors._normalizeStringOrColorableSequence(text), - Colors.blackBackground, - Colors.whiteBackground, - Colors.grayBackground, - Colors.magentaBackground, - Colors.redBackground, - Colors.yellowBackground, - Colors.greenBackground, - Colors.cyanBackground, - Colors.blueBackground - ]; - - const lines: IColorableSequence[][] = []; - - for (const backgroundFunction of backgroundFunctions) { - const sequences: IColorableSequence[] = []; - - for (const foregroundFunction of foregroundFunctions) { - let sequence: IColorableSequence = backgroundFunction(foregroundFunction('X')); - if (attributeFunction) { - sequence = attributeFunction(sequence); - } - - sequences.push(sequence); - } - - lines.push(sequences); - } - - return lines; -} diff --git a/libraries/node-core-library/src/Text.ts b/libraries/node-core-library/src/Text.ts index 75895cf0515..e3e801e6595 100644 --- a/libraries/node-core-library/src/Text.ts +++ b/libraries/node-core-library/src/Text.ts @@ -271,4 +271,12 @@ export class Text { yield remaining; } } + + /** + * Returns a new string that is the input string with the order of characters reversed. + */ + public static reverse(s: string): string { + // Benchmarks of several algorithms: https://jsbench.me/4bkfflcm2z + return s.split('').reduce((newString, char) => char + newString, ''); + } } diff --git a/libraries/node-core-library/src/index.ts b/libraries/node-core-library/src/index.ts index 66589e27de1..6683987fdcb 100644 --- a/libraries/node-core-library/src/index.ts +++ b/libraries/node-core-library/src/index.ts @@ -8,7 +8,6 @@ */ export { AlreadyReportedError } from './AlreadyReportedError'; -export { AnsiEscape, IAnsiEscapeConvertForTestsOptions } from './Terminal/AnsiEscape'; export { Async, AsyncQueue, IAsyncParallelismOptions, IRunWithRetriesOptions } from './Async'; export { Brand } from './PrimitiveTypes'; export { FileConstants, FolderConstants } from './Constants'; @@ -102,21 +101,4 @@ export { FileWriter, IFileWriterFlags } from './FileWriter'; export { LegacyAdapters, LegacyCallback } from './LegacyAdapters'; export { StringBuilder, IStringBuilder } from './StringBuilder'; export { ISubprocessOptions, SubprocessTerminator } from './SubprocessTerminator'; -export { ITerminal } from './Terminal/ITerminal'; -export { Terminal } from './Terminal/Terminal'; -export { Colors, IColorableSequence, ColorValue, TextAttribute } from './Terminal/Colors'; -export { ITerminalProvider, TerminalProviderSeverity } from './Terminal/ITerminalProvider'; -export { ConsoleTerminalProvider, IConsoleTerminalProviderOptions } from './Terminal/ConsoleTerminalProvider'; -export { - StringBufferTerminalProvider, - IStringBufferOutputOptions -} from './Terminal/StringBufferTerminalProvider'; -export { - PrefixProxyTerminalProvider, - IPrefixProxyTerminalProviderOptions, - IDynamicPrefixProxyTerminalProviderOptions, - IPrefixProxyTerminalProviderOptionsBase, - IStaticPrefixProxyTerminalProviderOptions -} from './Terminal/PrefixProxyTerminalProvider'; -export { TerminalWritable, ITerminalWritableOptions } from './Terminal/TerminalWritable'; export { TypeUuid } from './TypeUuid'; diff --git a/libraries/node-core-library/src/test/LockFile.test.ts b/libraries/node-core-library/src/test/LockFile.test.ts index 34c5dd48736..9661e84b387 100644 --- a/libraries/node-core-library/src/test/LockFile.test.ts +++ b/libraries/node-core-library/src/test/LockFile.test.ts @@ -16,6 +16,7 @@ const libTestFolder: string = path.resolve(__dirname, '../../lib/test'); describe(LockFile.name, () => { afterEach(() => { + jest.restoreAllMocks(); setLockFileGetProcessStartTime(getProcessStartTime); }); @@ -201,6 +202,86 @@ describe(LockFile.name, () => { // this lock should be undefined since there is an existing lock expect(lock).toBeUndefined(); }); + + test('deletes other hanging lockfiles if corresponding processes are not running anymore', () => { + // ensure test folder is clean + const testFolder: string = path.join(libTestFolder, '4'); + FileSystem.ensureEmptyFolder(testFolder); + + const resourceName: string = 'test'; + + const otherPid: number = 999999999; + const otherPidInitialStartTime: string = '2012-01-02 12:53:12'; + + // simulate a hanging lockfile that was not cleaned by other process + const otherPidLockFileName: string = LockFile.getLockFilePath(testFolder, resourceName, otherPid); + const lockFileHandle: FileWriter = FileWriter.open(otherPidLockFileName); + lockFileHandle.write(otherPidInitialStartTime); + lockFileHandle.close(); + FileSystem.updateTimes(otherPidLockFileName, { + accessedTime: 10000, + modifiedTime: 10000 + }); + + // return undefined as if the process was not running anymore + setLockFileGetProcessStartTime((pid: number) => { + return pid === otherPid ? undefined : getProcessStartTime(pid); + }); + + const deleteFileSpy = jest.spyOn(FileSystem, 'deleteFile'); + LockFile.tryAcquire(testFolder, resourceName); + + expect(deleteFileSpy).toHaveBeenCalledTimes(1); + expect(deleteFileSpy).toHaveBeenNthCalledWith(1, otherPidLockFileName); + }); + + test('doesn’t attempt deleting other process lockfile if it is released in the middle of acquiring process', () => { + // ensure test folder is clean + const testFolder: string = path.join(libTestFolder, '5'); + FileSystem.ensureEmptyFolder(testFolder); + + const resourceName: string = 'test'; + + const otherPid: number = 999999999; + const otherPidStartTime: string = '2012-01-02 12:53:12'; + + const otherPidLockFileName: string = LockFile.getLockFilePath(testFolder, resourceName, otherPid); + + // create an open lockfile for other process + const lockFileHandle: FileWriter = FileWriter.open(otherPidLockFileName); + lockFileHandle.write(otherPidStartTime); + lockFileHandle.close(); + FileSystem.updateTimes(otherPidLockFileName, { + accessedTime: 10000, + modifiedTime: 10000 + }); + + // return other process start time as if it was still running + setLockFileGetProcessStartTime((pid: number) => { + return pid === otherPid ? otherPidStartTime : getProcessStartTime(pid); + }); + + const originalReadFile = FileSystem.readFile; + jest.spyOn(FileSystem, 'readFile').mockImplementation((filePath: string) => { + if (filePath === otherPidLockFileName) { + // simulate other process lock release right before the current process reads + // other process lockfile to decide on next steps for acquiring the lock + FileSystem.deleteFile(filePath); + } + + return originalReadFile(filePath); + }); + + const deleteFileSpy = jest.spyOn(FileSystem, 'deleteFile'); + + LockFile.tryAcquire(testFolder, resourceName); + + // Ensure there were no other FileSystem.deleteFile calls after our lock release simulation. + // An extra attempt to delete the lockfile might lead to unexpectedly deleting a new lockfile + // created by another process right after releasing/deleting the previous lockfile + expect(deleteFileSpy).toHaveBeenCalledTimes(1); + expect(deleteFileSpy).toHaveBeenNthCalledWith(1, otherPidLockFileName); + }); }); } diff --git a/libraries/operation-graph/CHANGELOG.json b/libraries/operation-graph/CHANGELOG.json index 8a3d7da2c31..099ebedd2a4 100644 --- a/libraries/operation-graph/CHANGELOG.json +++ b/libraries/operation-graph/CHANGELOG.json @@ -1,6 +1,77 @@ { "name": "@rushstack/operation-graph", "entries": [ + { + "version": "0.2.11", + "tag": "@rushstack/operation-graph_v0.2.11", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + } + ] + } + }, + { + "version": "0.2.10", + "tag": "@rushstack/operation-graph_v0.2.10", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + } + ] + } + }, + { + "version": "0.2.9", + "tag": "@rushstack/operation-graph_v0.2.9", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + } + ] + } + }, + { + "version": "0.2.8", + "tag": "@rushstack/operation-graph_v0.2.8", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + } + ] + } + }, + { + "version": "0.2.7", + "tag": "@rushstack/operation-graph_v0.2.7", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + } + ] + } + }, { "version": "0.2.6", "tag": "@rushstack/operation-graph_v0.2.6", diff --git a/libraries/operation-graph/CHANGELOG.md b/libraries/operation-graph/CHANGELOG.md index 9bf938e4413..5c7a601bce2 100644 --- a/libraries/operation-graph/CHANGELOG.md +++ b/libraries/operation-graph/CHANGELOG.md @@ -1,6 +1,33 @@ # Change Log - @rushstack/operation-graph -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.2.11 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.2.10 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.2.9 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.2.8 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.2.7 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.2.6 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/operation-graph/README.md b/libraries/operation-graph/README.md index 7f442043cb7..f04f7c25777 100644 --- a/libraries/operation-graph/README.md +++ b/libraries/operation-graph/README.md @@ -7,6 +7,6 @@ This library contains logic for managing and executing tasks in a directed acycl - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/operation-graph/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/operation-graph/) +- [API Reference](https://api.rushstack.io/pages/operation-graph/) `@rushstack/operation-graph` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/operation-graph/package.json b/libraries/operation-graph/package.json index 1f919d8a812..2d7e9317f52 100644 --- a/libraries/operation-graph/package.json +++ b/libraries/operation-graph/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/operation-graph", - "version": "0.2.6", + "version": "0.2.11", "description": "Library for managing and executing operations in a directed acyclic graph.", "main": "lib/index.js", "typings": "dist/operation-graph.d.ts", @@ -16,7 +16,8 @@ "_phase:test": "heft run --only test -- --clean" }, "dependencies": { - "@rushstack/node-core-library": "workspace:*" + "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "local-eslint-config": "workspace:*", diff --git a/libraries/operation-graph/src/Operation.ts b/libraries/operation-graph/src/Operation.ts index 9e762d3e674..167c7abcafb 100644 --- a/libraries/operation-graph/src/Operation.ts +++ b/libraries/operation-graph/src/Operation.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { InternalError, type ITerminal } from '@rushstack/node-core-library'; +import { InternalError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { Stopwatch } from './Stopwatch'; import type { diff --git a/libraries/operation-graph/src/OperationExecutionManager.ts b/libraries/operation-graph/src/OperationExecutionManager.ts index af916732a3c..a4f3b1b360d 100644 --- a/libraries/operation-graph/src/OperationExecutionManager.ts +++ b/libraries/operation-graph/src/OperationExecutionManager.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Async, type ITerminal } from '@rushstack/node-core-library'; +import { Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IOperationState } from './IOperationRunner'; import type { IExecuteOperationContext, Operation } from './Operation'; diff --git a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts index 840cd35526a..ccb4dd189a3 100644 --- a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts +++ b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { type ITerminal, StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { type ITerminal, StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { Operation } from '../Operation'; import { OperationExecutionManager } from '../OperationExecutionManager'; import { OperationStatus } from '../OperationStatus'; diff --git a/libraries/package-deps-hash/CHANGELOG.json b/libraries/package-deps-hash/CHANGELOG.json index bf604c68cf3..25bfc0cc8f3 100644 --- a/libraries/package-deps-hash/CHANGELOG.json +++ b/libraries/package-deps-hash/CHANGELOG.json @@ -1,6 +1,115 @@ { "name": "@rushstack/package-deps-hash", "entries": [ + { + "version": "4.1.28", + "tag": "@rushstack/package-deps-hash_v4.1.28", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "4.1.27", + "tag": "@rushstack/package-deps-hash_v4.1.27", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "4.1.26", + "tag": "@rushstack/package-deps-hash_v4.1.26", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "patch": [ + { + "comment": "Fix a formatting issue with the LICENSE." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "4.1.25", + "tag": "@rushstack/package-deps-hash_v4.1.25", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "4.1.24", + "tag": "@rushstack/package-deps-hash_v4.1.24", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "4.1.23", + "tag": "@rushstack/package-deps-hash_v4.1.23", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "4.1.22", + "tag": "@rushstack/package-deps-hash_v4.1.22", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "4.1.21", "tag": "@rushstack/package-deps-hash_v4.1.21", diff --git a/libraries/package-deps-hash/CHANGELOG.md b/libraries/package-deps-hash/CHANGELOG.md index 7171b51221e..e7044f6e23b 100644 --- a/libraries/package-deps-hash/CHANGELOG.md +++ b/libraries/package-deps-hash/CHANGELOG.md @@ -1,6 +1,45 @@ # Change Log - @rushstack/package-deps-hash -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 4.1.28 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 4.1.27 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 4.1.26 +Mon, 19 Feb 2024 21:54:27 GMT + +### Patches + +- Fix a formatting issue with the LICENSE. + +## 4.1.25 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 4.1.24 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 4.1.23 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 4.1.22 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 4.1.21 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/package-deps-hash/LICENSE b/libraries/package-deps-hash/LICENSE index 93142aec687..c47fca6439f 100644 --- a/libraries/package-deps-hash/LICENSE +++ b/libraries/package-deps-hash/LICENSE @@ -1,24 +1,24 @@ -@rushstack/package-deps-hash - -Copyright (c) Microsoft Corporation. All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +@rushstack/package-deps-hash + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/libraries/package-deps-hash/README.md b/libraries/package-deps-hash/README.md index 9f573086e63..5386749d7a5 100644 --- a/libraries/package-deps-hash/README.md +++ b/libraries/package-deps-hash/README.md @@ -34,6 +34,6 @@ if (_.isEqual(deps, existingDeps)) { - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/package-deps-hash/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/package-deps-hash/) +- [API Reference](https://api.rushstack.io/pages/package-deps-hash/) `@rushstack/package-deps-hash` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/package-deps-hash/package.json b/libraries/package-deps-hash/package.json index ac2b15afa35..007af266f6f 100644 --- a/libraries/package-deps-hash/package.json +++ b/libraries/package-deps-hash/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/package-deps-hash", - "version": "4.1.21", + "version": "4.1.28", "description": "", "main": "lib/index.js", "typings": "dist/package-deps-hash.d.ts", diff --git a/libraries/package-extractor/CHANGELOG.json b/libraries/package-extractor/CHANGELOG.json index f13371b118a..9f3dbcf8c74 100644 --- a/libraries/package-extractor/CHANGELOG.json +++ b/libraries/package-extractor/CHANGELOG.json @@ -1,6 +1,170 @@ { "name": "@rushstack/package-extractor", "entries": [ + { + "version": "0.6.30", + "tag": "@rushstack/package-extractor_v0.6.30", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.27`" + } + ] + } + }, + { + "version": "0.6.29", + "tag": "@rushstack/package-extractor_v0.6.29", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.26`" + } + ] + } + }, + { + "version": "0.6.28", + "tag": "@rushstack/package-extractor_v0.6.28", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.25`" + } + ] + } + }, + { + "version": "0.6.27", + "tag": "@rushstack/package-extractor_v0.6.27", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.24`" + } + ] + } + }, + { + "version": "0.6.26", + "tag": "@rushstack/package-extractor_v0.6.26", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.23`" + } + ] + } + }, + { + "version": "0.6.25", + "tag": "@rushstack/package-extractor_v0.6.25", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.22`" + } + ] + } + }, + { + "version": "0.6.24", + "tag": "@rushstack/package-extractor_v0.6.24", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.11.21`" + } + ] + } + }, { "version": "0.6.23", "tag": "@rushstack/package-extractor_v0.6.23", diff --git a/libraries/package-extractor/CHANGELOG.md b/libraries/package-extractor/CHANGELOG.md index b0ead2008c2..99eac1fc05e 100644 --- a/libraries/package-extractor/CHANGELOG.md +++ b/libraries/package-extractor/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @rushstack/package-extractor -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.6.30 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.6.29 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.6.28 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.6.27 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.6.26 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.6.25 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.6.24 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.6.23 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/package-extractor/README.md b/libraries/package-extractor/README.md index dd1dc9b4c43..6bdf6b3af4a 100644 --- a/libraries/package-extractor/README.md +++ b/libraries/package-extractor/README.md @@ -7,6 +7,6 @@ A library used for creating an isolated copy of a package and, optionally, bundl - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/deploy-manager/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/deploy-manager/) +- [API Reference](https://api.rushstack.io/pages/deploy-manager/) `@rushstack/package-extractor` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/package-extractor/package.json b/libraries/package-extractor/package.json index ceb5b4fbe9e..4248f7af5a0 100644 --- a/libraries/package-extractor/package.json +++ b/libraries/package-extractor/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/package-extractor", - "version": "0.6.23", + "version": "0.6.30", "description": "A library for bundling selected files and dependencies into a deployable package.", "main": "lib/index.js", "typings": "dist/package-extractor.d.ts", diff --git a/libraries/package-extractor/src/PackageExtractor.ts b/libraries/package-extractor/src/PackageExtractor.ts index c416cf5cd9b..b38bee90483 100644 --- a/libraries/package-extractor/src/PackageExtractor.ts +++ b/libraries/package-extractor/src/PackageExtractor.ts @@ -14,12 +14,11 @@ import { Path, FileSystem, Import, - Colors, JsonFile, AlreadyExistsBehavior, - type IPackageJson, - type ITerminal + type IPackageJson } from '@rushstack/node-core-library'; +import { Colorize, type ITerminal } from '@rushstack/terminal'; import { ArchiveManager } from './ArchiveManager'; import { SymlinkAnalyzer, type ILinkInfo, type PathNode } from './SymlinkAnalyzer'; @@ -305,8 +304,8 @@ export class PackageExtractor { await FileSystem.ensureFolderAsync(targetRootFolder); - terminal.writeLine(Colors.cyan(`Extracting to target folder: ${targetRootFolder}`)); - terminal.writeLine(Colors.cyan(`Main project for extraction: ${mainProjectName}`)); + terminal.writeLine(Colorize.cyan(`Extracting to target folder: ${targetRootFolder}`)); + terminal.writeLine(Colorize.cyan(`Main project for extraction: ${mainProjectName}`)); try { const existingExtraction: boolean = @@ -392,7 +391,7 @@ export class PackageExtractor { } for (const { projectName, projectFolder } of includedProjectsSet) { - terminal.writeLine(Colors.cyan(`Analyzing project: ${projectName}`)); + terminal.writeLine(Colorize.cyan(`Analyzing project: ${projectName}`)); await this._collectFoldersAsync(projectFolder, options, state); } @@ -1010,7 +1009,7 @@ export class PackageExtractor { extractedProjectNodeModulesFolder, extractedProjectBinFolder, { - warn: (msg: string) => terminal.writeLine(Colors.yellow(msg)) + warn: (msg: string) => terminal.writeLine(Colorize.yellow(msg)) } ); diff --git a/libraries/package-extractor/src/test/PackageExtractor.test.ts b/libraries/package-extractor/src/test/PackageExtractor.test.ts index 153c0b4cf60..db43c9b11b5 100644 --- a/libraries/package-extractor/src/test/PackageExtractor.test.ts +++ b/libraries/package-extractor/src/test/PackageExtractor.test.ts @@ -3,7 +3,8 @@ import path from 'path'; -import { FileSystem, Terminal, StringBufferTerminalProvider } from '@rushstack/node-core-library'; +import { FileSystem } from '@rushstack/node-core-library'; +import { Terminal, StringBufferTerminalProvider } from '@rushstack/terminal'; import { PackageExtractor, type IExtractorProjectConfiguration } from '../PackageExtractor'; // Do this work in the "temp/test.jest" directory since it gets cleaned on clean runs diff --git a/libraries/rig-package/CHANGELOG.json b/libraries/rig-package/CHANGELOG.json index 3adc3ae8c90..36ca98f3a4c 100644 --- a/libraries/rig-package/CHANGELOG.json +++ b/libraries/rig-package/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@rushstack/rig-package", "entries": [ + { + "version": "0.5.2", + "tag": "@rushstack/rig-package_v0.5.2", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ] + } + }, { "version": "0.5.1", "tag": "@rushstack/rig-package_v0.5.1", diff --git a/libraries/rig-package/CHANGELOG.md b/libraries/rig-package/CHANGELOG.md index 116b36dab4a..8ca4bcbd849 100644 --- a/libraries/rig-package/CHANGELOG.md +++ b/libraries/rig-package/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @rushstack/rig-package -This log was last generated on Tue, 26 Sep 2023 09:30:33 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:35 GMT and should not be manually modified. + +## 0.5.2 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation ## 0.5.1 Tue, 26 Sep 2023 09:30:33 GMT diff --git a/libraries/rig-package/README.md b/libraries/rig-package/README.md index 7f4c4b6eee2..8ad3e006bda 100644 --- a/libraries/rig-package/README.md +++ b/libraries/rig-package/README.md @@ -224,6 +224,6 @@ Note that there are also async variants of the functions that access the filesys - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/rig-package/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/rig-package/) +- [API Reference](https://api.rushstack.io/pages/rig-package/) `@rushstack/rig-package` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/rig-package/package.json b/libraries/rig-package/package.json index 450ab81d292..0d90e4c96f2 100644 --- a/libraries/rig-package/package.json +++ b/libraries/rig-package/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rig-package", - "version": "0.5.1", + "version": "0.5.2", "description": "A system for sharing tool configurations between projects without duplicating config files.", "main": "lib/index.js", "typings": "dist/rig-package.d.ts", diff --git a/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json b/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json index db23def61a0..b831bc32a32 100644 --- a/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json +++ b/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json @@ -69,5 +69,23 @@ /** * If true, Rush will not allow node_modules in the repo folder or in parent folders. */ - /*[LINE "HYPOTHETICAL"]*/ "forbidPhantomResolvableNodeModulesFolders": true + /*[LINE "HYPOTHETICAL"]*/ "forbidPhantomResolvableNodeModulesFolders": true, + + /** + * (UNDER DEVELOPMENT) For certain installation problems involving peer dependencies, PNPM cannot + * correctly satisfy versioning requirements without installing duplicate copies of a package inside the + * node_modules folder. This poses a problem for "workspace:*" dependencies, as they are normally + * installed by making a symlink to the local project source folder. PNPM's "injected dependencies" + * feature provides a model for copying the local project folder into node_modules, however copying + * must occur AFTER the dependency project is built and BEFORE the consuming project starts to build. + * The "pnpm-sync" tool manages this operation; see its documentation for details. + * Enable this experiment if you want "rush" and "rushx" commands to resync injected dependencies + * by invoking "pnpm-sync" during the build. + */ + /*[LINE "HYPOTHETICAL"]*/ "usePnpmSyncForInjectedDependencies": true, + + /** + * If set to true, Rush will generate a `project-impact-graph.yaml` file in the repository root during `rush update`. + */ + /*[LINE "HYPOTHETICAL"]*/ "generateProjectImpactGraphDuringRushUpdate": true } diff --git a/libraries/rush-lib/assets/rush-init/common/config/rush/subspaces.json b/libraries/rush-lib/assets/rush-init/common/config/rush/subspaces.json index 3526906a094..d3c3ae8c516 100644 --- a/libraries/rush-lib/assets/rush-init/common/config/rush/subspaces.json +++ b/libraries/rush-lib/assets/rush-init/common/config/rush/subspaces.json @@ -1,30 +1,35 @@ /** - * This is the main configuration file for Rush. + * This configuration file manages the experimental "subspaces" feature for Rush, + * which allows multiple PNPM lockfiles to be used in a single Rush workspace. * For full documentation, please see https://rushjs.io */ - { +{ + "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/subspaces.schema.json", + /** - * Temporarily use the default schema until the subspaces schema is uploaded + * Set this flag to "true" to enable usage of subspaces. */ - "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/subspaces.schema.json", + "subspacesEnabled": false, /** - * This specifies whether or not to use the "subspaces" feature in rush. This allows grouping of - * projects into discrete workspaces known as "subspaces". + * (DEPRECATED) This is a temporary workaround for migrating from an earlier prototype + * of this feature: https://github.com/microsoft/rushstack/pull/3481 + * It allows subspaces with only one project to store their config files in the project folder. */ - "enabled": false, + "splitWorkspaceCompatibility": false, /** - * (DEPRECATED) A property that allows subspace configuration files to be stored under project folders directly. - * Used for migrating from a split-workspace format where there may be a large number of individual lockfiles and - * starting subspaces. + * When a command such as "rush update" is invoked without the "--subspace" or "--to" + * parameters, Rush will install all subspaces. In a huge monorepo with numerous subspaces, + * this would be extremely slow. Set "preventSelectingAllSubspaces" to true to avoid this + * mistake by always requiring selection parameters for commands such as "rush update". */ - "splitWorkspaceCompatibility": false, + "preventSelectingAllSubspaces": false, - /** - * The next field is an object describing the available subspaces in this workspace. Each individual subspace - * must be defined in this array. - */ + /** + * The list of subspace names, which should be lowercase alphanumeric words separated by + * hyphens, for example "my-subspace". The corresponding config files will have paths + * such as "common/config/subspaces/my-subspace/package-lock.yaml". + */ "subspaceNames": [] - } diff --git a/libraries/rush-lib/config/heft.json b/libraries/rush-lib/config/heft.json index fa542524f26..cb203be79e0 100644 --- a/libraries/rush-lib/config/heft.json +++ b/libraries/rush-lib/config/heft.json @@ -36,6 +36,11 @@ "sourcePath": "src/logic/pnpm/test", "destinationFolders": ["lib-commonjs/logic/pnpm/test"], "fileExtensions": [".yaml"] + }, + { + "sourcePath": "src/logic/test", + "destinationFolders": ["lib-commonjs/logic/test"], + "includeGlobs": ["**/.mergequeueignore"] } ] } diff --git a/libraries/rush-lib/package.json b/libraries/rush-lib/package.json index e7a9495fee6..64429a1685f 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/rush-lib", - "version": "5.113.0", + "version": "5.114.0", "description": "A library for writing scripts that interact with the Rush tool", "repository": { "type": "git", @@ -57,7 +57,8 @@ "tapable": "2.2.1", "tar": "~6.1.11", "true-case-path": "~2.2.1", - "uuid": "~8.3.2" + "uuid": "~8.3.2", + "pnpm-sync-lib": "0.1.3" }, "devDependencies": { "@pnpm/logger": "4.0.0", diff --git a/libraries/rush-lib/src/api/BuildCacheConfiguration.ts b/libraries/rush-lib/src/api/BuildCacheConfiguration.ts index c092e2ba4ce..cea1cb2a52e 100644 --- a/libraries/rush-lib/src/api/BuildCacheConfiguration.ts +++ b/libraries/rush-lib/src/api/BuildCacheConfiguration.ts @@ -7,9 +7,9 @@ import { JsonSchema, FileSystem, type JsonObject, - AlreadyReportedError, - type ITerminal + AlreadyReportedError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from './RushConfiguration'; import { FileSystemBuildCacheProvider } from '../logic/buildCache/FileSystemBuildCacheProvider'; diff --git a/libraries/rush-lib/src/api/CobuildConfiguration.ts b/libraries/rush-lib/src/api/CobuildConfiguration.ts index bb8b6c01da7..6d274ec43bd 100644 --- a/libraries/rush-lib/src/api/CobuildConfiguration.ts +++ b/libraries/rush-lib/src/api/CobuildConfiguration.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { FileSystem, type ITerminal, JsonFile, JsonSchema } from '@rushstack/node-core-library'; +import { FileSystem, JsonFile, JsonSchema } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { v4 as uuidv4 } from 'uuid'; import { EnvironmentConfiguration } from './EnvironmentConfiguration'; diff --git a/libraries/rush-lib/src/api/CustomTipsConfiguration.ts b/libraries/rush-lib/src/api/CustomTipsConfiguration.ts index 8128df01301..baf2c793712 100644 --- a/libraries/rush-lib/src/api/CustomTipsConfiguration.ts +++ b/libraries/rush-lib/src/api/CustomTipsConfiguration.ts @@ -2,8 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { FileSystem, type ITerminal, JsonFile, JsonSchema } from '@rushstack/node-core-library'; -import { PrintUtilities } from '@rushstack/terminal'; +import { FileSystem, JsonFile, JsonSchema } from '@rushstack/node-core-library'; +import { type ITerminal, PrintUtilities } from '@rushstack/terminal'; import colors from 'colors/safe'; import schemaJson from '../schemas/custom-tips.schema.json'; @@ -328,7 +328,10 @@ export class CustomTipsConfiguration { private _writeMessageWithPipes(terminal: ITerminal, severity: CustomTipSeverity, tipId: CustomTipId): void { const customTipJsonItem: ICustomTipItemJson | undefined = this.providedCustomTipsByTipId.get(tipId); if (customTipJsonItem) { - let writeFunction: (message: string) => void; + let writeFunction: + | typeof terminal.writeErrorLine + | typeof terminal.writeWarningLine + | typeof terminal.writeLine; let prefix: string; switch (severity) { case CustomTipSeverity.Error: @@ -350,7 +353,7 @@ export class CustomTipsConfiguration { const message: string = customTipJsonItem.message; const wrappedAndIndentedMessage: string = PrintUtilities.wrapWords(message, undefined, prefix); - writeFunction(wrappedAndIndentedMessage); + writeFunction(...wrappedAndIndentedMessage, { doNotOverrideSgrCodes: true }); terminal.writeLine(); } } diff --git a/libraries/rush-lib/src/api/ExperimentsConfiguration.ts b/libraries/rush-lib/src/api/ExperimentsConfiguration.ts index b15ff0655e9..76f6f31e82e 100644 --- a/libraries/rush-lib/src/api/ExperimentsConfiguration.ts +++ b/libraries/rush-lib/src/api/ExperimentsConfiguration.ts @@ -76,6 +76,24 @@ export interface IExperimentsJson { * If true, Rush will not allow node_modules in the repo folder or in parent folders. */ forbidPhantomResolvableNodeModulesFolders?: boolean; + + /** + * (UNDER DEVELOPMENT) For certain installation problems involving peer dependencies, PNPM cannot + * correctly satisfy versioning requirements without installing duplicate copies of a package inside the + * node_modules folder. This poses a problem for "workspace:*" dependencies, as they are normally + * installed by making a symlink to the local project source folder. PNPM's "injected dependencies" + * feature provides a model for copying the local project folder into node_modules, however copying + * must occur AFTER the dependency project is built and BEFORE the consuming project starts to build. + * The "pnpm-sync" tool manages this operation; see its documentation for details. + * Enable this experiment if you want "rush" and "rushx" commands to resync injected dependencies + * by invoking "pnpm-sync" during the build. + */ + usePnpmSyncForInjectedDependencies?: boolean; + + /** + * If set to true, Rush will generate a `project-impact-graph.yaml` file in the repository root during `rush update`. + */ + generateProjectImpactGraphDuringRushUpdate?: boolean; } /** diff --git a/libraries/rush-lib/src/api/Rush.ts b/libraries/rush-lib/src/api/Rush.ts index 83f384a47ca..fdf3ee6147d 100644 --- a/libraries/rush-lib/src/api/Rush.ts +++ b/libraries/rush-lib/src/api/Rush.ts @@ -3,12 +3,8 @@ import * as path from 'path'; -import { - InternalError, - type IPackageJson, - type ITerminalProvider, - PackageJsonLookup -} from '@rushstack/node-core-library'; +import { InternalError, type IPackageJson, PackageJsonLookup } from '@rushstack/node-core-library'; +import type { ITerminalProvider } from '@rushstack/terminal'; import '../utilities/SetRushLibPath'; @@ -109,7 +105,8 @@ export class Rush { public static launchRushX(launcherVersion: string, options: ILaunchOptions): void { options = Rush._normalizeLaunchOptions(options); Rush._assignRushInvokedFolder(); - RushXCommandLine.launchRushX(launcherVersion, options); + // eslint-disable-next-line no-console + RushXCommandLine.launchRushXAsync(launcherVersion, options).catch(console.error); // CommandLineParser.execute() should never reject the promise } /** diff --git a/libraries/rush-lib/src/api/RushConfiguration.ts b/libraries/rush-lib/src/api/RushConfiguration.ts index 0aaaa6e19a5..793c38a8c19 100644 --- a/libraries/rush-lib/src/api/RushConfiguration.ts +++ b/libraries/rush-lib/src/api/RushConfiguration.ts @@ -353,7 +353,7 @@ export class RushConfiguration { public readonly subspacesConfiguration: SubspacesConfiguration | undefined; /** - * Returns true if subspaces.json is present with "enabled=true". + * Returns true if subspaces.json is present with "subspacesEnabled=true". */ public readonly subspacesFeatureEnabled: boolean; @@ -633,7 +633,7 @@ export class RushConfiguration { // Try getting a subspace configuration this.subspacesConfiguration = SubspacesConfiguration.tryLoadFromDefaultLocation(this); - this.subspacesFeatureEnabled = !!this.subspacesConfiguration?.enabled; + this.subspacesFeatureEnabled = !!this.subspacesConfiguration?.subspacesEnabled; this._subspacesByName = new Map(); @@ -860,7 +860,7 @@ export class RushConfiguration { // Build the subspaces map const subspaceNames: string[] = []; let splitWorkspaceCompatibility: boolean = false; - if (this.subspacesConfiguration?.enabled) { + if (this.subspacesConfiguration?.subspacesEnabled) { splitWorkspaceCompatibility = this.subspacesConfiguration.splitWorkspaceCompatibility; subspaceNames.push(...this.subspacesConfiguration.subspaceNames); @@ -1310,7 +1310,10 @@ export class RushConfiguration { const subspace: Subspace | undefined = this._subspacesByName.get(subspaceName); if (!subspace) { // If the name is not even valid, that is more important information than if the subspace doesn't exist - SubspacesConfiguration.requireValidSubspaceName(subspaceName, this.subspacesFeatureEnabled); + SubspacesConfiguration.requireValidSubspaceName( + subspaceName, + this.subspacesConfiguration?.splitWorkspaceCompatibility + ); } return subspace; } diff --git a/libraries/rush-lib/src/api/RushProjectConfiguration.ts b/libraries/rush-lib/src/api/RushProjectConfiguration.ts index 51a096e6cc9..a541f26755e 100644 --- a/libraries/rush-lib/src/api/RushProjectConfiguration.ts +++ b/libraries/rush-lib/src/api/RushProjectConfiguration.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { AlreadyReportedError, Async, type ITerminal, Path } from '@rushstack/node-core-library'; +import { AlreadyReportedError, Async, Path } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { ConfigurationFile, InheritanceType } from '@rushstack/heft-config-file'; import { RigConfig } from '@rushstack/rig-package'; diff --git a/libraries/rush-lib/src/api/SubspacesConfiguration.ts b/libraries/rush-lib/src/api/SubspacesConfiguration.ts index 73a4ba5308e..fd18f6fa5a4 100644 --- a/libraries/rush-lib/src/api/SubspacesConfiguration.ts +++ b/libraries/rush-lib/src/api/SubspacesConfiguration.ts @@ -21,8 +21,9 @@ export const SPLIT_WORKSPACE_SUBSPACE_NAME_REGEXP: RegExp = /^[a-z0-9][+_\-a-z0- * See subspace.schema.json for documentation. */ interface ISubspacesConfigurationJson { - enabled: boolean; + subspacesEnabled: boolean; splitWorkspaceCompatibility?: boolean; + preventSelectingAllSubspaces?: boolean; subspaceNames: string[]; } @@ -39,16 +40,21 @@ export class SubspacesConfiguration { */ public readonly subspaceJsonFilePath: string; - /** + /* * Determines if the subspace feature is enabled */ - public readonly enabled: boolean; + public readonly subspacesEnabled: boolean; /** * This determines if the subspaces feature supports adding configuration files under the project folder itself */ public readonly splitWorkspaceCompatibility: boolean; + /** + * This determines if selectors are required when installing and building + */ + public readonly preventSelectingAllSubspaces: boolean; + /** * A set of the available subspaces */ @@ -56,11 +62,12 @@ export class SubspacesConfiguration { private constructor(configuration: Readonly, subspaceJsonFilePath: string) { this.subspaceJsonFilePath = subspaceJsonFilePath; - this.enabled = configuration.enabled; + this.subspacesEnabled = configuration.subspacesEnabled; this.splitWorkspaceCompatibility = !!configuration.splitWorkspaceCompatibility; + this.preventSelectingAllSubspaces = !!configuration.preventSelectingAllSubspaces; const subspaceNames: Set = new Set(); for (const subspaceName of configuration.subspaceNames) { - SubspacesConfiguration.requireValidSubspaceName(subspaceName, this.enabled); + SubspacesConfiguration.requireValidSubspaceName(subspaceName, this.splitWorkspaceCompatibility); subspaceNames.add(subspaceName); } diff --git a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts index 8654397f7b9..e638637f1a5 100644 --- a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts @@ -7,8 +7,8 @@ jest.mock('colors/safe', () => { return colors; }); -import { JsonFile, StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; -import { PrintUtilities } from '@rushstack/terminal'; +import { JsonFile } from '@rushstack/node-core-library'; +import { PrintUtilities, StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { CustomTipId, CustomTipsConfiguration, type ICustomTipsJson } from '../CustomTipsConfiguration'; import { RushConfiguration } from '../RushConfiguration'; diff --git a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts index e771ea52300..7acf22d2492 100644 --- a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; + import type { IPhase } from '../CommandLineConfiguration'; import type { RushConfigurationProject } from '../RushConfigurationProject'; import { RushProjectConfiguration } from '../RushProjectConfiguration'; diff --git a/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap b/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap index b91d7aaeb3d..3aa0dc6648d 100644 --- a/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap +++ b/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap @@ -9,7 +9,7 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[red]| [default]Lorem ipsum dolor sit amet, consectetur", "[red]| [default]adipiscing elit, sed do eiusmod tempor", "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", "[red]| [default]enim ad minim veniam, quis nostrud exercitation", @@ -28,7 +28,7 @@ Array [ "[red]| [default] reprehenderit in voluptate velit esse cillum", "[red]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", "[red]| [default] occaecat cupidatat non proident, sunt in culpa", - "[red]| [default] qui officia deserunt mollit anim id est laborum.[default]", + "[red]| [default] qui officia deserunt mollit anim id est laborum.", "", "--------------------", "--- warning output ---", @@ -91,7 +91,7 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[red]| [default]Lorem ipsum dolor sit amet, consectetur", "[red]| [default]adipiscing elit, sed do eiusmod tempor", "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", "[red]| [default]enim ad minim veniam, quis nostrud exercitation", @@ -110,7 +110,7 @@ Array [ "[red]| [default] reprehenderit in voluptate velit esse cillum", "[red]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", "[red]| [default] occaecat cupidatat non proident, sunt in culpa", - "[red]| [default] qui officia deserunt mollit anim id est laborum.[default]", + "[red]| [default] qui officia deserunt mollit anim id est laborum.", "", "--------------------", "--- warning output ---", @@ -137,7 +137,7 @@ Array [ "--- warning output ---", "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[yellow]|[default]", - "[yellow][yellow]| [default]Lorem ipsum dolor sit amet, consectetur", + "[yellow]| [default]Lorem ipsum dolor sit amet, consectetur", "[yellow]| [default]adipiscing elit, sed do eiusmod tempor", "[yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", "[yellow]| [default]enim ad minim veniam, quis nostrud exercitation", @@ -156,7 +156,7 @@ Array [ "[yellow]| [default] reprehenderit in voluptate velit esse cillum", "[yellow]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", "[yellow]| [default] occaecat cupidatat non proident, sunt in culpa", - "[yellow]| [default] qui officia deserunt mollit anim id est laborum.[default]", + "[yellow]| [default] qui officia deserunt mollit anim id est laborum.", "", "----------------------", "--- verbose output ---", @@ -177,7 +177,7 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[red]| [default]Lorem ipsum dolor sit amet, consectetur", "[red]| [default]adipiscing elit, sed do eiusmod tempor", "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", "[red]| [default]enim ad minim veniam, quis nostrud exercitation", @@ -186,7 +186,7 @@ Array [ "[red]| [default]reprehenderit in voluptate velit esse cillum", "[red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", "[red]| [default]occaecat cupidatat non proident, sunt in culpa", - "[red]| [default]qui officia deserunt mollit anim id est laborum.[default]", + "[red]| [default]qui officia deserunt mollit anim id est laborum.", "", "--------------------", "--- warning output ---", @@ -241,7 +241,7 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[red]| [default]Lorem ipsum dolor sit amet, consectetur", "[red]| [default]adipiscing elit, sed do eiusmod tempor", "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", "[red]| [default]enim ad minim veniam, quis nostrud exercitation", @@ -250,7 +250,7 @@ Array [ "[red]| [default]reprehenderit in voluptate velit esse cillum", "[red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", "[red]| [default]occaecat cupidatat non proident, sunt in culpa", - "[red]| [default]qui officia deserunt mollit anim id est laborum.[default]", + "[red]| [default]qui officia deserunt mollit anim id est laborum.", "", "--------------------", "--- warning output ---", @@ -277,7 +277,7 @@ Array [ "--- warning output ---", "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[yellow]|[default]", - "[yellow][yellow]| [default]Lorem ipsum dolor sit amet, consectetur", + "[yellow]| [default]Lorem ipsum dolor sit amet, consectetur", "[yellow]| [default]adipiscing elit, sed do eiusmod tempor", "[yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", "[yellow]| [default]enim ad minim veniam, quis nostrud exercitation", @@ -286,7 +286,7 @@ Array [ "[yellow]| [default]reprehenderit in voluptate velit esse cillum", "[yellow]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", "[yellow]| [default]occaecat cupidatat non proident, sunt in culpa", - "[yellow]| [default]qui officia deserunt mollit anim id est laborum.[default]", + "[yellow]| [default]qui officia deserunt mollit anim id est laborum.", "", "----------------------", "--- verbose output ---", @@ -307,8 +307,8 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]This is a test", - "[red]| [default] This is a test[default]", + "[red]| [default]This is a test", + "[red]| [default] This is a test", "", "--------------------", "--- warning output ---", @@ -357,8 +357,8 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]This is a test", - "[red]| [default] This is a test[default]", + "[red]| [default]This is a test", + "[red]| [default] This is a test", "", "--------------------", "--- warning output ---", @@ -385,8 +385,8 @@ Array [ "--- warning output ---", "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[yellow]|[default]", - "[yellow][yellow]| [default]This is a test", - "[yellow]| [default] This is a test[default]", + "[yellow]| [default]This is a test", + "[yellow]| [default] This is a test", "", "----------------------", "--- verbose output ---", @@ -407,8 +407,8 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]This is a test", - "[red]| [default]This is a test[default]", + "[red]| [default]This is a test", + "[red]| [default]This is a test", "", "--------------------", "--- warning output ---", @@ -457,8 +457,8 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]This is a test", - "[red]| [default]This is a test[default]", + "[red]| [default]This is a test", + "[red]| [default]This is a test", "", "--------------------", "--- warning output ---", @@ -485,8 +485,8 @@ Array [ "--- warning output ---", "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[yellow]|[default]", - "[yellow][yellow]| [default]This is a test", - "[yellow]| [default]This is a test[default]", + "[yellow]| [default]This is a test", + "[yellow]| [default]This is a test", "", "----------------------", "--- verbose output ---", @@ -507,7 +507,7 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]This is a test[default]", + "[red]| [default]This is a test", "", "--------------------", "--- warning output ---", @@ -555,7 +555,7 @@ Array [ "--- error output ---", "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[red]|[default]", - "[red][red]| [default]This is a test[default]", + "[red]| [default]This is a test", "", "--------------------", "--- warning output ---", @@ -582,7 +582,7 @@ Array [ "--- warning output ---", "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", "[yellow]|[default]", - "[yellow][yellow]| [default]This is a test[default]", + "[yellow]| [default]This is a test", "", "----------------------", "--- verbose output ---", diff --git a/libraries/rush-lib/src/cli/RushCommandLineParser.ts b/libraries/rush-lib/src/cli/RushCommandLineParser.ts index f2408e6c6bd..93f5b78f7e4 100644 --- a/libraries/rush-lib/src/cli/RushCommandLineParser.ts +++ b/libraries/rush-lib/src/cli/RushCommandLineParser.ts @@ -9,13 +9,8 @@ import { type CommandLineFlagParameter, CommandLineHelper } from '@rushstack/ts-command-line'; -import { - InternalError, - AlreadyReportedError, - ConsoleTerminalProvider, - Terminal -} from '@rushstack/node-core-library'; -import { PrintUtilities } from '@rushstack/terminal'; +import { InternalError, AlreadyReportedError } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal, PrintUtilities } from '@rushstack/terminal'; import { RushConfiguration } from '../api/RushConfiguration'; import { RushConstants } from '../logic/RushConstants'; diff --git a/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts b/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts index 0f3afa73640..b9046ab86d0 100644 --- a/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts +++ b/libraries/rush-lib/src/cli/RushPnpmCommandLineParser.ts @@ -5,18 +5,21 @@ import * as path from 'path'; import type { SpawnSyncReturns } from 'child_process'; import { AlreadyReportedError, - Colors, - ConsoleTerminalProvider, EnvironmentMap, Executable, FileConstants, FileSystem, + JsonFile, + type JsonObject +} from '@rushstack/node-core-library'; +import { + Colorize, + ConsoleTerminalProvider, type ITerminal, type ITerminalProvider, - JsonFile, - type JsonObject, Terminal -} from '@rushstack/node-core-library'; +} from '@rushstack/terminal'; + import { RushConfiguration } from '../api/RushConfiguration'; import { NodeJsCompatibility } from '../logic/NodeJsCompatibility'; import { PrintUtilities } from '@rushstack/terminal'; @@ -108,13 +111,13 @@ export class RushPnpmCommandLineParser { if (!FileSystem.exists(workspaceFilePath)) { this._terminal.writeErrorLine('Error: The PNPM workspace file has not been generated:'); this._terminal.writeErrorLine(` ${workspaceFilePath}\n`); - this._terminal.writeLine(Colors.cyan(`Do you need to run "rush install" or "rush update"?`)); + this._terminal.writeLine(Colorize.cyan(`Do you need to run "rush install" or "rush update"?`)); throw new AlreadyReportedError(); } if (!FileSystem.exists(rushConfiguration.packageManagerToolFilename)) { this._terminal.writeErrorLine('Error: The PNPM local binary has not been installed yet.'); - this._terminal.writeLine('\n' + Colors.cyan(`Do you need to run "rush install" or "rush update"?`)); + this._terminal.writeLine('\n' + Colorize.cyan(`Do you need to run "rush install" or "rush update"?`)); throw new AlreadyReportedError(); } @@ -193,7 +196,7 @@ export class RushPnpmCommandLineParser { this._terminal.writeErrorLine( `Warning: The "rush-pnpm" wrapper expects a command verb before "${firstArg}"\n` ); - this._terminal.writeLine(Colors.cyan(BYPASS_NOTICE)); + this._terminal.writeLine(Colorize.cyan(BYPASS_NOTICE)); throw new AlreadyReportedError(); } else { const commandName: string = firstArg; @@ -227,7 +230,7 @@ export class RushPnpmCommandLineParser { `Error: The "pnpm ${commandName}" command is known to be incompatible with Rush's environment.` ) + '\n' ); - this._terminal.writeLine(Colors.cyan(BYPASS_NOTICE)); + this._terminal.writeLine(Colorize.cyan(BYPASS_NOTICE)); throw new AlreadyReportedError(); } @@ -245,7 +248,7 @@ export class RushPnpmCommandLineParser { ` Use the "rush install" or "rush update" commands instead.` ) + '\n' ); - this._terminal.writeLine(Colors.cyan(BYPASS_NOTICE)); + this._terminal.writeLine(Colorize.cyan(BYPASS_NOTICE)); throw new AlreadyReportedError(); } @@ -338,7 +341,7 @@ export class RushPnpmCommandLineParser { `Error: The "pnpm ${commandName}" command has not been tested with Rush's environment. It may be incompatible.` ) + '\n' ); - this._terminal.writeLine(Colors.cyan(BYPASS_NOTICE)); + this._terminal.writeLine(Colorize.cyan(BYPASS_NOTICE)); } } /* eslint-enable no-fallthrough */ @@ -406,7 +409,7 @@ export class RushPnpmCommandLineParser { if (!objectsAreDeepEqual(currentGlobalPatchedDependencies, newGlobalPatchedDependencies)) { const commonTempPnpmPatchesFolder: string = `${this._rushConfiguration.commonTempFolder}/${RushConstants.pnpmPatchesFolderName}`; - const rushPnpmPatchesFolder: string = `${this._rushConfiguration.commonFolder}/pnpm-${RushConstants.pnpmPatchesFolderName}`; + const rushPnpmPatchesFolder: string = `${this._rushConfiguration.commonFolder}/${RushConstants.pnpmPatchesCommonFolderName}`; // Copy (or delete) common\temp\patches\ --> common\pnpm-patches\ if (FileSystem.exists(commonTempPnpmPatchesFolder)) { FileSystem.ensureEmptyFolder(rushPnpmPatchesFolder); @@ -433,7 +436,8 @@ export class RushPnpmCommandLineParser { await this._doRushUpdateAsync(); this._terminal.writeWarningLine( - `Rush refreshed the ${RushConstants.pnpmConfigFilename}, shrinkwrap file and patch files under the "common/pnpm/patches" folder.\n` + + `Rush refreshed the ${RushConstants.pnpmConfigFilename}, shrinkwrap file and patch files under the ` + + `"${RushConstants.commonFolderName}/${RushConstants.pnpmPatchesCommonFolderName}" folder.\n` + ' Please commit this change to Git.' ); } @@ -444,12 +448,12 @@ export class RushPnpmCommandLineParser { private async _doRushUpdateAsync(): Promise { if (this._rushConfiguration.subspacesFeatureEnabled) { - this._terminal.writeLine(Colors.red('The rush-pnpm command is not yet supported for subspaces.')); + this._terminal.writeLine(Colorize.red('The rush-pnpm command is not yet supported for subspaces.')); throw new AlreadyReportedError(); } this._terminal.writeLine(); - this._terminal.writeLine(Colors.green('Running "rush update"')); + this._terminal.writeLine(Colorize.green('Running "rush update"')); this._terminal.writeLine(); const rushGlobalFolder: RushGlobalFolder = new RushGlobalFolder(); diff --git a/libraries/rush-lib/src/cli/RushXCommandLine.ts b/libraries/rush-lib/src/cli/RushXCommandLine.ts index df4a7da07e3..aaa032d6ef6 100644 --- a/libraries/rush-lib/src/cli/RushXCommandLine.ts +++ b/libraries/rush-lib/src/cli/RushXCommandLine.ts @@ -3,7 +3,7 @@ import colors from 'colors/safe'; import * as path from 'path'; -import { PackageJsonLookup, type IPackageJson, Text } from '@rushstack/node-core-library'; +import { PackageJsonLookup, type IPackageJson, Text, FileSystem, Async } from '@rushstack/node-core-library'; import { DEFAULT_CONSOLE_WIDTH, PrintUtilities } from '@rushstack/terminal'; import { Utilities } from '../utilities/Utilities'; @@ -15,6 +15,7 @@ import { RushStartupBanner } from './RushStartupBanner'; import { EventHooksManager } from '../logic/EventHooksManager'; import { Event } from '../api/EventHooks'; import { EnvironmentVariableNames } from '../api/EnvironmentConfiguration'; +import { pnpmSyncCopyAsync } from 'pnpm-sync-lib'; interface IRushXCommandLineArguments { /** @@ -64,7 +65,7 @@ class ProcessError extends Error { } export class RushXCommandLine { - public static launchRushX(launcherVersion: string, options: ILaunchOptions): void { + public static async launchRushXAsync(launcherVersion: string, options: ILaunchOptions): Promise { try { const rushxArguments: IRushXCommandLineArguments = RushXCommandLine._parseCommandLineArguments(); const rushConfiguration: RushConfiguration | undefined = RushConfiguration.tryLoadFromDefaultLocation({ @@ -88,7 +89,7 @@ export class RushXCommandLine { // promise exception), so we start with the assumption that the exit code is 1 // and set it to 0 only on success. process.exitCode = 1; - RushXCommandLine._launchRushXInternal(rushxArguments, rushConfiguration, options); + await RushXCommandLine._launchRushXInternalAsync(rushxArguments, rushConfiguration, options); if (attemptHooks) { try { eventHooksManager?.handle(Event.postRushx, rushxArguments.isDebug, rushxArguments.ignoreHooks); @@ -111,11 +112,11 @@ export class RushXCommandLine { } } - private static _launchRushXInternal( + private static async _launchRushXInternalAsync( rushxArguments: IRushXCommandLineArguments, rushConfiguration: RushConfiguration | undefined, options: ILaunchOptions - ): void { + ): Promise { if (!rushxArguments.quiet) { RushStartupBanner.logStreamlinedBanner(Rush.version, options.isManaged); } @@ -207,6 +208,26 @@ export class RushXCommandLine { } }); + if (rushConfiguration?.packageManager === 'pnpm' && rushConfiguration?.experimentsConfiguration) { + const { configuration: experiments } = rushConfiguration?.experimentsConfiguration; + + if (experiments?.usePnpmSyncForInjectedDependencies) { + const pnpmSyncJsonPath: string = packageFolder + '/node_modules/.pnpm-sync.json'; + if (await FileSystem.existsAsync(pnpmSyncJsonPath)) { + const { PackageExtractor } = await import( + /* webpackChunkName: 'PackageExtractor' */ + '@rushstack/package-extractor' + ); + await pnpmSyncCopyAsync({ + pnpmSyncJsonPath, + ensureFolder: FileSystem.ensureFolderAsync, + forEachAsyncWithConcurrency: Async.forEachAsync, + getPackageIncludedFiles: PackageExtractor.getPackageIncludedFilesAsync + }); + } + } + } + if (exitCode > 0) { throw new ProcessError( `Failed calling ${commandWithArgsForDisplay}. Exit code: ${exitCode}`, diff --git a/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts b/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts index 84d4938e0fd..2207bd768f0 100644 --- a/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts +++ b/libraries/rush-lib/src/cli/actions/BaseInstallAction.ts @@ -8,12 +8,8 @@ import type { CommandLineIntegerParameter, CommandLineStringParameter } from '@rushstack/ts-command-line'; -import { - ConsoleTerminalProvider, - type ITerminal, - Terminal, - AlreadyReportedError -} from '@rushstack/node-core-library'; +import { AlreadyReportedError } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, type ITerminal, Terminal } from '@rushstack/terminal'; import { BaseRushAction, type IBaseRushActionOptions } from './BaseRushAction'; import { Event } from '../../api/EventHooks'; @@ -117,36 +113,21 @@ export abstract class BaseInstallAction extends BaseRushAction { protected getTargetSubspace(): Subspace { const parameterValue: string | undefined = this._subspaceParameter.value; - - if (this.rushConfiguration.subspacesFeatureEnabled) { - if (!parameterValue) { - // Temporarily ensure that a subspace is provided - // eslint-disable-next-line no-console - console.log(); - // eslint-disable-next-line no-console - console.log( - colors.red( - `The subspaces feature currently only supports installing for a specified set of subspace,` + - ` passed by the "--subspace" parameter or selected from targeted projects using any project selector.` - ) - ); - throw new AlreadyReportedError(); - } - return this.rushConfiguration.getSubspace(parameterValue); - } else { - if (parameterValue) { - // eslint-disable-next-line no-console - console.log(); - // eslint-disable-next-line no-console - console.log( - colors.red( - `The "--subspace" parameter can only be passed if the "enabled" option is enabled in subspaces.json.` - ) - ); - throw new AlreadyReportedError(); - } - return this.rushConfiguration.defaultSubspace; + if (parameterValue && !this.rushConfiguration.subspacesFeatureEnabled) { + // eslint-disable-next-line no-console + console.log(); + // eslint-disable-next-line no-console + console.log( + colors.red( + `The "--subspace" parameter can only be passed if "subspacesEnabled" is set to true in subspaces.json.` + ) + ); + throw new AlreadyReportedError(); } + const selectedSubspace: Subspace | undefined = parameterValue + ? this.rushConfiguration.getSubspace(parameterValue) + : this.rushConfiguration.defaultSubspace; + return selectedSubspace; } protected async runAsync(): Promise { @@ -154,13 +135,38 @@ export abstract class BaseInstallAction extends BaseRushAction { // If we are doing a filtered install and subspaces is enabled, we need to find the affected subspaces and install for all of them. let selectedSubspaces: ReadonlySet | undefined; - if (installManagerOptions.pnpmFilterArguments.length && this.rushConfiguration.subspacesFeatureEnabled) { - const selectedProjects: Set | undefined = - await this._selectionParameters?.getSelectedProjectsAsync(this._terminal); - if (selectedProjects) { - selectedSubspaces = this.rushConfiguration.getSubspacesForProjects(selectedProjects); + if (this.rushConfiguration.subspacesFeatureEnabled) { + if (installManagerOptions.pnpmFilterArguments.length) { + // Selecting a set of subspaces + const selectedProjects: Set | undefined = + await this._selectionParameters?.getSelectedProjectsAsync(this._terminal); + if (selectedProjects) { + selectedSubspaces = this.rushConfiguration.getSubspacesForProjects(selectedProjects); + } else { + throw new Error('The specified filter arguments resulted in no projects being selected.'); + } + // Remove the filter arguments as we already have the selected subspaces + installManagerOptions.pnpmFilterArguments = []; + } else if (this._subspaceParameter.value) { + // Selecting a single subspace + const selectedSubspace: Subspace = this.rushConfiguration.getSubspace(this._subspaceParameter.value); + selectedSubspaces = new Set([selectedSubspace]); } else { - throw new Error('The specified filter arguments resulted in no projects being selected.'); + // Selecting all subspaces if preventSelectingAllSubspaces is not enabled in subspaces.json + if (!this.rushConfiguration.subspacesConfiguration?.preventSelectingAllSubspaces) { + selectedSubspaces = new Set(this.rushConfiguration.subspaces); + } else { + // eslint-disable-next-line no-console + console.log(); + // eslint-disable-next-line no-console + console.log( + colors.red( + `The subspaces preventSelectingAllSubspaces configuration is enabled, which enforces installation for a specified set of subspace,` + + ` passed by the "--subspace" parameter or selected from targeted projects using any project selector.` + ) + ); + throw new AlreadyReportedError(); + } } } @@ -172,12 +178,6 @@ export abstract class BaseInstallAction extends BaseRushAction { subspace }); } - } else if (this._subspaceParameter.value) { - const subspace: Subspace = this.rushConfiguration.getSubspace(this._subspaceParameter.value); - VersionMismatchFinder.ensureConsistentVersions(this.rushConfiguration, this._terminal, { - variant: this._variant.value, - subspace: subspace - }); } else { VersionMismatchFinder.ensureConsistentVersions(this.rushConfiguration, this._terminal, { variant: this._variant.value diff --git a/libraries/rush-lib/src/cli/actions/ChangeAction.ts b/libraries/rush-lib/src/cli/actions/ChangeAction.ts index cb460eaeab9..3617557fefb 100644 --- a/libraries/rush-lib/src/cli/actions/ChangeAction.ts +++ b/libraries/rush-lib/src/cli/actions/ChangeAction.ts @@ -10,13 +10,8 @@ import type { CommandLineStringParameter, CommandLineChoiceParameter } from '@rushstack/ts-command-line'; -import { - FileSystem, - AlreadyReportedError, - Terminal, - type ITerminal, - ConsoleTerminalProvider -} from '@rushstack/node-core-library'; +import { FileSystem, AlreadyReportedError } from '@rushstack/node-core-library'; +import { Terminal, type ITerminal, ConsoleTerminalProvider } from '@rushstack/terminal'; import { getRepoRoot } from '@rushstack/package-deps-hash'; import type { RushConfigurationProject } from '../../api/RushConfigurationProject'; diff --git a/libraries/rush-lib/src/cli/actions/CheckAction.ts b/libraries/rush-lib/src/cli/actions/CheckAction.ts index 3815ca90f83..db1b3ceaf50 100644 --- a/libraries/rush-lib/src/cli/actions/CheckAction.ts +++ b/libraries/rush-lib/src/cli/actions/CheckAction.ts @@ -3,12 +3,12 @@ import colors from 'colors/safe'; import type { CommandLineStringParameter, CommandLineFlagParameter } from '@rushstack/ts-command-line'; +import { ConsoleTerminalProvider, type ITerminal, Terminal } from '@rushstack/terminal'; import type { RushCommandLineParser } from '../RushCommandLineParser'; import { BaseRushAction } from './BaseRushAction'; import { VersionMismatchFinder } from '../../logic/versionMismatch/VersionMismatchFinder'; import { Variants } from '../../api/Variants'; -import { ConsoleTerminalProvider, type ITerminal, Terminal } from '@rushstack/node-core-library'; export class CheckAction extends BaseRushAction { private readonly _terminal: ITerminal; diff --git a/libraries/rush-lib/src/cli/actions/InitAction.ts b/libraries/rush-lib/src/cli/actions/InitAction.ts index d20a17313dc..557a6e60ee1 100644 --- a/libraries/rush-lib/src/cli/actions/InitAction.ts +++ b/libraries/rush-lib/src/cli/actions/InitAction.ts @@ -177,6 +177,7 @@ export class InitAction extends BaseConfiglessRushAction { 'common/config/rush/experiments.json', 'common/config/rush/pnpm-config.json', 'common/config/rush/rush-plugins.json', + 'common/config/rush/subspaces.json', 'common/config/rush/version-policies.json', 'common/git-hooks/commit-msg.sample', diff --git a/libraries/rush-lib/src/cli/actions/ListAction.ts b/libraries/rush-lib/src/cli/actions/ListAction.ts index 309f8bfca2b..8ba113f17a9 100644 --- a/libraries/rush-lib/src/cli/actions/ListAction.ts +++ b/libraries/rush-lib/src/cli/actions/ListAction.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ConsoleTerminalProvider, Sort, Terminal } from '@rushstack/node-core-library'; +import { Sort } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; import type { CommandLineFlagParameter } from '@rushstack/ts-command-line'; import { BaseRushAction } from './BaseRushAction'; diff --git a/libraries/rush-lib/src/cli/actions/RemoveAction.ts b/libraries/rush-lib/src/cli/actions/RemoveAction.ts index 0e7aa47053e..4b953fe4b54 100644 --- a/libraries/rush-lib/src/cli/actions/RemoveAction.ts +++ b/libraries/rush-lib/src/cli/actions/RemoveAction.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ConsoleTerminalProvider, Terminal, type ITerminal } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal, type ITerminal } from '@rushstack/terminal'; import type { CommandLineFlagParameter, CommandLineStringListParameter } from '@rushstack/ts-command-line'; import { BaseAddAndRemoveAction } from './BaseAddAndRemoveAction'; diff --git a/libraries/rush-lib/src/cli/actions/ScanAction.ts b/libraries/rush-lib/src/cli/actions/ScanAction.ts index ef6ee38197e..a5e05c943e9 100644 --- a/libraries/rush-lib/src/cli/actions/ScanAction.ts +++ b/libraries/rush-lib/src/cli/actions/ScanAction.ts @@ -67,20 +67,24 @@ export class ScanAction extends BaseConfiglessRushAction { const requireRegExps: RegExp[] = [ // Example: require('something') - /\brequire\s*\(\s*[']([^']+\s*)[']\)/, - /\brequire\s*\(\s*["]([^"]+)["]\s*\)/, + /\brequire\s*\(\s*[']([^']+\s*)[']\s*\)/, + /\brequire\s*\(\s*["]([^"]+\s*)["]\s*\)/, // Example: require.ensure('something') - /\brequire.ensure\s*\(\s*[']([^']+\s*)[']\)/, - /\brequire.ensure\s*\(\s*["]([^"]+)["]\s*\)/, + /\brequire\.ensure\s*\(\s*[']([^']+\s*)[']\s*\)/, + /\brequire\.ensure\s*\(\s*["]([^"]+\s*)["]\s*\)/, // Example: require.resolve('something') - /\brequire.resolve\s*\(\s*[']([^']+\s*)[']\)/, - /\brequire.resolve\s*\(\s*["]([^"]+)["]\s*\)/, + /\brequire\.resolve\s*\(\s*[']([^']+\s*)[']\s*\)/, + /\brequire\.resolve\s*\(\s*["]([^"]+\s*)["]\s*\)/, // Example: System.import('something') - /\bSystem.import\s*\(\s*[']([^']+\s*)[']\)/, - /\bSystem.import\s*\(\s*["]([^"]+)["]\s*\)/, + /\bSystem\.import\s*\(\s*[']([^']+\s*)[']\s*\)/, + /\bSystem\.import\s*\(\s*["]([^"]+\s*)["]\s*\)/, + + // Example: Import.lazy('something', require); + /\bImport\.lazy\s*\(\s*[']([^']+\s*)[']/, + /\bImport\.lazy\s*\(\s*["]([^"]+\s*)["]/, // Example: // @@ -94,6 +98,10 @@ export class ScanAction extends BaseConfiglessRushAction { /\bimport\s*[']([^']+)[']\s*\;/, /\bimport\s*["]([^"]+)["]\s*\;/, + // Example: await import('fast-glob') + /\bimport\s*\(\s*[']([^']+)[']\s*\)/, + /\bimport\s*\(\s*["]([^"]+)["]\s*\)/, + // Example: // /// /\/\/\/\s*<\s*reference\s+types\s*=\s*["]([^"]+)["]\s*\/>/ diff --git a/libraries/rush-lib/src/cli/actions/UpdateCloudCredentialsAction.ts b/libraries/rush-lib/src/cli/actions/UpdateCloudCredentialsAction.ts index 1cd6e35fffd..97a792c9916 100644 --- a/libraries/rush-lib/src/cli/actions/UpdateCloudCredentialsAction.ts +++ b/libraries/rush-lib/src/cli/actions/UpdateCloudCredentialsAction.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import type { CommandLineStringParameter, CommandLineFlagParameter } from '@rushstack/ts-command-line'; -import { AlreadyReportedError, ConsoleTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { AlreadyReportedError } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; import type { RushCommandLineParser } from '../RushCommandLineParser'; import { BaseRushAction } from './BaseRushAction'; diff --git a/libraries/rush-lib/src/cli/parsing/SelectionParameterSet.ts b/libraries/rush-lib/src/cli/parsing/SelectionParameterSet.ts index 7b5ea3901a1..d1658beddbc 100644 --- a/libraries/rush-lib/src/cli/parsing/SelectionParameterSet.ts +++ b/libraries/rush-lib/src/cli/parsing/SelectionParameterSet.ts @@ -1,12 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { - AlreadyReportedError, - PackageJsonLookup, - type IPackageJson, - type ITerminal -} from '@rushstack/node-core-library'; +import { AlreadyReportedError, PackageJsonLookup, type IPackageJson } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { CommandLineParameterProvider, CommandLineStringListParameter diff --git a/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts b/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts index 33545142ef8..72f14bacac4 100644 --- a/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts +++ b/libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts @@ -4,7 +4,8 @@ import colors from 'colors/safe'; import type { AsyncSeriesHook } from 'tapable'; -import { AlreadyReportedError, InternalError, type ITerminal, Terminal } from '@rushstack/node-core-library'; +import { AlreadyReportedError, InternalError } from '@rushstack/node-core-library'; +import { type ITerminal, Terminal } from '@rushstack/terminal'; import type { CommandLineFlagParameter, CommandLineParameter, @@ -379,6 +380,17 @@ export class PhasedScriptAction extends BaseScriptAction { terminal.writeVerboseLine(`Incremental strategy: none (full rebuild)`); } + const { configuration: experiments } = this.rushConfiguration.experimentsConfiguration; + if ( + this.rushConfiguration?.packageManager === 'pnpm' && + experiments?.usePnpmSyncForInjectedDependencies + ) { + const { PnpmSyncCopyOperationPlugin } = await import( + '../../logic/operations/PnpmSyncCopyOperationPlugin' + ); + new PnpmSyncCopyOperationPlugin().apply(this.hooks); + } + const projectConfigurations: ReadonlyMap = this ._runsBeforeInstall ? new Map() diff --git a/libraries/rush-lib/src/cli/test/CommandLineHelp.test.ts b/libraries/rush-lib/src/cli/test/CommandLineHelp.test.ts index 0b4cc01e13d..e8d12da6902 100644 --- a/libraries/rush-lib/src/cli/test/CommandLineHelp.test.ts +++ b/libraries/rush-lib/src/cli/test/CommandLineHelp.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { AnsiEscape } from '@rushstack/node-core-library'; +import { AnsiEscape } from '@rushstack/terminal'; import * as colorsPackage from 'colors'; import { RushCommandLineParser } from '../RushCommandLineParser'; diff --git a/libraries/rush-lib/src/cli/test/RushXCommandLine.test.ts b/libraries/rush-lib/src/cli/test/RushXCommandLine.test.ts index b29f362a3c8..b06f0bdfd7d 100644 --- a/libraries/rush-lib/src/cli/test/RushXCommandLine.test.ts +++ b/libraries/rush-lib/src/cli/test/RushXCommandLine.test.ts @@ -94,7 +94,7 @@ describe(RushXCommandLine.name, () => { jest.restoreAllMocks(); }); - describe(RushXCommandLine.launchRushX.name, () => { + describe(RushXCommandLine.launchRushXAsync.name, () => { it('prints usage info', () => { process.argv = ['node', 'startx.js', '--help']; executeLifecycleCommandMock!.mockReturnValue(0); diff --git a/libraries/rush-lib/src/cli/test/__snapshots__/RushXCommandLine.test.ts.snap b/libraries/rush-lib/src/cli/test/__snapshots__/RushXCommandLine.test.ts.snap index 2f406bb3dd5..e171ae4d905 100644 --- a/libraries/rush-lib/src/cli/test/__snapshots__/RushXCommandLine.test.ts.snap +++ b/libraries/rush-lib/src/cli/test/__snapshots__/RushXCommandLine.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`RushXCommandLine launchRushX executes a valid package script 1`] = ` +exports[`RushXCommandLine launchRushXAsync executes a valid package script 1`] = ` Array [ Array [ "Rush Multi-Project Build Tool 40.40.40 - Node.js 12.12.12 (LTS)", @@ -12,9 +12,9 @@ Array [ ] `; -exports[`RushXCommandLine launchRushX executes a valid package script with no startup banner 1`] = `Array []`; +exports[`RushXCommandLine launchRushXAsync executes a valid package script with no startup banner 1`] = `Array []`; -exports[`RushXCommandLine launchRushX fails if the package does not contain a matching script 1`] = ` +exports[`RushXCommandLine launchRushXAsync fails if the package does not contain a matching script 1`] = ` Array [ Array [ "Rush Multi-Project Build Tool 40.40.40 - Node.js 12.12.12 (LTS)", @@ -22,7 +22,7 @@ Array [ ] `; -exports[`RushXCommandLine launchRushX prints usage info 1`] = ` +exports[`RushXCommandLine launchRushXAsync prints usage info 1`] = ` Array [ Array [ "Rush Multi-Project Build Tool 40.40.40 - Node.js 12.12.12 (LTS)", diff --git a/libraries/rush-lib/src/logic/Git.ts b/libraries/rush-lib/src/logic/Git.ts index 83bc1a35119..b20daac6623 100644 --- a/libraries/rush-lib/src/logic/Git.ts +++ b/libraries/rush-lib/src/logic/Git.ts @@ -7,7 +7,8 @@ import * as path from 'path'; import * as url from 'url'; import colors from 'colors/safe'; import { trueCasePathSync } from 'true-case-path'; -import { Executable, AlreadyReportedError, Path, type ITerminal } from '@rushstack/node-core-library'; +import { Executable, AlreadyReportedError, Path } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { ensureGitMinimumVersion } from '@rushstack/package-deps-hash'; import { Utilities } from '../utilities/Utilities'; diff --git a/libraries/rush-lib/src/logic/PackageJsonUpdater.ts b/libraries/rush-lib/src/logic/PackageJsonUpdater.ts index 92f40a7ac4b..8599b5d9b7e 100644 --- a/libraries/rush-lib/src/logic/PackageJsonUpdater.ts +++ b/libraries/rush-lib/src/logic/PackageJsonUpdater.ts @@ -4,12 +4,7 @@ import colors from 'colors/safe'; import * as semver from 'semver'; import type * as NpmCheck from 'npm-check'; -import { - ConsoleTerminalProvider, - Terminal, - type ITerminalProvider, - Colors -} from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal, type ITerminalProvider, Colorize } from '@rushstack/terminal'; import type { RushConfiguration } from '../api/RushConfiguration'; import type { BaseInstallManager } from './base/BaseInstallManager'; @@ -268,7 +263,7 @@ export class PackageJsonUpdater { const { skipUpdate, debugInstall, variant } = options; for (const { project } of allPackageUpdates) { if (project.saveIfModified()) { - this._terminal.writeLine(Colors.green('Wrote'), project.filePath); + this._terminal.writeLine(Colorize.green('Wrote'), project.filePath); } } @@ -292,7 +287,7 @@ export class PackageJsonUpdater { variant: string | undefined ): Promise { this._terminal.writeLine(); - this._terminal.writeLine(Colors.green('Running "rush update"')); + this._terminal.writeLine(Colorize.green('Running "rush update"')); this._terminal.writeLine(); const purgeManager: PurgeManager = new PurgeManager(this._rushConfiguration, this._rushGlobalFolder); @@ -368,9 +363,9 @@ export class PackageJsonUpdater { dependenciesToAddOrUpdate[packageName] = version; this._terminal.writeLine( - Colors.green('Updating projects to use'), + Colorize.green('Updating projects to use'), `${packageName}@`, - Colors.cyan(version) + Colorize.cyan(version) ); this._terminal.writeLine(); diff --git a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts index cc9f9cfcdd0..b76841de7e3 100644 --- a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts +++ b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts @@ -11,7 +11,8 @@ import { getRepoStateAsync, type IFileDiffStatus } from '@rushstack/package-deps-hash'; -import { Path, FileSystem, type ITerminal, Async } from '@rushstack/node-core-library'; +import { Path, FileSystem, Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../api/RushConfiguration'; import { RushProjectConfiguration } from '../api/RushProjectConfiguration'; diff --git a/libraries/rush-lib/src/logic/ProjectImpactGraphGenerator.ts b/libraries/rush-lib/src/logic/ProjectImpactGraphGenerator.ts new file mode 100644 index 00000000000..560147f96a1 --- /dev/null +++ b/libraries/rush-lib/src/logic/ProjectImpactGraphGenerator.ts @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { FileSystem, Text, Async } from '@rushstack/node-core-library'; +import yaml from 'js-yaml'; + +import type { RushConfiguration } from '../api/RushConfiguration'; +import type { RushConfigurationProject } from '../api/RushConfigurationProject'; +import { Stopwatch } from '../utilities/Stopwatch'; +import { RushConstants } from './RushConstants'; +import { Colorize, type ITerminal } from '@rushstack/terminal'; + +/** + * Project property configuration + */ +export interface IProjectImpactGraphProjectConfiguration { + includedGlobs: string[]; + excludedGlobs?: string[]; + dependentProjects: string[]; +} + +/** + * The schema of `project-impact-graph.yaml` + */ +export interface IProjectImpactGraphFile { + globalExcludedGlobs: string[]; + projects: Record; +} + +/** + * Default global excluded globs + * Only used if the `/.mergequeueignore` does not exist + */ +const DEFAULT_GLOBAL_EXCLUDED_GLOBS: string[] = ['common/autoinstallers/**']; + +async function tryReadFileLinesAsync(filePath: string): Promise { + let fileContents: string | undefined; + try { + fileContents = await FileSystem.readFileAsync(filePath); + } catch (error) { + if (!FileSystem.isNotExistError(error)) { + throw error; + } + } + + if (fileContents) { + return Text.convertToLf(fileContents).split('\n'); + } +} + +export class ProjectImpactGraphGenerator { + private readonly _terminal: ITerminal; + + /** + * The Rush configuration + */ + private readonly _rushConfiguration: RushConfiguration; + + /** + * Full path of repository root + */ + private readonly _repositoryRoot: string; + + /** + * Full path to `project-impact-graph.yaml` + */ + private readonly _projectImpactGraphFilePath: string; + + /** + * Get repositoryRoot and load projects within the rush.json + */ + public constructor(terminal: ITerminal, rushConfiguration: RushConfiguration) { + this._terminal = terminal; + this._rushConfiguration = rushConfiguration; + const { rushJsonFolder } = rushConfiguration; + this._repositoryRoot = rushJsonFolder; + this._projectImpactGraphFilePath = `${rushJsonFolder}/${RushConstants.projectImpactGraphFilename}`; + } + + /** + * Load global excluded globs + */ + private async _loadGlobalExcludedGlobsAsync(): Promise { + const filePath: string = `${this._repositoryRoot}/${RushConstants.mergeQueueIgnoreFileName}`; + return await tryReadFileLinesAsync(filePath); + } + + /** + * Load project excluded globs + * @param projectRootRelativePath - project root relative path + */ + private async _tryLoadProjectExcludedGlobsAsync( + projectRootRelativePath: string + ): Promise { + const filePath: string = `${this._repositoryRoot}/${projectRootRelativePath}/${RushConstants.mergeQueueIgnoreFileName}`; + + const globs: string[] | undefined = await tryReadFileLinesAsync(filePath); + if (globs) { + for (let i: number = 0; i < globs.length; i++) { + globs[i] = `${projectRootRelativePath}/${globs[i]}`; + } + + return globs; + } + } + + /** + * Core Logic: generate project-impact-graph.yaml + */ + public async generateAsync(): Promise { + const stopwatch: Stopwatch = Stopwatch.start(); + + const [globalExcludedGlobs = DEFAULT_GLOBAL_EXCLUDED_GLOBS, projectEntries] = await Promise.all([ + this._loadGlobalExcludedGlobsAsync(), + Async.mapAsync( + this._rushConfiguration.projects, + async ({ packageName, consumingProjects, projectRelativeFolder }) => { + const dependentList: string[] = [packageName]; + for (const consumingProject of consumingProjects) { + dependentList.push(consumingProject.packageName); + } + + const projectImpactGraphProjectConfiguration: IProjectImpactGraphProjectConfiguration = { + includedGlobs: [`${projectRelativeFolder}/**`], + dependentProjects: dependentList.sort() + }; + + const projectExcludedGlobs: string[] | undefined = await this._tryLoadProjectExcludedGlobsAsync( + projectRelativeFolder + ); + if (projectExcludedGlobs) { + projectImpactGraphProjectConfiguration.excludedGlobs = projectExcludedGlobs; + } + + return [packageName, projectImpactGraphProjectConfiguration]; + }, + { concurrency: 50 } + ) + ]); + + projectEntries.sort(([aName], [bName]) => aName.localeCompare(bName)); + const projects: Record = + Object.fromEntries(projectEntries); + const content: IProjectImpactGraphFile = { globalExcludedGlobs, projects }; + await FileSystem.writeFileAsync(this._projectImpactGraphFilePath, yaml.safeDump(content)); + + stopwatch.stop(); + this._terminal.writeLine(); + this._terminal.writeLine( + Colorize.green(`Generate project impact graph successfully. (${stopwatch.toString()})`) + ); + } + + public async validateAsync(): Promise { + // TODO: More validation other than just existence + return await FileSystem.existsAsync(this._projectImpactGraphFilePath); + } +} diff --git a/libraries/rush-lib/src/logic/ProjectWatcher.ts b/libraries/rush-lib/src/logic/ProjectWatcher.ts index 3d2a315bd1b..1fe8b36a459 100644 --- a/libraries/rush-lib/src/logic/ProjectWatcher.ts +++ b/libraries/rush-lib/src/logic/ProjectWatcher.ts @@ -6,7 +6,8 @@ import * as os from 'os'; import * as readline from 'readline'; import { once } from 'events'; import { getRepoRoot } from '@rushstack/package-deps-hash'; -import { Colors, Path, type ITerminal, type FileSystemStats, FileSystem } from '@rushstack/node-core-library'; +import { Path, type FileSystemStats, FileSystem } from '@rushstack/node-core-library'; +import { Colorize, type ITerminal } from '@rushstack/terminal'; import { Git } from './Git'; import { ProjectChangeAnalyzer } from './ProjectChangeAnalyzer'; @@ -317,8 +318,8 @@ export class ProjectWatcher { } this._terminal.write( - Colors.bold( - Colors.cyan( + Colorize.bold( + Colorize.cyan( `[${this.isPaused ? 'PAUSED' : 'WATCHING'}] Watch Status: ${status} ${ this.isPaused ? 'Press to resume. Press to build once.' : 'Press to pause.' }` diff --git a/libraries/rush-lib/src/logic/RushConstants.ts b/libraries/rush-lib/src/logic/RushConstants.ts index 58ba68aa325..091f4fe4b4e 100644 --- a/libraries/rush-lib/src/logic/RushConstants.ts +++ b/libraries/rush-lib/src/logic/RushConstants.ts @@ -103,6 +103,12 @@ export class RushConstants { */ public static readonly pnpmPatchesFolderName: string = 'patches'; + /** + * The folder name under `/common/temp` used to store checked-in patches. + * Example: `C:\MyRepo\common\pnpm-patches` + */ + public static readonly pnpmPatchesCommonFolderName: string = `pnpm-${RushConstants.pnpmPatchesFolderName}`; + /** * The filename ("shrinkwrap.yaml") used to store state for pnpm */ @@ -296,4 +302,14 @@ export class RushConstants { * The name of the parameter that can be used to bypass policies. */ public static readonly bypassPolicyFlagLongName: '--bypass-policy' = '--bypass-policy'; + + /** + * Merge Queue ignore configuration file. + */ + public static readonly mergeQueueIgnoreFileName: string = '.mergequeueignore'; + + /** + * The filename ("project-impact-graph.yaml") for the project impact graph file. + */ + public static readonly projectImpactGraphFilename: string = 'project-impact-graph.yaml'; } diff --git a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts index bcbbc804168..b0bbcfb9220 100644 --- a/libraries/rush-lib/src/logic/base/BaseInstallManager.ts +++ b/libraries/rush-lib/src/logic/base/BaseInstallManager.ts @@ -14,12 +14,14 @@ import { NewlineKind, AlreadyReportedError, type FileSystemStats, - ConsoleTerminalProvider, - Terminal, - type ITerminalProvider, Path } from '@rushstack/node-core-library'; -import { PrintUtilities } from '@rushstack/terminal'; +import { + PrintUtilities, + ConsoleTerminalProvider, + Terminal, + type ITerminalProvider +} from '@rushstack/terminal'; import { ApprovedPackagesChecker } from '../ApprovedPackagesChecker'; import type { AsyncRecycler } from '../../utilities/AsyncRecycler'; @@ -47,6 +49,7 @@ import type { PnpmResolutionMode } from '../pnpm/PnpmOptionsConfiguration'; import { SubspacePnpmfileConfiguration } from '../pnpm/SubspacePnpmfileConfiguration'; import type { Subspace } from '../../api/Subspace'; import { SubspacesConfiguration } from '../../api/SubspacesConfiguration'; +import { ProjectImpactGraphGenerator } from '../ProjectImpactGraphGenerator'; /** * Pnpm don't support --ignore-compatibility-db, so use --config.ignoreCompatibilityDb for now. @@ -103,6 +106,7 @@ export abstract class BaseInstallManager { } public async doInstallAsync(): Promise { + const { allowShrinkwrapUpdates } = this.options; const isFilteredInstall: boolean = this.options.pnpmFilterArguments.length > 0; const useWorkspaces: boolean = this.rushConfiguration.pnpmOptions && this.rushConfiguration.pnpmOptions.useWorkspaces; @@ -121,7 +125,7 @@ export abstract class BaseInstallManager { } // Prevent update when using a filter, as modifications to the shrinkwrap shouldn't be saved - if (this.options.allowShrinkwrapUpdates && isFilteredInstall) { + if (allowShrinkwrapUpdates && isFilteredInstall) { // Allow partial update when there are subspace projects if (!this.rushConfiguration.subspacesFeatureEnabled) { // eslint-disable-next-line no-console @@ -139,7 +143,12 @@ export abstract class BaseInstallManager { const subspace: Subspace = this.options.subspace; - const { shrinkwrapIsUpToDate, variantIsUpToDate, npmrcHash } = await this.prepareAsync(subspace); + const projectImpactGraphGenerator: ProjectImpactGraphGenerator | undefined = this.rushConfiguration + .experimentsConfiguration.configuration.generateProjectImpactGraphDuringRushUpdate + ? new ProjectImpactGraphGenerator(this._terminal, this.rushConfiguration) + : undefined; + const { shrinkwrapIsUpToDate, variantIsUpToDate, npmrcHash, projectImpactGraphIsUpToDate } = + await this.prepareAsync(subspace, projectImpactGraphGenerator); if (this.options.checkOnly) { return; @@ -164,7 +173,7 @@ export abstract class BaseInstallManager { const cleanInstall: boolean = isFilteredInstall || !commonTempInstallFlag.checkValidAndReportStoreIssues({ - rushVerb: this.options.allowShrinkwrapUpdates ? 'update' : 'install', + rushVerb: allowShrinkwrapUpdates ? 'update' : 'install', statePropertiesToIgnore: optionsToIgnore }); @@ -175,7 +184,13 @@ export abstract class BaseInstallManager { return this.canSkipInstall(outputStats.mtime, subspace); }; - if (cleanInstall || !shrinkwrapIsUpToDate || !variantIsUpToDate || !canSkipInstall()) { + if ( + cleanInstall || + !shrinkwrapIsUpToDate || + !variantIsUpToDate || + !canSkipInstall() || + !projectImpactGraphIsUpToDate + ) { // eslint-disable-next-line no-console console.log(); await this.validateNpmSetup(); @@ -207,8 +222,12 @@ export abstract class BaseInstallManager { await this.options.beforeInstallAsync(); } - // Perform the actual install - await this.installAsync(cleanInstall, subspace); + await Promise.all([ + // Perform the actual install + this.installAsync(cleanInstall, subspace), + // If allowed, generate the project impact graph + allowShrinkwrapUpdates ? projectImpactGraphGenerator?.generateAsync() : undefined + ]); if (this.options.allowShrinkwrapUpdates && !shrinkwrapIsUpToDate) { // Copy (or delete) common\temp\pnpm-lock.yaml --> common\config\rush\pnpm-lock.yaml @@ -283,11 +302,17 @@ export abstract class BaseInstallManager { return Utilities.isFileTimestampCurrent(lastModifiedDate, potentiallyChangedFiles); } - protected async prepareAsync(subspace: Subspace): Promise<{ + protected async prepareAsync( + subspace: Subspace, + projectImpactGraphGenerator: ProjectImpactGraphGenerator | undefined + ): Promise<{ variantIsUpToDate: boolean; shrinkwrapIsUpToDate: boolean; npmrcHash: string | undefined; + projectImpactGraphIsUpToDate: boolean; }> { + const { allowShrinkwrapUpdates } = this.options; + // Check the policies await PolicyValidator.validatePolicyAsync(this.rushConfiguration, subspace, this.options); @@ -297,8 +322,8 @@ export abstract class BaseInstallManager { this.rushConfiguration ); if (approvedPackagesChecker.approvedPackagesFilesAreOutOfDate) { - if (this.options.allowShrinkwrapUpdates) { - approvedPackagesChecker.rewriteConfigFiles(); + approvedPackagesChecker.rewriteConfigFiles(); + if (allowShrinkwrapUpdates) { // eslint-disable-next-line no-console console.log( colors.yellow( @@ -321,12 +346,12 @@ export abstract class BaseInstallManager { // (If it's a full update, then we ignore the shrinkwrap from Git since it will be overwritten) if (!this.options.fullUpgrade) { - const commitedShrinkwrapFileName: string = subspace.getCommittedShrinkwrapFilename(); + const committedShrinkwrapFileName: string = subspace.getCommittedShrinkwrapFilename(); try { shrinkwrapFile = ShrinkwrapFileFactory.getShrinkwrapFile( this.rushConfiguration.packageManager, this.rushConfiguration.packageManagerOptions, - commitedShrinkwrapFileName + committedShrinkwrapFileName ); } catch (ex) { // eslint-disable-next-line no-console @@ -336,7 +361,7 @@ export abstract class BaseInstallManager { `Unable to load the ${this.rushConfiguration.shrinkwrapFilePhrase}: ${(ex as Error).message}` ); - if (!this.options.allowShrinkwrapUpdates) { + if (!allowShrinkwrapUpdates) { // eslint-disable-next-line no-console console.log(); // eslint-disable-next-line no-console @@ -415,7 +440,7 @@ export abstract class BaseInstallManager { const commonTempPnpmPatchesFolder: string = `${subspace.getSubspaceTempFolder()}/${ RushConstants.pnpmPatchesFolderName }`; - const rushPnpmPatchesFolder: string = `${this.rushConfiguration.commonFolder}/pnpm-${RushConstants.pnpmPatchesFolderName}`; + const rushPnpmPatchesFolder: string = `${this.rushConfiguration.commonFolder}/${RushConstants.pnpmPatchesCommonFolderName}`; if (FileSystem.exists(rushPnpmPatchesFolder)) { FileSystem.copyFiles({ sourcePath: rushPnpmPatchesFolder, @@ -442,12 +467,13 @@ export abstract class BaseInstallManager { } } - // Allow for package managers to do their own preparation and check that the shrinkwrap is up to date // eslint-disable-next-line prefer-const - let { shrinkwrapIsUpToDate, shrinkwrapWarnings } = await this.prepareCommonTempAsync( - subspace, - shrinkwrapFile - ); + let [{ shrinkwrapIsUpToDate, shrinkwrapWarnings }, projectImpactGraphIsUpToDate = true] = + await Promise.all([ + // Allow for package managers to do their own preparation and check that the shrinkwrap is up to date + this.prepareCommonTempAsync(subspace, shrinkwrapFile), + projectImpactGraphGenerator?.validateAsync() + ]); shrinkwrapIsUpToDate = shrinkwrapIsUpToDate && !this.options.recheckShrinkwrap; this._syncTempShrinkwrap(subspace, shrinkwrapFile); @@ -473,22 +499,31 @@ export abstract class BaseInstallManager { console.log(); } + let hasErrors: boolean = false; // Force update if the shrinkwrap is out of date - if (!shrinkwrapIsUpToDate) { - if (!this.options.allowShrinkwrapUpdates) { - // eslint-disable-next-line no-console - console.log(); - // eslint-disable-next-line no-console - console.log( - colors.red( - `The ${this.rushConfiguration.shrinkwrapFilePhrase} is out of date. You need to run "rush update".` - ) - ); - throw new AlreadyReportedError(); - } + if (!shrinkwrapIsUpToDate && !allowShrinkwrapUpdates) { + this._terminal.writeErrorLine(); + this._terminal.writeErrorLine( + `The ${this.rushConfiguration.shrinkwrapFilePhrase} is out of date. You need to run "rush update".` + ); + hasErrors = true; + } + + if (!projectImpactGraphIsUpToDate && !allowShrinkwrapUpdates) { + hasErrors = true; + this._terminal.writeErrorLine(); + this._terminal.writeErrorLine( + colors.red( + `The ${RushConstants.projectImpactGraphFilename} file is missing or out of date. You need to run "rush update".` + ) + ); + } + + if (hasErrors) { + throw new AlreadyReportedError(); } - return { shrinkwrapIsUpToDate, variantIsUpToDate, npmrcHash }; + return { shrinkwrapIsUpToDate, variantIsUpToDate, npmrcHash, projectImpactGraphIsUpToDate }; } /** diff --git a/libraries/rush-lib/src/logic/buildCache/FileSystemBuildCacheProvider.ts b/libraries/rush-lib/src/logic/buildCache/FileSystemBuildCacheProvider.ts index 35df3b6896d..240dc6477e0 100644 --- a/libraries/rush-lib/src/logic/buildCache/FileSystemBuildCacheProvider.ts +++ b/libraries/rush-lib/src/logic/buildCache/FileSystemBuildCacheProvider.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { FileSystem, type ITerminal } from '@rushstack/node-core-library'; +import { FileSystem } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../../api/RushConfiguration'; import type { RushUserConfiguration } from '../../api/RushUserConfiguration'; diff --git a/libraries/rush-lib/src/logic/buildCache/ICloudBuildCacheProvider.ts b/libraries/rush-lib/src/logic/buildCache/ICloudBuildCacheProvider.ts index 8f5d648654d..f55a0870ad8 100644 --- a/libraries/rush-lib/src/logic/buildCache/ICloudBuildCacheProvider.ts +++ b/libraries/rush-lib/src/logic/buildCache/ICloudBuildCacheProvider.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; /** * @beta diff --git a/libraries/rush-lib/src/logic/buildCache/ProjectBuildCache.ts b/libraries/rush-lib/src/logic/buildCache/ProjectBuildCache.ts index e5921029fee..1de67d7b229 100644 --- a/libraries/rush-lib/src/logic/buildCache/ProjectBuildCache.ts +++ b/libraries/rush-lib/src/logic/buildCache/ProjectBuildCache.ts @@ -4,13 +4,8 @@ import * as path from 'path'; import * as crypto from 'crypto'; -import { - FileSystem, - type ITerminal, - type FolderItem, - InternalError, - Async -} from '@rushstack/node-core-library'; +import { FileSystem, type FolderItem, InternalError, Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfigurationProject } from '../../api/RushConfigurationProject'; import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer'; diff --git a/libraries/rush-lib/src/logic/buildCache/test/ProjectBuildCache.test.ts b/libraries/rush-lib/src/logic/buildCache/test/ProjectBuildCache.test.ts index 268d14d2059..6f0873ee95a 100644 --- a/libraries/rush-lib/src/logic/buildCache/test/ProjectBuildCache.test.ts +++ b/libraries/rush-lib/src/logic/buildCache/test/ProjectBuildCache.test.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; + import type { BuildCacheConfiguration } from '../../../api/BuildCacheConfiguration'; import type { RushConfigurationProject } from '../../../api/RushConfigurationProject'; import { ProjectChangeAnalyzer } from '../../ProjectChangeAnalyzer'; diff --git a/libraries/rush-lib/src/logic/deploy/DeployScenarioConfiguration.ts b/libraries/rush-lib/src/logic/deploy/DeployScenarioConfiguration.ts index 3266f321241..13a4d93c55e 100644 --- a/libraries/rush-lib/src/logic/deploy/DeployScenarioConfiguration.ts +++ b/libraries/rush-lib/src/logic/deploy/DeployScenarioConfiguration.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { FileSystem, JsonFile, JsonSchema, Colors, type ITerminal } from '@rushstack/node-core-library'; +import { FileSystem, JsonFile, JsonSchema } from '@rushstack/node-core-library'; +import { Colorize, type ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../../api/RushConfiguration'; import schemaJson from '../../schemas/deploy-scenario.schema.json'; @@ -104,7 +105,7 @@ export class DeployScenarioConfiguration { throw new Error('The scenario config file was not found: ' + scenarioFilePath); } - terminal.writeLine(Colors.cyan(`Loading deployment scenario: ${scenarioFilePath}`)); + terminal.writeLine(Colorize.cyan(`Loading deployment scenario: ${scenarioFilePath}`)); const deployScenarioJson: IDeployScenarioJson = JsonFile.loadAndValidate( scenarioFilePath, diff --git a/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts b/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts index a800c9d67b0..c3e092eb394 100644 --- a/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts +++ b/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts @@ -33,8 +33,9 @@ import { EnvironmentConfiguration } from '../../api/EnvironmentConfiguration'; import { ShrinkwrapFileFactory } from '../ShrinkwrapFileFactory'; import { BaseProjectShrinkwrapFile } from '../base/BaseProjectShrinkwrapFile'; import { type CustomTipId, type ICustomTipInfo, PNPM_CUSTOM_TIPS } from '../../api/CustomTipsConfiguration'; -import type { PnpmShrinkwrapFile } from '../pnpm/PnpmShrinkwrapFile'; +import { PnpmShrinkwrapFile } from '../pnpm/PnpmShrinkwrapFile'; import { objectsAreDeepEqual } from '../../utilities/objectUtilities'; +import { type ILockfile, pnpmSyncPrepareAsync } from 'pnpm-sync-lib'; import type { Subspace } from '../../api/Subspace'; /** @@ -112,9 +113,9 @@ export class WorkspaceInstallManager extends BaseInstallManager { ); if (orphanedProjects.length > 0) { - for (const orhpanedProject of orphanedProjects) { + for (const orphanedProject of orphanedProjects) { shrinkwrapWarnings.push( - `Your ${this.rushConfiguration.shrinkwrapFilePhrase} references "${orhpanedProject}" ` + + `Your ${this.rushConfiguration.shrinkwrapFilePhrase} references "${orphanedProject}" ` + 'which was not found in rush.json' ); } @@ -145,6 +146,16 @@ export class WorkspaceInstallManager extends BaseInstallManager { path.join(subspace.getSubspaceTempFolder(), 'pnpm-workspace.yaml') ); + // For pnpm pacakge manager, we need to handle dependenciesMeta changes in package.json. See more: https://pnpm.io/package_json#dependenciesmeta + // If dependenciesMeta settings is different between package.json and pnpm-lock.yaml, then shrinkwrapIsUpToDate return false. + // Build a object for dependenciesMeta settings in projects' package.jsons + // key is the package path, value is the dependenciesMeta info for that package + const expectedDependenciesMetaByProjectRelativePath: Record = {}; + const commonTempFolder: string = this.rushConfiguration.commonTempFolder; + const rushJsonFolder: string = this.rushConfiguration.rushJsonFolder; + // get the relative path from common temp folder to repo root folder + const relativeFromTempFolderToRootFolder: string = path.relative(commonTempFolder, rushJsonFolder); + // Loop through the projects and add them to the workspace file. While we're at it, also validate that // referenced workspace projects are valid, and check if the shrinkwrap file is already up-to-date. for (const rushProject of this.rushConfiguration.projects) { @@ -253,60 +264,44 @@ export class WorkspaceInstallManager extends BaseInstallManager { ); shrinkwrapIsUpToDate = false; } - } - // For pnpm pacakge manager, we need to handle dependenciesMeta changes in package.json. See more: https://pnpm.io/package_json#dependenciesmeta - // If dependenciesMeta settings is different between package.json and pnpm-lock.yaml, then shrinkwrapIsUpToDate return false. - if (this.rushConfiguration.packageManager === 'pnpm') { - // First, build a object for dependenciesMeta settings in package.json - // key is the package path, value is the dependenciesMeta info for that package - const packagePathToDependenciesMetaInPackageJson: { [key: string]: IDependenciesMetaTable } = {}; - const commonTempFolder: string = this.rushConfiguration.commonTempFolder; - const rushJsonFolder: string = this.rushConfiguration.rushJsonFolder; - - // get the relative path from common temp folder to repo root folder - const relativeFromTempFolderToRootFolder: string = path.relative(commonTempFolder, rushJsonFolder); - for (const rushProject of this.rushConfiguration.projects) { - if (subspace.contains(rushProject)) { - // skip processing any project that isn't in this subspace - continue; + const dependencyMetaList: ReadonlyArray = packageJson.dependencyMetaList; + if (dependencyMetaList.length !== 0) { + const dependenciesMeta: IDependenciesMetaTable = {}; + for (const dependencyMeta of dependencyMetaList) { + dependenciesMeta[dependencyMeta.name] = { + injected: dependencyMeta.injected + }; } - const packageJson: PackageJsonEditor = rushProject.packageJsonEditor; - const projectRelativeFolder: string = rushProject.projectRelativeFolder; // get the relative path from common temp folder to package folder, to align with the value in pnpm-lock.yaml - const relativePathFromTempFolderToPackageFolder: string = - relativeFromTempFolderToRootFolder + '/' + projectRelativeFolder; - const dependencyMetaList: ReadonlyArray = packageJson.dependencyMetaList; - - if (dependencyMetaList.length !== 0) { - const dependenciesMeta: IDependenciesMetaTable = {}; - for (const dependencyMeta of dependencyMetaList) { - dependenciesMeta[dependencyMeta.name] = { - injected: dependencyMeta.injected - }; - } - packagePathToDependenciesMetaInPackageJson[relativePathFromTempFolderToPackageFolder] = - dependenciesMeta; - } + const relativePathFromTempFolderToPackageFolder: string = `${relativeFromTempFolderToRootFolder}/${rushProject.projectRelativeFolder}`; + expectedDependenciesMetaByProjectRelativePath[relativePathFromTempFolderToPackageFolder] = + dependenciesMeta; } + } - // Second, build a object for dependenciesMeta settings in pnpm-lock.yaml - // key is the package path, value is the dependenciesMeta info for that package - const packagePathToDependenciesMetaInShrinkwrapFile: { [key: string]: IDependenciesMetaTable } = {}; - if (shrinkwrapFile?.importers !== undefined) { - for (const [key, value] of shrinkwrapFile?.importers) { - if (value.dependenciesMeta !== undefined) { - packagePathToDependenciesMetaInShrinkwrapFile[key] = value.dependenciesMeta; - } + // Build a object for dependenciesMeta settings in pnpm-lock.yaml + // key is the package path, value is the dependenciesMeta info for that package + const lockfileDependenciesMetaByProjectRelativePath: { [key: string]: IDependenciesMetaTable } = {}; + if (shrinkwrapFile?.importers !== undefined) { + for (const [key, value] of shrinkwrapFile?.importers) { + if (value.dependenciesMeta !== undefined) { + lockfileDependenciesMetaByProjectRelativePath[key] = value.dependenciesMeta; } } + } - // Now, we compare these two objects to see if they are equal or not - shrinkwrapIsUpToDate = objectsAreDeepEqual( - packagePathToDependenciesMetaInPackageJson, - packagePathToDependenciesMetaInShrinkwrapFile + // Now, we compare these two objects to see if they are equal or not + const dependenciesMetaAreEqual: boolean = objectsAreDeepEqual( + expectedDependenciesMetaByProjectRelativePath, + lockfileDependenciesMetaByProjectRelativePath + ); + if (!dependenciesMetaAreEqual) { + shrinkwrapWarnings.push( + "The dependenciesMeta settings in one or more package.json don't match the current shrinkwrap." ); + shrinkwrapIsUpToDate = false; } // Write the common package.json @@ -356,7 +351,7 @@ export class WorkspaceInstallManager extends BaseInstallManager { } /** - * Runs "npm install" in the common folder. + * Runs "pnpm install" in the common folder. */ protected async installAsync(cleanInstall: boolean, subspace: Subspace): Promise { // Example: "C:\MyRepo\common\temp\npm-local\node_modules\.bin\npm" @@ -506,6 +501,32 @@ export class WorkspaceInstallManager extends BaseInstallManager { await doInstallInternalAsync(this.options); } + // if usePnpmSyncForInjectedDependencies is true + // the pnpm-sync will generate the pnpm-sync.json based on lockfile + if (this.rushConfiguration.packageManager === 'pnpm' && experiments?.usePnpmSyncForInjectedDependencies) { + const pnpmLockfilePath: string = this.rushConfiguration.tempShrinkwrapFilename; + const pnpmStorePath: string = `${this.rushConfiguration.commonTempFolder}/node_modules/.pnpm`; + await pnpmSyncPrepareAsync({ + lockfilePath: pnpmLockfilePath, + storePath: pnpmStorePath, + readPnpmLockfile: async (lockfilePath: string) => { + const wantedPnpmLockfile: PnpmShrinkwrapFile | undefined = await PnpmShrinkwrapFile.loadFromFile( + lockfilePath, + { withCaching: true } + ); + + if (!wantedPnpmLockfile) { + return undefined; + } else { + const result: ILockfile = { + importers: Object.fromEntries(wantedPnpmLockfile.importers.entries()) + }; + return result; + } + } + }); + } + // If all attempts fail we just terminate. No special handling needed. // Ensure that node_modules folders exist after install, since the timestamps on these folders are used diff --git a/libraries/rush-lib/src/logic/installManager/doBasicInstallAsync.ts b/libraries/rush-lib/src/logic/installManager/doBasicInstallAsync.ts index f3bdff0fffe..b3514fbdc52 100644 --- a/libraries/rush-lib/src/logic/installManager/doBasicInstallAsync.ts +++ b/libraries/rush-lib/src/logic/installManager/doBasicInstallAsync.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../../api/RushConfiguration'; import type { RushGlobalFolder } from '../../api/RushGlobalFolder'; diff --git a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts index 82d1d2b4b36..649c3d61d4b 100644 --- a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts @@ -2,17 +2,10 @@ // See LICENSE in the project root for license information. import * as crypto from 'crypto'; -import { - Async, - InternalError, - type ITerminal, - NewlineKind, - Sort, - Terminal -} from '@rushstack/node-core-library'; +import { Async, InternalError, NewlineKind, Sort } from '@rushstack/node-core-library'; import { CollatedTerminal, type CollatedWriter } from '@rushstack/stream-collator'; import { DiscardStdoutTransform, TextRewriterTransform } from '@rushstack/terminal'; -import { SplitterTransform, type TerminalWritable } from '@rushstack/terminal'; +import { SplitterTransform, type TerminalWritable, type ITerminal, Terminal } from '@rushstack/terminal'; import { CollatedTerminalProvider } from '../../utilities/CollatedTerminalProvider'; import { OperationStatus } from './OperationStatus'; diff --git a/libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts b/libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts index bf826c03659..94d71c43b99 100644 --- a/libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts +++ b/libraries/rush-lib/src/logic/operations/ConsoleTimelinePlugin.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { PrintUtilities } from '@rushstack/terminal'; import colors from 'colors/safe'; import type { IPhase } from '../../api/CommandLineConfiguration'; diff --git a/libraries/rush-lib/src/logic/operations/LegacySkipPlugin.ts b/libraries/rush-lib/src/logic/operations/LegacySkipPlugin.ts index 4b77efc7222..d8461920dad 100644 --- a/libraries/rush-lib/src/logic/operations/LegacySkipPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/LegacySkipPlugin.ts @@ -3,15 +3,8 @@ import path from 'node:path'; -import { - Async, - ColorValue, - FileSystem, - JsonFile, - type ITerminal, - type JsonObject -} from '@rushstack/node-core-library'; -import { PrintUtilities } from '@rushstack/terminal'; +import { Async, FileSystem, JsonFile, type JsonObject } from '@rushstack/node-core-library'; +import { PrintUtilities, Colorize, type ITerminal } from '@rushstack/terminal'; import type { Operation } from './Operation'; import { OperationStatus } from './OperationStatus'; @@ -140,10 +133,9 @@ export class LegacySkipPlugin implements IPhasedCommandPlugin { `Unable to calculate incremental state for ${record.operation.name}: ` + (error as Error).toString() ); - terminal.writeLine({ - text: 'Rush will proceed without incremental execution and change detection.', - foregroundColor: ColorValue.Cyan - }); + terminal.writeLine( + Colorize.cyan('Rush will proceed without incremental execution and change detection.') + ); } stateMap.set(operation, { @@ -156,13 +148,14 @@ export class LegacySkipPlugin implements IPhasedCommandPlugin { if (logGitWarning) { // To test this code path: // Remove the `.git` folder then run "rush build --verbose" - terminal.writeLine({ - text: PrintUtilities.wrapWords( - 'This workspace does not appear to be tracked by Git. ' + - 'Rush will proceed without incremental execution, caching, and change detection.' - ), - foregroundColor: ColorValue.Cyan - }); + terminal.writeLine( + Colorize.cyan( + PrintUtilities.wrapWords( + 'This workspace does not appear to be tracked by Git. ' + + 'Rush will proceed without incremental execution, caching, and change detection.' + ) + ) + ); } } ); diff --git a/libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts b/libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts index 06972864595..5667b8811ff 100644 --- a/libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts +++ b/libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts @@ -2,12 +2,8 @@ // See LICENSE in the project root for license information. import * as fs from 'fs'; -import { - Async, - FileSystem, - type IFileSystemCopyFileOptions, - type ITerminal -} from '@rushstack/node-core-library'; +import { Async, FileSystem, type IFileSystemCopyFileOptions } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { OperationStateFile } from './OperationStateFile'; import { RushConstants } from '../RushConstants'; diff --git a/libraries/rush-lib/src/logic/operations/OperationResultSummarizerPlugin.ts b/libraries/rush-lib/src/logic/operations/OperationResultSummarizerPlugin.ts index 6a255152355..df9d93369a4 100644 --- a/libraries/rush-lib/src/logic/operations/OperationResultSummarizerPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/OperationResultSummarizerPlugin.ts @@ -2,7 +2,9 @@ // See LICENSE in the project root for license information. import colors from 'colors/safe'; -import { InternalError, type ITerminal } from '@rushstack/node-core-library'; +import { InternalError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; + import type { ICreateOperationsContext, IPhasedCommandPlugin, diff --git a/libraries/rush-lib/src/logic/operations/PnpmSyncCopyOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/PnpmSyncCopyOperationPlugin.ts new file mode 100644 index 00000000000..c72d59269d0 --- /dev/null +++ b/libraries/rush-lib/src/logic/operations/PnpmSyncCopyOperationPlugin.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { Async, FileSystem } from '@rushstack/node-core-library'; +import { pnpmSyncCopyAsync } from 'pnpm-sync-lib'; + +import { OperationStatus } from './OperationStatus'; +import type { IOperationRunnerContext } from './IOperationRunner'; +import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks'; +import type { OperationExecutionRecord } from './OperationExecutionRecord'; + +const PLUGIN_NAME: 'PnpmSyncCopyOperationPlugin' = 'PnpmSyncCopyOperationPlugin'; + +export class PnpmSyncCopyOperationPlugin implements IPhasedCommandPlugin { + public apply(hooks: PhasedCommandHooks): void { + hooks.afterExecuteOperation.tapPromise( + PLUGIN_NAME, + async (runnerContext: IOperationRunnerContext): Promise => { + const record: OperationExecutionRecord = runnerContext as OperationExecutionRecord; + const { + status, + operation: { associatedProject: project } + } = record; + + //skip if the phase is skipped, from cache or no operation + if ( + status === OperationStatus.Skipped || + status === OperationStatus.FromCache || + status === OperationStatus.NoOp + ) { + return; + } + + if (project) { + const pnpmSyncJsonPath: string = `${project.projectFolder}/node_modules/.pnpm-sync.json`; + if (await FileSystem.exists(pnpmSyncJsonPath)) { + const { PackageExtractor } = await import( + /* webpackChunkName: 'PackageExtractor' */ + '@rushstack/package-extractor' + ); + await pnpmSyncCopyAsync({ + pnpmSyncJsonPath, + ensureFolder: FileSystem.ensureFolderAsync, + forEachAsyncWithConcurrency: Async.forEachAsync, + getPackageIncludedFiles: PackageExtractor.getPackageIncludedFilesAsync + }); + } + } + } + ); + } +} diff --git a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts index bb1747bf929..3438a7ed9e5 100644 --- a/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts +++ b/libraries/rush-lib/src/logic/operations/ShellOperationRunner.ts @@ -2,8 +2,9 @@ // See LICENSE in the project root for license information. import type * as child_process from 'child_process'; -import { Text, NewlineKind, InternalError, Terminal } from '@rushstack/node-core-library'; +import { Text, NewlineKind, InternalError } from '@rushstack/node-core-library'; import { + Terminal, TerminalChunkKind, TextRewriterTransform, StderrLineTransform, diff --git a/libraries/rush-lib/src/logic/operations/ValidateOperationsPlugin.ts b/libraries/rush-lib/src/logic/operations/ValidateOperationsPlugin.ts index 5aa9c946437..29b6b1b0c9a 100644 --- a/libraries/rush-lib/src/logic/operations/ValidateOperationsPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/ValidateOperationsPlugin.ts @@ -10,7 +10,7 @@ import type { import type { IOperationExecutionResult } from './IOperationExecutionResult'; import type { RushConfigurationProject } from '../../api/RushConfigurationProject'; import type { RushProjectConfiguration } from '../../api/RushProjectConfiguration'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { IPhase } from '../../api/CommandLineConfiguration'; const PLUGIN_NAME: 'ValidateOperationsPlugin' = 'ValidateOperationsPlugin'; diff --git a/libraries/rush-lib/src/logic/operations/test/OperationExecutionManager.test.ts b/libraries/rush-lib/src/logic/operations/test/OperationExecutionManager.test.ts index e2d13b20421..281703c752a 100644 --- a/libraries/rush-lib/src/logic/operations/test/OperationExecutionManager.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/OperationExecutionManager.test.ts @@ -6,7 +6,7 @@ jest.mock('../../../utilities/Utilities'); import colors from 'colors/safe'; -import { Terminal } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; import { CollatedTerminal } from '@rushstack/stream-collator'; import { MockWritable, PrintUtilities } from '@rushstack/terminal'; diff --git a/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts b/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts index 7f5bd13a2ff..52bc7f492d0 100644 --- a/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts +++ b/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts @@ -133,6 +133,10 @@ export interface IPnpmShrinkwrapYaml { overrides?: { [dependency: string]: string }; } +export interface ILoadFromFileOptions { + withCaching?: boolean; +} + /** * Given an encoded "dependency key" from the PNPM shrinkwrap file, this parses it into an equivalent * DependencySpecifier. @@ -243,6 +247,9 @@ export function normalizePnpmVersionSpecifier(versionSpecifier: IPnpmVersionSpec } export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { + // TODO: Implement cache eviction when a lockfile is copied back + private static _cacheByLockfilePath: Map = new Map(); + public readonly shrinkwrapFileMajorVersion: number; public readonly isWorkspaceCompatible: boolean; public readonly registry: string; @@ -286,16 +293,30 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { this._integrities = new Map(); } - public static loadFromFile(shrinkwrapYamlFilename: string): PnpmShrinkwrapFile | undefined { - try { - const shrinkwrapContent: string = FileSystem.readFile(shrinkwrapYamlFilename); - return PnpmShrinkwrapFile.loadFromString(shrinkwrapContent); - } catch (error) { - if (FileSystem.isNotExistError(error as Error)) { - return undefined; // file does not exist - } - throw new Error(`Error reading "${shrinkwrapYamlFilename}":\n ${(error as Error).message}`); + public static loadFromFile( + shrinkwrapYamlFilePath: string, + { withCaching }: ILoadFromFileOptions = {} + ): PnpmShrinkwrapFile | undefined { + let loaded: PnpmShrinkwrapFile | undefined; + if (withCaching) { + loaded = PnpmShrinkwrapFile._cacheByLockfilePath.get(shrinkwrapYamlFilePath); } + + // TODO: Promisify this + loaded ??= (() => { + try { + const shrinkwrapContent: string = FileSystem.readFile(shrinkwrapYamlFilePath); + return PnpmShrinkwrapFile.loadFromString(shrinkwrapContent); + } catch (error) { + if (FileSystem.isNotExistError(error as Error)) { + return undefined; // file does not exist + } + throw new Error(`Error reading "${shrinkwrapYamlFilePath}":\n ${(error as Error).message}`); + } + })(); + + PnpmShrinkwrapFile._cacheByLockfilePath.set(shrinkwrapYamlFilePath, loaded); + return loaded; } public static loadFromString(shrinkwrapContent: string): PnpmShrinkwrapFile { @@ -715,7 +736,7 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { RushConstants.pnpmfileGlobalFilename ); - if (FileSystem.exists(subspacePnpmfilePath)) { + if (await FileSystem.existsAsync(subspacePnpmfilePath)) { try { subspacePnpmfile = require(subspacePnpmfilePath); } catch (err) { diff --git a/libraries/rush-lib/src/logic/selectors/ISelectorParser.ts b/libraries/rush-lib/src/logic/selectors/ISelectorParser.ts index e20d89fa0da..000010afa11 100644 --- a/libraries/rush-lib/src/logic/selectors/ISelectorParser.ts +++ b/libraries/rush-lib/src/logic/selectors/ISelectorParser.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; export interface IEvaluateSelectorOptions { unscopedSelector: string; diff --git a/libraries/rush-lib/src/logic/setup/KeyboardLoop.ts b/libraries/rush-lib/src/logic/setup/KeyboardLoop.ts index 1ed2f4f18ad..b5dfd578442 100644 --- a/libraries/rush-lib/src/logic/setup/KeyboardLoop.ts +++ b/libraries/rush-lib/src/logic/setup/KeyboardLoop.ts @@ -6,8 +6,8 @@ import * as readline from 'readline'; import * as process from 'process'; import { AlreadyReportedError, InternalError } from '@rushstack/node-core-library'; -// TODO: Integrate these into the AnsiEscape API in @rushstack/node-core-library -// As part of that work we should generalize the "Colors" API to support more general +// TODO: Integrate these into the AnsiEscape API in @rushstack/terminal +// As part of that work we should generalize the "Colorize" API to support more general // terminal escapes, and simplify the interface for that API. const ANSI_ESCAPE_SHOW_CURSOR: string = '\u001B[?25l'; const ANSI_ESCAPE_HIDE_CURSOR: string = '\u001B[?25h'; diff --git a/libraries/rush-lib/src/logic/setup/SetupPackageRegistry.ts b/libraries/rush-lib/src/logic/setup/SetupPackageRegistry.ts index c9017ef6c0c..d1e80c5cd42 100644 --- a/libraries/rush-lib/src/logic/setup/SetupPackageRegistry.ts +++ b/libraries/rush-lib/src/logic/setup/SetupPackageRegistry.ts @@ -5,17 +5,14 @@ import * as path from 'path'; import type * as child_process from 'child_process'; import { AlreadyReportedError, - Colors, - ConsoleTerminalProvider, Executable, FileSystem, InternalError, type JsonObject, NewlineKind, - Terminal, Text } from '@rushstack/node-core-library'; -import { PrintUtilities } from '@rushstack/terminal'; +import { PrintUtilities, Colorize, ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../../api/RushConfiguration'; import { Utilities } from '../../utilities/Utilities'; @@ -240,7 +237,7 @@ export class SetupPackageRegistry { this._artifactoryConfiguration.configuration.packageRegistry.artifactoryWebsiteUrl; if (artifactoryWebsiteUrl) { - this._terminal.writeLine(' ', Colors.cyan(artifactoryWebsiteUrl)); + this._terminal.writeLine(' ', Colorize.cyan(artifactoryWebsiteUrl)); this._terminal.writeLine(); } } @@ -254,7 +251,7 @@ export class SetupPackageRegistry { artifactoryUser = artifactoryUser.trim(); if (artifactoryUser.length === 0) { - this._terminal.writeLine(Colors.red('Operation aborted because the input was empty')); + this._terminal.writeLine(Colorize.red('Operation aborted because the input was empty')); this._terminal.writeLine(); throw new AlreadyReportedError(); } @@ -268,7 +265,7 @@ export class SetupPackageRegistry { artifactoryKey = artifactoryKey.trim(); if (artifactoryKey.length === 0) { - this._terminal.writeLine(Colors.red('Operation aborted because the input was empty')); + this._terminal.writeLine(Colorize.red('Operation aborted because the input was empty')); this._terminal.writeLine(); throw new AlreadyReportedError(); } @@ -397,7 +394,7 @@ export class SetupPackageRegistry { } this._terminal.writeLine(); - this._terminal.writeLine(Colors.green('Adding Artifactory token to: '), npmrcPath); + this._terminal.writeLine(Colorize.green('Adding Artifactory token to: '), npmrcPath); const npmrcLines: string[] = []; diff --git a/libraries/rush-lib/src/logic/setup/TerminalInput.ts b/libraries/rush-lib/src/logic/setup/TerminalInput.ts index 05f46cb810f..47bf4f144ae 100644 --- a/libraries/rush-lib/src/logic/setup/TerminalInput.ts +++ b/libraries/rush-lib/src/logic/setup/TerminalInput.ts @@ -4,7 +4,7 @@ import * as readline from 'readline'; import * as process from 'process'; import colors from 'colors/safe'; -import { AnsiEscape } from '@rushstack/node-core-library'; +import { AnsiEscape } from '@rushstack/terminal'; import { KeyboardLoop } from './KeyboardLoop'; diff --git a/libraries/rush-lib/src/logic/test/BaseInstallManager.test.ts b/libraries/rush-lib/src/logic/test/BaseInstallManager.test.ts index 59fcc9e39b7..f1719640e51 100644 --- a/libraries/rush-lib/src/logic/test/BaseInstallManager.test.ts +++ b/libraries/rush-lib/src/logic/test/BaseInstallManager.test.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { ConsoleTerminalProvider } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider } from '@rushstack/terminal'; import { PurgeManager } from '../PurgeManager'; import { BaseInstallManager, pnpmIgnoreCompatibilityDbParameter } from '../base/BaseInstallManager'; diff --git a/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts b/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts index 5760c02a45b..c5257354feb 100644 --- a/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts +++ b/libraries/rush-lib/src/logic/test/ProjectChangeAnalyzer.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer'; import type { RushConfiguration } from '../../api/RushConfiguration'; diff --git a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts new file mode 100644 index 00000000000..89213fdb03b --- /dev/null +++ b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { FileSystem, Path } from '@rushstack/node-core-library'; +import { ProjectImpactGraphGenerator } from '../ProjectImpactGraphGenerator'; +import { RushConfiguration } from '../../api/RushConfiguration'; +import { Stopwatch } from '../../utilities/Stopwatch'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; + +const NORMALIZED_DIRNAME: string = Path.convertToSlashes(__dirname); + +async function runTestForExampleRepoAsync( + repoName: string, + testFn: (generator: ProjectImpactGraphGenerator) => Promise +): Promise { + const terminalProvider: StringBufferTerminalProvider = new StringBufferTerminalProvider(true); + const terminal: Terminal = new Terminal(terminalProvider); + const rushConfiguration: RushConfiguration = RushConfiguration.loadFromConfigurationFile( + `${NORMALIZED_DIRNAME}/${repoName}/rush.json` + ); + + const generator: ProjectImpactGraphGenerator = new ProjectImpactGraphGenerator(terminal, rushConfiguration); + await testFn(generator); + + expect({ + output: terminalProvider.getOutput({ normalizeSpecialCharacters: true }), + verbose: terminalProvider.getVerbose({ normalizeSpecialCharacters: true }), + error: terminalProvider.getDebugOutput({ normalizeSpecialCharacters: true }), + warning: terminalProvider.getWarningOutput({ normalizeSpecialCharacters: true }), + debug: terminalProvider.getDebugOutput({ normalizeSpecialCharacters: true }) + }).toMatchSnapshot('Terminal Output'); +} + +describe(ProjectImpactGraphGenerator.name, () => { + describe(ProjectImpactGraphGenerator.prototype.generateAsync.name, () => { + beforeEach(() => { + jest.spyOn(Stopwatch.prototype, 'duration', 'get').mockReturnValue(1.5); + }); + + it.each(['workspacePackages', 'packages', 'repo'])( + 'Correctly generates a project impact graph (repo: "%p")', + async (repoName) => + await runTestForExampleRepoAsync(repoName, async (generator) => { + const writeFileAsyncSpy: jest.SpyInstance = jest + .spyOn(FileSystem, 'writeFileAsync') + .mockImplementation(); + + await generator.generateAsync(); + + expect(writeFileAsyncSpy).toHaveBeenCalledTimes(1); + expect( + Path.convertToSlashes(writeFileAsyncSpy.mock.calls[0][0]).replace( + `${NORMALIZED_DIRNAME}/${repoName}`, + '' + ) + ).toMatchSnapshot('Output file path'); + expect(writeFileAsyncSpy.mock.calls[0][1]).toMatchSnapshot('Output file data'); + }) + ); + }); + + describe(ProjectImpactGraphGenerator.prototype.validateAsync.name, () => { + it.each(['workspacePackages'])( + 'Reports if the project-impact-graph.yaml file is missing (repo: "%p")', + async (repoName) => + await runTestForExampleRepoAsync(repoName, async (generator) => { + await expect(generator.validateAsync()).resolves.toBe(false); + }) + ); + }); +}); diff --git a/libraries/rush-lib/src/logic/test/Telemetry.test.ts b/libraries/rush-lib/src/logic/test/Telemetry.test.ts index 42028e84242..d98795c26de 100644 --- a/libraries/rush-lib/src/logic/test/Telemetry.test.ts +++ b/libraries/rush-lib/src/logic/test/Telemetry.test.ts @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import { JsonFile } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider } from '@rushstack/terminal'; + import { RushConfiguration } from '../../api/RushConfiguration'; import { Rush } from '../../api/Rush'; import { Telemetry, type ITelemetryData, type ITelemetryMachineInfo } from '../Telemetry'; import { RushSession } from '../../pluginFramework/RushSession'; -import { ConsoleTerminalProvider, JsonFile } from '@rushstack/node-core-library'; interface ITelemetryPrivateMembers extends Omit { _flushAsyncTasks: Map>; diff --git a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap new file mode 100644 index 00000000000..f784a772885 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap @@ -0,0 +1,292 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Output file data 1`] = ` +"globalExcludedGlobs: + - common/autoinstallers/** +projects: + a: + includedGlobs: + - a/** + dependentProjects: + - a + - b + - e + - g + - h + b: + includedGlobs: + - b/** + dependentProjects: + - b + - c + - f + c: + includedGlobs: + - c/** + dependentProjects: + - c + - d + cyclic-dep-1: + includedGlobs: + - cyclic-dep-1/** + dependentProjects: + - cyclic-dep-1 + - cyclic-dep-2 + cyclic-dep-2: + includedGlobs: + - cyclic-dep-2/** + dependentProjects: + - cyclic-dep-1 + - cyclic-dep-2 + cyclic-dep-explicit-1: + includedGlobs: + - cyclic-dep-explicit-1/** + dependentProjects: + - cyclic-dep-explicit-1 + cyclic-dep-explicit-2: + includedGlobs: + - cyclic-dep-explicit-2/** + dependentProjects: + - cyclic-dep-explicit-1 + - cyclic-dep-explicit-2 + d: + includedGlobs: + - d/** + dependentProjects: + - d + e: + includedGlobs: + - e/** + dependentProjects: + - e + f: + includedGlobs: + - f/** + dependentProjects: + - f + g: + includedGlobs: + - g/** + dependentProjects: + - g + h: + includedGlobs: + - h/** + dependentProjects: + - f + - h + i: + includedGlobs: + - i/** + dependentProjects: + - i + - j + j: + includedGlobs: + - j/** + dependentProjects: + - j +" +`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Output file path 1`] = `"/project-impact-graph.yaml"`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Terminal Output 1`] = ` +Object { + "debug": "", + "error": "", + "output": "[n][green]Generate project impact graph successfully. (1.50 seconds)[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Output file data 1`] = ` +"globalExcludedGlobs: + - common/autoinstallers/** +projects: + a: + includedGlobs: + - a/** + dependentProjects: + - a + - b + - f + - g + - h + b: + includedGlobs: + - b/** + dependentProjects: + - b + - c + - d + c: + includedGlobs: + - c/** + dependentProjects: + - c + - e + d: + includedGlobs: + - d/** + dependentProjects: + - d + e: + includedGlobs: + - e/** + dependentProjects: + - e + f: + includedGlobs: + - f/** + dependentProjects: + - f + g: + includedGlobs: + - g/** + dependentProjects: + - g + h: + includedGlobs: + - h/** + dependentProjects: + - f + - h + i: + includedGlobs: + - i/** + dependentProjects: + - i + j: + includedGlobs: + - j/** + dependentProjects: + - j +" +`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Output file path 1`] = `"/project-impact-graph.yaml"`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Terminal Output 1`] = ` +Object { + "debug": "", + "error": "", + "output": "[n][green]Generate project impact graph successfully. (1.50 seconds)[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Output file data 1`] = ` +"globalExcludedGlobs: + - common/config/version-policies.json +projects: + a: + includedGlobs: + - a/** + dependentProjects: + - a + - b + - e + - g + - h + b: + includedGlobs: + - b/** + dependentProjects: + - b + - c + - f + c: + includedGlobs: + - c/** + dependentProjects: + - c + - d + cyclic-dep-1: + includedGlobs: + - cyclic-dep-1/** + dependentProjects: + - cyclic-dep-1 + - cyclic-dep-2 + cyclic-dep-2: + includedGlobs: + - cyclic-dep-2/** + dependentProjects: + - cyclic-dep-1 + - cyclic-dep-2 + cyclic-dep-explicit-1: + includedGlobs: + - cyclic-dep-explicit-1/** + dependentProjects: + - cyclic-dep-explicit-1 + cyclic-dep-explicit-2: + includedGlobs: + - cyclic-dep-explicit-2/** + dependentProjects: + - cyclic-dep-explicit-1 + - cyclic-dep-explicit-2 + d: + includedGlobs: + - d/** + dependentProjects: + - d + e: + includedGlobs: + - e/** + dependentProjects: + - e + excludedGlobs: + - e/src/** + f: + includedGlobs: + - f/** + dependentProjects: + - f + g: + includedGlobs: + - g/** + dependentProjects: + - g + h: + includedGlobs: + - h/** + dependentProjects: + - f + - h + i: + includedGlobs: + - i/** + dependentProjects: + - i + - j + j: + includedGlobs: + - j/** + dependentProjects: + - j +" +`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Output file path 1`] = `"/project-impact-graph.yaml"`; + +exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Terminal Output 1`] = ` +Object { + "debug": "", + "error": "", + "output": "[n][green]Generate project impact graph successfully. (1.50 seconds)[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`ProjectImpactGraphGenerator validateAsync Reports if the project-impact-graph.yaml file is missing (repo: ""workspacePackages""): Terminal Output 1`] = ` +Object { + "debug": "", + "error": "", + "output": "", + "verbose": "", + "warning": "", +} +`; diff --git a/libraries/rush-lib/src/logic/test/workspacePackages/.mergequeueignore b/libraries/rush-lib/src/logic/test/workspacePackages/.mergequeueignore new file mode 100644 index 00000000000..b68298052b9 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/workspacePackages/.mergequeueignore @@ -0,0 +1 @@ +common/config/version-policies.json \ No newline at end of file diff --git a/libraries/rush-lib/src/logic/test/workspacePackages/e/.mergequeueignore b/libraries/rush-lib/src/logic/test/workspacePackages/e/.mergequeueignore new file mode 100644 index 00000000000..c578b1d164c --- /dev/null +++ b/libraries/rush-lib/src/logic/test/workspacePackages/e/.mergequeueignore @@ -0,0 +1 @@ +src/** \ No newline at end of file diff --git a/libraries/rush-lib/src/logic/versionMismatch/VersionMismatchFinder.ts b/libraries/rush-lib/src/logic/versionMismatch/VersionMismatchFinder.ts index 22e8bfa4ecb..cebeff4b29c 100644 --- a/libraries/rush-lib/src/logic/versionMismatch/VersionMismatchFinder.ts +++ b/libraries/rush-lib/src/logic/versionMismatch/VersionMismatchFinder.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import colors from 'colors/safe'; -import { AlreadyReportedError, type ITerminal } from '@rushstack/node-core-library'; +import { AlreadyReportedError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { RushConfiguration } from '../../api/RushConfiguration'; import { type PackageJsonDependency, DependencyType } from '../../api/PackageJsonEditor'; diff --git a/libraries/rush-lib/src/pluginFramework/PluginLoader/PluginLoaderBase.ts b/libraries/rush-lib/src/pluginFramework/PluginLoader/PluginLoaderBase.ts index 90cf5bad252..3b9a3d568f6 100644 --- a/libraries/rush-lib/src/pluginFramework/PluginLoader/PluginLoaderBase.ts +++ b/libraries/rush-lib/src/pluginFramework/PluginLoader/PluginLoaderBase.ts @@ -4,11 +4,11 @@ import { FileSystem, InternalError, - type ITerminal, JsonFile, type JsonObject, JsonSchema } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import * as path from 'path'; import { CommandLineConfiguration } from '../../api/CommandLineConfiguration'; diff --git a/libraries/rush-lib/src/pluginFramework/PluginManager.ts b/libraries/rush-lib/src/pluginFramework/PluginManager.ts index a6c9ffa59b9..9a5181e078c 100644 --- a/libraries/rush-lib/src/pluginFramework/PluginManager.ts +++ b/libraries/rush-lib/src/pluginFramework/PluginManager.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { FileSystem, Import, InternalError, type ITerminal } from '@rushstack/node-core-library'; +import { FileSystem, Import, InternalError } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { CommandLineConfiguration } from '../api/CommandLineConfiguration'; import type { RushConfiguration } from '../api/RushConfiguration'; diff --git a/libraries/rush-lib/src/pluginFramework/RushSession.ts b/libraries/rush-lib/src/pluginFramework/RushSession.ts index 3cb68941631..221a23133f8 100644 --- a/libraries/rush-lib/src/pluginFramework/RushSession.ts +++ b/libraries/rush-lib/src/pluginFramework/RushSession.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { InternalError, type ITerminalProvider } from '@rushstack/node-core-library'; +import { InternalError } from '@rushstack/node-core-library'; +import type { ITerminalProvider } from '@rushstack/terminal'; import { type ILogger, type ILoggerOptions, Logger } from './logging/Logger'; import { RushLifecycleHooks } from './RushLifeCycle'; diff --git a/libraries/rush-lib/src/pluginFramework/logging/Logger.ts b/libraries/rush-lib/src/pluginFramework/logging/Logger.ts index e09a8626558..46b01be524f 100644 --- a/libraries/rush-lib/src/pluginFramework/logging/Logger.ts +++ b/libraries/rush-lib/src/pluginFramework/logging/Logger.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { type ITerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { type ITerminalProvider, Terminal } from '@rushstack/terminal'; /** * @beta diff --git a/libraries/rush-lib/src/schemas/experiments.schema.json b/libraries/rush-lib/src/schemas/experiments.schema.json index d14fc18534d..90a0f729add 100644 --- a/libraries/rush-lib/src/schemas/experiments.schema.json +++ b/libraries/rush-lib/src/schemas/experiments.schema.json @@ -53,6 +53,14 @@ "forbidPhantomResolvableNodeModulesFolders": { "description": "If true, Rush will not allow node_modules in the repo folder or in parent folders.", "type": "boolean" + }, + "usePnpmSyncForInjectedDependencies": { + "description": "(UNDER DEVELOPMENT) For certain installation problems involving peer dependencies, PNPM cannot correctly satisfy versioning requirements without installing duplicate copies of a package inside the node_modules folder. This poses a problem for 'workspace:*' dependencies, as they are normally installed by making a symlink to the local project source folder. PNPM's 'injected dependencies' feature provides a model for copying the local project folder into node_modules, however copying must occur AFTER the dependency project is built and BEFORE the consuming project starts to build. The 'pnpm-sync' tool manages this operation; see its documentation for details. Enable this experiment if you want 'rush' and 'rushx' commands to resync injected dependencies by invoking 'pnpm-sync' during the build.", + "type": "boolean" + }, + "generateProjectImpactGraphDuringRushUpdate": { + "description": "If set to true, Rush will generate a `project-impact-graph.yaml` file in the repository root during `rush update`.", + "type": "boolean" } }, "additionalProperties": false diff --git a/libraries/rush-lib/src/schemas/subspaces.schema.json b/libraries/rush-lib/src/schemas/subspaces.schema.json index e6d62d9b2fe..5322a806a7b 100644 --- a/libraries/rush-lib/src/schemas/subspaces.schema.json +++ b/libraries/rush-lib/src/schemas/subspaces.schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Rush subspace config file.", - "description": "The configuration file for enabling the subspaces feature in rush. This is an EXPERIMENTAL feature which is not yet fully implemented. To opt into the experiemnt, simply toggle the 'enabled' property in this file.", + "description": "The configuration file for enabling the subspaces feature in rush. This is an EXPERIMENTAL feature which is not yet fully implemented. To opt into the experiment, simply toggle the 'enabled' property in this file.", "type": "object", "properties": { @@ -9,7 +9,7 @@ "description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.", "type": "string" }, - "enabled": { + "subspacesEnabled": { "description": "If true, rush will use the subspaces configuration.", "type": "boolean" }, @@ -17,6 +17,10 @@ "description": "(DEPRECATED) Allows individual subspaces to be configured at the package level if that package is the only project in the subspace. Used to help migrate from a split workspace state.", "type": "boolean" }, + "preventSelectingAllSubspaces": { + "description": "If true, requires a selector for a subspace or set of subspaces when installing.", + "type": "boolean" + }, "subspaceNames": { "description": "Individual subspace configurations.", "type": "array", diff --git a/libraries/rush-lib/src/utilities/CollatedTerminalProvider.ts b/libraries/rush-lib/src/utilities/CollatedTerminalProvider.ts index 0addd4b8d99..d83701011c3 100644 --- a/libraries/rush-lib/src/utilities/CollatedTerminalProvider.ts +++ b/libraries/rush-lib/src/utilities/CollatedTerminalProvider.ts @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { type ITerminalProvider, TerminalProviderSeverity } from '@rushstack/node-core-library'; import type { CollatedTerminal } from '@rushstack/stream-collator'; -import { TerminalChunkKind } from '@rushstack/terminal'; +import { type ITerminalProvider, TerminalProviderSeverity, TerminalChunkKind } from '@rushstack/terminal'; export interface ICollatedTerminalProviderOptions { debugEnabled: boolean; diff --git a/libraries/rush-lib/src/utilities/NullTerminalProvider.ts b/libraries/rush-lib/src/utilities/NullTerminalProvider.ts index d95201cb8a8..675e75e29db 100644 --- a/libraries/rush-lib/src/utilities/NullTerminalProvider.ts +++ b/libraries/rush-lib/src/utilities/NullTerminalProvider.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminalProvider } from '@rushstack/node-core-library'; +import type { ITerminalProvider } from '@rushstack/terminal'; /** * A terminal provider like /dev/null diff --git a/libraries/rush-lib/src/utilities/TarExecutable.ts b/libraries/rush-lib/src/utilities/TarExecutable.ts index 04b3cdd6be8..237f8662239 100644 --- a/libraries/rush-lib/src/utilities/TarExecutable.ts +++ b/libraries/rush-lib/src/utilities/TarExecutable.ts @@ -3,7 +3,8 @@ import * as path from 'path'; import os from 'os'; -import { Executable, FileSystem, FileWriter, type ITerminal } from '@rushstack/node-core-library'; +import { Executable, FileSystem, FileWriter } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import type { ChildProcess } from 'child_process'; import events from 'events'; diff --git a/libraries/rush-sdk/package.json b/libraries/rush-sdk/package.json index fa864420b51..fe2f6ec47de 100644 --- a/libraries/rush-sdk/package.json +++ b/libraries/rush-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-sdk", - "version": "5.113.0", + "version": "5.114.0", "description": "An API for interacting with the Rush engine", "repository": { "type": "git", diff --git a/libraries/rush-sdk/src/index.ts b/libraries/rush-sdk/src/index.ts index adb619dfc6f..56d3c7eb276 100644 --- a/libraries/rush-sdk/src/index.ts +++ b/libraries/rush-sdk/src/index.ts @@ -7,10 +7,9 @@ import { type JsonObject, type IPackageJson, PackageJsonLookup, - Executable, - Terminal, - ConsoleTerminalProvider + Executable } from '@rushstack/node-core-library'; +import { Terminal, ConsoleTerminalProvider } from '@rushstack/terminal'; import type { SpawnSyncReturns } from 'child_process'; import { RUSH_LIB_NAME, diff --git a/libraries/stream-collator/CHANGELOG.json b/libraries/stream-collator/CHANGELOG.json index 90f5343e89c..c47f20944bc 100644 --- a/libraries/stream-collator/CHANGELOG.json +++ b/libraries/stream-collator/CHANGELOG.json @@ -1,6 +1,128 @@ { "name": "@rushstack/stream-collator", "entries": [ + { + "version": "4.1.28", + "tag": "@rushstack/stream-collator_v4.1.28", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "4.1.27", + "tag": "@rushstack/stream-collator_v4.1.27", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "4.1.26", + "tag": "@rushstack/stream-collator_v4.1.26", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "4.1.25", + "tag": "@rushstack/stream-collator_v4.1.25", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "4.1.24", + "tag": "@rushstack/stream-collator_v4.1.24", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "4.1.23", + "tag": "@rushstack/stream-collator_v4.1.23", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "4.1.22", + "tag": "@rushstack/stream-collator_v4.1.22", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.7.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "4.1.21", "tag": "@rushstack/stream-collator_v4.1.21", diff --git a/libraries/stream-collator/CHANGELOG.md b/libraries/stream-collator/CHANGELOG.md index f73057c81c3..a384fad95a5 100644 --- a/libraries/stream-collator/CHANGELOG.md +++ b/libraries/stream-collator/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @rushstack/stream-collator -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 4.1.28 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 4.1.27 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 4.1.26 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 4.1.25 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 4.1.24 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 4.1.23 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 4.1.22 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 4.1.21 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/stream-collator/README.md b/libraries/stream-collator/README.md index ae248f51fea..fed7d4f7d75 100644 --- a/libraries/stream-collator/README.md +++ b/libraries/stream-collator/README.md @@ -52,6 +52,6 @@ all background streams which have been completed will be emitted. - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/stream-collator/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/stream-collator/) +- [API Reference](https://api.rushstack.io/pages/stream-collator/) `@rushstack/stream-collator` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/stream-collator/package.json b/libraries/stream-collator/package.json index e00511a65e0..d5b7cc128df 100644 --- a/libraries/stream-collator/package.json +++ b/libraries/stream-collator/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/stream-collator", - "version": "4.1.21", + "version": "4.1.28", "description": "Display intelligible realtime output from concurrent processes", "repository": { "type": "git", diff --git a/libraries/terminal/.eslintrc.js b/libraries/terminal/.eslintrc.js index 0b04796d1ee..de794c04ae0 100644 --- a/libraries/terminal/.eslintrc.js +++ b/libraries/terminal/.eslintrc.js @@ -1,13 +1,13 @@ // This is a workaround for https://github.com/eslint/eslint/issues/3458 -require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); +require('local-eslint-config/patch/modern-module-resolution'); // This is a workaround for https://github.com/microsoft/rushstack/issues/3021 -require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); +require('local-eslint-config/patch/custom-config-package-names'); module.exports = { extends: [ - 'local-node-rig/profiles/default/includes/eslint/profile/node', - 'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals', - 'local-node-rig/profiles/default/includes/eslint/mixins/tsdoc' + 'local-eslint-config/profile/node', + 'local-eslint-config/mixins/friendly-locals', + 'local-eslint-config/mixins/tsdoc' ], parserOptions: { tsconfigRootDir: __dirname } }; diff --git a/libraries/terminal/CHANGELOG.json b/libraries/terminal/CHANGELOG.json index b4684ce240c..4b6839e753b 100644 --- a/libraries/terminal/CHANGELOG.json +++ b/libraries/terminal/CHANGELOG.json @@ -1,6 +1,102 @@ { "name": "@rushstack/terminal", "entries": [ + { + "version": "0.8.1", + "tag": "@rushstack/terminal_v0.8.1", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "patch": [ + { + "comment": "Fix a recent regression causing `Error: Cannot find module 'colors/safe'` (GitHub #4525)" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + } + ] + } + }, + { + "version": "0.8.0", + "tag": "@rushstack/terminal_v0.8.0", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "minor": [ + { + "comment": "Introduce a Terminal, Colors, AsciEscape, and some related APIs. These APIs were previously in the @rushstack/node-core-library package. See https://github.com/microsoft/rushstack/pull/3176 for details." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + } + ] + } + }, + { + "version": "0.7.24", + "tag": "@rushstack/terminal_v0.7.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.7.23", + "tag": "@rushstack/terminal_v0.7.23", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.7.22", + "tag": "@rushstack/terminal_v0.7.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.7.21", + "tag": "@rushstack/terminal_v0.7.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.7.20", "tag": "@rushstack/terminal_v0.7.20", diff --git a/libraries/terminal/CHANGELOG.md b/libraries/terminal/CHANGELOG.md index 887bf7fb64e..5f9db266d9b 100644 --- a/libraries/terminal/CHANGELOG.md +++ b/libraries/terminal/CHANGELOG.md @@ -1,6 +1,42 @@ # Change Log - @rushstack/terminal -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.8.1 +Tue, 20 Feb 2024 21:45:10 GMT + +### Patches + +- Fix a recent regression causing `Error: Cannot find module 'colors/safe'` (GitHub #4525) + +## 0.8.0 +Mon, 19 Feb 2024 21:54:27 GMT + +### Minor changes + +- Introduce a Terminal, Colors, AsciEscape, and some related APIs. These APIs were previously in the @rushstack/node-core-library package. See https://github.com/microsoft/rushstack/pull/3176 for details. + +## 0.7.24 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.7.23 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.7.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.7.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.7.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/terminal/README.md b/libraries/terminal/README.md index 355f5a2afc1..ee8ab33b119 100644 --- a/libraries/terminal/README.md +++ b/libraries/terminal/README.md @@ -48,6 +48,6 @@ capable of matching substrings that span multiple chunks. - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/terminal/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/terminal/) +- [API Reference](https://api.rushstack.io/pages/terminal/) `@rushstack/terminal` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/terminal/config/jest.config.json b/libraries/terminal/config/jest.config.json index d1749681d90..8e67263514a 100644 --- a/libraries/terminal/config/jest.config.json +++ b/libraries/terminal/config/jest.config.json @@ -1,3 +1,11 @@ { - "extends": "local-node-rig/profiles/default/config/jest.config.json" + "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json", + + // Enable code coverage for Jest + "collectCoverage": true, + "coverageDirectory": "/coverage", + "coverageReporters": ["cobertura", "html"], + + // Use v8 coverage provider to avoid Babel + "coverageProvider": "v8" } diff --git a/libraries/terminal/config/rig.json b/libraries/terminal/config/rig.json index 165ffb001f5..6ac88a96368 100644 --- a/libraries/terminal/config/rig.json +++ b/libraries/terminal/config/rig.json @@ -3,5 +3,5 @@ // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "local-node-rig" + "rigPackageName": "@rushstack/heft-node-rig" } diff --git a/libraries/terminal/config/rush-project.json b/libraries/terminal/config/rush-project.json new file mode 100644 index 00000000000..4e090849eeb --- /dev/null +++ b/libraries/terminal/config/rush-project.json @@ -0,0 +1,14 @@ +{ + "extends": "@rushstack/heft-node-rig/profiles/default/config/rush-project.json", + + "operationSettings": [ + { + "operationName": "_phase:build", + "outputFolderNames": [".heft"] + }, + { + "operationName": "_phase:test", + "outputFolderNames": ["coverage"] + } + ] +} diff --git a/libraries/terminal/package.json b/libraries/terminal/package.json index 4bde63cf911..5dbb62dd8eb 100644 --- a/libraries/terminal/package.json +++ b/libraries/terminal/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/terminal", - "version": "0.7.20", + "version": "0.8.1", "description": "User interface primitives for console applications", "main": "lib/index.js", "typings": "dist/terminal.d.ts", @@ -16,12 +16,15 @@ "_phase:test": "heft run --only test -- --clean" }, "dependencies": { - "@rushstack/node-core-library": "workspace:*" + "@rushstack/node-core-library": "workspace:*", + "colors": "~1.2.1" }, "devDependencies": { - "@rushstack/heft": "workspace:*", - "local-node-rig": "workspace:*", - "colors": "~1.2.1" + "@rushstack/heft": "0.64.0", + "@rushstack/heft-node-rig": "2.4.0", + "@types/heft-jest": "1.0.1", + "@types/node": "18.17.15", + "local-eslint-config": "workspace:*" }, "peerDependencies": { "@types/node": "*" diff --git a/libraries/node-core-library/src/Terminal/AnsiEscape.ts b/libraries/terminal/src/AnsiEscape.ts similarity index 71% rename from libraries/node-core-library/src/Terminal/AnsiEscape.ts rename to libraries/terminal/src/AnsiEscape.ts index 3f0c1969b8c..c209718cd70 100644 --- a/libraries/node-core-library/src/Terminal/AnsiEscape.ts +++ b/libraries/terminal/src/AnsiEscape.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ConsoleColorCodes } from './Colors'; +import { SgrParameterAttribute } from './Colorize'; /** * Options for {@link AnsiEscape.formatForTests}. @@ -32,6 +32,10 @@ export class AnsiEscape { private static readonly _backslashNRegExp: RegExp = /\n/g; private static readonly _backslashRRegExp: RegExp = /\r/g; + public static getEscapeSequenceForAnsiCode(code: number): string { + return `\u001b[${code}m`; + } + /** * Returns the input text with all ANSI escape codes removed. For example, this is useful when saving * colorized console output to a log file. @@ -80,69 +84,69 @@ export class AnsiEscape { // https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters private static _tryGetSgrFriendlyName(sgiParameter: number): string | undefined { switch (sgiParameter) { - case ConsoleColorCodes.BlackForeground: + case SgrParameterAttribute.BlackForeground: return 'black'; - case ConsoleColorCodes.RedForeground: + case SgrParameterAttribute.RedForeground: return 'red'; - case ConsoleColorCodes.GreenForeground: + case SgrParameterAttribute.GreenForeground: return 'green'; - case ConsoleColorCodes.YellowForeground: + case SgrParameterAttribute.YellowForeground: return 'yellow'; - case ConsoleColorCodes.BlueForeground: + case SgrParameterAttribute.BlueForeground: return 'blue'; - case ConsoleColorCodes.MagentaForeground: + case SgrParameterAttribute.MagentaForeground: return 'magenta'; - case ConsoleColorCodes.CyanForeground: + case SgrParameterAttribute.CyanForeground: return 'cyan'; - case ConsoleColorCodes.WhiteForeground: + case SgrParameterAttribute.WhiteForeground: return 'white'; - case ConsoleColorCodes.GrayForeground: + case SgrParameterAttribute.GrayForeground: return 'gray'; - case ConsoleColorCodes.DefaultForeground: + case SgrParameterAttribute.DefaultForeground: return 'default'; - case ConsoleColorCodes.BlackBackground: + case SgrParameterAttribute.BlackBackground: return 'black-bg'; - case ConsoleColorCodes.RedBackground: + case SgrParameterAttribute.RedBackground: return 'red-bg'; - case ConsoleColorCodes.GreenBackground: + case SgrParameterAttribute.GreenBackground: return 'green-bg'; - case ConsoleColorCodes.YellowBackground: + case SgrParameterAttribute.YellowBackground: return 'yellow-bg'; - case ConsoleColorCodes.BlueBackground: + case SgrParameterAttribute.BlueBackground: return 'blue-bg'; - case ConsoleColorCodes.MagentaBackground: + case SgrParameterAttribute.MagentaBackground: return 'magenta-bg'; - case ConsoleColorCodes.CyanBackground: + case SgrParameterAttribute.CyanBackground: return 'cyan-bg'; - case ConsoleColorCodes.WhiteBackground: + case SgrParameterAttribute.WhiteBackground: return 'white-bg'; - case ConsoleColorCodes.GrayBackground: + case SgrParameterAttribute.GrayBackground: return 'gray-bg'; - case ConsoleColorCodes.DefaultBackground: + case SgrParameterAttribute.DefaultBackground: return 'default-bg'; - case ConsoleColorCodes.Bold: + case SgrParameterAttribute.Bold: return 'bold'; - case ConsoleColorCodes.Dim: + case SgrParameterAttribute.Dim: return 'dim'; - case ConsoleColorCodes.NormalColorOrIntensity: + case SgrParameterAttribute.NormalColorOrIntensity: return 'normal'; - case ConsoleColorCodes.Underline: + case SgrParameterAttribute.Underline: return 'underline'; - case ConsoleColorCodes.UnderlineOff: + case SgrParameterAttribute.UnderlineOff: return 'underline-off'; - case ConsoleColorCodes.Blink: + case SgrParameterAttribute.Blink: return 'blink'; - case ConsoleColorCodes.BlinkOff: + case SgrParameterAttribute.BlinkOff: return 'blink-off'; - case ConsoleColorCodes.InvertColor: + case SgrParameterAttribute.InvertColor: return 'invert'; - case ConsoleColorCodes.InvertColorOff: + case SgrParameterAttribute.InvertColorOff: return 'invert-off'; - case ConsoleColorCodes.Hidden: + case SgrParameterAttribute.Hidden: return 'hidden'; - case ConsoleColorCodes.HiddenOff: + case SgrParameterAttribute.HiddenOff: return 'hidden-off'; default: return undefined; diff --git a/libraries/terminal/src/Colorize.ts b/libraries/terminal/src/Colorize.ts new file mode 100644 index 00000000000..666ebe0cecb --- /dev/null +++ b/libraries/terminal/src/Colorize.ts @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { AnsiEscape } from './AnsiEscape'; + +export enum SgrParameterAttribute { + BlackForeground = 30, + RedForeground = 31, + GreenForeground = 32, + YellowForeground = 33, + BlueForeground = 34, + MagentaForeground = 35, + CyanForeground = 36, + WhiteForeground = 37, + GrayForeground = 90, + DefaultForeground = 39, + + BlackBackground = 40, + RedBackground = 41, + GreenBackground = 42, + YellowBackground = 43, + BlueBackground = 44, + MagentaBackground = 45, + CyanBackground = 46, + WhiteBackground = 47, + GrayBackground = 100, + DefaultBackground = 49, + + Bold = 1, + + // On Linux, the "BoldOff" code instead causes the text to be double-underlined: + // https://en.wikipedia.org/wiki/Talk:ANSI_escape_code#SGR_21%E2%80%94%60Bold_off%60_not_widely_supported + // Use "NormalColorOrIntensity" instead + // BoldOff = 21, + + Dim = 2, + NormalColorOrIntensity = 22, + Underline = 4, + UnderlineOff = 24, + Blink = 5, + BlinkOff = 25, + InvertColor = 7, + InvertColorOff = 27, + Hidden = 8, + HiddenOff = 28 +} + +/** + * The static functions on this class are used to produce colored text + * for use with a terminal that supports ANSI escape codes. + * + * Note that this API always generates color codes, regardless of whether + * the process's stdout is a TTY. The reason is that, in a complex program, the + * code that is generating strings often does not know were those strings will end + * up. In some cases, the same log message may get printed both to a shell + * that supports color AND to a log file that does not. + * + * @example + * ```ts + * console.log(Colorize.red('Red Text!')) + * terminal.writeLine(Colorize.green('Green Text!'), ' ', Colorize.blue('Blue Text!')); + *``` + * + * @public + */ +export class Colorize { + public static black(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.BlackForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static red(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.RedForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static green(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.GreenForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static yellow(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.YellowForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static blue(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.BlueForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static magenta(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.MagentaForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static cyan(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.CyanForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static white(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.WhiteForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static gray(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.GrayForeground, + SgrParameterAttribute.DefaultForeground, + text + ); + } + + public static blackBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.BlackBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static redBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.RedBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static greenBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.GreenBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static yellowBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.YellowBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static blueBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.BlueBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static magentaBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.MagentaBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static cyanBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.CyanBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static whiteBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.WhiteBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static grayBackground(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.GrayBackground, + SgrParameterAttribute.DefaultBackground, + text + ); + } + + public static bold(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.Bold, + SgrParameterAttribute.NormalColorOrIntensity, + text + ); + } + + public static dim(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.Dim, + SgrParameterAttribute.NormalColorOrIntensity, + text + ); + } + + public static underline(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.Underline, + SgrParameterAttribute.UnderlineOff, + text + ); + } + + public static blink(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.Blink, + SgrParameterAttribute.BlinkOff, + text + ); + } + + public static invertColor(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.InvertColor, + SgrParameterAttribute.InvertColorOff, + text + ); + } + + public static hidden(text: string): string { + return Colorize._wrapTextInAnsiEscapeCodes( + SgrParameterAttribute.Hidden, + SgrParameterAttribute.HiddenOff, + text + ); + } + + private static _wrapTextInAnsiEscapeCodes(startCode: number, endCode: number, text: string): string { + return ( + AnsiEscape.getEscapeSequenceForAnsiCode(startCode) + + text + + AnsiEscape.getEscapeSequenceForAnsiCode(endCode) + ); + } +} diff --git a/libraries/node-core-library/src/Terminal/ConsoleTerminalProvider.ts b/libraries/terminal/src/ConsoleTerminalProvider.ts similarity index 100% rename from libraries/node-core-library/src/Terminal/ConsoleTerminalProvider.ts rename to libraries/terminal/src/ConsoleTerminalProvider.ts diff --git a/libraries/node-core-library/src/Terminal/ITerminal.ts b/libraries/terminal/src/ITerminal.ts similarity index 62% rename from libraries/node-core-library/src/Terminal/ITerminal.ts rename to libraries/terminal/src/ITerminal.ts index 55a1c19426e..2d3e3b94dab 100644 --- a/libraries/node-core-library/src/Terminal/ITerminal.ts +++ b/libraries/terminal/src/ITerminal.ts @@ -2,7 +2,22 @@ // See LICENSE in the project root for license information. import type { ITerminalProvider } from './ITerminalProvider'; -import type { IColorableSequence } from './Colors'; + +/** + * @beta + */ +export interface ITerminalWriteOptions { + /** + * If set to true, SGR parameters will not be replaced by the terminal + * standard (i.e. - red for errors, yellow for warnings). + */ + doNotOverrideSgrCodes?: boolean; +} + +/** + * @beta + */ +export type TerminalWriteParameters = string[] | [...string[], ITerminalWriteOptions]; /** * @beta @@ -21,12 +36,12 @@ export interface ITerminal { /** * Write a generic message to the terminal */ - write(...messageParts: (string | IColorableSequence)[]): void; + write(...messageParts: TerminalWriteParameters): void; /** * Write a generic message to the terminal, followed by a newline */ - writeLine(...messageParts: (string | IColorableSequence)[]): void; + writeLine(...messageParts: TerminalWriteParameters): void; /** * Write a warning message to the console with yellow text. @@ -34,7 +49,7 @@ export interface ITerminal { * @remarks * The yellow color takes precedence over any other foreground colors set. */ - writeWarning(...messageParts: (string | IColorableSequence)[]): void; + writeWarning(...messageParts: TerminalWriteParameters): void; /** * Write a warning message to the console with yellow text, followed by a newline. @@ -42,7 +57,7 @@ export interface ITerminal { * @remarks * The yellow color takes precedence over any other foreground colors set. */ - writeWarningLine(...messageParts: (string | IColorableSequence)[]): void; + writeWarningLine(...messageParts: TerminalWriteParameters): void; /** * Write an error message to the console with red text. @@ -50,7 +65,7 @@ export interface ITerminal { * @remarks * The red color takes precedence over any other foreground colors set. */ - writeError(...messageParts: (string | IColorableSequence)[]): void; + writeError(...messageParts: TerminalWriteParameters): void; /** * Write an error message to the console with red text, followed by a newline. @@ -58,25 +73,25 @@ export interface ITerminal { * @remarks * The red color takes precedence over any other foreground colors set. */ - writeErrorLine(...messageParts: (string | IColorableSequence)[]): void; + writeErrorLine(...messageParts: TerminalWriteParameters): void; /** * Write a verbose-level message. */ - writeVerbose(...messageParts: (string | IColorableSequence)[]): void; + writeVerbose(...messageParts: TerminalWriteParameters): void; /** * Write a verbose-level message followed by a newline. */ - writeVerboseLine(...messageParts: (string | IColorableSequence)[]): void; + writeVerboseLine(...messageParts: TerminalWriteParameters): void; /** * Write a debug-level message. */ - writeDebug(...messageParts: (string | IColorableSequence)[]): void; + writeDebug(...messageParts: TerminalWriteParameters): void; /** * Write a debug-level message followed by a newline. */ - writeDebugLine(...messageParts: (string | IColorableSequence)[]): void; + writeDebugLine(...messageParts: TerminalWriteParameters): void; } diff --git a/libraries/node-core-library/src/Terminal/ITerminalProvider.ts b/libraries/terminal/src/ITerminalProvider.ts similarity index 100% rename from libraries/node-core-library/src/Terminal/ITerminalProvider.ts rename to libraries/terminal/src/ITerminalProvider.ts diff --git a/libraries/terminal/src/MockWritable.ts b/libraries/terminal/src/MockWritable.ts index 832a5da73a6..04ced06f8da 100644 --- a/libraries/terminal/src/MockWritable.ts +++ b/libraries/terminal/src/MockWritable.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import { AnsiEscape } from './AnsiEscape'; import type { ITerminalChunk } from './ITerminalChunk'; import { TerminalWritable } from './TerminalWritable'; -import { AnsiEscape } from '@rushstack/node-core-library'; /** * A {@link TerminalWritable} subclass for use by unit tests. diff --git a/libraries/node-core-library/src/Terminal/PrefixProxyTerminalProvider.ts b/libraries/terminal/src/PrefixProxyTerminalProvider.ts similarity index 98% rename from libraries/node-core-library/src/Terminal/PrefixProxyTerminalProvider.ts rename to libraries/terminal/src/PrefixProxyTerminalProvider.ts index f12163e6de0..ce02bbc4c1e 100644 --- a/libraries/node-core-library/src/Terminal/PrefixProxyTerminalProvider.ts +++ b/libraries/terminal/src/PrefixProxyTerminalProvider.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import { Text } from '@rushstack/node-core-library'; import type { ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider'; -import { Text } from '../Text'; /** * @beta diff --git a/libraries/terminal/src/PrintUtilities.ts b/libraries/terminal/src/PrintUtilities.ts index d4db26ad9f2..6b22e6acd32 100644 --- a/libraries/terminal/src/PrintUtilities.ts +++ b/libraries/terminal/src/PrintUtilities.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from './ITerminal'; /** * A sensible fallback column width for consoles. diff --git a/libraries/terminal/src/RemoveColorsTextRewriter.ts b/libraries/terminal/src/RemoveColorsTextRewriter.ts index f042a04bde6..7a9e8dd3352 100644 --- a/libraries/terminal/src/RemoveColorsTextRewriter.ts +++ b/libraries/terminal/src/RemoveColorsTextRewriter.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { AnsiEscape } from '@rushstack/node-core-library'; +import { AnsiEscape } from './AnsiEscape'; import { TextRewriter, type TextRewriterState } from './TextRewriter'; enum State { diff --git a/libraries/node-core-library/src/Terminal/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts similarity index 97% rename from libraries/node-core-library/src/Terminal/StringBufferTerminalProvider.ts rename to libraries/terminal/src/StringBufferTerminalProvider.ts index 4ee07fe4721..b03408c80f4 100644 --- a/libraries/node-core-library/src/Terminal/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import { StringBuilder, Text } from '@rushstack/node-core-library'; import { type ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider'; -import { StringBuilder } from '../StringBuilder'; -import { Text } from '../Text'; import { AnsiEscape } from './AnsiEscape'; /** diff --git a/libraries/terminal/src/Terminal.ts b/libraries/terminal/src/Terminal.ts new file mode 100644 index 00000000000..cf346a8101f --- /dev/null +++ b/libraries/terminal/src/Terminal.ts @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { type ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider'; +import { Colorize, SgrParameterAttribute } from './Colorize'; +import type { ITerminal, ITerminalWriteOptions, TerminalWriteParameters } from './ITerminal'; +import { AnsiEscape } from './AnsiEscape'; + +/** + * Colors used with {@link ILegacyColorableSequence}. + */ +enum ColorValue { + Black, + Red, + Green, + Yellow, + Blue, + Magenta, + Cyan, + White, + Gray +} + +/** + * Text styles used with {@link ILegacyColorableSequence}. + */ +enum TextAttribute { + Bold, + Dim, + Underline, + Blink, + InvertColor, + Hidden +} + +interface ILegacyColorableSequence { + text: string; + isEol?: boolean; + foregroundColor?: ColorValue; + backgroundColor?: ColorValue; + textAttributes?: TextAttribute[]; +} + +/** + * This class facilitates writing to a console. + * + * @beta + */ +export class Terminal implements ITerminal { + private _providers: Set; + + public constructor(provider: ITerminalProvider) { + this._providers = new Set(); + this._providers.add(provider); + } + + /** + * {@inheritdoc ITerminal.registerProvider} + */ + public registerProvider(provider: ITerminalProvider): void { + this._providers.add(provider); + } + + /** + * {@inheritdoc ITerminal.unregisterProvider} + */ + public unregisterProvider(provider: ITerminalProvider): void { + if (this._providers.has(provider)) { + this._providers.delete(provider); + } + } + + /** + * {@inheritdoc ITerminal.write} + */ + public write(...messageParts: TerminalWriteParameters): void { + const { parts } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders(parts, TerminalProviderSeverity.log, false); + } + + /** + * {@inheritdoc ITerminal.writeLine} + */ + public writeLine(...messageParts: TerminalWriteParameters): void { + const { parts } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders(parts, TerminalProviderSeverity.log, true); + } + + /** + * {@inheritdoc ITerminal.writeWarning} + */ + public writeWarning(...messageParts: TerminalWriteParameters): void { + const { + parts, + options: { doNotOverrideSgrCodes } + } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders( + doNotOverrideSgrCodes + ? parts + : parts.map((part): string => Colorize.yellow(AnsiEscape.removeCodes(part))), + TerminalProviderSeverity.warning, + false + ); + } + + /** + * {@inheritdoc ITerminal.writeWarningLine} + */ + public writeWarningLine(...messageParts: TerminalWriteParameters): void { + const { + parts, + options: { doNotOverrideSgrCodes } + } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders( + doNotOverrideSgrCodes + ? parts + : parts.map((part): string => Colorize.yellow(AnsiEscape.removeCodes(part))), + TerminalProviderSeverity.warning, + true + ); + } + + /** + * {@inheritdoc ITerminal.writeError} + */ + public writeError(...messageParts: TerminalWriteParameters): void { + const { + parts, + options: { doNotOverrideSgrCodes } + } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders( + doNotOverrideSgrCodes ? parts : parts.map((part): string => Colorize.red(AnsiEscape.removeCodes(part))), + TerminalProviderSeverity.error, + false + ); + } + + /** + * {@inheritdoc ITerminal.writeErrorLine} + */ + public writeErrorLine(...messageParts: TerminalWriteParameters): void { + const { + parts, + options: { doNotOverrideSgrCodes } + } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders( + doNotOverrideSgrCodes ? parts : parts.map((part): string => Colorize.red(AnsiEscape.removeCodes(part))), + TerminalProviderSeverity.error, + true + ); + } + + /** + * {@inheritdoc ITerminal.writeVerbose} + */ + public writeVerbose(...messageParts: TerminalWriteParameters): void { + const { parts } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders(parts, TerminalProviderSeverity.verbose, false); + } + + /** + * {@inheritdoc ITerminal.writeVerboseLine} + */ + public writeVerboseLine(...messageParts: TerminalWriteParameters): void { + const { parts } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders(parts, TerminalProviderSeverity.verbose, true); + } + + /** + * {@inheritdoc ITerminal.writeDebug} + */ + public writeDebug(...messageParts: TerminalWriteParameters): void { + const { parts } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders(parts, TerminalProviderSeverity.debug, false); + } + + /** + * {@inheritdoc ITerminal.writeDebugLine} + */ + public writeDebugLine(...messageParts: TerminalWriteParameters): void { + const { parts } = this._normalizeWriteParameters(messageParts); + this._writeSegmentsToProviders(parts, TerminalProviderSeverity.debug, true); + } + + private _writeSegmentsToProviders( + segments: (string | ILegacyColorableSequence)[], + severity: TerminalProviderSeverity, + followedByEol: boolean + ): void { + const linesSegments: string[][] = [[]]; + let currentLineSegments: string[] = linesSegments[0]; + for (const segment of segments) { + if (typeof segment === 'string') { + currentLineSegments.push(segment); + } else { + if (segment.isEol) { + linesSegments.push([]); + currentLineSegments = linesSegments[linesSegments.length - 1]; + } else { + currentLineSegments.push(this._serializeLegacyColorableSequence(segment)); + } + } + } + + const lines: string[] = []; + for (const lineSegments of linesSegments) { + lines.push(lineSegments.join('')); + } + + if (followedByEol) { + lines.push(''); + } + + let linesWithoutColor: string[] | undefined; + + const concatenatedLinesWithColorByNewlineChar: Map = new Map(); + const concatenatedLinesWithoutColorByNewlineChar: Map = new Map(); + for (const provider of this._providers) { + let textToWrite: string | undefined; + const eol: string = provider.eolCharacter; + if (provider.supportsColor) { + textToWrite = concatenatedLinesWithColorByNewlineChar.get(eol); + if (!textToWrite) { + textToWrite = lines.join(eol); + concatenatedLinesWithColorByNewlineChar.set(eol, textToWrite); + } + } else { + textToWrite = concatenatedLinesWithoutColorByNewlineChar.get(eol); + if (!textToWrite) { + if (!linesWithoutColor) { + linesWithoutColor = []; + for (const line of lines) { + linesWithoutColor.push(AnsiEscape.removeCodes(line)); + } + } + + textToWrite = linesWithoutColor.join(eol); + concatenatedLinesWithoutColorByNewlineChar.set(eol, textToWrite); + } + } + + provider.write(textToWrite, severity); + } + } + + private _serializeLegacyColorableSequence(segment: ILegacyColorableSequence): string { + const startColorCodes: number[] = []; + const endColorCodes: number[] = []; + switch (segment.foregroundColor) { + case ColorValue.Black: { + startColorCodes.push(SgrParameterAttribute.BlackForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Red: { + startColorCodes.push(SgrParameterAttribute.RedForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Green: { + startColorCodes.push(SgrParameterAttribute.GreenForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Yellow: { + startColorCodes.push(SgrParameterAttribute.YellowForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Blue: { + startColorCodes.push(SgrParameterAttribute.BlueForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Magenta: { + startColorCodes.push(SgrParameterAttribute.MagentaForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Cyan: { + startColorCodes.push(SgrParameterAttribute.CyanForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.White: { + startColorCodes.push(SgrParameterAttribute.WhiteForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + + case ColorValue.Gray: { + startColorCodes.push(SgrParameterAttribute.GrayForeground); + endColorCodes.push(SgrParameterAttribute.DefaultForeground); + break; + } + } + + switch (segment.backgroundColor) { + case ColorValue.Black: { + startColorCodes.push(SgrParameterAttribute.BlackBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Red: { + startColorCodes.push(SgrParameterAttribute.RedBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Green: { + startColorCodes.push(SgrParameterAttribute.GreenBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Yellow: { + startColorCodes.push(SgrParameterAttribute.YellowBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Blue: { + startColorCodes.push(SgrParameterAttribute.BlueBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Magenta: { + startColorCodes.push(SgrParameterAttribute.MagentaBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Cyan: { + startColorCodes.push(SgrParameterAttribute.CyanBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.White: { + startColorCodes.push(SgrParameterAttribute.WhiteBackground); + endColorCodes.push(SgrParameterAttribute.DefaultBackground); + break; + } + + case ColorValue.Gray: { + startColorCodes.push(SgrParameterAttribute.GrayBackground); + endColorCodes.push(49); + break; + } + } + + if (segment.textAttributes) { + for (const textAttribute of segment.textAttributes) { + switch (textAttribute) { + case TextAttribute.Bold: { + startColorCodes.push(SgrParameterAttribute.Bold); + endColorCodes.push(SgrParameterAttribute.NormalColorOrIntensity); + break; + } + + case TextAttribute.Dim: { + startColorCodes.push(SgrParameterAttribute.Dim); + endColorCodes.push(SgrParameterAttribute.NormalColorOrIntensity); + break; + } + + case TextAttribute.Underline: { + startColorCodes.push(SgrParameterAttribute.Underline); + endColorCodes.push(SgrParameterAttribute.UnderlineOff); + break; + } + + case TextAttribute.Blink: { + startColorCodes.push(SgrParameterAttribute.Blink); + endColorCodes.push(SgrParameterAttribute.BlinkOff); + break; + } + + case TextAttribute.InvertColor: { + startColorCodes.push(SgrParameterAttribute.InvertColor); + endColorCodes.push(SgrParameterAttribute.InvertColorOff); + break; + } + + case TextAttribute.Hidden: { + startColorCodes.push(SgrParameterAttribute.Hidden); + endColorCodes.push(SgrParameterAttribute.HiddenOff); + break; + } + } + } + } + + const resultSegments: string[] = []; + for (let j: number = 0; j < startColorCodes.length; j++) { + const code: number = startColorCodes[j]; + resultSegments.push(AnsiEscape.getEscapeSequenceForAnsiCode(code)); + } + + resultSegments.push(segment.text); + + for (let j: number = endColorCodes.length - 1; j >= 0; j--) { + const code: number = endColorCodes[j]; + resultSegments.push(AnsiEscape.getEscapeSequenceForAnsiCode(code)); + } + + return resultSegments.join(''); + } + + private _normalizeWriteParameters(parameters: TerminalWriteParameters): { + parts: string[]; + options: ITerminalWriteOptions; + } { + if (parameters.length === 0) { + return { parts: [], options: {} }; + } else { + const lastParameter: string | ITerminalWriteOptions = parameters[parameters.length - 1]; + if (typeof lastParameter === 'string') { + return { parts: parameters as string[], options: {} }; + } else { + return { parts: parameters.slice(0, -1) as string[], options: lastParameter }; + } + } + } +} diff --git a/libraries/node-core-library/src/Terminal/TerminalWritable.ts b/libraries/terminal/src/TerminalStreamWritable.ts similarity index 90% rename from libraries/node-core-library/src/Terminal/TerminalWritable.ts rename to libraries/terminal/src/TerminalStreamWritable.ts index 8681ac5af29..8a45ed3fa9e 100644 --- a/libraries/node-core-library/src/Terminal/TerminalWritable.ts +++ b/libraries/terminal/src/TerminalStreamWritable.ts @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import { Writable, type WritableOptions } from 'stream'; import type { ITerminal } from './ITerminal'; import { TerminalProviderSeverity } from './ITerminalProvider'; -import { Writable, type WritableOptions } from 'stream'; /** - * Options for {@link TerminalWritable}. + * Options for {@link TerminalStreamWritable}. * * @beta */ -export interface ITerminalWritableOptions { +export interface ITerminalStreamWritableOptions { /** * The {@link ITerminal} that the Writable will write to. */ @@ -30,10 +30,10 @@ export interface ITerminalWritableOptions { * * @beta */ -export class TerminalWritable extends Writable { +export class TerminalStreamWritable extends Writable { private _writeMethod: (data: string) => void; - public constructor(options: ITerminalWritableOptions) { + public constructor(options: ITerminalStreamWritableOptions) { const { terminal, severity, writableOptions } = options; super(writableOptions); diff --git a/libraries/terminal/src/TerminalWritable.ts b/libraries/terminal/src/TerminalWritable.ts index f7b61b742df..22f20f72263 100644 --- a/libraries/terminal/src/TerminalWritable.ts +++ b/libraries/terminal/src/TerminalWritable.ts @@ -26,7 +26,7 @@ export interface ITerminalWritableOptions { /** * The abstract base class for objects that can present, route, or process text output for * a console application. This output is typically prepared using - * the {@link @rushstack/node-core-library#Terminal} API. + * the {@link Terminal} API. * * @remarks * diff --git a/libraries/terminal/src/index.ts b/libraries/terminal/src/index.ts index 8617e5172c6..c2c3c7dc0ff 100644 --- a/libraries/terminal/src/index.ts +++ b/libraries/terminal/src/index.ts @@ -11,18 +11,36 @@ * @packageDocumentation */ -export * from './CallbackWritable'; -export * from './DiscardStdoutTransform'; -export * from './ITerminalChunk'; -export * from './MockWritable'; -export * from './NormalizeNewlinesTextRewriter'; -export * from './PrintUtilities'; -export * from './RemoveColorsTextRewriter'; -export * from './SplitterTransform'; -export * from './StdioLineTransform'; -export * from './StdioSummarizer'; -export * from './StdioWritable'; -export * from './TerminalTransform'; -export * from './TerminalWritable'; -export * from './TextRewriter'; -export * from './TextRewriterTransform'; +export { ICallbackWritableOptions, CallbackWritable } from './CallbackWritable'; +export { IDiscardStdoutTransformOptions, DiscardStdoutTransform } from './DiscardStdoutTransform'; +export { TerminalChunkKind, ITerminalChunk } from './ITerminalChunk'; +export { MockWritable } from './MockWritable'; +export { + INormalizeNewlinesTextRewriterOptions, + NormalizeNewlinesTextRewriter +} from './NormalizeNewlinesTextRewriter'; +export { DEFAULT_CONSOLE_WIDTH, PrintUtilities } from './PrintUtilities'; +export { RemoveColorsTextRewriter } from './RemoveColorsTextRewriter'; +export { ISplitterTransformOptions, SplitterTransform } from './SplitterTransform'; +export { IStdioLineTransformOptions, StderrLineTransform } from './StdioLineTransform'; +export { IStdioSummarizerOptions, StdioSummarizer } from './StdioSummarizer'; +export { StdioWritable } from './StdioWritable'; +export { ITerminalTransformOptions, TerminalTransform } from './TerminalTransform'; +export { ITerminalWritableOptions, TerminalWritable } from './TerminalWritable'; +export { TextRewriterState, TextRewriter } from './TextRewriter'; +export { ITextRewriterTransformOptions, TextRewriterTransform } from './TextRewriterTransform'; +export { AnsiEscape, IAnsiEscapeConvertForTestsOptions } from './AnsiEscape'; +export { ITerminal, TerminalWriteParameters, ITerminalWriteOptions } from './ITerminal'; +export { Terminal } from './Terminal'; +export { Colorize } from './Colorize'; +export { ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider'; +export { ConsoleTerminalProvider, IConsoleTerminalProviderOptions } from './ConsoleTerminalProvider'; +export { StringBufferTerminalProvider, IStringBufferOutputOptions } from './StringBufferTerminalProvider'; +export { + PrefixProxyTerminalProvider, + IPrefixProxyTerminalProviderOptions, + IDynamicPrefixProxyTerminalProviderOptions, + IPrefixProxyTerminalProviderOptionsBase, + IStaticPrefixProxyTerminalProviderOptions +} from './PrefixProxyTerminalProvider'; +export { TerminalStreamWritable, ITerminalStreamWritableOptions } from './TerminalStreamWritable'; diff --git a/libraries/node-core-library/src/Terminal/test/AnsiEscape.test.ts b/libraries/terminal/src/test/AnsiEscape.test.ts similarity index 93% rename from libraries/node-core-library/src/Terminal/test/AnsiEscape.test.ts rename to libraries/terminal/src/test/AnsiEscape.test.ts index 00a926fa60a..8747d13d5bf 100644 --- a/libraries/node-core-library/src/Terminal/test/AnsiEscape.test.ts +++ b/libraries/terminal/src/test/AnsiEscape.test.ts @@ -18,7 +18,7 @@ describe(AnsiEscape.name, () => { } }); - test('calls removeCodes() successfully', () => { + it('calls removeCodes() successfully', () => { const coloredInput: string = colors.rainbow('Hello, world!'); const decoloredInput: string = AnsiEscape.removeCodes(coloredInput); expect(coloredInput).not.toBe(decoloredInput); diff --git a/libraries/terminal/src/test/Colorize.test.ts b/libraries/terminal/src/test/Colorize.test.ts new file mode 100644 index 00000000000..ffa0d5ce513 --- /dev/null +++ b/libraries/terminal/src/test/Colorize.test.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { createColorGrid } from './createColorGrid'; +import { Colorize } from '../Colorize'; +import { AnsiEscape } from '../AnsiEscape'; + +describe(Colorize.name, () => { + test('writes color grid correctly', () => { + let lineCount: number = 0; + for (const line of createColorGrid()) { + expect(line.map((linePart) => AnsiEscape.formatForTests(linePart))).toMatchSnapshot( + `line ${lineCount++}` + ); + } + + expect(lineCount).toMatchInlineSnapshot(`10`); + }); + + it('generates codes as expected', () => { + type ColorsFunctionNames = { + [K in keyof typeof Colorize]: typeof Colorize[K] extends (str: string) => string ? K : never; + }[keyof typeof Colorize]; + function testColorFunction(functionName: ColorsFunctionNames): void { + expect(Colorize[functionName]('x')).toMatchSnapshot(functionName); + } + + testColorFunction('black'); + testColorFunction('red'); + testColorFunction('green'); + testColorFunction('yellow'); + testColorFunction('blue'); + testColorFunction('magenta'); + testColorFunction('cyan'); + testColorFunction('white'); + testColorFunction('gray'); + testColorFunction('blackBackground'); + testColorFunction('redBackground'); + testColorFunction('greenBackground'); + testColorFunction('yellowBackground'); + testColorFunction('blueBackground'); + testColorFunction('magentaBackground'); + testColorFunction('cyanBackground'); + testColorFunction('whiteBackground'); + testColorFunction('grayBackground'); + testColorFunction('bold'); + testColorFunction('dim'); + testColorFunction('underline'); + testColorFunction('blink'); + testColorFunction('invertColor'); + testColorFunction('hidden'); + }); +}); diff --git a/libraries/node-core-library/src/Terminal/test/PrefixProxyTerminalProvider.test.ts b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts similarity index 100% rename from libraries/node-core-library/src/Terminal/test/PrefixProxyTerminalProvider.test.ts rename to libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts diff --git a/libraries/terminal/src/test/PrintUtilities.test.ts b/libraries/terminal/src/test/PrintUtilities.test.ts index a709b676dfb..f09a79b3e0a 100644 --- a/libraries/terminal/src/test/PrintUtilities.test.ts +++ b/libraries/terminal/src/test/PrintUtilities.test.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; - +import { StringBufferTerminalProvider } from '../StringBufferTerminalProvider'; +import { Terminal } from '../Terminal'; import { PrintUtilities } from '../PrintUtilities'; describe(PrintUtilities.name, () => { diff --git a/libraries/terminal/src/test/RemoveColorsTextRewriter.test.ts b/libraries/terminal/src/test/RemoveColorsTextRewriter.test.ts index ba6a23daecc..ffffcb976c0 100644 --- a/libraries/terminal/src/test/RemoveColorsTextRewriter.test.ts +++ b/libraries/terminal/src/test/RemoveColorsTextRewriter.test.ts @@ -2,10 +2,10 @@ // See LICENSE in the project root for license information. import colors from 'colors'; +import { AnsiEscape } from '../AnsiEscape'; import { RemoveColorsTextRewriter } from '../RemoveColorsTextRewriter'; import type { TextRewriterState } from '../TextRewriter'; -import { AnsiEscape } from '@rushstack/node-core-library'; function testCase(inputs: string[]): void { const matcher: RemoveColorsTextRewriter = new RemoveColorsTextRewriter(); diff --git a/libraries/terminal/src/test/Terminal.test.ts b/libraries/terminal/src/test/Terminal.test.ts new file mode 100644 index 00000000000..9e1eaf9b07d --- /dev/null +++ b/libraries/terminal/src/test/Terminal.test.ts @@ -0,0 +1,911 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { Terminal } from '../Terminal'; +import { StringBufferTerminalProvider } from '../StringBufferTerminalProvider'; +import { Colorize } from '../Colorize'; + +describe(Terminal.name, () => { + let terminal: Terminal; + let provider: StringBufferTerminalProvider; + + function verifyProvider(): void { + expect({ + log: provider.getOutput(), + warning: provider.getWarningOutput(), + error: provider.getErrorOutput(), + verbose: provider.getVerbose(), + debug: provider.getDebugOutput() + }).toMatchSnapshot(); + } + + describe('01 color enabled', () => { + beforeEach(() => { + provider = new StringBufferTerminalProvider(true); + terminal = new Terminal(provider); + }); + + describe('01 basic terminal functions', () => { + describe('01 write', () => { + it('01 writes a single message', () => { + terminal.write('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.write('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.write(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.write(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.write('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.write('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4'), { + doNotOverrideSgrCodes: true + }); + verifyProvider(); + }); + }); + + describe('02 writeLine', () => { + it('01 writes a single message', () => { + terminal.writeLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('03 writeWarning', () => { + it('01 writes a single message', () => { + terminal.writeWarning('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeWarning('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeWarning(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeWarning(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeWarning( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeWarning( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('04 writeWarningLine', () => { + it('01 writes a single message', () => { + terminal.writeWarningLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeWarningLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeWarningLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeWarningLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeWarningLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeWarningLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('05 writeError', () => { + it('01 writes a single message', () => { + terminal.writeError('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeError('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeError(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeError(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeError( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeError( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('06 writeErrorLine', () => { + it('01 writes a single message', () => { + terminal.writeErrorLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeErrorLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeErrorLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeErrorLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeErrorLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeErrorLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('07 writeVerbose', () => { + it('01 writes a single message', () => { + terminal.writeVerbose('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeVerbose('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeVerbose(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeVerbose(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeVerbose( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeVerbose( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('08 writeVerboseLine', () => { + it('01 writes a single message', () => { + terminal.writeVerboseLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeVerboseLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeVerboseLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeVerboseLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeVerboseLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeVerboseLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + }); + + it('05 writes to multiple streams', () => { + terminal.write('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeWarningLine('message 1', 'message 2'); + terminal.writeVerbose('test message'); + terminal.writeVerbose(Colorize.green('message 1')); + terminal.writeLine(Colorize.green('message 1')); + terminal.writeError('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeErrorLine('test message'); + terminal.writeVerboseLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + terminal.writeVerboseLine('test message'); + terminal.writeWarning(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarning('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeError('message 1', 'message 2'); + terminal.write(Colorize.green('message 1')); + terminal.writeVerbose('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeErrorLine('message 1', 'message 2'); + terminal.write(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeVerbose('message 1', 'message 2'); + terminal.writeVerboseLine(Colorize.green('message 1')); + terminal.writeLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeError(Colorize.green('message 1')); + terminal.writeWarningLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + terminal.write('test message'); + terminal.writeWarningLine('test message'); + terminal.writeVerboseLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeVerboseLine('message 1', 'message 2'); + terminal.writeErrorLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + terminal.writeLine('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeWarning('message 1', 'message 2'); + terminal.writeErrorLine(Colorize.green('message 1')); + terminal.write('message 1', 'message 2'); + terminal.writeVerbose(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarning(Colorize.green('message 1')); + terminal.writeLine('test message'); + terminal.writeError('test message'); + terminal.writeLine('message 1', 'message 2'); + terminal.writeErrorLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeError(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarningLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarningLine(Colorize.green('message 1')); + verifyProvider(); + }); + }); + + describe('02 color disabled', () => { + beforeEach(() => { + provider = new StringBufferTerminalProvider(false); + terminal = new Terminal(provider); + }); + + describe('01 basic terminal functions', () => { + describe('01 write', () => { + it('01 writes a single message', () => { + terminal.write('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.write('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.write(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.write(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.write('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.write('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4'), { + doNotOverrideSgrCodes: true + }); + verifyProvider(); + }); + }); + + describe('02 writeLine', () => { + it('01 writes a single message', () => { + terminal.writeLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('03 writeWarning', () => { + it('01 writes a single message', () => { + terminal.writeWarning('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeWarning('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeWarning(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeWarning(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeWarning( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeWarning( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('04 writeWarningLine', () => { + it('01 writes a single message', () => { + terminal.writeWarningLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeWarningLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeWarningLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeWarningLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeWarningLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeWarningLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('05 writeError', () => { + it('01 writes a single message', () => { + terminal.writeError('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeError('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeError(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeError(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeError( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeError( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('06 writeErrorLine', () => { + it('01 writes a single message', () => { + terminal.writeErrorLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeErrorLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeErrorLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeErrorLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeErrorLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeErrorLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('07 writeVerbose', () => { + it('01 writes a single message', () => { + terminal.writeVerbose('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeVerbose('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeVerbose(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeVerbose(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeVerbose( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeVerbose( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('08 writeVerboseLine', () => { + it('01 writes a single message', () => { + terminal.writeVerboseLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeVerboseLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeVerboseLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeVerboseLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeVerboseLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeVerboseLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('09 writeDebug', () => { + it('01 writes a single message', () => { + terminal.writeDebug('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeDebug('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeDebug(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeDebug(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeDebug( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeDebug( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + + describe('10 writeDebugLine', () => { + it('01 writes a single message', () => { + terminal.writeDebugLine('test message'); + verifyProvider(); + }); + + it('02 writes multiple messages', () => { + terminal.writeDebugLine('message 1', 'message 2'); + verifyProvider(); + }); + + it('03 writes a message with colors', () => { + terminal.writeDebugLine(Colorize.green('message 1')); + verifyProvider(); + }); + + it('04 writes a multiple messages with colors', () => { + terminal.writeDebugLine(Colorize.green('message 1'), Colorize.red('message 2')); + verifyProvider(); + }); + + it('05 writes a messages with colors interspersed with non-colored messages', () => { + terminal.writeDebugLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + verifyProvider(); + }); + + it('06 writes a messages with colors interspersed with non-colored messages with color overriding disabled', () => { + terminal.writeDebugLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4'), + { doNotOverrideSgrCodes: true } + ); + verifyProvider(); + }); + }); + }); + + it('05 writes to multiple streams', () => { + terminal.write('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeWarningLine('message 1', 'message 2'); + terminal.writeVerbose('test message'); + terminal.writeVerbose(Colorize.green('message 1')); + terminal.writeLine(Colorize.green('message 1')); + terminal.writeError('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeErrorLine('test message'); + terminal.writeVerboseLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + terminal.writeVerboseLine('test message'); + terminal.writeWarning(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarning('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeError('message 1', 'message 2'); + terminal.write(Colorize.green('message 1')); + terminal.writeVerbose('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeErrorLine('message 1', 'message 2'); + terminal.write(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeVerbose('message 1', 'message 2'); + terminal.writeVerboseLine(Colorize.green('message 1')); + terminal.writeLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeError(Colorize.green('message 1')); + terminal.writeWarningLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + terminal.write('test message'); + terminal.writeWarningLine('test message'); + terminal.writeVerboseLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeVerboseLine('message 1', 'message 2'); + terminal.writeErrorLine( + 'message 1', + Colorize.green('message 2'), + 'message 3', + Colorize.red('message 4') + ); + terminal.writeLine('message 1', Colorize.green('message 2'), 'message 3', Colorize.red('message 4')); + terminal.writeWarning('message 1', 'message 2'); + terminal.writeErrorLine(Colorize.green('message 1')); + terminal.write('message 1', 'message 2'); + terminal.writeVerbose(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarning(Colorize.green('message 1')); + terminal.writeLine('test message'); + terminal.writeError('test message'); + terminal.writeLine('message 1', 'message 2'); + terminal.writeErrorLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeError(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarningLine(Colorize.green('message 1'), Colorize.red('message 2')); + terminal.writeWarningLine(Colorize.green('message 1')); + verifyProvider(); + }); + }); +}); diff --git a/libraries/node-core-library/src/Terminal/test/TerminalWritable.test.ts b/libraries/terminal/src/test/TerminalStreamWritable.test.ts similarity index 81% rename from libraries/node-core-library/src/Terminal/test/TerminalWritable.test.ts rename to libraries/terminal/src/test/TerminalStreamWritable.test.ts index feaaa86b306..049a9735f84 100644 --- a/libraries/node-core-library/src/Terminal/test/TerminalWritable.test.ts +++ b/libraries/terminal/src/test/TerminalStreamWritable.test.ts @@ -3,7 +3,7 @@ import { Terminal } from '../Terminal'; import { StringBufferTerminalProvider } from '../StringBufferTerminalProvider'; -import { TerminalWritable } from '../TerminalWritable'; +import { TerminalStreamWritable } from '../TerminalStreamWritable'; import { TerminalProviderSeverity } from '../ITerminalProvider'; import type { Writable } from 'stream'; @@ -33,14 +33,14 @@ async function writeAsync(writable: Writable, data: string): Promise { }); } -describe(TerminalWritable.name, () => { +describe(TerminalStreamWritable.name, () => { beforeEach(() => { provider = new StringBufferTerminalProvider(true); terminal = new Terminal(provider); }); test('writes a message', async () => { - const writable: TerminalWritable = new TerminalWritable({ + const writable: TerminalStreamWritable = new TerminalStreamWritable({ terminal, severity: TerminalProviderSeverity.log }); @@ -50,7 +50,7 @@ describe(TerminalWritable.name, () => { }); test('writes a verbose message', async () => { - const writable: TerminalWritable = new TerminalWritable({ + const writable: TerminalStreamWritable = new TerminalStreamWritable({ terminal, severity: TerminalProviderSeverity.verbose }); @@ -60,7 +60,7 @@ describe(TerminalWritable.name, () => { }); test('writes a debug message', async () => { - const writable: TerminalWritable = new TerminalWritable({ + const writable: TerminalStreamWritable = new TerminalStreamWritable({ terminal, severity: TerminalProviderSeverity.debug }); @@ -70,7 +70,7 @@ describe(TerminalWritable.name, () => { }); test('writes a warning message', async () => { - const writable: TerminalWritable = new TerminalWritable({ + const writable: TerminalStreamWritable = new TerminalStreamWritable({ terminal, severity: TerminalProviderSeverity.warning }); @@ -80,7 +80,7 @@ describe(TerminalWritable.name, () => { }); test('writes an error message', async () => { - const writable: TerminalWritable = new TerminalWritable({ + const writable: TerminalStreamWritable = new TerminalStreamWritable({ terminal, severity: TerminalProviderSeverity.error }); diff --git a/libraries/terminal/src/test/__snapshots__/Colorize.test.ts.snap b/libraries/terminal/src/test/__snapshots__/Colorize.test.ts.snap new file mode 100644 index 00000000000..00a6cc10b10 --- /dev/null +++ b/libraries/terminal/src/test/__snapshots__/Colorize.test.ts.snap @@ -0,0 +1,199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Colorize generates codes as expected: black 1`] = `"x"`; + +exports[`Colorize generates codes as expected: blackBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: blink 1`] = `"x"`; + +exports[`Colorize generates codes as expected: blue 1`] = `"x"`; + +exports[`Colorize generates codes as expected: blueBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: bold 1`] = `"x"`; + +exports[`Colorize generates codes as expected: cyan 1`] = `"x"`; + +exports[`Colorize generates codes as expected: cyanBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: dim 1`] = `"x"`; + +exports[`Colorize generates codes as expected: gray 1`] = `"x"`; + +exports[`Colorize generates codes as expected: grayBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: green 1`] = `"x"`; + +exports[`Colorize generates codes as expected: greenBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: hidden 1`] = `"x"`; + +exports[`Colorize generates codes as expected: invertColor 1`] = `"x"`; + +exports[`Colorize generates codes as expected: magenta 1`] = `"x"`; + +exports[`Colorize generates codes as expected: magentaBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: red 1`] = `"x"`; + +exports[`Colorize generates codes as expected: redBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: underline 1`] = `"x"`; + +exports[`Colorize generates codes as expected: white 1`] = `"x"`; + +exports[`Colorize generates codes as expected: whiteBackground 1`] = `"x"`; + +exports[`Colorize generates codes as expected: yellow 1`] = `"x"`; + +exports[`Colorize generates codes as expected: yellowBackground 1`] = `"x"`; + +exports[`Colorize writes color grid correctly: line 0 1`] = ` +Array [ + "X", + "[black]X[default]", + "[white]X[default]", + "[gray]X[default]", + "[magenta]X[default]", + "[red]X[default]", + "[yellow]X[default]", + "[green]X[default]", + "[cyan]X[default]", + "[blue]X[default]", +] +`; + +exports[`Colorize writes color grid correctly: line 1 1`] = ` +Array [ + "[black-bg]X[default-bg]", + "[black-bg][black]X[default][default-bg]", + "[black-bg][white]X[default][default-bg]", + "[black-bg][gray]X[default][default-bg]", + "[black-bg][magenta]X[default][default-bg]", + "[black-bg][red]X[default][default-bg]", + "[black-bg][yellow]X[default][default-bg]", + "[black-bg][green]X[default][default-bg]", + "[black-bg][cyan]X[default][default-bg]", + "[black-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 2 1`] = ` +Array [ + "[white-bg]X[default-bg]", + "[white-bg][black]X[default][default-bg]", + "[white-bg][white]X[default][default-bg]", + "[white-bg][gray]X[default][default-bg]", + "[white-bg][magenta]X[default][default-bg]", + "[white-bg][red]X[default][default-bg]", + "[white-bg][yellow]X[default][default-bg]", + "[white-bg][green]X[default][default-bg]", + "[white-bg][cyan]X[default][default-bg]", + "[white-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 3 1`] = ` +Array [ + "[gray-bg]X[default-bg]", + "[gray-bg][black]X[default][default-bg]", + "[gray-bg][white]X[default][default-bg]", + "[gray-bg][gray]X[default][default-bg]", + "[gray-bg][magenta]X[default][default-bg]", + "[gray-bg][red]X[default][default-bg]", + "[gray-bg][yellow]X[default][default-bg]", + "[gray-bg][green]X[default][default-bg]", + "[gray-bg][cyan]X[default][default-bg]", + "[gray-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 4 1`] = ` +Array [ + "[magenta-bg]X[default-bg]", + "[magenta-bg][black]X[default][default-bg]", + "[magenta-bg][white]X[default][default-bg]", + "[magenta-bg][gray]X[default][default-bg]", + "[magenta-bg][magenta]X[default][default-bg]", + "[magenta-bg][red]X[default][default-bg]", + "[magenta-bg][yellow]X[default][default-bg]", + "[magenta-bg][green]X[default][default-bg]", + "[magenta-bg][cyan]X[default][default-bg]", + "[magenta-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 5 1`] = ` +Array [ + "[red-bg]X[default-bg]", + "[red-bg][black]X[default][default-bg]", + "[red-bg][white]X[default][default-bg]", + "[red-bg][gray]X[default][default-bg]", + "[red-bg][magenta]X[default][default-bg]", + "[red-bg][red]X[default][default-bg]", + "[red-bg][yellow]X[default][default-bg]", + "[red-bg][green]X[default][default-bg]", + "[red-bg][cyan]X[default][default-bg]", + "[red-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 6 1`] = ` +Array [ + "[yellow-bg]X[default-bg]", + "[yellow-bg][black]X[default][default-bg]", + "[yellow-bg][white]X[default][default-bg]", + "[yellow-bg][gray]X[default][default-bg]", + "[yellow-bg][magenta]X[default][default-bg]", + "[yellow-bg][red]X[default][default-bg]", + "[yellow-bg][yellow]X[default][default-bg]", + "[yellow-bg][green]X[default][default-bg]", + "[yellow-bg][cyan]X[default][default-bg]", + "[yellow-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 7 1`] = ` +Array [ + "[green-bg]X[default-bg]", + "[green-bg][black]X[default][default-bg]", + "[green-bg][white]X[default][default-bg]", + "[green-bg][gray]X[default][default-bg]", + "[green-bg][magenta]X[default][default-bg]", + "[green-bg][red]X[default][default-bg]", + "[green-bg][yellow]X[default][default-bg]", + "[green-bg][green]X[default][default-bg]", + "[green-bg][cyan]X[default][default-bg]", + "[green-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 8 1`] = ` +Array [ + "[cyan-bg]X[default-bg]", + "[cyan-bg][black]X[default][default-bg]", + "[cyan-bg][white]X[default][default-bg]", + "[cyan-bg][gray]X[default][default-bg]", + "[cyan-bg][magenta]X[default][default-bg]", + "[cyan-bg][red]X[default][default-bg]", + "[cyan-bg][yellow]X[default][default-bg]", + "[cyan-bg][green]X[default][default-bg]", + "[cyan-bg][cyan]X[default][default-bg]", + "[cyan-bg][blue]X[default][default-bg]", +] +`; + +exports[`Colorize writes color grid correctly: line 9 1`] = ` +Array [ + "[blue-bg]X[default-bg]", + "[blue-bg][black]X[default][default-bg]", + "[blue-bg][white]X[default][default-bg]", + "[blue-bg][gray]X[default][default-bg]", + "[blue-bg][magenta]X[default][default-bg]", + "[blue-bg][red]X[default][default-bg]", + "[blue-bg][yellow]X[default][default-bg]", + "[blue-bg][green]X[default][default-bg]", + "[blue-bg][cyan]X[default][default-bg]", + "[blue-bg][blue]X[default][default-bg]", +] +`; diff --git a/libraries/node-core-library/src/Terminal/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap similarity index 100% rename from libraries/node-core-library/src/Terminal/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap rename to libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap diff --git a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap new file mode 100644 index 00000000000..6ba14641d27 --- /dev/null +++ b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap @@ -0,0 +1,1101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "test message", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "[green]message 1[default]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "[green]message 1[default][red]message 2[default]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1[green]message 2[default]message 3[red]message 4[default]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1[green]message 2[default]message 3[red]message 4[default]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "test message[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "[green]message 1[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "[green]message 1[default][red]message 2[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1[green]message 2[default]message 3[red]message 4[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1[green]message 2[default]message 3[red]message 4[default][n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]test message[default]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][yellow]message 2[default]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][yellow]message 2[default]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1[green]message 2[default]message 3[red]message 4[default]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]test message[default][n]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][yellow]message 2[default][n]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][n]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][yellow]message 2[default][n]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1[green]message 2[default]message 3[red]message 4[default][n]", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "[red]test message[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "message 1[green]message 2[default]message 3[red]message 4[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "[red]test message[default][n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default][n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default][n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "message 1[green]message 2[default]message 3[red]message 4[default][n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "test message", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "[green]message 1[default]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "[green]message 1[default][red]message 2[default]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1[green]message 2[default]message 3[red]message 4[default]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1[green]message 2[default]message 3[red]message 4[default]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "test message[n]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2[n]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "[green]message 1[default][n]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "[green]message 1[default][red]message 2[default][n]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1[green]message 2[default]message 3[red]message 4[default][n]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1[green]message 2[default]message 3[red]message 4[default][n]", + "warning": "", +} +`; + +exports[`Terminal 01 color enabled 05 writes to multiple streams 1`] = ` +Object { + "debug": "", + "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][red]test message[default][n][red]message 1[default][red]message 2[default][red]message 1[default][red]message 2[default][n][red]message 1[default][red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n][red]message 1[default][n][red]test message[default][red]message 1[default][red]message 2[default][n][red]message 1[default][red]message 2[default]", + "log": "message 1[green]message 2[default]message 3[red]message 4[default][green]message 1[default][n][green]message 1[default][green]message 1[default][red]message 2[default][green]message 1[default][red]message 2[default][n]test messagemessage 1[green]message 2[default]message 3[red]message 4[default][n]message 1message 2test message[n]message 1message 2[n]", + "verbose": "test message[green]message 1[default]message 1[green]message 2[default]message 3[red]message 4[default][n]test message[n]message 1[green]message 2[default]message 3[red]message 4[default]message 1message 2[green]message 1[default][n][green]message 1[default][red]message 2[default][n]message 1message 2[n][green]message 1[default][red]message 2[default]", + "warning": "[yellow]message 1[default][yellow]message 2[default][n][yellow]message 1[default][yellow]message 2[default][yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n][yellow]test message[default][n][yellow]message 1[default][yellow]message 2[default][yellow]message 1[default][yellow]message 1[default][yellow]message 2[default][n][yellow]message 1[default][n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "test message", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2message 3message 4", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2message 3message 4", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "test message[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2message 3message 4[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "message 1message 2message 3message 4[n]", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "test message", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2message 3message 4", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2message 3message 4", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "test message[n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2[n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1[n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2[n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2message 3message 4[n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "message 1message 2message 3message 4[n]", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "test message", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "message 1message 2", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "message 1", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "message 1message 2", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "message 1message 2message 3message 4", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "message 1message 2message 3message 4", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "test message[n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "message 1message 2[n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "message 1[n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "message 1message 2[n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "message 1message 2message 3message 4[n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "message 1message 2message 3message 4[n]", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "test message", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2message 3message 4", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2message 3message 4", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "test message[n]", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2[n]", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1[n]", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2[n]", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2message 3message 4[n]", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "message 1message 2message 3message 4[n]", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 01 writes a single message 1`] = ` +Object { + "debug": "test message", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 02 writes multiple messages 1`] = ` +Object { + "debug": "message 1message 2", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 03 writes a message with colors 1`] = ` +Object { + "debug": "message 1", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "message 1message 2", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "message 1message 2message 3message 4", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "message 1message 2message 3message 4", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message 1`] = ` +Object { + "debug": "test message[n]", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages 1`] = ` +Object { + "debug": "message 1message 2[n]", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors 1`] = ` +Object { + "debug": "message 1[n]", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors 1`] = ` +Object { + "debug": "message 1message 2[n]", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +Object { + "debug": "message 1message 2message 3message 4[n]", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +Object { + "debug": "message 1message 2message 3message 4[n]", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`Terminal 02 color disabled 05 writes to multiple streams 1`] = ` +Object { + "debug": "", + "error": "message 1message 2message 3message 4test message[n]message 1message 2message 1message 2[n]message 1message 1message 2message 3message 4[n]message 1[n]test messagemessage 1message 2[n]message 1message 2", + "log": "message 1message 2message 3message 4message 1[n]message 1message 1message 2message 1message 2[n]test messagemessage 1message 2message 3message 4[n]message 1message 2test message[n]message 1message 2[n]", + "verbose": "test messagemessage 1message 1message 2message 3message 4[n]test message[n]message 1message 2message 3message 4message 1message 2message 1[n]message 1message 2[n]message 1message 2[n]message 1message 2", + "warning": "message 1message 2[n]message 1message 2message 1message 2message 3message 4message 1message 2message 3message 4[n]test message[n]message 1message 2message 1message 1message 2[n]message 1[n]", +} +`; diff --git a/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap b/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap new file mode 100644 index 00000000000..7682242fb62 --- /dev/null +++ b/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap @@ -0,0 +1,51 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TerminalStreamWritable writes a debug message 1`] = ` +Object { + "debug": "test message", + "error": "", + "log": "", + "verbose": "", + "warning": "", +} +`; + +exports[`TerminalStreamWritable writes a message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "test message", + "verbose": "", + "warning": "", +} +`; + +exports[`TerminalStreamWritable writes a verbose message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "test message", + "warning": "", +} +`; + +exports[`TerminalStreamWritable writes a warning message 1`] = ` +Object { + "debug": "", + "error": "", + "log": "", + "verbose": "", + "warning": "[yellow]test message[default]", +} +`; + +exports[`TerminalStreamWritable writes an error message 1`] = ` +Object { + "debug": "", + "error": "[red]test message[default]", + "log": "", + "verbose": "", + "warning": "", +} +`; diff --git a/libraries/node-core-library/src/Terminal/test/__snapshots__/TerminalWritable.test.ts.snap b/libraries/terminal/src/test/__snapshots__/TerminalWritable.test.ts.snap similarity index 100% rename from libraries/node-core-library/src/Terminal/test/__snapshots__/TerminalWritable.test.ts.snap rename to libraries/terminal/src/test/__snapshots__/TerminalWritable.test.ts.snap diff --git a/libraries/terminal/src/test/createColorGrid.ts b/libraries/terminal/src/test/createColorGrid.ts new file mode 100644 index 00000000000..a2dca2e2be3 --- /dev/null +++ b/libraries/terminal/src/test/createColorGrid.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +/** + * This file is a little program that prints all of the colors to the console + */ + +import { Colorize } from '../index'; + +export function createColorGrid(attributeFunction?: (text: string) => string): string[][] { + const foregroundFunctions: ((text: string) => string)[] = [ + (text) => text, + Colorize.black, + Colorize.white, + Colorize.gray, + Colorize.magenta, + Colorize.red, + Colorize.yellow, + Colorize.green, + Colorize.cyan, + Colorize.blue + ]; + + const backgroundFunctions: ((text: string) => string)[] = [ + (text) => text, + Colorize.blackBackground, + Colorize.whiteBackground, + Colorize.grayBackground, + Colorize.magentaBackground, + Colorize.redBackground, + Colorize.yellowBackground, + Colorize.greenBackground, + Colorize.cyanBackground, + Colorize.blueBackground + ]; + + const lines: string[][] = []; + + for (const backgroundFunction of backgroundFunctions) { + const sequences: string[] = []; + + for (const foregroundFunction of foregroundFunctions) { + let sequence: string = backgroundFunction(foregroundFunction('X')); + if (attributeFunction) { + sequence = attributeFunction(sequence); + } + + sequences.push(sequence); + } + + lines.push(sequences); + } + + return lines; +} diff --git a/libraries/node-core-library/src/Terminal/test/write-colors.ts b/libraries/terminal/src/test/write-colors.ts similarity index 52% rename from libraries/node-core-library/src/Terminal/test/write-colors.ts rename to libraries/terminal/src/test/write-colors.ts index f59a63d4196..03a2f74ba07 100644 --- a/libraries/node-core-library/src/Terminal/test/write-colors.ts +++ b/libraries/terminal/src/test/write-colors.ts @@ -7,37 +7,36 @@ * Run this program with `node write-colors.js` */ -import { Terminal, ConsoleTerminalProvider } from '../../index'; +import { Terminal, ConsoleTerminalProvider, Colorize } from '../index'; import { createColorGrid } from './createColorGrid'; -import { Colors, type IColorableSequence } from '../Colors'; const terminal: Terminal = new Terminal(new ConsoleTerminalProvider()); -function writeColorGrid(colorGridSequences: IColorableSequence[][]): void { - for (const line of colorGridSequences) { +function writeColorGrid(colorGrid: string[][]): void { + for (const line of colorGrid) { terminal.writeLine(...line); } } writeColorGrid(createColorGrid()); terminal.writeLine(); -writeColorGrid(createColorGrid(Colors.bold)); +writeColorGrid(createColorGrid(Colorize.bold)); terminal.writeLine(); -writeColorGrid(createColorGrid(Colors.dim)); +writeColorGrid(createColorGrid(Colorize.dim)); terminal.writeLine(); -writeColorGrid(createColorGrid(Colors.underline)); +writeColorGrid(createColorGrid(Colorize.underline)); terminal.writeLine(); -writeColorGrid(createColorGrid(Colors.blink)); +writeColorGrid(createColorGrid(Colorize.blink)); terminal.writeLine(); -writeColorGrid(createColorGrid(Colors.invertColor)); +writeColorGrid(createColorGrid(Colorize.invertColor)); terminal.writeLine(); -writeColorGrid(createColorGrid(Colors.hidden)); +writeColorGrid(createColorGrid(Colorize.hidden)); terminal.writeLine(); terminal.write('Normal text...'); -terminal.writeLine(Colors.green('done')); +terminal.writeLine(Colorize.green('done')); terminal.writeError('Error...'); -terminal.writeErrorLine(Colors.green('done')); +terminal.writeErrorLine(Colorize.green('done')); terminal.writeWarning('Warning...'); -terminal.writeWarningLine(Colors.green('done')); +terminal.writeWarningLine(Colorize.green('done')); diff --git a/libraries/terminal/tsconfig.json b/libraries/terminal/tsconfig.json index dac21d04081..fbc2f5c0a6c 100644 --- a/libraries/terminal/tsconfig.json +++ b/libraries/terminal/tsconfig.json @@ -1,3 +1,7 @@ { - "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json" + "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json", + + "compilerOptions": { + "types": ["heft-jest", "node"] + } } diff --git a/libraries/tree-pattern/CHANGELOG.json b/libraries/tree-pattern/CHANGELOG.json index 9a015b78fe8..fce556aec2b 100644 --- a/libraries/tree-pattern/CHANGELOG.json +++ b/libraries/tree-pattern/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@rushstack/tree-pattern", "entries": [ + { + "version": "0.3.3", + "tag": "@rushstack/tree-pattern_v0.3.3", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ] + } + }, { "version": "0.3.2", "tag": "@rushstack/tree-pattern_v0.3.2", diff --git a/libraries/tree-pattern/CHANGELOG.md b/libraries/tree-pattern/CHANGELOG.md index 6c5f41d1b85..5577e22033f 100644 --- a/libraries/tree-pattern/CHANGELOG.md +++ b/libraries/tree-pattern/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @rushstack/tree-pattern -This log was last generated on Tue, 16 Jan 2024 18:30:10 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:35 GMT and should not be manually modified. + +## 0.3.3 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation ## 0.3.2 Tue, 16 Jan 2024 18:30:10 GMT diff --git a/libraries/tree-pattern/README.md b/libraries/tree-pattern/README.md index 26093953686..ff9a0284018 100644 --- a/libraries/tree-pattern/README.md +++ b/libraries/tree-pattern/README.md @@ -143,6 +143,6 @@ separate patterns. - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/tree-pattern/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/tree-pattern/) +- [API Reference](https://api.rushstack.io/pages/tree-pattern/) `@rushstack/tree-pattern` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/tree-pattern/package.json b/libraries/tree-pattern/package.json index 4667ea34535..e2889312f24 100644 --- a/libraries/tree-pattern/package.json +++ b/libraries/tree-pattern/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/tree-pattern", - "version": "0.3.2", + "version": "0.3.3", "description": "A fast, lightweight pattern matcher for tree structures such as an Abstract Syntax Tree (AST)", "main": "lib/index.js", "typings": "dist/tree-pattern.d.ts", diff --git a/libraries/ts-command-line/CHANGELOG.json b/libraries/ts-command-line/CHANGELOG.json index 3a046dfba36..81158b58f73 100644 --- a/libraries/ts-command-line/CHANGELOG.json +++ b/libraries/ts-command-line/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@rushstack/ts-command-line", "entries": [ + { + "version": "4.17.2", + "tag": "@rushstack/ts-command-line_v4.17.2", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ] + } + }, { "version": "4.17.1", "tag": "@rushstack/ts-command-line_v4.17.1", diff --git a/libraries/ts-command-line/CHANGELOG.md b/libraries/ts-command-line/CHANGELOG.md index fae13616efe..5f7a89267bc 100644 --- a/libraries/ts-command-line/CHANGELOG.md +++ b/libraries/ts-command-line/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @rushstack/ts-command-line -This log was last generated on Wed, 01 Nov 2023 23:11:35 GMT and should not be manually modified. +This log was last generated on Sat, 17 Feb 2024 06:24:35 GMT and should not be manually modified. + +## 4.17.2 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation ## 4.17.1 Wed, 01 Nov 2023 23:11:35 GMT diff --git a/libraries/ts-command-line/README.md b/libraries/ts-command-line/README.md index f49d5716373..39d0dec42c9 100644 --- a/libraries/ts-command-line/README.md +++ b/libraries/ts-command-line/README.md @@ -240,7 +240,7 @@ You can also mix the two models. For example, we could augment the `WidgetComma - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/ts-command-line/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/ts-command-line/) +- [API Reference](https://api.rushstack.io/pages/ts-command-line/) Here are some real world GitHub projects that illustrate different use cases for **ts-command-line**: diff --git a/libraries/ts-command-line/package.json b/libraries/ts-command-line/package.json index 2040be0d1ce..2d543f92948 100644 --- a/libraries/ts-command-line/package.json +++ b/libraries/ts-command-line/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/ts-command-line", - "version": "4.17.1", + "version": "4.17.2", "description": "An object-oriented command-line parser for TypeScript", "repository": { "type": "git", diff --git a/libraries/typings-generator/CHANGELOG.json b/libraries/typings-generator/CHANGELOG.json index 34c7f6f5357..34b9eb39eec 100644 --- a/libraries/typings-generator/CHANGELOG.json +++ b/libraries/typings-generator/CHANGELOG.json @@ -1,6 +1,116 @@ { "name": "@rushstack/typings-generator", "entries": [ + { + "version": "0.12.27", + "tag": "@rushstack/typings-generator_v0.12.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.12.26", + "tag": "@rushstack/typings-generator_v0.12.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.12.25", + "tag": "@rushstack/typings-generator_v0.12.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.12.24", + "tag": "@rushstack/typings-generator_v0.12.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.12.23", + "tag": "@rushstack/typings-generator_v0.12.23", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.12.22", + "tag": "@rushstack/typings-generator_v0.12.22", + "date": "Wed, 07 Feb 2024 01:11:19 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.12.21", + "tag": "@rushstack/typings-generator_v0.12.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.12.20", "tag": "@rushstack/typings-generator_v0.12.20", diff --git a/libraries/typings-generator/CHANGELOG.md b/libraries/typings-generator/CHANGELOG.md index 44a9ac1d746..c145e647f4f 100644 --- a/libraries/typings-generator/CHANGELOG.md +++ b/libraries/typings-generator/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @rushstack/typings-generator -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.12.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.12.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.12.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.12.24 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.12.23 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.12.22 +Wed, 07 Feb 2024 01:11:19 GMT + +_Version update only_ + +## 0.12.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.12.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/typings-generator/README.md b/libraries/typings-generator/README.md index 784450361aa..123d8a63ac3 100644 --- a/libraries/typings-generator/README.md +++ b/libraries/typings-generator/README.md @@ -158,6 +158,6 @@ is set to `IExportStyles`. If not specified, the interface name will be `IExport - [CHANGELOG.md](https://github.com/microsoft/rushstack/blob/main/libraries/typings-generator/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/typings-generator/) +- [API Reference](https://api.rushstack.io/pages/typings-generator/) `@rushstack/typings-generator` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/typings-generator/package.json b/libraries/typings-generator/package.json index 810035668b0..1074d55c852 100644 --- a/libraries/typings-generator/package.json +++ b/libraries/typings-generator/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/typings-generator", - "version": "0.12.20", + "version": "0.12.27", "description": "This library provides functionality for automatically generating typings for non-TS files.", "keywords": [ "dts", @@ -21,6 +21,7 @@ }, "dependencies": { "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*", "chokidar": "~3.4.0", "fast-glob": "~3.3.1" }, diff --git a/libraries/typings-generator/src/TypingsGenerator.ts b/libraries/typings-generator/src/TypingsGenerator.ts index 0545cbe198d..bbb1634a36d 100644 --- a/libraries/typings-generator/src/TypingsGenerator.ts +++ b/libraries/typings-generator/src/TypingsGenerator.ts @@ -1,15 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { - FileSystem, - type ITerminal, - Terminal, - ConsoleTerminalProvider, - Path, - NewlineKind, - Async -} from '@rushstack/node-core-library'; +import { FileSystem, Path, NewlineKind, Async } from '@rushstack/node-core-library'; +import { type ITerminal, Terminal, ConsoleTerminalProvider } from '@rushstack/terminal'; import glob from 'fast-glob'; import * as path from 'path'; import { EOL } from 'os'; diff --git a/libraries/worker-pool/CHANGELOG.json b/libraries/worker-pool/CHANGELOG.json index 8e34bd1346e..f62e4ad6cf0 100644 --- a/libraries/worker-pool/CHANGELOG.json +++ b/libraries/worker-pool/CHANGELOG.json @@ -1,6 +1,95 @@ { "name": "@rushstack/worker-pool", "entries": [ + { + "version": "0.4.27", + "tag": "@rushstack/worker-pool_v0.4.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.4.26", + "tag": "@rushstack/worker-pool_v0.4.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.4.25", + "tag": "@rushstack/worker-pool_v0.4.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.4.24", + "tag": "@rushstack/worker-pool_v0.4.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "patch": [ + { + "comment": "Fix broken link to API documentation" + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.4.23", + "tag": "@rushstack/worker-pool_v0.4.23", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.4.22", + "tag": "@rushstack/worker-pool_v0.4.22", + "date": "Wed, 07 Feb 2024 01:11:19 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.4.21", + "tag": "@rushstack/worker-pool_v0.4.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.4.20", "tag": "@rushstack/worker-pool_v0.4.20", diff --git a/libraries/worker-pool/CHANGELOG.md b/libraries/worker-pool/CHANGELOG.md index 647087aaa40..892617c0c08 100644 --- a/libraries/worker-pool/CHANGELOG.md +++ b/libraries/worker-pool/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @rushstack/worker-pool -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.4.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.4.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.4.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.4.24 +Sat, 17 Feb 2024 06:24:35 GMT + +### Patches + +- Fix broken link to API documentation + +## 0.4.23 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.4.22 +Wed, 07 Feb 2024 01:11:19 GMT + +_Version update only_ + +## 0.4.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.4.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/libraries/worker-pool/README.md b/libraries/worker-pool/README.md index f2c4671140c..7a35ca43590 100644 --- a/libraries/worker-pool/README.md +++ b/libraries/worker-pool/README.md @@ -7,6 +7,6 @@ This library contains a lightweight worker pool using the NodeJS worker_threads - [CHANGELOG.md]( https://github.com/microsoft/rushstack/blob/main/libraries/worker-pool/CHANGELOG.md) - Find out what's new in the latest version -- [API Reference](https://rushstack.io/pages/api/worker-pool/) +- [API Reference](https://api.rushstack.io/pages/worker-pool/) `@rushstack/worker-pool` is part of the [Rush Stack](https://rushstack.io/) family of projects. diff --git a/libraries/worker-pool/package.json b/libraries/worker-pool/package.json index 122b512288b..7ed2b9c866b 100644 --- a/libraries/worker-pool/package.json +++ b/libraries/worker-pool/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/worker-pool", - "version": "0.4.20", + "version": "0.4.27", "description": "Lightweight worker pool using NodeJS worker_threads", "main": "lib/index.js", "typings": "dist/worker-pool.d.ts", diff --git a/repo-scripts/repo-toolbox/package.json b/repo-scripts/repo-toolbox/package.json index a9571dd19ff..e138b67cd86 100644 --- a/repo-scripts/repo-toolbox/package.json +++ b/repo-scripts/repo-toolbox/package.json @@ -12,6 +12,7 @@ "dependencies": { "@microsoft/rush-lib": "workspace:*", "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*", "@rushstack/ts-command-line": "workspace:*", "diff": "~5.0.0" }, diff --git a/repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts b/repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts index d1adfc4a112..6d26dd4b784 100644 --- a/repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts +++ b/repo-scripts/repo-toolbox/src/BumpCyclicsAction.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Async, ConsoleTerminalProvider, Executable, JsonFile, Terminal } from '@rushstack/node-core-library'; +import { Async, Executable, JsonFile } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; import { DependencyType, RushConfiguration } from '@microsoft/rush-lib'; import { CommandLineAction } from '@rushstack/ts-command-line'; import type { ChildProcess } from 'child_process'; diff --git a/repo-scripts/repo-toolbox/src/ReadmeAction.ts b/repo-scripts/repo-toolbox/src/ReadmeAction.ts index 13aeaca2399..8f9f0671150 100644 --- a/repo-scripts/repo-toolbox/src/ReadmeAction.ts +++ b/repo-scripts/repo-toolbox/src/ReadmeAction.ts @@ -2,17 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { - StringBuilder, - Sort, - FileSystem, - Text, - Terminal, - ConsoleTerminalProvider, - AlreadyReportedError, - Colors, - type IColorableSequence -} from '@rushstack/node-core-library'; +import { StringBuilder, Sort, FileSystem, Text, AlreadyReportedError } from '@rushstack/node-core-library'; +import { Terminal, ConsoleTerminalProvider, Colorize } from '@rushstack/terminal'; import { RushConfiguration, type RushConfigurationProject, LockStepVersionPolicy } from '@microsoft/rush-lib'; import { CommandLineAction, type CommandLineFlagParameter } from '@rushstack/ts-command-line'; import * as Diff from 'diff'; @@ -163,16 +154,16 @@ export class ReadmeAction extends CommandLineAction { for (const change of diff) { const lines: string[] = change.value.trimEnd().split('\n'); let linePrefix: string; - let colorizer: (text: string | IColorableSequence) => IColorableSequence; + let colorizer: (text: string) => string; if (change.added) { linePrefix = '+ '; - colorizer = Colors.green; + colorizer = Colorize.green; } else if (change.removed) { linePrefix = '- '; - colorizer = Colors.red; + colorizer = Colorize.red; } else { linePrefix = ' '; - colorizer = Colors.gray; + colorizer = Colorize.gray; } for (const line of lines) { @@ -191,7 +182,7 @@ export class ReadmeAction extends CommandLineAction { terminal.writeLine(`Writing ${repoReadmePath}`); await FileSystem.writeFileAsync(repoReadmePath, readmeString); terminal.writeLine(); - terminal.writeLine(Colors.green('\nSuccess.')); + terminal.writeLine(Colorize.green('\nSuccess.')); } } else { // eslint-disable-next-line no-console diff --git a/repo-scripts/repo-toolbox/src/RecordVersionsAction.ts b/repo-scripts/repo-toolbox/src/RecordVersionsAction.ts index f859d060fa2..063023496fd 100644 --- a/repo-scripts/repo-toolbox/src/RecordVersionsAction.ts +++ b/repo-scripts/repo-toolbox/src/RecordVersionsAction.ts @@ -2,7 +2,8 @@ // See LICENSE in the project root for license information. import * as path from 'path'; -import { Terminal, ConsoleTerminalProvider, JsonFile } from '@rushstack/node-core-library'; +import { JsonFile } from '@rushstack/node-core-library'; +import { Terminal, ConsoleTerminalProvider } from '@rushstack/terminal'; import { RushConfiguration } from '@microsoft/rush-lib'; import { CommandLineAction, type CommandLineStringParameter } from '@rushstack/ts-command-line'; diff --git a/rigs/heft-node-rig/CHANGELOG.json b/rigs/heft-node-rig/CHANGELOG.json index 7b2ca36be02..669d5b00240 100644 --- a/rigs/heft-node-rig/CHANGELOG.json +++ b/rigs/heft-node-rig/CHANGELOG.json @@ -1,6 +1,219 @@ { "name": "@rushstack/heft-node-rig", "entries": [ + { + "version": "2.4.12", + "tag": "@rushstack/heft-node-rig_v2.4.12", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "2.4.11", + "tag": "@rushstack/heft-node-rig_v2.4.11", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "2.4.10", + "tag": "@rushstack/heft-node-rig_v2.4.10", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "2.4.9", + "tag": "@rushstack/heft-node-rig_v2.4.9", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.2`" + }, + { + "comment": "Updating dependency \"@rushstack/eslint-config\" to `3.6.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "2.4.8", + "tag": "@rushstack/heft-node-rig_v2.4.8", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "2.4.7", + "tag": "@rushstack/heft-node-rig_v2.4.7", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.0`" + }, + { + "comment": "Updating dependency \"@rushstack/eslint-config\" to `3.6.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "2.4.6", + "tag": "@rushstack/heft-node-rig_v2.4.6", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.39.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "2.4.5", "tag": "@rushstack/heft-node-rig_v2.4.5", diff --git a/rigs/heft-node-rig/CHANGELOG.md b/rigs/heft-node-rig/CHANGELOG.md index bd0149910c0..271163d11d7 100644 --- a/rigs/heft-node-rig/CHANGELOG.md +++ b/rigs/heft-node-rig/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/heft-node-rig -This log was last generated on Thu, 25 Jan 2024 23:03:57 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 2.4.12 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 2.4.11 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 2.4.10 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 2.4.9 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 2.4.8 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 2.4.7 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 2.4.6 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 2.4.5 Thu, 25 Jan 2024 23:03:57 GMT diff --git a/rigs/heft-node-rig/package.json b/rigs/heft-node-rig/package.json index 91cb2b5f784..2c7f2b05496 100644 --- a/rigs/heft-node-rig/package.json +++ b/rigs/heft-node-rig/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-node-rig", - "version": "2.4.5", + "version": "2.4.12", "description": "A rig package for Node.js projects that build using Heft", "license": "MIT", "scripts": { @@ -13,7 +13,7 @@ "directory": "rigs/heft-node-rig" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3" + "@rushstack/heft": "^0.65.1" }, "dependencies": { "@microsoft/api-extractor": "workspace:*", diff --git a/rigs/heft-web-rig/CHANGELOG.json b/rigs/heft-web-rig/CHANGELOG.json index 7a9996ea92b..3b5dfb7982f 100644 --- a/rigs/heft-web-rig/CHANGELOG.json +++ b/rigs/heft-web-rig/CHANGELOG.json @@ -1,6 +1,269 @@ { "name": "@rushstack/heft-web-rig", "entries": [ + { + "version": "0.21.1", + "tag": "@rushstack/heft-web-rig_v0.21.1", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.13`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.65.0` to `^0.65.1`" + } + ] + } + }, + { + "version": "0.21.0", + "tag": "@rushstack/heft-web-rig_v0.21.0", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "minor": [ + { + "comment": "Include the `set-environment-variables-plugin` plugin from the `@rushstack/heft` package to set the `BROWSERSLIST_IGNORE_OLD_DATA` environment variable to `1` to suppress the warning printed when the `browserslist` package decides it's out of date." + }, + { + "comment": "Rename the `sass-typings` task in the \"library\" profile to `sass`, which more accurately describes what the task does and matches what's in the \"app\" profile." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.12`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.8` to `^0.65.0`" + } + ] + } + }, + { + "version": "0.20.10", + "tag": "@rushstack/heft-web-rig_v0.20.10", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.11`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.7` to `^0.64.8`" + } + ] + } + }, + { + "version": "0.20.9", + "tag": "@rushstack/heft-web-rig_v0.20.9", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.2`" + }, + { + "comment": "Updating dependency \"@rushstack/eslint-config\" to `3.6.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.6` to `^0.64.7`" + } + ] + } + }, + { + "version": "0.20.8", + "tag": "@rushstack/heft-web-rig_v0.20.8", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.5` to `^0.64.6`" + } + ] + } + }, + { + "version": "0.20.7", + "tag": "@rushstack/heft-web-rig_v0.20.7", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.40.0`" + }, + { + "comment": "Updating dependency \"@rushstack/eslint-config\" to `3.6.3`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.4` to `^0.64.5`" + } + ] + } + }, + { + "version": "0.20.6", + "tag": "@rushstack/heft-web-rig_v0.20.6", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/api-extractor\" to `7.39.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-api-extractor-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-jest-plugin\" to `0.11.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-lint-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-sass-plugin\" to `0.13.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-typescript-plugin\" to `0.3.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `0.9.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" from `^0.64.3` to `^0.64.4`" + } + ] + } + }, { "version": "0.20.5", "tag": "@rushstack/heft-web-rig_v0.20.5", diff --git a/rigs/heft-web-rig/CHANGELOG.md b/rigs/heft-web-rig/CHANGELOG.md index 997c5ab7cb0..b06e6673f05 100644 --- a/rigs/heft-web-rig/CHANGELOG.md +++ b/rigs/heft-web-rig/CHANGELOG.md @@ -1,6 +1,44 @@ # Change Log - @rushstack/heft-web-rig -This log was last generated on Thu, 25 Jan 2024 23:03:58 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.21.1 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.21.0 +Tue, 20 Feb 2024 16:10:52 GMT + +### Minor changes + +- Include the `set-environment-variables-plugin` plugin from the `@rushstack/heft` package to set the `BROWSERSLIST_IGNORE_OLD_DATA` environment variable to `1` to suppress the warning printed when the `browserslist` package decides it's out of date. +- Rename the `sass-typings` task in the "library" profile to `sass`, which more accurately describes what the task does and matches what's in the "app" profile. + +## 0.20.10 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.20.9 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.20.8 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.20.7 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.20.6 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.20.5 Thu, 25 Jan 2024 23:03:58 GMT diff --git a/rigs/heft-web-rig/package.json b/rigs/heft-web-rig/package.json index ed3efd5d731..e9f636cd12f 100644 --- a/rigs/heft-web-rig/package.json +++ b/rigs/heft-web-rig/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/heft-web-rig", - "version": "0.20.5", + "version": "0.21.1", "description": "A rig package for web browser projects that build using Heft", "license": "MIT", "scripts": { @@ -13,7 +13,7 @@ "directory": "rigs/heft-web-rig" }, "peerDependencies": { - "@rushstack/heft": "^0.64.3" + "@rushstack/heft": "^0.65.1" }, "dependencies": { "@microsoft/api-extractor": "workspace:*", diff --git a/rigs/heft-web-rig/profiles/app/config/heft.json b/rigs/heft-web-rig/profiles/app/config/heft.json index 3009c39afd0..bdf1a762f11 100644 --- a/rigs/heft-web-rig/profiles/app/config/heft.json +++ b/rigs/heft-web-rig/profiles/app/config/heft.json @@ -22,7 +22,23 @@ "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6"] }], "tasksByName": { + "set-browserslist-ignore-old-data-env-var": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "set-environment-variables-plugin", + "options": { + "environmentVariablesToSet": { + // Suppress the "Browserslist: caniuse-lite is outdated" warning. Although the warning is + // potentially useful, the check is performed in a way that is nondeterministic and can cause + // Rush pipelines to fail. Moreover, the outdated version is often irrelevant and/or nontrivial + // to upgrade. See this thread for details: https://github.com/microsoft/rushstack/issues/2981 + "BROWSERSLIST_IGNORE_OLD_DATA": "1" + } + } + } + }, "sass": { + "taskDependencies": ["set-browserslist-ignore-old-data-env-var"], "taskPlugin": { "pluginPackage": "@rushstack/heft-sass-plugin" } diff --git a/rigs/heft-web-rig/profiles/library/config/heft.json b/rigs/heft-web-rig/profiles/library/config/heft.json index 926dc612991..bdf1a762f11 100644 --- a/rigs/heft-web-rig/profiles/library/config/heft.json +++ b/rigs/heft-web-rig/profiles/library/config/heft.json @@ -22,13 +22,29 @@ "cleanFiles": [{ "includeGlobs": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6"] }], "tasksByName": { - "sass-typings": { + "set-browserslist-ignore-old-data-env-var": { + "taskPlugin": { + "pluginPackage": "@rushstack/heft", + "pluginName": "set-environment-variables-plugin", + "options": { + "environmentVariablesToSet": { + // Suppress the "Browserslist: caniuse-lite is outdated" warning. Although the warning is + // potentially useful, the check is performed in a way that is nondeterministic and can cause + // Rush pipelines to fail. Moreover, the outdated version is often irrelevant and/or nontrivial + // to upgrade. See this thread for details: https://github.com/microsoft/rushstack/issues/2981 + "BROWSERSLIST_IGNORE_OLD_DATA": "1" + } + } + } + }, + "sass": { + "taskDependencies": ["set-browserslist-ignore-old-data-env-var"], "taskPlugin": { "pluginPackage": "@rushstack/heft-sass-plugin" } }, "typescript": { - "taskDependencies": ["sass-typings"], + "taskDependencies": ["sass"], "taskPlugin": { "pluginPackage": "@rushstack/heft-typescript-plugin" } diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json b/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json index 2344f36b5ed..0e817555c3b 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-amazon-s3-build-cache-plugin", - "version": "5.113.0", + "version": "5.114.0", "description": "Rush plugin for Amazon S3 cloud build cache", "repository": { "type": "git", @@ -21,6 +21,7 @@ "dependencies": { "@rushstack/node-core-library": "workspace:*", "@rushstack/rush-sdk": "workspace:*", + "@rushstack/terminal": "workspace:*", "https-proxy-agent": "~5.0.0", "node-fetch": "2.6.7" }, diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3BuildCacheProvider.ts b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3BuildCacheProvider.ts index 7bff15b9ec2..d040e8d0b75 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3BuildCacheProvider.ts +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3BuildCacheProvider.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { type ICloudBuildCacheProvider, type ICredentialCacheEntry, diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3Client.ts b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3Client.ts index 7dfb1df7eef..e3b627df50a 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3Client.ts +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/AmazonS3Client.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { Async, Colors, type IColorableSequence, type ITerminal } from '@rushstack/node-core-library'; +import { Async } from '@rushstack/node-core-library'; +import { Colorize, type ITerminal } from '@rushstack/terminal'; import * as crypto from 'crypto'; import * as fetch from 'node-fetch'; @@ -171,7 +172,7 @@ export class AmazonS3Client { }); } - private _writeDebugLine(...messageParts: (string | IColorableSequence)[]): void { + private _writeDebugLine(...messageParts: string[]): void { // if the terminal has been closed then don't bother sending a debug message try { this._terminal.writeDebugLine(...messageParts); @@ -180,7 +181,7 @@ export class AmazonS3Client { } } - private _writeWarningLine(...messageParts: (string | IColorableSequence)[]): void { + private _writeWarningLine(...messageParts: string[]): void { // if the terminal has been closed then don't bother sending a warning message try { this._terminal.writeWarningLine(...messageParts); @@ -203,7 +204,7 @@ export class AmazonS3Client { // the host can be e.g. https://s3.aws.com or http://localhost:9000 const host: string = this._s3Endpoint.replace(protocolRegex, ''); const canonicalUri: string = AmazonS3Client.UriEncode(`/${objectName}`); - this._writeDebugLine(Colors.bold('Canonical URI: '), canonicalUri); + this._writeDebugLine(Colorize.bold('Canonical URI: '), canonicalUri); if (this._credentials) { // Compute the authorization header. See https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html @@ -302,11 +303,11 @@ export class AmazonS3Client { const url: string = `${this._s3Endpoint}${canonicalUri}`; - this._writeDebugLine(Colors.bold(Colors.underline('Sending request to S3'))); - this._writeDebugLine(Colors.bold('HOST: '), url); - this._writeDebugLine(Colors.bold('Headers: ')); + this._writeDebugLine(Colorize.bold(Colorize.underline('Sending request to S3'))); + this._writeDebugLine(Colorize.bold('HOST: '), url); + this._writeDebugLine(Colorize.bold('Headers: ')); headers.forEach((value, name) => { - this._writeDebugLine(Colors.cyan(`\t${name}: ${value}`)); + this._writeDebugLine(Colorize.cyan(`\t${name}: ${value}`)); }); const response: fetch.Response = await this._webClient.fetchAsync(url, webFetchOptions); @@ -432,7 +433,7 @@ export class AmazonS3Client { ): Promise { const response: RetryableRequestResponse = await sendRequest(); - const log: (...messageParts: (string | IColorableSequence)[]) => void = this._writeDebugLine.bind(this); + const log: (...messageParts: string[]) => void = this._writeDebugLine.bind(this); if (response.hasNetworkError) { if (storageRetryOptions && storageRetryOptions.maxTries > 1) { diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3BuildCacheProvider.test.ts b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3BuildCacheProvider.test.ts index 0eb49a471e8..4ab30117f11 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3BuildCacheProvider.test.ts +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3BuildCacheProvider.test.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { - ConsoleTerminalProvider, - StringBufferTerminalProvider, - Terminal -} from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { RushSession, CredentialCache, diff --git a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3Client.test.ts b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3Client.test.ts index 55c625ba7f8..d87115b17ed 100644 --- a/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3Client.test.ts +++ b/rush-plugins/rush-amazon-s3-build-cache-plugin/src/test/AmazonS3Client.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ConsoleTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; import { Response, type ResponseInit } from 'node-fetch'; import type { IAmazonS3BuildCacheProviderOptionsAdvanced } from '../AmazonS3BuildCacheProvider'; diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/package.json b/rush-plugins/rush-azure-storage-build-cache-plugin/package.json index 9539c510cf4..d2b6580d0bf 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/package.json +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-azure-storage-build-cache-plugin", - "version": "5.113.0", + "version": "5.114.0", "description": "Rush plugin for Azure storage cloud build cache", "repository": { "type": "git", diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureAuthenticationBase.ts b/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureAuthenticationBase.ts index f566297c500..0c758de44c8 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureAuthenticationBase.ts +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureAuthenticationBase.ts @@ -7,7 +7,7 @@ import { AzureAuthorityHosts, type DeviceCodeCredentialOptions } from '@azure/identity'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { CredentialCache } from '@rushstack/rush-sdk'; // Use a separate import line so the .d.ts file ends up with an `import type { ... }` // See https://github.com/microsoft/rushstack/issues/3432 diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageAuthentication.ts b/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageAuthentication.ts index 975ba4f9b59..d0c2ec74ad0 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageAuthentication.ts +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageAuthentication.ts @@ -9,7 +9,7 @@ import { type SASQueryParameters, type ServiceGetUserDelegationKeyResponse } from '@azure/storage-blob'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { AzureAuthenticationBase, type ICredentialResult, diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageBuildCacheProvider.ts b/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageBuildCacheProvider.ts index 2d4ecd01c7c..ba329be5a72 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageBuildCacheProvider.ts +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/src/AzureStorageBuildCacheProvider.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { type ICloudBuildCacheProvider, EnvironmentVariableNames, diff --git a/rush-plugins/rush-azure-storage-build-cache-plugin/src/test/AzureStorageBuildCacheProvider.test.ts b/rush-plugins/rush-azure-storage-build-cache-plugin/src/test/AzureStorageBuildCacheProvider.test.ts index 0a593abbc01..4bde79dd705 100644 --- a/rush-plugins/rush-azure-storage-build-cache-plugin/src/test/AzureStorageBuildCacheProvider.test.ts +++ b/rush-plugins/rush-azure-storage-build-cache-plugin/src/test/AzureStorageBuildCacheProvider.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { CredentialCache, EnvironmentConfiguration, RushUserConfiguration } from '@rushstack/rush-sdk'; import { AzureStorageBuildCacheProvider } from '../AzureStorageBuildCacheProvider'; diff --git a/rush-plugins/rush-http-build-cache-plugin/.eslintrc.js b/rush-plugins/rush-http-build-cache-plugin/.eslintrc.js new file mode 100644 index 00000000000..27dc0bdff95 --- /dev/null +++ b/rush-plugins/rush-http-build-cache-plugin/.eslintrc.js @@ -0,0 +1,12 @@ +// This is a workaround for https://github.com/eslint/eslint/issues/3458 +require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution'); +// This is a workaround for https://github.com/microsoft/rushstack/issues/3021 +require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names'); + +module.exports = { + extends: [ + 'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool', + 'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals' + ], + parserOptions: { tsconfigRootDir: __dirname } +}; diff --git a/rush-plugins/rush-http-build-cache-plugin/package.json b/rush-plugins/rush-http-build-cache-plugin/package.json index b6de997759a..6b3710b5939 100644 --- a/rush-plugins/rush-http-build-cache-plugin/package.json +++ b/rush-plugins/rush-http-build-cache-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-http-build-cache-plugin", - "version": "5.113.0", + "version": "5.114.0", "description": "Rush plugin for generic HTTP cloud build cache", "repository": { "type": "git", @@ -27,6 +27,7 @@ "devDependencies": { "@microsoft/rush-lib": "workspace:*", "@rushstack/heft": "workspace:*", + "@rushstack/terminal": "workspace:*", "local-node-rig": "workspace:*", "@types/node-fetch": "2.6.2" } diff --git a/rush-plugins/rush-http-build-cache-plugin/src/HttpBuildCacheProvider.ts b/rush-plugins/rush-http-build-cache-plugin/src/HttpBuildCacheProvider.ts index d77dc8a109d..0b22b2a952b 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/HttpBuildCacheProvider.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/HttpBuildCacheProvider.ts @@ -1,12 +1,17 @@ -import { ITerminal, Executable, Async } from '@rushstack/node-core-library'; +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { Executable, Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { - ICloudBuildCacheProvider, - ICredentialCacheEntry, + type ICloudBuildCacheProvider, + type ICredentialCacheEntry, CredentialCache, - RushSession, + type RushSession, EnvironmentConfiguration } from '@rushstack/rush-sdk'; -import fetch, { BodyInit, Response } from 'node-fetch'; +import fetch, { type BodyInit, type Response } from 'node-fetch'; +import type { SpawnSyncReturns } from 'child_process'; enum CredentialsOptions { Optional, @@ -43,7 +48,7 @@ export interface IHttpBuildCacheProviderOptions { } const MAX_HTTP_CACHE_ATTEMPTS: number = 3; -const DEFAULT_MIN_HTTP_RETRY_DELAY_MS = 2500; +const DEFAULT_MIN_HTTP_RETRY_DELAY_MS: number = 2500; export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { private readonly _pluginName: string; @@ -81,7 +86,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { cacheId: string ): Promise { try { - const result = await this._http({ + const result: boolean | Buffer = await this._http({ terminal: terminal, relUrl: `${this._cacheKeyPrefix}${cacheId}`, method: 'GET', @@ -111,7 +116,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { terminal.writeDebugLine('Uploading object with cacheId: ', cacheId); try { - const result = await this._http({ + const result: boolean | Buffer = await this._http({ terminal: terminal, relUrl: `${this._cacheKeyPrefix}${cacheId}`, method: this._uploadMethod, @@ -154,9 +159,13 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { const cmd: string = `${this._tokenHandler.exec} ${(this._tokenHandler.args || []).join(' ')}`; terminal.writeVerboseLine(`Running '${cmd}' to get credentials`); - const result = Executable.spawnSync(this._tokenHandler.exec, this._tokenHandler.args || [], { - currentWorkingDirectory: this._rushProjectRoot - }); + const result: SpawnSyncReturns = Executable.spawnSync( + this._tokenHandler.exec, + this._tokenHandler.args || [], + { + currentWorkingDirectory: this._rushProjectRoot + } + ); terminal.writeErrorLine(result.stderr); @@ -164,7 +173,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { throw new Error(`Could not obtain credentials. The command '${cmd}' failed.`); } - const credential = result.stdout.trim(); + const credential: string = result.stdout.trim(); terminal.writeVerboseLine('Got credentials'); await this.updateCachedCredentialAsync(terminal, credential); @@ -209,9 +218,9 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { credentialOptions?: CredentialsOptions; }): Promise { const { terminal, relUrl, method, body, warningText, readBody, credentialOptions } = options; - const safeCredentialOptions = credentialOptions ?? CredentialsOptions.Optional; - const credentials = await this._tryGetCredentials(safeCredentialOptions); - const url = new URL(relUrl, this._url).href; + const safeCredentialOptions: CredentialsOptions = credentialOptions ?? CredentialsOptions.Optional; + const credentials: string | undefined = await this._tryGetCredentials(safeCredentialOptions); + const url: string = new URL(relUrl, this._url).href; const headers: Record = {}; if (typeof credentials === 'string') { @@ -224,11 +233,11 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { } } - const bodyLength = (body as { length: number })?.length || 'unknown'; + const bodyLength: number | 'unknown' = (body as { length: number })?.length || 'unknown'; terminal.writeDebugLine(`[http-build-cache] request: ${method} ${url} ${bodyLength} bytes`); - const response = await fetch(url, { + const response: Response = await fetch(url, { method: method, headers: headers, body: body, @@ -236,7 +245,7 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { }); if (!response.ok) { - const isNonCredentialResponse = response.status >= 500 && response.status < 600; + const isNonCredentialResponse: boolean = response.status >= 500 && response.status < 600; if ( !isNonCredentialResponse && @@ -255,8 +264,8 @@ export class HttpBuildCacheProvider implements ICloudBuildCacheProvider { // Pause a bit before retrying in case the server is busy // Add some random jitter to the retry so we can spread out load on the remote service // A proper solution might add exponential back off in case the retry count is high (10 or more) - const factor = 1.0 + Math.random(); // A random number between 1.0 and 2.0 - const retryDelay = Math.floor(factor * this._minHttpRetryDelayMs); + const factor: number = 1.0 + Math.random(); // A random number between 1.0 and 2.0 + const retryDelay: number = Math.floor(factor * this._minHttpRetryDelayMs); await Async.sleep(retryDelay); diff --git a/rush-plugins/rush-http-build-cache-plugin/src/RushHttpBuildCachePlugin.ts b/rush-plugins/rush-http-build-cache-plugin/src/RushHttpBuildCachePlugin.ts index a4aced33cb9..a06a55409c8 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/RushHttpBuildCachePlugin.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/RushHttpBuildCachePlugin.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { IRushPlugin, RushSession, RushConfiguration } from '@rushstack/rush-sdk'; -import type { HttpBuildCacheProvider, IHttpBuildCacheProviderOptions } from './HttpBuildCacheProvider'; +import type { IHttpBuildCacheProviderOptions } from './HttpBuildCacheProvider'; const PLUGIN_NAME: string = 'HttpBuildCachePlugin'; diff --git a/rush-plugins/rush-http-build-cache-plugin/src/index.ts b/rush-plugins/rush-http-build-cache-plugin/src/index.ts index 17e67ac1859..d8d186d6c80 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/index.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/index.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + import { RushHttpBuildCachePlugin } from './RushHttpBuildCachePlugin'; export default RushHttpBuildCachePlugin; diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index b86d6855bda..fe93acce8c4 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -6,8 +6,8 @@ jest.mock('node-fetch', function () { }); import fetch, { Response } from 'node-fetch'; -import { RushSession, EnvironmentConfiguration } from '@rushstack/rush-sdk'; -import { StringBufferTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { type RushSession, EnvironmentConfiguration } from '@rushstack/rush-sdk'; +import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal'; import { HttpBuildCacheProvider, type IHttpBuildCacheProviderOptions } from '../HttpBuildCacheProvider'; diff --git a/rush-plugins/rush-litewatch-plugin/package.json b/rush-plugins/rush-litewatch-plugin/package.json index 330a2c1ff76..dd77b35abea 100644 --- a/rush-plugins/rush-litewatch-plugin/package.json +++ b/rush-plugins/rush-litewatch-plugin/package.json @@ -16,7 +16,8 @@ }, "dependencies": { "@rushstack/node-core-library": "workspace:*", - "@rushstack/rush-sdk": "workspace:*" + "@rushstack/rush-sdk": "workspace:*", + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "@rushstack/heft": "workspace:*", diff --git a/rush-plugins/rush-litewatch-plugin/src/WatchManager.ts b/rush-plugins/rush-litewatch-plugin/src/WatchManager.ts index b91c1b6b30a..0cc5da8cc75 100644 --- a/rush-plugins/rush-litewatch-plugin/src/WatchManager.ts +++ b/rush-plugins/rush-litewatch-plugin/src/WatchManager.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { type ITerminal, type ITerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { type ITerminal, type ITerminalProvider, Terminal } from '@rushstack/terminal'; import { type WatchProject, WatchState } from './WatchProject'; diff --git a/rush-plugins/rush-litewatch-plugin/src/WatchProject.ts b/rush-plugins/rush-litewatch-plugin/src/WatchProject.ts index dcd77646c79..d4ad6a7c23f 100644 --- a/rush-plugins/rush-litewatch-plugin/src/WatchProject.ts +++ b/rush-plugins/rush-litewatch-plugin/src/WatchProject.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; export enum WatchState { /** No output received yet */ diff --git a/rush-plugins/rush-litewatch-plugin/src/test/WatchManager.test.ts b/rush-plugins/rush-litewatch-plugin/src/test/WatchManager.test.ts index 8c9f3fdd6f9..886893ea95f 100644 --- a/rush-plugins/rush-litewatch-plugin/src/test/WatchManager.test.ts +++ b/rush-plugins/rush-litewatch-plugin/src/test/WatchManager.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import type { ITerminalProvider, TerminalProviderSeverity } from '@rushstack/node-core-library'; +import type { ITerminalProvider, TerminalProviderSeverity } from '@rushstack/terminal'; import { WatchManager } from '../WatchManager'; import { WatchProject } from '../WatchProject'; diff --git a/rush-plugins/rush-redis-cobuild-plugin/package.json b/rush-plugins/rush-redis-cobuild-plugin/package.json index f2b8e428f45..174b659a880 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/package.json +++ b/rush-plugins/rush-redis-cobuild-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-redis-cobuild-plugin", - "version": "5.113.0", + "version": "5.114.0", "description": "Rush plugin for Redis cobuild lock", "repository": { "type": "git", @@ -26,6 +26,7 @@ "devDependencies": { "@microsoft/rush-lib": "workspace:*", "@rushstack/heft": "workspace:*", + "@rushstack/terminal": "workspace:*", "local-node-rig": "workspace:*" } } diff --git a/rush-plugins/rush-redis-cobuild-plugin/src/RedisCobuildLockProvider.ts b/rush-plugins/rush-redis-cobuild-plugin/src/RedisCobuildLockProvider.ts index f4c5485cb3b..21a35f10a27 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/src/RedisCobuildLockProvider.ts +++ b/rush-plugins/rush-redis-cobuild-plugin/src/RedisCobuildLockProvider.ts @@ -16,7 +16,7 @@ import type { RedisModules, RedisScripts } from '@redis/client'; -import type { ITerminal } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; /** * The redis client options diff --git a/rush-plugins/rush-redis-cobuild-plugin/src/test/RedisCobuildLockProvider.test.ts b/rush-plugins/rush-redis-cobuild-plugin/src/test/RedisCobuildLockProvider.test.ts index 03479caf486..3fa6cf43c02 100644 --- a/rush-plugins/rush-redis-cobuild-plugin/src/test/RedisCobuildLockProvider.test.ts +++ b/rush-plugins/rush-redis-cobuild-plugin/src/test/RedisCobuildLockProvider.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ConsoleTerminalProvider } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider } from '@rushstack/terminal'; import * as redisAPI from '@redis/client'; import type { RedisClientType } from '@redis/client'; diff --git a/rush-plugins/rush-serve-plugin/LICENSE b/rush-plugins/rush-serve-plugin/LICENSE index a30e22afb98..3d9be20289b 100644 --- a/rush-plugins/rush-serve-plugin/LICENSE +++ b/rush-plugins/rush-serve-plugin/LICENSE @@ -1,4 +1,4 @@ -@rushstack/rush-litewatch-plugin +@rushstack/rush-serve-plugin Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/rush-plugins/rush-serve-plugin/package.json b/rush-plugins/rush-serve-plugin/package.json index 9a20d2bc90f..f54aff1f0b9 100644 --- a/rush-plugins/rush-serve-plugin/package.json +++ b/rush-plugins/rush-serve-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/rush-serve-plugin", - "version": "5.113.0", + "version": "5.114.0", "description": "A Rush plugin that hooks into a rush action and serves output folders from all projects in the repository.", "license": "MIT", "repository": { @@ -30,6 +30,7 @@ }, "devDependencies": { "@rushstack/heft": "workspace:*", + "@rushstack/terminal": "workspace:*", "local-node-rig": "workspace:*", "@types/compression": "~1.7.2", "@types/cors": "~2.8.12", diff --git a/rush-plugins/rush-serve-plugin/src/RushProjectServeConfigFile.ts b/rush-plugins/rush-serve-plugin/src/RushProjectServeConfigFile.ts index 77806769b7a..62322db213e 100644 --- a/rush-plugins/rush-serve-plugin/src/RushProjectServeConfigFile.ts +++ b/rush-plugins/rush-serve-plugin/src/RushProjectServeConfigFile.ts @@ -4,7 +4,8 @@ import path from 'path'; import { ConfigurationFile, InheritanceType } from '@rushstack/heft-config-file'; -import { Async, type ITerminal } from '@rushstack/node-core-library'; +import { Async } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import { RigConfig } from '@rushstack/rig-package'; import type { RushConfigurationProject } from '@rushstack/rush-sdk'; import rushProjectServeSchema from './schemas/rush-project-serve.schema.json'; diff --git a/rush.json b/rush.json index ee1966c7c01..12d81bcd26b 100644 --- a/rush.json +++ b/rush.json @@ -16,7 +16,7 @@ * path segment in the "$schema" field for all your Rush config files. This will ensure * correct error-underlining and tab-completion for editors such as VS Code. */ - "rushVersion": "5.109.1", + "rushVersion": "5.113.4", /** * The next field selects which package manager should be installed and determines its version. @@ -1112,7 +1112,8 @@ "packageName": "@rushstack/terminal", "projectFolder": "libraries/terminal", "reviewCategory": "libraries", - "shouldPublish": true + "shouldPublish": true, + "decoupledLocalDependencies": ["@rushstack/heft-node-rig", "@rushstack/heft"] }, { "packageName": "@rushstack/tree-pattern", diff --git a/vscode-extensions/rush-vscode-extension/package.json b/vscode-extensions/rush-vscode-extension/package.json index 454baa133a2..966d18d162f 100644 --- a/vscode-extensions/rush-vscode-extension/package.json +++ b/vscode-extensions/rush-vscode-extension/package.json @@ -259,7 +259,8 @@ "@rushstack/node-core-library": "workspace:*", "@rushstack/rush-sdk": "workspace:*", "@rushstack/ts-command-line": "workspace:*", - "@rushstack/rush-vscode-command-webview": "workspace:*" + "@rushstack/rush-vscode-command-webview": "workspace:*", + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "@microsoft/rush-lib": "workspace:*", diff --git a/vscode-extensions/rush-vscode-extension/src/logic/logger.ts b/vscode-extensions/rush-vscode-extension/src/logic/logger.ts index fa0ae78fbdd..cc281933961 100644 --- a/vscode-extensions/rush-vscode-extension/src/logic/logger.ts +++ b/vscode-extensions/rush-vscode-extension/src/logic/logger.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { ConsoleTerminalProvider, Terminal } from '@rushstack/node-core-library'; +import { ConsoleTerminalProvider, Terminal } from '@rushstack/terminal'; const consoleTerminalProvider: ConsoleTerminalProvider = new ConsoleTerminalProvider(); diff --git a/webpack/hashed-folder-copy-plugin/CHANGELOG.json b/webpack/hashed-folder-copy-plugin/CHANGELOG.json index dc995519dc3..c43c661e4af 100644 --- a/webpack/hashed-folder-copy-plugin/CHANGELOG.json +++ b/webpack/hashed-folder-copy-plugin/CHANGELOG.json @@ -1,6 +1,105 @@ { "name": "@rushstack/hashed-folder-copy-plugin", "entries": [ + { + "version": "1.0.19", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.19", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "1.0.18", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.18", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "1.0.17", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.17", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "1.0.16", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.16", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "1.0.15", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.15", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "1.0.14", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.14", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "1.0.13", + "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.13", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "1.0.12", "tag": "@rushstack/hashed-folder-copy-plugin_v1.0.12", diff --git a/webpack/hashed-folder-copy-plugin/CHANGELOG.md b/webpack/hashed-folder-copy-plugin/CHANGELOG.md index f6896ffe60b..3dbdca3b71e 100644 --- a/webpack/hashed-folder-copy-plugin/CHANGELOG.md +++ b/webpack/hashed-folder-copy-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/hashed-folder-copy-plugin -This log was last generated on Thu, 25 Jan 2024 23:03:57 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 1.0.19 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 1.0.18 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 1.0.17 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 1.0.16 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 1.0.15 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 1.0.14 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 1.0.13 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 1.0.12 Thu, 25 Jan 2024 23:03:57 GMT diff --git a/webpack/hashed-folder-copy-plugin/package.json b/webpack/hashed-folder-copy-plugin/package.json index b152a2e5ab9..0cd9ef0f4e8 100644 --- a/webpack/hashed-folder-copy-plugin/package.json +++ b/webpack/hashed-folder-copy-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/hashed-folder-copy-plugin", - "version": "1.0.12", + "version": "1.0.19", "description": "Webpack plugin for copying a folder to the output directory with a hash in the folder name.", "typings": "dist/hashed-folder-copy-plugin.d.ts", "main": "lib/index.js", diff --git a/webpack/loader-load-themed-styles/CHANGELOG.json b/webpack/loader-load-themed-styles/CHANGELOG.json index e0ef6d338a5..749ce1a7943 100644 --- a/webpack/loader-load-themed-styles/CHANGELOG.json +++ b/webpack/loader-load-themed-styles/CHANGELOG.json @@ -1,6 +1,132 @@ { "name": "@microsoft/loader-load-themed-styles", "entries": [ + { + "version": "2.1.27", + "tag": "@microsoft/loader-load-themed-styles_v2.1.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.103`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.102` to `^2.0.103`" + } + ] + } + }, + { + "version": "2.1.26", + "tag": "@microsoft/loader-load-themed-styles_v2.1.26", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.102`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.101` to `^2.0.102`" + } + ] + } + }, + { + "version": "2.1.25", + "tag": "@microsoft/loader-load-themed-styles_v2.1.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.101`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.100` to `^2.0.101`" + } + ] + } + }, + { + "version": "2.1.24", + "tag": "@microsoft/loader-load-themed-styles_v2.1.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.100`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.99` to `^2.0.100`" + } + ] + } + }, + { + "version": "2.1.23", + "tag": "@microsoft/loader-load-themed-styles_v2.1.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.99`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.98` to `^2.0.99`" + } + ] + } + }, + { + "version": "2.1.22", + "tag": "@microsoft/loader-load-themed-styles_v2.1.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.98`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.97` to `^2.0.98`" + } + ] + } + }, + { + "version": "2.1.21", + "tag": "@microsoft/loader-load-themed-styles_v2.1.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.97`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.96` to `^2.0.97`" + } + ] + } + }, { "version": "2.1.20", "tag": "@microsoft/loader-load-themed-styles_v2.1.20", diff --git a/webpack/loader-load-themed-styles/CHANGELOG.md b/webpack/loader-load-themed-styles/CHANGELOG.md index d6cb824858d..42e4398744a 100644 --- a/webpack/loader-load-themed-styles/CHANGELOG.md +++ b/webpack/loader-load-themed-styles/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @microsoft/loader-load-themed-styles -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 2.1.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 2.1.26 +Tue, 20 Feb 2024 16:10:52 GMT + +_Version update only_ + +## 2.1.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 2.1.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 2.1.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 2.1.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 2.1.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 2.1.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/loader-load-themed-styles/package.json b/webpack/loader-load-themed-styles/package.json index 74a5189f3ca..023387622ae 100644 --- a/webpack/loader-load-themed-styles/package.json +++ b/webpack/loader-load-themed-styles/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/loader-load-themed-styles", - "version": "2.1.20", + "version": "2.1.27", "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -22,7 +22,7 @@ }, "peerDependencies": { "@types/webpack": "^4", - "@microsoft/load-themed-styles": "^2.0.96" + "@microsoft/load-themed-styles": "^2.0.103" }, "dependencies": { "loader-utils": "1.4.2" diff --git a/webpack/loader-raw-script/CHANGELOG.json b/webpack/loader-raw-script/CHANGELOG.json index f2ebd5e43ea..7c10231c8dd 100644 --- a/webpack/loader-raw-script/CHANGELOG.json +++ b/webpack/loader-raw-script/CHANGELOG.json @@ -1,6 +1,95 @@ { "name": "@rushstack/loader-raw-script", "entries": [ + { + "version": "1.4.27", + "tag": "@rushstack/loader-raw-script_v1.4.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "1.4.26", + "tag": "@rushstack/loader-raw-script_v1.4.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "1.4.25", + "tag": "@rushstack/loader-raw-script_v1.4.25", + "date": "Mon, 19 Feb 2024 21:54:26 GMT", + "comments": { + "patch": [ + { + "comment": "Fix a formatting issue with the LICENSE." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "1.4.24", + "tag": "@rushstack/loader-raw-script_v1.4.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "1.4.23", + "tag": "@rushstack/loader-raw-script_v1.4.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "1.4.22", + "tag": "@rushstack/loader-raw-script_v1.4.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "1.4.21", + "tag": "@rushstack/loader-raw-script_v1.4.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "1.4.20", "tag": "@rushstack/loader-raw-script_v1.4.20", diff --git a/webpack/loader-raw-script/CHANGELOG.md b/webpack/loader-raw-script/CHANGELOG.md index df2a36312f8..98cae90d749 100644 --- a/webpack/loader-raw-script/CHANGELOG.md +++ b/webpack/loader-raw-script/CHANGELOG.md @@ -1,6 +1,43 @@ # Change Log - @rushstack/loader-raw-script -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 1.4.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 1.4.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 1.4.25 +Mon, 19 Feb 2024 21:54:26 GMT + +### Patches + +- Fix a formatting issue with the LICENSE. + +## 1.4.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 1.4.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 1.4.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 1.4.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 1.4.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/loader-raw-script/LICENSE b/webpack/loader-raw-script/LICENSE index d5923df9eb4..efdea4ef4ce 100644 --- a/webpack/loader-raw-script/LICENSE +++ b/webpack/loader-raw-script/LICENSE @@ -1,24 +1,24 @@ -@rushstack/loader-raw-script - -Copyright (c) Microsoft Corporation. All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +@rushstack/loader-raw-script + +Copyright (c) Microsoft Corporation. All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/webpack/loader-raw-script/package.json b/webpack/loader-raw-script/package.json index f334176c0f8..5d3f113f365 100644 --- a/webpack/loader-raw-script/package.json +++ b/webpack/loader-raw-script/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/loader-raw-script", - "version": "1.4.20", + "version": "1.4.27", "description": "", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/webpack/preserve-dynamic-require-plugin/CHANGELOG.json b/webpack/preserve-dynamic-require-plugin/CHANGELOG.json index 2848fce4e1f..d80bcb3eb41 100644 --- a/webpack/preserve-dynamic-require-plugin/CHANGELOG.json +++ b/webpack/preserve-dynamic-require-plugin/CHANGELOG.json @@ -1,6 +1,90 @@ { "name": "@rushstack/webpack-preserve-dynamic-require-plugin", "entries": [ + { + "version": "0.11.27", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.11.26", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.11.25", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.11.24", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.11.23", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.23", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.11.22", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.22", + "date": "Wed, 07 Feb 2024 01:11:19 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.11.21", + "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.11.20", "tag": "@rushstack/webpack-preserve-dynamic-require-plugin_v0.11.20", diff --git a/webpack/preserve-dynamic-require-plugin/CHANGELOG.md b/webpack/preserve-dynamic-require-plugin/CHANGELOG.md index b089133921e..cb6f1c599b8 100644 --- a/webpack/preserve-dynamic-require-plugin/CHANGELOG.md +++ b/webpack/preserve-dynamic-require-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/webpack-preserve-dynamic-require-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.11.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.11.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.11.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.11.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.11.23 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.11.22 +Wed, 07 Feb 2024 01:11:19 GMT + +_Version update only_ + +## 0.11.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.11.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/preserve-dynamic-require-plugin/package.json b/webpack/preserve-dynamic-require-plugin/package.json index ef5f504cdbe..483127e5568 100644 --- a/webpack/preserve-dynamic-require-plugin/package.json +++ b/webpack/preserve-dynamic-require-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack-preserve-dynamic-require-plugin", - "version": "0.11.20", + "version": "0.11.27", "description": "This plugin tells webpack to leave dynamic calls to \"require\" as-is instead of trying to bundle them.", "main": "lib/index.js", "typings": "dist/webpack-preserve-dynamic-require-plugin.d.ts", diff --git a/webpack/set-webpack-public-path-plugin/CHANGELOG.json b/webpack/set-webpack-public-path-plugin/CHANGELOG.json index 4b91c9bd859..04ee117ab6d 100644 --- a/webpack/set-webpack-public-path-plugin/CHANGELOG.json +++ b/webpack/set-webpack-public-path-plugin/CHANGELOG.json @@ -1,6 +1,126 @@ { "name": "@rushstack/set-webpack-public-path-plugin", "entries": [ + { + "version": "5.1.11", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.11", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.11`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "5.1.10", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.10", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "5.1.9", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.9", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "5.1.8", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.8", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "5.1.7", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.7", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "5.1.6", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.6", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "5.1.5", + "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.5", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "5.1.4", "tag": "@rushstack/set-webpack-public-path-plugin_v5.1.4", diff --git a/webpack/set-webpack-public-path-plugin/CHANGELOG.md b/webpack/set-webpack-public-path-plugin/CHANGELOG.md index 2f429ccf03d..b67611d57df 100644 --- a/webpack/set-webpack-public-path-plugin/CHANGELOG.md +++ b/webpack/set-webpack-public-path-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/set-webpack-public-path-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 5.1.11 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 5.1.10 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 5.1.9 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 5.1.8 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 5.1.7 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 5.1.6 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 5.1.5 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 5.1.4 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/set-webpack-public-path-plugin/package.json b/webpack/set-webpack-public-path-plugin/package.json index 6005737baa4..7fad53ff883 100644 --- a/webpack/set-webpack-public-path-plugin/package.json +++ b/webpack/set-webpack-public-path-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/set-webpack-public-path-plugin", - "version": "5.1.4", + "version": "5.1.11", "description": "This plugin sets the webpack public path at runtime.", "main": "lib/index.js", "typings": "dist/set-webpack-public-path-plugin.d.ts", diff --git a/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.json b/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.json index 1bc9d1ccd09..b973a3c37e2 100644 --- a/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.json +++ b/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.json @@ -1,6 +1,126 @@ { "name": "@rushstack/webpack-embedded-dependencies-plugin", "entries": [ + { + "version": "0.2.28", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.28", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.11`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.2.27", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.27", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.10`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.2.26", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.26", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.9`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.2.25", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.25", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.8`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.2.24", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.24", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.7`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.2.23", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.23", + "date": "Wed, 07 Feb 2024 01:11:19 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.6`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.2.22", + "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.22", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/webpack-plugin-utilities\" to `0.4.5`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.2.21", "tag": "@rushstack/webpack-embedded-dependencies-plugin_v0.2.21", diff --git a/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.md b/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.md index 5e61ccac3a4..eb3d231da89 100644 --- a/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.md +++ b/webpack/webpack-embedded-dependencies-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/webpack-embedded-dependencies-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.2.28 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.2.27 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.2.26 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.2.25 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.2.24 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.2.23 +Wed, 07 Feb 2024 01:11:19 GMT + +_Version update only_ + +## 0.2.22 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.2.21 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack-embedded-dependencies-plugin/package.json b/webpack/webpack-embedded-dependencies-plugin/package.json index e1acfc54196..d67cd5160ae 100644 --- a/webpack/webpack-embedded-dependencies-plugin/package.json +++ b/webpack/webpack-embedded-dependencies-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack-embedded-dependencies-plugin", - "version": "0.2.21", + "version": "0.2.28", "description": "This plugin analyzes bundled dependencies from Node Modules for use with Component Governance and License Scanning.", "main": "lib/index.js", "typings": "dist/webpack-embedded-dependencies-plugin.d.ts", diff --git a/webpack/webpack-plugin-utilities/CHANGELOG.json b/webpack/webpack-plugin-utilities/CHANGELOG.json index eff5b8577f5..39e8cc65932 100644 --- a/webpack/webpack-plugin-utilities/CHANGELOG.json +++ b/webpack/webpack-plugin-utilities/CHANGELOG.json @@ -1,6 +1,90 @@ { "name": "@rushstack/webpack-plugin-utilities", "entries": [ + { + "version": "0.4.11", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.11", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.4.10", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.10", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.4.9", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.9", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.4.8", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.8", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.4.7", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.7", + "date": "Thu, 08 Feb 2024 01:09:22 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.4.6", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.6", + "date": "Wed, 07 Feb 2024 01:11:19 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.4.5", + "tag": "@rushstack/webpack-plugin-utilities_v0.4.5", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.4.4", "tag": "@rushstack/webpack-plugin-utilities_v0.4.4", diff --git a/webpack/webpack-plugin-utilities/CHANGELOG.md b/webpack/webpack-plugin-utilities/CHANGELOG.md index af36d03ed78..d93c8c40ec9 100644 --- a/webpack/webpack-plugin-utilities/CHANGELOG.md +++ b/webpack/webpack-plugin-utilities/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/webpack-plugin-utilities -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.4.11 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.4.10 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.4.9 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.4.8 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.4.7 +Thu, 08 Feb 2024 01:09:22 GMT + +_Version update only_ + +## 0.4.6 +Wed, 07 Feb 2024 01:11:19 GMT + +_Version update only_ + +## 0.4.5 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.4.4 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack-plugin-utilities/package.json b/webpack/webpack-plugin-utilities/package.json index 68e96a434f7..6288f131eee 100644 --- a/webpack/webpack-plugin-utilities/package.json +++ b/webpack/webpack-plugin-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack-plugin-utilities", - "version": "0.4.4", + "version": "0.4.11", "description": "This plugin sets the webpack public path at runtime.", "main": "lib/index.js", "typings": "dist/webpack-plugin-utilities.d.ts", diff --git a/webpack/webpack4-localization-plugin/CHANGELOG.json b/webpack/webpack4-localization-plugin/CHANGELOG.json index 0bebea27a71..ec201988030 100644 --- a/webpack/webpack4-localization-plugin/CHANGELOG.json +++ b/webpack/webpack4-localization-plugin/CHANGELOG.json @@ -1,6 +1,132 @@ { "name": "@rushstack/webpack4-localization-plugin", "entries": [ + { + "version": "0.18.27", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.27`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.18.26", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.18.25", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.25`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.18.24", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.24`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.18.23", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.23`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.18.22", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.18.21", + "tag": "@rushstack/webpack4-localization-plugin_v0.18.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.21`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.18.20", "tag": "@rushstack/webpack4-localization-plugin_v0.18.20", diff --git a/webpack/webpack4-localization-plugin/CHANGELOG.md b/webpack/webpack4-localization-plugin/CHANGELOG.md index add0ceea020..8d5e161e328 100644 --- a/webpack/webpack4-localization-plugin/CHANGELOG.md +++ b/webpack/webpack4-localization-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/webpack4-localization-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.18.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.18.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.18.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.18.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.18.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.18.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.18.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.18.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack4-localization-plugin/package.json b/webpack/webpack4-localization-plugin/package.json index 1da137b2587..7e57e63ecc1 100644 --- a/webpack/webpack4-localization-plugin/package.json +++ b/webpack/webpack4-localization-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack4-localization-plugin", - "version": "0.18.20", + "version": "0.18.27", "description": "This plugin facilitates localization with Webpack.", "main": "lib/index.js", "typings": "dist/webpack4-localization-plugin.d.ts", @@ -34,6 +34,7 @@ "dependencies": { "@rushstack/localization-utilities": "workspace:*", "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*", "@types/tapable": "1.0.6", "loader-utils": "1.4.2", "minimatch": "~3.0.3" diff --git a/webpack/webpack4-localization-plugin/src/LocalizationPlugin.ts b/webpack/webpack4-localization-plugin/src/LocalizationPlugin.ts index 3606ca23938..9c021acfe09 100644 --- a/webpack/webpack4-localization-plugin/src/LocalizationPlugin.ts +++ b/webpack/webpack4-localization-plugin/src/LocalizationPlugin.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -import { JsonFile, FileSystem, type ITerminal, NewlineKind } from '@rushstack/node-core-library'; +import { JsonFile, FileSystem, NewlineKind } from '@rushstack/node-core-library'; +import type { ITerminal } from '@rushstack/terminal'; import * as Webpack from 'webpack'; import * as path from 'path'; import type * as Tapable from 'tapable'; diff --git a/webpack/webpack4-localization-plugin/src/loaders/InPlaceLocFileLoader.ts b/webpack/webpack4-localization-plugin/src/loaders/InPlaceLocFileLoader.ts index 4cfd9a3a69b..7b6d6856e30 100644 --- a/webpack/webpack4-localization-plugin/src/loaders/InPlaceLocFileLoader.ts +++ b/webpack/webpack4-localization-plugin/src/loaders/InPlaceLocFileLoader.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { loader } from 'webpack'; -import { Terminal } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; import { type ILocalizationFile, parseLocFile } from '@rushstack/localization-utilities'; import { loaderFactory, type IBaseLoaderOptions } from './LoaderFactory'; diff --git a/webpack/webpack4-localization-plugin/src/loaders/LocLoader.ts b/webpack/webpack4-localization-plugin/src/loaders/LocLoader.ts index 3008cd6e177..efe2b6cd098 100644 --- a/webpack/webpack4-localization-plugin/src/loaders/LocLoader.ts +++ b/webpack/webpack4-localization-plugin/src/loaders/LocLoader.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { loader } from 'webpack'; -import { Terminal } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; import { type ILocalizationFile, parseLocFile } from '@rushstack/localization-utilities'; import type { LocalizationPlugin } from '../LocalizationPlugin'; diff --git a/webpack/webpack4-localization-plugin/src/utilities/LoaderTerminalProvider.ts b/webpack/webpack4-localization-plugin/src/utilities/LoaderTerminalProvider.ts index 067e9c6bffc..49582f72b2a 100644 --- a/webpack/webpack4-localization-plugin/src/utilities/LoaderTerminalProvider.ts +++ b/webpack/webpack4-localization-plugin/src/utilities/LoaderTerminalProvider.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type * as webpack from 'webpack'; -import { type ITerminalProvider, TerminalProviderSeverity } from '@rushstack/node-core-library'; +import { type ITerminalProvider, TerminalProviderSeverity } from '@rushstack/terminal'; export class LoaderTerminalProvider { public static getTerminalProviderForLoader(loaderContext: webpack.loader.LoaderContext): ITerminalProvider { diff --git a/webpack/webpack4-module-minifier-plugin/CHANGELOG.json b/webpack/webpack4-module-minifier-plugin/CHANGELOG.json index bb70d7459b9..43720885297 100644 --- a/webpack/webpack4-module-minifier-plugin/CHANGELOG.json +++ b/webpack/webpack4-module-minifier-plugin/CHANGELOG.json @@ -1,6 +1,132 @@ { "name": "@rushstack/webpack4-module-minifier-plugin", "entries": [ + { + "version": "0.13.27", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.27`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.13.26", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.26`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.13.25", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.25`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.13.24", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.24`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.13.23", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.23`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.13.22", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.22`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.13.21", + "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.21`" + }, + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.13.20", "tag": "@rushstack/webpack4-module-minifier-plugin_v0.13.20", diff --git a/webpack/webpack4-module-minifier-plugin/CHANGELOG.md b/webpack/webpack4-module-minifier-plugin/CHANGELOG.md index 1b68cbd8072..fedac322d36 100644 --- a/webpack/webpack4-module-minifier-plugin/CHANGELOG.md +++ b/webpack/webpack4-module-minifier-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/webpack4-module-minifier-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.13.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.13.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.13.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.13.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.13.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.13.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.13.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.13.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack4-module-minifier-plugin/package.json b/webpack/webpack4-module-minifier-plugin/package.json index aee52d66d0f..fba2e32e851 100644 --- a/webpack/webpack4-module-minifier-plugin/package.json +++ b/webpack/webpack4-module-minifier-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack4-module-minifier-plugin", - "version": "0.13.20", + "version": "0.13.27", "description": "This plugin splits minification of webpack compilations into smaller units.", "main": "lib/index.js", "typings": "dist/webpack4-module-minifier-plugin.d.ts", diff --git a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json index 25c8fd3ec86..a746a6974d7 100644 --- a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json +++ b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.json @@ -1,6 +1,147 @@ { "name": "@microsoft/webpack5-load-themed-styles-loader", "entries": [ + { + "version": "0.2.27", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.103`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.102` to `^2.0.103`" + } + ] + } + }, + { + "version": "0.2.26", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.26", + "date": "Tue, 20 Feb 2024 16:10:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.102`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.101` to `^2.0.102`" + } + ] + } + }, + { + "version": "0.2.25", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.101`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.100` to `^2.0.101`" + } + ] + } + }, + { + "version": "0.2.24", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.100`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.99` to `^2.0.100`" + } + ] + } + }, + { + "version": "0.2.23", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.99`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.98` to `^2.0.99`" + } + ] + } + }, + { + "version": "0.2.22", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.98`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.97` to `^2.0.98`" + } + ] + } + }, + { + "version": "0.2.21", + "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" to `2.0.97`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@microsoft/load-themed-styles\" from `^2.0.96` to `^2.0.97`" + } + ] + } + }, { "version": "0.2.20", "tag": "@microsoft/webpack5-load-themed-styles-loader_v0.2.20", diff --git a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md index 81457014beb..5b46d9226a4 100644 --- a/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md +++ b/webpack/webpack5-load-themed-styles-loader/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @microsoft/webpack5-load-themed-styles-loader -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.2.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.2.26 +Tue, 20 Feb 2024 16:10:52 GMT + +_Version update only_ + +## 0.2.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 0.2.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.2.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.2.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.2.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 0.2.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack5-load-themed-styles-loader/package.json b/webpack/webpack5-load-themed-styles-loader/package.json index 1a88a64c4a3..dbbee553638 100644 --- a/webpack/webpack5-load-themed-styles-loader/package.json +++ b/webpack/webpack5-load-themed-styles-loader/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/webpack5-load-themed-styles-loader", - "version": "0.2.20", + "version": "0.2.27", "description": "This simple loader wraps the loading of CSS in script equivalent to `require('load-themed-styles').loadStyles( /* css text */ )`. It is designed to be a replacement for style-loader.", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -16,7 +16,7 @@ "_phase:test": "heft run --only test -- --clean" }, "peerDependencies": { - "@microsoft/load-themed-styles": "^2.0.96", + "@microsoft/load-themed-styles": "^2.0.103", "webpack": "^5" }, "peerDependenciesMeta": { diff --git a/webpack/webpack5-localization-plugin/CHANGELOG.json b/webpack/webpack5-localization-plugin/CHANGELOG.json index 951bd8148e7..df8f8f3af11 100644 --- a/webpack/webpack5-localization-plugin/CHANGELOG.json +++ b/webpack/webpack5-localization-plugin/CHANGELOG.json @@ -1,6 +1,169 @@ { "name": "@rushstack/webpack5-localization-plugin", "entries": [ + { + "version": "0.9.2", + "tag": "@rushstack/webpack5-localization-plugin_v0.9.2", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.27`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.1`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + } + ] + } + }, + { + "version": "0.9.1", + "tag": "@rushstack/webpack5-localization-plugin_v0.9.1", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + } + ] + } + }, + { + "version": "0.9.0", + "tag": "@rushstack/webpack5-localization-plugin_v0.9.0", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "minor": [ + { + "comment": "Filter out non-JS chunks." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.25`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `4.0.0`" + }, + { + "comment": "Updating dependency \"@rushstack/terminal\" to `0.8.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + } + ] + } + }, + { + "version": "0.8.1", + "tag": "@rushstack/webpack5-localization-plugin_v0.8.1", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.24`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.1`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + } + ] + } + }, + { + "version": "0.8.0", + "tag": "@rushstack/webpack5-localization-plugin_v0.8.0", + "date": "Sat, 10 Feb 2024 01:40:49 GMT", + "comments": { + "minor": [ + { + "comment": "Export a `TrueHashPlugin` that performs what the `realContentHash` option does, but without validating the localization plugin's options." + } + ] + } + }, + { + "version": "0.7.3", + "tag": "@rushstack/webpack5-localization-plugin_v0.7.3", + "date": "Sat, 10 Feb 2024 01:29:22 GMT", + "comments": { + "patch": [ + { + "comment": "Add support for the `output.hashSalt` option when the `realContentHashes` feature is enabled." + } + ] + } + }, + { + "version": "0.7.2", + "tag": "@rushstack/webpack5-localization-plugin_v0.7.2", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.23`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.66.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + } + ] + } + }, + { + "version": "0.7.1", + "tag": "@rushstack/webpack5-localization-plugin_v0.7.1", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + } + ] + } + }, + { + "version": "0.7.0", + "tag": "@rushstack/webpack5-localization-plugin_v0.7.0", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "minor": [ + { + "comment": "Include an option called `realContentHash` that updates \"[contenthash]\" hashes to the actual hashes of chunks." + }, + { + "comment": "Add a warning if `optimization.realContentHash` is set." + } + ], + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/localization-utilities\" to `0.9.21`" + }, + { + "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + } + ] + } + }, { "version": "0.6.4", "tag": "@rushstack/webpack5-localization-plugin_v0.6.4", diff --git a/webpack/webpack5-localization-plugin/CHANGELOG.md b/webpack/webpack5-localization-plugin/CHANGELOG.md index 4b2af54b37a..ebcf924eb60 100644 --- a/webpack/webpack5-localization-plugin/CHANGELOG.md +++ b/webpack/webpack5-localization-plugin/CHANGELOG.md @@ -1,6 +1,60 @@ # Change Log - @rushstack/webpack5-localization-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 0.9.2 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 0.9.1 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 0.9.0 +Mon, 19 Feb 2024 21:54:27 GMT + +### Minor changes + +- Filter out non-JS chunks. + +## 0.8.1 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 0.8.0 +Sat, 10 Feb 2024 01:40:49 GMT + +### Minor changes + +- Export a `TrueHashPlugin` that performs what the `realContentHash` option does, but without validating the localization plugin's options. + +## 0.7.3 +Sat, 10 Feb 2024 01:29:22 GMT + +### Patches + +- Add support for the `output.hashSalt` option when the `realContentHashes` feature is enabled. + +## 0.7.2 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 0.7.1 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 0.7.0 +Mon, 05 Feb 2024 23:46:52 GMT + +### Minor changes + +- Include an option called `realContentHash` that updates "[contenthash]" hashes to the actual hashes of chunks. +- Add a warning if `optimization.realContentHash` is set. ## 0.6.4 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack5-localization-plugin/README.md b/webpack/webpack5-localization-plugin/README.md index c20e622ba88..ffe6bc458ad 100644 --- a/webpack/webpack5-localization-plugin/README.md +++ b/webpack/webpack5-localization-plugin/README.md @@ -47,21 +47,21 @@ any translations. ## Options -### `localizedData = { }` +### `localizedData: { }` -#### `localizedData.defaultLocale = { }` +#### `localizedData.defaultLocale: { }` This option has a required property (`localeName`), to specify the name of the locale used in the `.resx` and `.loc.json` files in the source. -##### `localizedData.defaultLocale.fillMissingTranslationStrings = true | false` +##### `localizedData.defaultLocale.fillMissingTranslationStrings: true | false` If this option is set to `true`, strings that are missing from `localizedData.translatedStrings` will be provided by the default locale (the strings in the `.resx` and `.loc.json` files in the source). If this option is unset or set to `false`, an error will be emitted if a string is missing from `localizedData.translatedStrings`. -#### `localizedData.translatedStrings = { }` +#### `localizedData.translatedStrings: { }` This option is used to specify the localization data to be used in the build. This object has the following structure: @@ -101,7 +101,7 @@ translatedStrings: { } ``` -#### `localizedData.resolveMissingTranslatedStrings = (locales: string[], filePath: string, context: LoaderContext<{}>) => { ... }` +#### `localizedData.resolveMissingTranslatedStrings: (locales: string[], filePath: string, context: LoaderContext<{}>) => { ... }` This optional option can be used to resolve translated data that is missing from data that is provided in the `localizedData.translatedStrings` option. Set this option with a function expecting two parameters: @@ -120,7 +120,7 @@ If the function returns data that is missing locales or individual strings, the default locale if `localizedData.defaultLocale.fillMissingTranslationStrings` is set to `true`. If `localizedData.defaultLocale.fillMissingTranslationStrings` is set to `false`, an error will result. -#### `localizedData.passthroughLocale = { }` +#### `localizedData.passthroughLocale: { }` This option is used to specify how and if a passthrough locale should be generated. A passthrough locale is a generated locale in which each string's value is its name. This is useful for debugging and for identifying @@ -128,34 +128,34 @@ cases where a locale is missing. This option takes two optional properties: -##### `localizedData.passthroughLocale.usePassthroughLocale = true | false` +##### `localizedData.passthroughLocale.usePassthroughLocale: true | false` If `passthroughLocale.usePassthroughLocale` is set to `true`, a passthrough locale will be included in the output. By default, the passthrough locale's name is "passthrough." -##### `localizedData.passthroughLocale.passthroughLocaleName = '...'` +##### `localizedData.passthroughLocale.passthroughLocaleName: '...'` If `passthroughLocale.usePassthroughLocale` is set to `true`, the "passthrough" locale name can be overridden by setting a value on `passthroughLocale.passthroughLocaleName`. -#### `localizedData.pseudolocales = { }` +#### `localizedData.pseudolocales: { }` This option allows pseudolocales to be generated from the strings in the default locale. This option takes an option with pseudolocales as keys and options for the [pseudolocale package](https://www.npmjs.com/package/pseudolocale) as values. -### `noStringsLocaleName = '...'` +### `noStringsLocaleName: '...'` The value to replace the `[locale]` token with for chunks without localized strings. Defaults to "none" -### `runtimeLocaleExpression = '...'` +### `runtimeLocaleExpression: '...'` A chunk of raw ECMAScript to inject into the webpack runtime to resolve the current locale at execution time. Allows multiple locales to share the same runtime chunk if it does not directly contain localized strings. -### `localizationStats = { }` +### `localizationStats: { }` -#### `localizationStats.dropPath = '...'` +#### `localizationStats.dropPath: '...'` This option is used to designate a path at which a JSON file describing the localized assets produced should be written. If this property is omitted, the stats file won't be written. @@ -196,11 +196,19 @@ The file has the following format: ``` -#### `localizationStats.callback = (stats) => { ... }` +#### `localizationStats.callback: (stats) => { ... }` This option is used to specify a callback to be called with the stats data that would be dropped at [`localizationStats.dropPath`](#localizationStats.DropPath--) after compilation completes. +### `realContentHash: true | false` + +If this option is set to `true`, the plugin will update `[contenthash]` tokens in the output filenames to +use the true hash of the content, rather than an intermediate hash that is shared between all locales. + +Note that this option is not compatible with the `runtimeLocaleExpression` option and will cause an error if +both are set. + ## Links - [CHANGELOG.md](https://github.com/microsoft/rushstack/blob/main/webpack/localization-plugin/CHANGELOG.md) - Find diff --git a/webpack/webpack5-localization-plugin/package.json b/webpack/webpack5-localization-plugin/package.json index 2822498d922..41f0c91f67e 100644 --- a/webpack/webpack5-localization-plugin/package.json +++ b/webpack/webpack5-localization-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack5-localization-plugin", - "version": "0.6.4", + "version": "0.9.2", "description": "This plugin facilitates localization with Webpack.", "main": "lib/index.js", "typings": "dist/webpack5-localization-plugin.d.ts", @@ -21,7 +21,8 @@ }, "dependencies": { "@rushstack/localization-utilities": "workspace:*", - "@rushstack/node-core-library": "workspace:*" + "@rushstack/node-core-library": "workspace:*", + "@rushstack/terminal": "workspace:*" }, "devDependencies": { "@rushstack/heft": "workspace:*", diff --git a/webpack/webpack5-localization-plugin/src/LocalizationPlugin.ts b/webpack/webpack5-localization-plugin/src/LocalizationPlugin.ts index 6b698dc22bf..9be64729814 100644 --- a/webpack/webpack5-localization-plugin/src/LocalizationPlugin.ts +++ b/webpack/webpack5-localization-plugin/src/LocalizationPlugin.ts @@ -29,6 +29,8 @@ import type { import type { IAssetPathOptions } from './webpackInterfaces'; import { markEntity, getMark } from './utilities/EntityMarker'; import { processLocalizedAsset, processNonLocalizedAsset } from './AssetProcessor'; +import { getHashFunction, type HashFn, updateAssetHashes } from './trueHashes'; +import { chunkIsJs } from './utilities/chunkUtilities'; /** * @public @@ -80,7 +82,10 @@ export function getPluginInstance(compiler: Compiler | undefined): LocalizationP export class LocalizationPlugin implements WebpackPluginInstance { public readonly stringKeys: Map = new Map(); - private readonly _options: ILocalizationPluginOptions; + /** + * @internal + */ + public readonly _options: ILocalizationPluginOptions; private readonly _resolvedTranslatedStringsFromOptions: Map< string, Map> @@ -129,10 +134,11 @@ export class LocalizationPlugin implements WebpackPluginInstance { } } + const { webpack: thisWebpack } = compiler; const { WebpackError, runtime: { GetChunkFilenameRuntimeModule } - } = compiler.webpack; + } = thisWebpack; // Side-channel for async chunk URL generator chunk, since the actual chunk is completely inaccessible // from the assetPath hook below when invoked to build the async URL generator @@ -157,6 +163,27 @@ export class LocalizationPlugin implements WebpackPluginInstance { const { runtimeLocaleExpression } = this._options; compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation: Compilation) => { + let hashFn: HashFn | undefined; + if (this._options.realContentHash) { + if (runtimeLocaleExpression) { + compilation.errors.push( + new WebpackError( + `The "realContentHash" option cannot be used in conjunction with "runtimeLocaleExpression".` + ) + ); + } else { + hashFn = getHashFunction({ thisWebpack, compilation }); + } + } else if (compiler.options.optimization?.realContentHash) { + compilation.errors.push( + new thisWebpack.WebpackError( + `The \`optimization.realContentHash\` option is set and the ${LocalizationPlugin.name}'s ` + + '`realContentHash` option is not set. This will likely produce invalid results. Consider setting the ' + + `\`realContentHash\` option in the ${LocalizationPlugin.name} plugin.` + ) + ); + } + compilation.hooks.assetPath.tap( PLUGIN_NAME, (assetPath: string, options: IAssetPathOptions): string => { @@ -274,14 +301,19 @@ export class LocalizationPlugin implements WebpackPluginInstance { const locales: Set = new Set(this._resolvedLocalizedStrings.keys()); const { chunkGraph, chunks } = compilation; + const { localizationStats: statsOptions } = this._options; - const filesByChunkName: Map> = new Map(); + const filesByChunkName: Map> | undefined = statsOptions + ? new Map() + : undefined; const localizedEntryPointNames: string[] = []; const localizedChunkNames: string[] = []; - const { localizationStats: statsOptions } = this._options; - for (const chunk of chunks) { + if (!chunkIsJs(chunk, chunkGraph)) { + continue; + } + const isLocalized: boolean = _chunkHasLocalizedModules( chunkGraph, chunk, @@ -319,11 +351,9 @@ export class LocalizationPlugin implements WebpackPluginInstance { filenameTemplate: template }); - if (statsOptions) { - if (chunk.name) { - filesByChunkName.set(chunk.name, localizedAssets); - (chunk.hasRuntime() ? localizedEntryPointNames : localizedChunkNames).push(chunk.name); - } + if (filesByChunkName && chunk.name) { + filesByChunkName.set(chunk.name, localizedAssets); + (chunk.hasRuntime() ? localizedEntryPointNames : localizedChunkNames).push(chunk.name); } } else { processNonLocalizedAsset({ @@ -340,8 +370,17 @@ export class LocalizationPlugin implements WebpackPluginInstance { } } + if (hashFn) { + updateAssetHashes({ + thisWebpack, + compilation, + hashFn, + filesByChunkName + }); + } + // Since the stats generation doesn't depend on content, do it immediately - if (statsOptions) { + if (statsOptions && filesByChunkName) { const localizationStats: ILocalizationStats = { entrypoints: {}, namedChunkGroups: {} diff --git a/webpack/webpack5-localization-plugin/src/TrueHashPlugin.ts b/webpack/webpack5-localization-plugin/src/TrueHashPlugin.ts new file mode 100644 index 00000000000..2ebbb5c2fbb --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/TrueHashPlugin.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import type { Compilation, Compiler, WebpackPluginInstance } from 'webpack'; + +import { type HashFn, getHashFunction, updateAssetHashes } from './trueHashes'; + +const PLUGIN_NAME: 'true-hash' = 'true-hash'; + +/** + * @public + */ +export interface ITrueHashPluginOptions { + /** + * A function that takes the contents of a file and returns a hash. + */ + hashFunction?: (contents: string | Buffer) => string; + + /** + * Optionally override the process assets stage for this plugin. + */ + stageOverride?: number; +} + +/** + * @public + */ +export class TrueHashPlugin implements WebpackPluginInstance { + private readonly _options: ITrueHashPluginOptions; + + public constructor(options: ITrueHashPluginOptions = {}) { + this._options = options; + } + + public apply(compiler: Compiler): void { + compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation: Compilation) => { + const { webpack: thisWebpack } = compiler; + const { hashFunction, stageOverride = thisWebpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE } = + this._options; + const hashFn: HashFn = + hashFunction ?? + getHashFunction({ + thisWebpack, + compilation + }); + + compilation.hooks.processAssets.tap( + { + name: PLUGIN_NAME, + stage: stageOverride + }, + () => updateAssetHashes({ thisWebpack, compilation, hashFn }) + ); + }); + } +} diff --git a/webpack/webpack5-localization-plugin/src/index.ts b/webpack/webpack5-localization-plugin/src/index.ts index cc86d18fb27..5bca18124c9 100644 --- a/webpack/webpack5-localization-plugin/src/index.ts +++ b/webpack/webpack5-localization-plugin/src/index.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. -export { LocalizationPlugin, IStringPlaceholder as _IStringPlaceholder } from './LocalizationPlugin'; +export { LocalizationPlugin, type IStringPlaceholder as _IStringPlaceholder } from './LocalizationPlugin'; +export { TrueHashPlugin, type ITrueHashPluginOptions } from './TrueHashPlugin'; export { IDefaultLocaleOptions, @@ -20,5 +21,4 @@ export { IPseudolocalesOptions, IResolvedMissingTranslations } from './interfaces'; - export { ILocalizedWebpackChunk } from './webpackInterfaces'; diff --git a/webpack/webpack5-localization-plugin/src/interfaces.ts b/webpack/webpack5-localization-plugin/src/interfaces.ts index 89f508008bb..6bf188e1ea6 100644 --- a/webpack/webpack5-localization-plugin/src/interfaces.ts +++ b/webpack/webpack5-localization-plugin/src/interfaces.ts @@ -144,6 +144,11 @@ export interface ILocalizationPluginOptions { * runtimeLocaleExpression produces the same output as formatLocaleForFilename. */ formatLocaleForFilename?: (locale: string) => string; + + /** + * If set to true, update usages of [contenthash] to use the true hash of the file contents + */ + realContentHash?: boolean; } /** diff --git a/webpack/webpack5-localization-plugin/src/loaders/default-locale-loader.ts b/webpack/webpack5-localization-plugin/src/loaders/default-locale-loader.ts index 5894ccf4497..024370dad5b 100644 --- a/webpack/webpack5-localization-plugin/src/loaders/default-locale-loader.ts +++ b/webpack/webpack5-localization-plugin/src/loaders/default-locale-loader.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { LoaderContext, LoaderDefinitionFunction } from 'webpack'; -import { Terminal } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; import { type ILocalizationFile, parseLocFile } from '@rushstack/localization-utilities'; import type { IResxLoaderOptions } from './IResxLoaderOptions'; diff --git a/webpack/webpack5-localization-plugin/src/loaders/loc-loader.ts b/webpack/webpack5-localization-plugin/src/loaders/loc-loader.ts index 293021ba16d..5378b14f197 100644 --- a/webpack/webpack5-localization-plugin/src/loaders/loc-loader.ts +++ b/webpack/webpack5-localization-plugin/src/loaders/loc-loader.ts @@ -3,7 +3,8 @@ import type { LoaderContext, LoaderDefinitionFunction } from 'webpack'; -import { Terminal, type NewlineKind } from '@rushstack/node-core-library'; +import type { NewlineKind } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; import { parseLocFile } from '@rushstack/localization-utilities'; import type { LocalizationPlugin } from '../LocalizationPlugin'; diff --git a/webpack/webpack5-localization-plugin/src/loaders/resx-loader.ts b/webpack/webpack5-localization-plugin/src/loaders/resx-loader.ts index 9d5fdab88f4..cfa8498d2cb 100644 --- a/webpack/webpack5-localization-plugin/src/loaders/resx-loader.ts +++ b/webpack/webpack5-localization-plugin/src/loaders/resx-loader.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { LoaderContext, LoaderDefinitionFunction } from 'webpack'; -import { Terminal } from '@rushstack/node-core-library'; +import { Terminal } from '@rushstack/terminal'; import { parseResx } from '@rushstack/localization-utilities'; import type { IResxLocLoaderOptions } from './IResxLoaderOptions'; diff --git a/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamic.test.ts b/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamic.test.ts index 5b0ca68ad89..87aef19bde3 100644 --- a/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamic.test.ts +++ b/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamic.test.ts @@ -17,8 +17,10 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise memoryFileSystem.fromJSON( { '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js"] }', - '/a/async.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test, strings2.another);`, - '/a/entry.js': `import(/* webpackChunkName: 'async' */ './async');`, + '/a/async1.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test, strings2.another);`, + '/a/async2.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test + strings2.another);`, + '/a/entrySingleChunk.js': `import(/* webpackChunkName: 'async1' */ './async1');`, + '/a/entryTwoChunks.js': `import(/* webpackChunkName: 'async1' */ './async1');import(/* webpackChunkName: 'async2' */ './async2');`, '/a/strings1.resjson': `{"test":"blah","_test.comment":"A string"}`, '/a/strings2.resjson': `{"another":"something else","_another.comment":"Another string"}` }, @@ -34,10 +36,10 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise const options: ILocalizationPluginOptions = { localizedData: { defaultLocale: { - localeName: 'en-us' + localeName: 'LOCALE1' }, translatedStrings: { - foo: { + LOCALE2: { '/a/strings1.resjson': { test: 'baz' }, @@ -57,12 +59,13 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise const compiler: Compiler = webpack({ entry: { - main: '/a/entry.js' + mainSingleChunk: '/a/entrySingleChunk.js', + mainTwoChunks: '/a/entryTwoChunks.js' }, output: { path: '/release', - filename: '[name]-[locale].js', - chunkFilename: 'chunks/[name]-[locale].js' + filename: '[name]-[locale]-[contenthash].js', + chunkFilename: 'chunks/[name]-[locale]-[contenthash].js' }, module: { rules: [ @@ -78,7 +81,8 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise }, optimization: { minimize, - moduleIds: 'named' + moduleIds: 'named', + realContentHash: false }, context: '/', mode: 'production', @@ -98,6 +102,9 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise expect(results).toMatchSnapshot('Content'); expect(localizationStats).toMatchSnapshot('Localization Stats'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); } describe(LocalizationPlugin.name, () => { diff --git a/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts b/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts index 57a427e194b..3c2ec58b434 100644 --- a/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts +++ b/webpack/webpack5-localization-plugin/src/test/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts @@ -17,8 +17,10 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise memoryFileSystem.fromJSON( { '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js"] }', - '/a/async.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test, strings2.another);`, - '/a/entry.js': `import(/* webpackChunkName: 'async' */ './async');`, + '/a/async1.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test, strings2.another);`, + '/a/async2.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test + strings2.another);`, + '/a/entrySingleChunk.js': `import(/* webpackChunkName: 'async1' */ './async1');`, + '/a/entryTwoChunks.js': `import(/* webpackChunkName: 'async1' */ './async1');import(/* webpackChunkName: 'async2' */ './async2');`, '/a/strings1.resjson': `{"test":"blah","_test.comment":"A string"}`, '/a/strings2.resjson': `{"another":"something else","_another.comment":"Another string"}`, '/b/entry.js': `console.log('hello world');` @@ -35,10 +37,10 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise const options: ILocalizationPluginOptions = { localizedData: { defaultLocale: { - localeName: 'en-us' + localeName: 'LOCALE1' }, translatedStrings: { - foo: { + LOCALE2: { '/a/strings1.resjson': { test: 'baz' }, @@ -65,13 +67,14 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise const compiler: Compiler = webpack({ entry: { - main: '/a/entry.js', + mainSingleChunk: '/a/entrySingleChunk.js', + mainTwoChunks: '/a/entryTwoChunks.js', other: '/b/entry.js' }, output: { path: '/release', - filename: '[locale][name].js', - chunkFilename: 'chunks/[locale][name].js' + filename: '[name]-[locale]-[contenthash].js', + chunkFilename: 'chunks/[name]-[locale]-[contenthash].js' }, module: { rules: [ @@ -87,7 +90,8 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise }, optimization: { minimize, - moduleIds: 'named' + moduleIds: 'named', + realContentHash: false }, context: '/', mode: 'production', @@ -109,6 +113,9 @@ async function testLocalizedAsyncDynamicInner(minimize: boolean): Promise expect(results).toMatchSnapshot('Content'); expect(localizationStats).toMatchSnapshot('Localization Stats'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); } describe(LocalizationPlugin.name, () => { diff --git a/webpack/webpack5-localization-plugin/src/test/LocalizedNoAsync.test.ts b/webpack/webpack5-localization-plugin/src/test/LocalizedNoAsync.test.ts index 03f388d3142..decc51b3af8 100644 --- a/webpack/webpack5-localization-plugin/src/test/LocalizedNoAsync.test.ts +++ b/webpack/webpack5-localization-plugin/src/test/LocalizedNoAsync.test.ts @@ -31,11 +31,11 @@ async function testLocalizedNoAsyncInner(minimize: boolean): Promise { const options: ILocalizationPluginOptions = { localizedData: { defaultLocale: { - localeName: 'en-us', + localeName: 'LOCALE1', fillMissingTranslationStrings: true }, translatedStrings: { - foo: { + LOCALE2: { '/a/strings1.resjson': { test: `return:\r,newline:\n,tab:\t,backslash:\\,apos:',quote:"` } @@ -54,7 +54,8 @@ async function testLocalizedNoAsyncInner(minimize: boolean): Promise { }, localizationStats: { dropPath: 'localization-stats.json' - } + }, + realContentHash: true }; const localizationPlugin: LocalizationPlugin = new LocalizationPlugin(options); @@ -65,7 +66,7 @@ async function testLocalizedNoAsyncInner(minimize: boolean): Promise { }, output: { path: '/release', - filename: '[name]-[locale].js' + filename: '[name]-[locale]-[contenthash].js' }, module: { rules: [ @@ -99,6 +100,9 @@ async function testLocalizedNoAsyncInner(minimize: boolean): Promise { const results: {} = memoryFileSystem.toJSON('/release'); expect(results).toMatchSnapshot('Content'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); } describe(LocalizationPlugin.name, () => { diff --git a/webpack/webpack5-localization-plugin/src/test/LocalizedRuntime.test.ts b/webpack/webpack5-localization-plugin/src/test/LocalizedRuntime.test.ts index d7456f11445..a6c838fe034 100644 --- a/webpack/webpack5-localization-plugin/src/test/LocalizedRuntime.test.ts +++ b/webpack/webpack5-localization-plugin/src/test/LocalizedRuntime.test.ts @@ -2,99 +2,7 @@ // See LICENSE in the project root for license information. jest.disableAutomock(); -import { resolve } from 'path'; -import { promisify } from 'util'; -import webpack, { type Compiler, type Stats } from 'webpack'; -import { Volume } from 'memfs/lib/volume'; +import { runTests } from './LocalizedRuntimeTestBase'; -import { LocalizationPlugin } from '../LocalizationPlugin'; -import type { ILocalizationPluginOptions } from '../interfaces'; -import { MemFSPlugin } from './MemFSPlugin'; - -async function testLocalizedRuntimeInner(minimize: boolean): Promise { - const memoryFileSystem: Volume = new Volume(); - memoryFileSystem.fromJSON( - { - '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js"] }', - '/a/async.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test, strings2.another);`, - '/a/entry.js': `import(/* webpackChunkName: 'async' */ './async');`, - '/a/strings1.resjson': `{"test":"blah","_test.comment":"A string"}`, - '/a/strings2.resjson': `{"another":"something else","_another.comment":"Another string"}` - }, - '/' - ); - - const resJsonLoader: string = resolve(__dirname, '../loaders/resjson-loader.js'); - const options: ILocalizationPluginOptions = { - localizedData: { - defaultLocale: { - localeName: 'en-us' - }, - translatedStrings: { - foo: { - '/a/strings1.resjson': { - test: 'baz' - }, - '/a/strings2.resjson': { - another: 'some random translation' - } - } - } - } - }; - - const localizationPlugin: LocalizationPlugin = new LocalizationPlugin(options); - - const compiler: Compiler = webpack({ - entry: { - main: '/a/entry.js' - }, - output: { - path: '/release', - filename: '[name]-[locale].js', - chunkFilename: 'chunks/[name]-[locale].js' - }, - module: { - rules: [ - { - test: /\.resjson$/, - use: { - loader: resJsonLoader - }, - type: 'javascript/esm', - sideEffects: false - } - ] - }, - optimization: { - minimize, - moduleIds: 'named' - }, - context: '/', - mode: 'production', - plugins: [localizationPlugin, new MemFSPlugin(memoryFileSystem)] - }); - - const stats: Stats | undefined = await promisify(compiler.run.bind(compiler))(); - await promisify(compiler.close.bind(compiler))(); - if (!stats) { - throw new Error(`Expected stats`); - } - const { errors, warnings } = stats.toJson('errors-warnings'); - expect(errors).toMatchSnapshot('Errors'); - expect(warnings).toMatchSnapshot('Warnings'); - - const results: {} = memoryFileSystem.toJSON('/release'); - expect(results).toMatchSnapshot('Content'); -} - -describe(LocalizationPlugin.name, () => { - it('Handles async localized chunks (unminified)', async () => { - await testLocalizedRuntimeInner(false); - }); - - it('Handles async localized chunks (minified)', async () => { - await testLocalizedRuntimeInner(true); - }); -}); +runTests(); diff --git a/webpack/webpack5-localization-plugin/src/test/LocalizedRuntimeDifferentHashLengths.test.ts b/webpack/webpack5-localization-plugin/src/test/LocalizedRuntimeDifferentHashLengths.test.ts new file mode 100644 index 00000000000..f2cb276e654 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/LocalizedRuntimeDifferentHashLengths.test.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +jest.disableAutomock(); + +import { createHash } from 'crypto'; + +import { runTests } from './LocalizedRuntimeTestBase'; + +runTests({ + hashFunction: (contents) => createHash('sha256').update(contents).digest('hex') +}); diff --git a/webpack/webpack5-localization-plugin/src/test/LocalizedRuntimeTestBase.ts b/webpack/webpack5-localization-plugin/src/test/LocalizedRuntimeTestBase.ts new file mode 100644 index 00000000000..2d1841c4ae8 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/LocalizedRuntimeTestBase.ts @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { resolve } from 'path'; +import { promisify } from 'util'; + +import webpack, { type Compiler, type Stats } from 'webpack'; +import { Volume } from 'memfs/lib/volume'; + +import { MemFSPlugin } from './MemFSPlugin'; +import type { ILocalizationPluginOptions } from '../interfaces'; +import { LocalizationPlugin } from '../LocalizationPlugin'; +import { type ITrueHashPluginOptions, TrueHashPlugin } from '../TrueHashPlugin'; + +export function runTests(trueHashPluginOptions: ITrueHashPluginOptions = {}): void { + async function testLocalizedRuntimeInner(minimize: boolean): Promise { + const memoryFileSystem: Volume = new Volume(); + memoryFileSystem.fromJSON( + { + '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js"] }', + '/a/async1.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test, strings2.another);`, + '/a/async2.js': `import strings1 from './strings1.resjson'; import strings2 from './strings2.resjson'; console.log(strings1.test + strings2.another);`, + '/a/entrySingleChunk.js': `import(/* webpackChunkName: 'async1' */ './async1');`, + '/a/entryTwoChunks.js': `import(/* webpackChunkName: 'async1' */ './async1');import(/* webpackChunkName: 'async2' */ './async2');`, + '/a/strings1.resjson': `{"test":"blah","_test.comment":"A string"}`, + '/a/strings2.resjson': `{"another":"something else","_another.comment":"Another string"}` + }, + '/' + ); + + const trueHashPlugin: TrueHashPlugin = new TrueHashPlugin(trueHashPluginOptions); + + const resJsonLoader: string = resolve(__dirname, '../loaders/resjson-loader.js'); + const options: ILocalizationPluginOptions = { + localizedData: { + defaultLocale: { + localeName: 'LOCALE1' + }, + translatedStrings: { + LOCALE2: { + '/a/strings1.resjson': { + test: 'baz' + }, + '/a/strings2.resjson': { + another: 'some random translation' + } + } + } + } + }; + + const localizationPlugin: LocalizationPlugin = new LocalizationPlugin(options); + + const compiler: Compiler = webpack({ + entry: { + mainSingleChunk: '/a/entrySingleChunk.js', + mainTwoChunks: '/a/entryTwoChunks.js' + }, + output: { + path: '/release', + filename: '[name]-[locale]-[contenthash].js', + chunkFilename: 'chunks/[name]-[locale]-[contenthash].js' + }, + module: { + rules: [ + { + test: /\.resjson$/, + use: { + loader: resJsonLoader + }, + type: 'javascript/esm', + sideEffects: false + } + ] + }, + optimization: { + minimize, + moduleIds: 'named', + realContentHash: false + }, + context: '/', + mode: 'production', + plugins: [localizationPlugin, trueHashPlugin, new MemFSPlugin(memoryFileSystem)] + }); + + const stats: Stats | undefined = await promisify(compiler.run.bind(compiler))(); + await promisify(compiler.close.bind(compiler))(); + if (!stats) { + throw new Error(`Expected stats`); + } + const { errors, warnings } = stats.toJson('errors-warnings'); + expect(errors).toMatchSnapshot('Errors'); + expect(warnings).toMatchSnapshot('Warnings'); + + const results: {} = memoryFileSystem.toJSON('/release'); + expect(results).toMatchSnapshot('Content'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); + } + + describe(LocalizationPlugin.name, () => { + it('Handles async localized chunks (unminified)', async () => { + await testLocalizedRuntimeInner(false); + }); + + it('Handles async localized chunks (minified)', async () => { + await testLocalizedRuntimeInner(true); + }); + }); +} diff --git a/webpack/webpack5-localization-plugin/src/test/MixedAsync.test.ts b/webpack/webpack5-localization-plugin/src/test/MixedAsync.test.ts new file mode 100644 index 00000000000..734999a647e --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/MixedAsync.test.ts @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +jest.disableAutomock(); +import { resolve } from 'path'; +import { promisify } from 'util'; + +import webpack, { type Compiler, type Stats } from 'webpack'; +import { Volume } from 'memfs/lib/volume'; + +import { LocalizationPlugin } from '../LocalizationPlugin'; +import type { ILocalizationPluginOptions, ILocalizationStats } from '../interfaces'; +import { MemFSPlugin } from './MemFSPlugin'; + +async function testMixedAsyncInner(minimize: boolean): Promise { + const memoryFileSystem: Volume = new Volume(); + memoryFileSystem.fromJSON( + { + '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js", "asyncLoc.js"] }', + '/a/async1.js': `console.log("blah1");`, + '/a/async2.js': `console.log("blah2");`, + '/a/asyncLoc1.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test, strings2.another);`, + '/a/asyncLoc2.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test + strings2.another);`, + '/a/entry.js': `import(/* webpackChunkName: 'asyncLoc1' */ './asyncLoc1');import(/* webpackChunkName: 'asyncLoc2' */ './asyncLoc2');import(/* webpackChunkName: 'async1' */ './async1');import(/* webpackChunkName: 'async2' */ './async2');`, + '/a/strings1.loc.json': `{"test":{"value":"blah","comment":"A string"}}`, + '/a/strings2.loc.json': `{"another":{"value":"something else","comment":"Another string" }}` + }, + '/' + ); + + let localizationStats: ILocalizationStats | undefined; + function statsCallback(stats: ILocalizationStats): void { + localizationStats = stats; + } + + const loader: string = resolve(__dirname, '../loaders/locjson-loader.js'); + const options: ILocalizationPluginOptions = { + localizedData: { + defaultLocale: { + localeName: 'LOCALE1' + }, + translatedStrings: { + LOCALE2: { + '/a/strings1.loc.json': { + test: 'baz' + }, + '/a/strings2.loc.json': { + another: 'some random translation' + } + } + } + }, + localizationStats: { + callback: statsCallback + }, + realContentHash: true + }; + + const localizationPlugin: LocalizationPlugin = new LocalizationPlugin(options); + + const compiler: Compiler = webpack({ + entry: { + main: '/a/entry.js' + }, + output: { + path: '/release', + filename: '[name]-[locale]-[contenthash].js', + chunkFilename: 'chunks/[name]-[locale]-[contenthash].js', + hashSalt: '1' + }, + module: { + rules: [ + { + test: /\.loc.json$/, + use: { + loader + }, + type: 'javascript/esm', + sideEffects: false + } + ] + }, + optimization: { + minimize, + moduleIds: 'named' + }, + context: '/', + mode: 'production', + plugins: [localizationPlugin, new MemFSPlugin(memoryFileSystem)] + }); + + const stats: Stats | undefined = await promisify(compiler.run.bind(compiler))(); + await promisify(compiler.close.bind(compiler))(); + if (!stats) { + throw new Error(`Expected stats`); + } + const { errors, warnings } = stats.toJson('errors-warnings'); + expect(errors).toMatchSnapshot('Errors'); + expect(warnings).toMatchSnapshot('Warnings'); + + const results: {} = memoryFileSystem.toJSON('/release'); + expect(results).toMatchSnapshot('Content'); + + expect(localizationStats).toMatchSnapshot('Localization Stats'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); +} + +describe(LocalizationPlugin.name, () => { + it('Handles async localized and non-localized chunks (unminified)', async () => { + await testMixedAsyncInner(false); + }); + + it('Handles async localized and non-localized chunks (minified)', async () => { + await testMixedAsyncInner(true); + }); +}); diff --git a/webpack/webpack5-localization-plugin/src/test/MixedAsyncDynamic.test.ts b/webpack/webpack5-localization-plugin/src/test/MixedAsyncDynamic.test.ts index 354a963ee0b..d9aa504f3ee 100644 --- a/webpack/webpack5-localization-plugin/src/test/MixedAsyncDynamic.test.ts +++ b/webpack/webpack5-localization-plugin/src/test/MixedAsyncDynamic.test.ts @@ -9,7 +9,7 @@ import webpack, { type Compiler, type Stats } from 'webpack'; import { Volume } from 'memfs/lib/volume'; import { LocalizationPlugin } from '../LocalizationPlugin'; -import type { ILocalizationPluginOptions } from '../interfaces'; +import type { ILocalizationPluginOptions, ILocalizationStats } from '../interfaces'; import { MemFSPlugin } from './MemFSPlugin'; async function testMixedAsyncDynamicInner(minimize: boolean): Promise { @@ -17,23 +17,31 @@ async function testMixedAsyncDynamicInner(minimize: boolean): Promise { memoryFileSystem.fromJSON( { '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js", "asyncLoc.js"] }', - '/a/async.js': `console.log("blah");`, - '/a/asyncLoc.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test, strings2.another);`, - '/a/entry.js': `import(/* webpackChunkName: 'asyncLoc' */ './asyncLoc');import(/* webpackChunkName: 'async' */ './async');`, + '/a/async1.js': `console.log("blah1");`, + '/a/async2.js': `console.log("blah2");`, + '/a/asyncLoc1.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test, strings2.another);`, + '/a/asyncLoc2.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test + strings2.another);`, + '/a/entryTwoChunks.js': `import(/* webpackChunkName: 'asyncLoc1' */ './asyncLoc1');import(/* webpackChunkName: 'asyncLoc2' */ './asyncLoc2');`, + '/a/entryFourChunks.js': `import(/* webpackChunkName: 'asyncLoc1' */ './asyncLoc1');import(/* webpackChunkName: 'asyncLoc2' */ './asyncLoc2');import(/* webpackChunkName: 'async1' */ './async1');import(/* webpackChunkName: 'async2' */ './async2');`, '/a/strings1.loc.json': `{"test":{"value":"blah","comment":"A string"}}`, '/a/strings2.loc.json': `{"another":{"value":"something else","comment":"Another string" }}` }, '/' ); + let localizationStats: ILocalizationStats | undefined; + function statsCallback(stats: ILocalizationStats): void { + localizationStats = stats; + } + const loader: string = resolve(__dirname, '../loaders/locjson-loader.js'); const options: ILocalizationPluginOptions = { localizedData: { defaultLocale: { - localeName: 'en-us' + localeName: 'LOCALE1' }, translatedStrings: { - foo: { + LOCALE2: { '/a/strings1.loc.json': { test: 'baz' }, @@ -43,6 +51,9 @@ async function testMixedAsyncDynamicInner(minimize: boolean): Promise { } } }, + localizationStats: { + callback: statsCallback + }, runtimeLocaleExpression: 'self.__locale' }; @@ -50,12 +61,13 @@ async function testMixedAsyncDynamicInner(minimize: boolean): Promise { const compiler: Compiler = webpack({ entry: { - main: '/a/entry.js' + mainTwoChunks: '/a/entryTwoChunks.js', + mainFourChunks: '/a/entryFourChunks.js' }, output: { path: '/release', - filename: '[name]-[locale].js', - chunkFilename: 'chunks/[name]-[locale].js' + filename: '[name]-[locale]-[contenthash].js', + chunkFilename: 'chunks/[name]-[locale]-[contenthash].js' }, module: { rules: [ @@ -71,7 +83,8 @@ async function testMixedAsyncDynamicInner(minimize: boolean): Promise { }, optimization: { minimize, - moduleIds: 'named' + moduleIds: 'named', + realContentHash: false }, context: '/', mode: 'production', @@ -89,6 +102,11 @@ async function testMixedAsyncDynamicInner(minimize: boolean): Promise { const results: {} = memoryFileSystem.toJSON('/release'); expect(results).toMatchSnapshot('Content'); + + expect(localizationStats).toMatchSnapshot('Localization Stats'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); } describe(LocalizationPlugin.name, () => { diff --git a/webpack/webpack5-localization-plugin/src/test/MixedAsyncNonHashed.test.ts b/webpack/webpack5-localization-plugin/src/test/MixedAsyncNonHashed.test.ts new file mode 100644 index 00000000000..9f1992ec6d0 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/MixedAsyncNonHashed.test.ts @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +jest.disableAutomock(); +import { resolve } from 'path'; +import { promisify } from 'util'; + +import webpack, { type Compiler, type Stats } from 'webpack'; +import { Volume } from 'memfs/lib/volume'; + +import { LocalizationPlugin } from '../LocalizationPlugin'; +import type { ILocalizationPluginOptions, ILocalizationStats } from '../interfaces'; +import { MemFSPlugin } from './MemFSPlugin'; + +async function testMixedAsyncInner(minimize: boolean): Promise { + const memoryFileSystem: Volume = new Volume(); + memoryFileSystem.fromJSON( + { + '/a/package.json': '{ "name": "a", "sideEffects": ["entry.js", "async.js", "asyncLoc.js"] }', + '/a/async1.js': `console.log("blah1");`, + '/a/async2.js': `console.log("blah2");`, + '/a/asyncLoc1.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test, strings2.another);`, + '/a/asyncLoc2.js': `import strings1 from './strings1.loc.json'; import strings2 from './strings2.loc.json'; console.log(strings1.test + strings2.another);`, + '/a/entry.js': `import(/* webpackChunkName: 'asyncLoc1' */ './asyncLoc1');import(/* webpackChunkName: 'asyncLoc2' */ './asyncLoc2');import(/* webpackChunkName: 'async1' */ './async1');import(/* webpackChunkName: 'async2' */ './async2');`, + '/a/strings1.loc.json': `{"test":{"value":"blah","comment":"A string"}}`, + '/a/strings2.loc.json': `{"another":{"value":"something else","comment":"Another string" }}` + }, + '/' + ); + + let localizationStats: ILocalizationStats | undefined; + function statsCallback(stats: ILocalizationStats): void { + localizationStats = stats; + } + + const loader: string = resolve(__dirname, '../loaders/locjson-loader.js'); + const options: ILocalizationPluginOptions = { + localizedData: { + defaultLocale: { + localeName: 'LOCALE1' + }, + translatedStrings: { + LOCALE2: { + '/a/strings1.loc.json': { + test: 'baz' + }, + '/a/strings2.loc.json': { + another: 'some random translation' + } + } + } + }, + localizationStats: { + callback: statsCallback + }, + realContentHash: true + }; + + const localizationPlugin: LocalizationPlugin = new LocalizationPlugin(options); + + const compiler: Compiler = webpack({ + entry: { + main: '/a/entry.js' + }, + output: { + path: '/release', + filename: '[name]-[locale].js', + chunkFilename: 'chunks/[name]-[locale].js' + }, + module: { + rules: [ + { + test: /\.loc.json$/, + use: { + loader + }, + type: 'javascript/esm', + sideEffects: false + } + ] + }, + optimization: { + minimize, + moduleIds: 'named' + }, + context: '/', + mode: 'production', + plugins: [localizationPlugin, new MemFSPlugin(memoryFileSystem)] + }); + + const stats: Stats | undefined = await promisify(compiler.run.bind(compiler))(); + await promisify(compiler.close.bind(compiler))(); + if (!stats) { + throw new Error(`Expected stats`); + } + const { errors, warnings } = stats.toJson('errors-warnings'); + expect(errors).toMatchSnapshot('Errors'); + expect(warnings).toMatchSnapshot('Warnings'); + + const results: {} = memoryFileSystem.toJSON('/release'); + expect(results).toMatchSnapshot('Content'); + + expect(localizationStats).toMatchSnapshot('Localization Stats'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); +} + +describe(LocalizationPlugin.name, () => { + it('Handles async localized and non-localized chunks with a runtime locale expression and without an asset filename hash (unminified)', async () => { + await testMixedAsyncInner(false); + }); + + it('Handles async localized and non-localized chunks with a runtime locale expression and without an asset filename hash (minified)', async () => { + await testMixedAsyncInner(true); + }); +}); diff --git a/webpack/webpack5-localization-plugin/src/test/NoLocalizedFiles.test.ts b/webpack/webpack5-localization-plugin/src/test/NoLocalizedFiles.test.ts index 20388576737..b1dc7da9e2c 100644 --- a/webpack/webpack5-localization-plugin/src/test/NoLocalizedFiles.test.ts +++ b/webpack/webpack5-localization-plugin/src/test/NoLocalizedFiles.test.ts @@ -8,14 +8,17 @@ import webpack, { type Stats } from 'webpack'; import { Volume } from 'memfs/lib/volume'; import { LocalizationPlugin } from '../LocalizationPlugin'; +import { MemFSPlugin } from './MemFSPlugin'; async function testNonLocalizedInner(minimize: boolean): Promise { const memoryFileSystem: Volume = new Volume(); memoryFileSystem.fromJSON( { '/package.json': '{}', - '/entry.js': `console.log("Do stuff");import(/* webpackChunkName: 'async' */ './async.js').then(mod => mod.foo());`, - '/async.js': `export function foo() { console.log('foo'); }` + '/entrySingleChunk.js': `console.log("Do stuff");import(/* webpackChunkName: 'async1' */ './async1.js').then(mod => mod.foo());`, + '/entryTwoChunks.js': `console.log("Do stuff");import(/* webpackChunkName: 'async1' */ './async1.js').then(mod => mod.foo());import(/* webpackChunkName: 'async2' */ './async2.js').then(mod => mod.foo());`, + '/async1.js': `export function foo() { console.log('foo1'); }`, + '/async2.js': `export function foo() { console.log('foo2'); }` }, '/src' ); @@ -23,19 +26,21 @@ async function testNonLocalizedInner(minimize: boolean): Promise { const localizationPlugin: LocalizationPlugin = new LocalizationPlugin({ localizedData: { defaultLocale: { - localeName: 'en-us' + localeName: 'LOCALE1' }, translatedStrings: {} - } + }, + realContentHash: true }); const compiler: webpack.Compiler = webpack({ entry: { - main: '/entry.js' + mainSingleChunk: '/entrySingleChunk.js', + mainTwoChunks: '/entryTwoChunks.js' }, output: { path: '/release', - filename: '[name]-[locale].js' + filename: '[name]-[locale]-[contenthash].js' }, context: '/', optimization: { @@ -43,12 +48,9 @@ async function testNonLocalizedInner(minimize: boolean): Promise { moduleIds: 'named' }, mode: 'production', - plugins: [localizationPlugin] + plugins: [localizationPlugin, new MemFSPlugin(memoryFileSystem)] }); - compiler.inputFileSystem = memoryFileSystem; - compiler.outputFileSystem = memoryFileSystem; - const stats: Stats | undefined = await promisify(compiler.run.bind(compiler))(); await promisify(compiler.close.bind(compiler))(); if (!stats) { @@ -60,6 +62,9 @@ async function testNonLocalizedInner(minimize: boolean): Promise { const results: {} = memoryFileSystem.toJSON('/release'); expect(results).toMatchSnapshot('Content'); + + expect(errors).toHaveLength(0); + expect(warnings).toHaveLength(0); } describe(LocalizationPlugin.name, () => { diff --git a/webpack/webpack5-localization-plugin/src/test/NonHashedNonLocalizedAssets.test.ts b/webpack/webpack5-localization-plugin/src/test/NonHashedNonLocalizedAssets.test.ts new file mode 100644 index 00000000000..b94d85fdc8b --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/NonHashedNonLocalizedAssets.test.ts @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +jest.disableAutomock(); +import { promisify } from 'util'; + +import webpack, { type Stats } from 'webpack'; +import { Volume } from 'memfs/lib/volume'; + +import { TrueHashPlugin } from '../TrueHashPlugin'; +import { MemFSPlugin } from './MemFSPlugin'; + +async function testNonLocalizedInner(minimize: boolean): Promise { + async function getResultsAsync(useTrueHashPlugin: boolean): Promise<{ + errors: webpack.StatsError[] | undefined; + warnings: webpack.StatsError[] | undefined; + results: {}; + }> { + const memoryFileSystem: Volume = new Volume(); + memoryFileSystem.fromJSON( + { + '/package.json': '{}', + '/entrySingleChunk.js': `console.log("Do stuff");import(/* webpackChunkName: 'async1' */ './async1.js').then(mod => mod.foo());`, + '/entryTwoChunks.js': `console.log("Do stuff");import(/* webpackChunkName: 'async1' */ './async1.js').then(mod => mod.foo());import(/* webpackChunkName: 'async2' */ './async2.js').then(mod => mod.foo());`, + '/async1.js': `export function foo() { console.log('foo1'); }`, + '/async2.js': `export function foo() { console.log('foo2'); }` + }, + '/src' + ); + + const webpackConfig: webpack.Configuration = { + entry: { + mainSingleChunk: '/entrySingleChunk.js', + mainTwoChunks: '/entryTwoChunks.js' + }, + output: { + path: '/release', + filename: '[name].js' + }, + context: '/', + optimization: { + minimize, + moduleIds: 'named', + realContentHash: !useTrueHashPlugin + }, + mode: 'production', + plugins: [new MemFSPlugin(memoryFileSystem)] + }; + + if (useTrueHashPlugin) { + webpackConfig.plugins!.push(new TrueHashPlugin()); + } + + const trueHashPluginCompiler: webpack.Compiler = webpack(webpackConfig); + const trueHashPluginStats: Stats | undefined = await promisify( + trueHashPluginCompiler.run.bind(trueHashPluginCompiler) + )(); + await promisify(trueHashPluginCompiler.close.bind(trueHashPluginCompiler))(); + if (!trueHashPluginStats) { + throw new Error(`Expected stats`); + } + const { errors, warnings } = trueHashPluginStats.toJson('errors-warnings'); + + const results: {} = memoryFileSystem.toJSON('/release'); + return { errors, warnings, results }; + } + + const [ + { errors: realContentHashErrors, warnings: realContentHashWarnings, results: realContentHashResults }, + { errors: trueHashPluginErrors, warnings: trueHashPluginWarnings, results: trueHashPluginResults } + ] = await Promise.all([getResultsAsync(false), getResultsAsync(true)]); + + expect(trueHashPluginErrors).toMatchSnapshot('Errors'); + expect(trueHashPluginWarnings).toMatchSnapshot('Warnings'); + + expect(trueHashPluginResults).toMatchSnapshot('Content'); + + expect(trueHashPluginErrors).toEqual(realContentHashErrors); + expect(trueHashPluginWarnings).toEqual(realContentHashWarnings); + expect(realContentHashResults).toEqual(realContentHashResults); + + expect(trueHashPluginErrors).toHaveLength(0); + expect(trueHashPluginWarnings).toHaveLength(0); +} + +describe(TrueHashPlugin.name, () => { + it('Handles non-localized non-hashed compilations (unminified)', async () => { + await testNonLocalizedInner(false); + }); + + it('Handles non-localized non-hashed compilations (minified)', async () => { + await testNonLocalizedInner(true); + }); +}); diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamic.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamic.test.ts.snap index f10566354ba..e8244b312cc 100644 --- a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamic.test.ts.snap +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamic.test.ts.snap @@ -2,9 +2,12 @@ exports[`LocalizationPlugin Handles async localized chunks with a runtime locale expression (minified): Content 1`] = ` Object { - "/release/chunks/async-en-us.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":(_,s,e)=>{e.r(s);const a=JSON.parse('{\\"B\\":\\"blah\\"}'),h=JSON.parse('{\\"P\\":\\"something else\\"}');console.log(a.B,h.P)}}]);", - "/release/chunks/async-foo.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":(_,s,e)=>{e.r(s);const a=JSON.parse('{\\"B\\":\\"baz\\"}'),h=JSON.parse('{\\"P\\":\\"some random translation\\"}');console.log(a.B,h.P)}}]);", - "/release/main-none.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async-\\"+self.__locale+\\".js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(d);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={179:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B,n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"blah\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"something else\\"}')}}]);", + "/release/chunks/async1-LOCALE2-29f4b5c23308c59f00e0.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":(s,_,e)=>{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B,n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"baz\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"some random translation\\"}')}}]);", + "/release/chunks/async2-LOCALE1-0a81b98f18e89ac22e39.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,e)=>{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B+n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"blah\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"something else\\"}')}}]);", + "/release/chunks/async2-LOCALE2-0a81b98f18e89ac22e39.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,e)=>{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B+n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"baz\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"some random translation\\"}')}}]);", + "/release/mainSingleChunk-none-7f5cec07d3033072f5c4.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async1-\\"+self.__locale+\\"-29f4b5c23308c59f00e0.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(d);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>\\"chunks/\\"+{515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+self.__locale+\\"-\\"+{515:\\"29f4b5c23308c59f00e0\\",989:\\"0a81b98f18e89ac22e39\\"}[e]+\\".js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},n.l=(r,t,o,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==o)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={903:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,l]=t,s=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);l&&l(n)}for(r&&r(t);s { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { -/***/ \\"./a/async.js\\": +module.exports = JSON.parse('{\\"B\\":\\"blah\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"P\\":\\"something else\\"}'); + +/***/ }) + +}]);", + "/release/chunks/async1-LOCALE2-268cfe557834794b247b.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[515],{ + +/***/ \\"./a/async1.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), -;// CONCATENATED MODULE: ./a/strings1.resjson -const strings1_resjson_namespaceObject = JSON.parse('{\\"B\\":\\"blah\\"}'); -;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"something else\\"}'); -;// CONCATENATED MODULE: ./a/async.js - console.log(strings1_resjson_namespaceObject.B, strings2_resjson_namespaceObject.P); +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"baz\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"P\\":\\"some random translation\\"}'); /***/ }) }]);", - "/release/chunks/async-foo.js": "\\"use strict\\"; -(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[931],{ + "/release/chunks/async2-LOCALE1-c8dd89f429d58ff2c174.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ -/***/ \\"./a/async.js\\": +/***/ \\"./a/async2.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"blah\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { -;// CONCATENATED MODULE: ./a/strings1.resjson -const strings1_resjson_namespaceObject = JSON.parse('{\\"B\\":\\"baz\\"}'); -;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random translation\\"}'); -;// CONCATENATED MODULE: ./a/async.js - console.log(strings1_resjson_namespaceObject.B, strings2_resjson_namespaceObject.P); +module.exports = JSON.parse('{\\"P\\":\\"something else\\"}'); /***/ }) }]);", - "/release/main-none.js": "/******/ (() => { // webpackBootstrap + "/release/chunks/async2-LOCALE2-c8dd89f429d58ff2c174.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"baz\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"P\\":\\"some random translation\\"}'); + +/***/ }) + +}]);", + "/release/mainSingleChunk-none-a643b96683c5fe603a4a.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + \\"async1\\" + \\"-\\" + self.__locale + \\"-\\" + \\"268cfe557834794b247b\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\")); +/******/ })() +;", + "/release/mainTwoChunks-none-a66c8e0f054e8766319c.js": "/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache @@ -115,7 +442,7 @@ const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random tra /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template -/******/ return \\"chunks/\\" + \\"async\\" + \\"-\\" + self.__locale + \\".js\\"; +/******/ return \\"chunks/\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + self.__locale + \\"-\\" + {\\"515\\":\\"268cfe557834794b247b\\",\\"989\\":\\"c8dd89f429d58ff2c174\\"}[chunkId] + \\".js\\"; /******/ }; /******/ })(); /******/ @@ -223,7 +550,7 @@ const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random tra /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { -/******/ 179: 0 +/******/ 903: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { @@ -307,7 +634,7 @@ const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random tra /******/ /************************************************************************/ var __webpack_exports__ = {}; -__webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind(__webpack_require__, \\"./a/async.js\\")); +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\"));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./a/async2.js\\")); /******/ })() ;", } @@ -319,10 +646,16 @@ exports[`LocalizationPlugin Handles async localized chunks with a runtime locale Object { "entrypoints": Object {}, "namedChunkGroups": Object { - "async": Object { + "async1": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/async1-LOCALE1-268cfe557834794b247b.js", + "LOCALE2": "chunks/async1-LOCALE2-268cfe557834794b247b.js", + }, + }, + "async2": Object { "localizedAssets": Object { - "en-us": "chunks/async-en-us.js", - "foo": "chunks/async-foo.js", + "LOCALE1": "chunks/async2-LOCALE1-c8dd89f429d58ff2c174.js", + "LOCALE2": "chunks/async2-LOCALE2-c8dd89f429d58ff2c174.js", }, }, }, diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts.snap index 1004d57776d..61ba9c933fb 100644 --- a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts.snap +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedAsyncDynamicFormatWithNoLocaleFallback.test.ts.snap @@ -2,16 +2,25 @@ exports[`LocalizationPlugin Handles async localized chunks with a runtime locale expression (minified): Assets 1`] = ` Object { - "chunks/en-us/async.js": SizeOnlySource { - "_size": 199, + "chunks/async1-LOCALE1/-29f4b5c23308c59f00e0.js": SizeOnlySource { + "_size": 326, }, - "chunks/foo/async.js": SizeOnlySource { - "_size": 207, + "chunks/async1-LOCALE2/-29f4b5c23308c59f00e0.js": SizeOnlySource { + "_size": 334, }, - "main.js": SizeOnlySource { - "_size": 2434, + "chunks/async2-LOCALE1/-0a81b98f18e89ac22e39.js": SizeOnlySource { + "_size": 326, }, - "other.js": SizeOnlySource { + "chunks/async2-LOCALE2/-0a81b98f18e89ac22e39.js": SizeOnlySource { + "_size": 334, + }, + "mainSingleChunk--df7e43feef4d4754999e.js": SizeOnlySource { + "_size": 2458, + }, + "mainTwoChunks--30003a41739da59295ab.js": SizeOnlySource { + "_size": 2569, + }, + "other--b50b2019193c9195115f.js": SizeOnlySource { "_size": 27, }, } @@ -19,10 +28,13 @@ Object { exports[`LocalizationPlugin Handles async localized chunks with a runtime locale expression (minified): Content 1`] = ` Object { - "/release/chunks/en-us/async.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":(_,s,e)=>{e.r(s);const a=JSON.parse('{\\"B\\":\\"blah\\"}'),h=JSON.parse('{\\"P\\":\\"something else\\"}');console.log(a.B,h.P)}}]);", - "/release/chunks/foo/async.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":(_,s,e)=>{e.r(s);const a=JSON.parse('{\\"B\\":\\"baz\\"}'),h=JSON.parse('{\\"P\\":\\"some random translation\\"}');console.log(a.B,h.P)}}]);", - "/release/main.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/\\"+self.__locale+\\"/async.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(d);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={179:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B,n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"blah\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"something else\\"}')}}]);", + "/release/chunks/async1-LOCALE2/-29f4b5c23308c59f00e0.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":(s,_,e)=>{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B,n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"baz\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"some random translation\\"}')}}]);", + "/release/chunks/async2-LOCALE1/-0a81b98f18e89ac22e39.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,e)=>{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B+n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"blah\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"something else\\"}')}}]);", + "/release/chunks/async2-LOCALE2/-0a81b98f18e89ac22e39.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,e)=>{e.r(_);var r=e(\\"./a/strings1.resjson\\"),n=e(\\"./a/strings2.resjson\\");console.log(r.B+n.P)},\\"./a/strings1.resjson\\":s=>{s.exports=JSON.parse('{\\"B\\":\\"baz\\"}')},\\"./a/strings2.resjson\\":s=>{s.exports=JSON.parse('{\\"P\\":\\"some random translation\\"}')}}]);", + "/release/mainSingleChunk--df7e43feef4d4754999e.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async1-\\"+self.__locale+\\"/-29f4b5c23308c59f00e0.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(d);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>\\"chunks/\\"+{515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+self.__locale+\\"/-\\"+{515:\\"29f4b5c23308c59f00e0\\",989:\\"0a81b98f18e89ac22e39\\"}[e]+\\".js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},n.l=(r,t,o,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==o)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={903:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,l]=t,s=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);l&&l(n)}for(r&&r(t);s { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), -;// CONCATENATED MODULE: ./a/strings1.resjson -const strings1_resjson_namespaceObject = JSON.parse('{\\"B\\":\\"blah\\"}'); -;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"something else\\"}'); -;// CONCATENATED MODULE: ./a/async.js - console.log(strings1_resjson_namespaceObject.B, strings2_resjson_namespaceObject.P); +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"blah\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"P\\":\\"something else\\"}'); /***/ }) }]);", - "/release/chunks/foo/async.js": "\\"use strict\\"; -(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[931],{ + "/release/chunks/async1-LOCALE2/-268cfe557834794b247b.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[515],{ -/***/ \\"./a/async.js\\": +/***/ \\"./a/async1.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"baz\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { -;// CONCATENATED MODULE: ./a/strings1.resjson -const strings1_resjson_namespaceObject = JSON.parse('{\\"B\\":\\"baz\\"}'); -;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random translation\\"}'); -;// CONCATENATED MODULE: ./a/async.js - console.log(strings1_resjson_namespaceObject.B, strings2_resjson_namespaceObject.P); +module.exports = JSON.parse('{\\"P\\":\\"some random translation\\"}'); /***/ }) }]);", - "/release/main.js": "/******/ (() => { // webpackBootstrap + "/release/chunks/async2-LOCALE1/-c8dd89f429d58ff2c174.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"blah\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"P\\":\\"something else\\"}'); + +/***/ }) + +}]);", + "/release/chunks/async2-LOCALE2/-c8dd89f429d58ff2c174.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* .test */ .B + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* .another */ .P); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"B\\":\\"baz\\"}'); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((module) => { + +module.exports = JSON.parse('{\\"P\\":\\"some random translation\\"}'); + +/***/ }) + +}]);", + "/release/mainSingleChunk--ceb947c06eacae29b495.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + \\"async1\\" + \\"-\\" + self.__locale + \\"/\\" + \\"-\\" + \\"268cfe557834794b247b\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\")); +/******/ })() +;", + "/release/mainTwoChunks--196c2ee23a8f06e045d5.js": "/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache @@ -150,7 +495,7 @@ const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random tra /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template -/******/ return \\"chunks/\\" + self.__locale + \\"/\\" + \\"\\" + \\"async\\" + \\".js\\"; +/******/ return \\"chunks/\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + self.__locale + \\"/\\" + \\"-\\" + {\\"515\\":\\"268cfe557834794b247b\\",\\"989\\":\\"c8dd89f429d58ff2c174\\"}[chunkId] + \\".js\\"; /******/ }; /******/ })(); /******/ @@ -258,7 +603,7 @@ const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random tra /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { -/******/ 179: 0 +/******/ 903: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { @@ -342,10 +687,10 @@ const strings2_resjson_namespaceObject = JSON.parse('{\\"P\\":\\"some random tra /******/ /************************************************************************/ var __webpack_exports__ = {}; -__webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind(__webpack_require__, \\"./a/async.js\\")); +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\"));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./a/async2.js\\")); /******/ })() ;", - "/release/other.js": "/******/ (() => { // webpackBootstrap + "/release/other--0a22a28bc727b811fbb2.js": "/******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; console.log('hello world'); /******/ })() @@ -359,10 +704,16 @@ exports[`LocalizationPlugin Handles async localized chunks with a runtime locale Object { "entrypoints": Object {}, "namedChunkGroups": Object { - "async": Object { + "async1": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/async1-LOCALE1/-268cfe557834794b247b.js", + "LOCALE2": "chunks/async1-LOCALE2/-268cfe557834794b247b.js", + }, + }, + "async2": Object { "localizedAssets": Object { - "en-us": "chunks/en-us/async.js", - "foo": "chunks/foo/async.js", + "LOCALE1": "chunks/async2-LOCALE1/-c8dd89f429d58ff2c174.js", + "LOCALE2": "chunks/async2-LOCALE2/-c8dd89f429d58ff2c174.js", }, }, }, diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedNoAsync.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedNoAsync.test.ts.snap index 3fae95cc347..35b4af334ae 100644 --- a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedNoAsync.test.ts.snap +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedNoAsync.test.ts.snap @@ -2,11 +2,11 @@ exports[`LocalizationPlugin Handles localized compilation with no async chunks (minified): Content 1`] = ` Object { - "/release/localization-stats.json": "{\\"entrypoints\\":{\\"main\\":{\\"localizedAssets\\":{\\"default\\":\\"main-default.js\\",\\"foo\\":\\"main-foo.js\\",\\"en-us\\":\\"main-en-us.js\\",\\"qps-ploc\\":\\"main-qps-ploc.js\\"}}},\\"namedChunkGroups\\":{}}", - "/release/main-default.js": "(()=>{\\"use strict\\";console.log(\\"test\\",\\"another\\")})();", - "/release/main-en-us.js": "(()=>{\\"use strict\\";console.log(\\"blah\\\\r\\\\n\\\\t\\\\\\\\\\\\u0027\\\\u0022\\",\\"something else\\")})();", - "/release/main-foo.js": "(()=>{\\"use strict\\";console.log(\\"return:\\\\r,newline:\\\\n,tab:\\\\t,backslash:\\\\\\\\,apos:\\\\u0027,quote:\\\\u0022\\",\\"something else\\")})();", - "/release/main-qps-ploc.js": "(()=>{\\"use strict\\";console.log(\\"!--ƀĺàĥ\\\\r\\\\n\\\\t\\\\\\\\\\\\u0027\\\\u0022-|-\\",\\"!--śōmēţĥĩńĝ ēĺśē-|-\\")})();", + "/release/localization-stats.json": "{\\"entrypoints\\":{\\"main\\":{\\"localizedAssets\\":{\\"default\\":\\"main-default-83f4ee1ad53822d08923.js\\",\\"LOCALE2\\":\\"main-LOCALE2-53db16ce65a171b2d58d.js\\",\\"LOCALE1\\":\\"main-LOCALE1-d0826e06031981558e87.js\\",\\"qps-ploc\\":\\"main-qps-ploc-d917b232cbcc8f9aec8d.js\\"}}},\\"namedChunkGroups\\":{}}", + "/release/main-LOCALE1-d0826e06031981558e87.js": "(()=>{\\"use strict\\";console.log(\\"blah\\\\r\\\\n\\\\t\\\\\\\\\\\\u0027\\\\u0022\\",\\"something else\\")})();", + "/release/main-LOCALE2-53db16ce65a171b2d58d.js": "(()=>{\\"use strict\\";console.log(\\"return:\\\\r,newline:\\\\n,tab:\\\\t,backslash:\\\\\\\\,apos:\\\\u0027,quote:\\\\u0022\\",\\"something else\\")})();", + "/release/main-default-83f4ee1ad53822d08923.js": "(()=>{\\"use strict\\";console.log(\\"test\\",\\"another\\")})();", + "/release/main-qps-ploc-d917b232cbcc8f9aec8d.js": "(()=>{\\"use strict\\";console.log(\\"!--ƀĺàĥ\\\\r\\\\n\\\\t\\\\\\\\\\\\u0027\\\\u0022-|-\\",\\"!--śōmēţĥĩńĝ ēĺśē-|-\\")})();", } `; @@ -16,27 +16,27 @@ exports[`LocalizationPlugin Handles localized compilation with no async chunks ( exports[`LocalizationPlugin Handles localized compilation with no async chunks (unminified): Content 1`] = ` Object { - "/release/localization-stats.json": "{\\"entrypoints\\":{\\"main\\":{\\"localizedAssets\\":{\\"default\\":\\"main-default.js\\",\\"foo\\":\\"main-foo.js\\",\\"en-us\\":\\"main-en-us.js\\",\\"qps-ploc\\":\\"main-qps-ploc.js\\"}}},\\"namedChunkGroups\\":{}}", - "/release/main-default.js": "/******/ (() => { // webpackBootstrap + "/release/localization-stats.json": "{\\"entrypoints\\":{\\"main\\":{\\"localizedAssets\\":{\\"default\\":\\"main-default-fc50d2a48e11f2b086ea.js\\",\\"LOCALE2\\":\\"main-LOCALE2-a314aaef0a110988940c.js\\",\\"LOCALE1\\":\\"main-LOCALE1-5ebe1f1f7b993dda2dc3.js\\",\\"qps-ploc\\":\\"main-qps-ploc-7e43fa8e6919d74fccb9.js\\"}}},\\"namedChunkGroups\\":{}}", + "/release/main-LOCALE1-5ebe1f1f7b993dda2dc3.js": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./a/strings1.resjson -const strings = {\\"test\\":\\"test\\"}; +const strings = {\\"test\\":\\"blah\\\\r\\\\n\\\\t\\\\\\\\\\\\u0027\\\\u0022\\"}; /* harmony default export */ const strings1_resjson = (strings); ;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_strings = {\\"another\\":\\"another\\"}; +const strings2_resjson_strings = {\\"another\\":\\"something else\\"}; /* harmony default export */ const strings2_resjson = (strings2_resjson_strings); ;// CONCATENATED MODULE: ./a/entry.js console.log(strings1_resjson.test, strings2_resjson.another); /******/ })() ;", - "/release/main-en-us.js": "/******/ (() => { // webpackBootstrap + "/release/main-LOCALE2-a314aaef0a110988940c.js": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./a/strings1.resjson -const strings = {\\"test\\":\\"blah\\\\r\\\\n\\\\t\\\\\\\\\\\\u0027\\\\u0022\\"}; +const strings = {\\"test\\":\\"return:\\\\r,newline:\\\\n,tab:\\\\t,backslash:\\\\\\\\,apos:\\\\u0027,quote:\\\\u0022\\"}; /* harmony default export */ const strings1_resjson = (strings); ;// CONCATENATED MODULE: ./a/strings2.resjson const strings2_resjson_strings = {\\"another\\":\\"something else\\"}; @@ -45,21 +45,21 @@ const strings2_resjson_strings = {\\"another\\":\\"something else\\"}; console.log(strings1_resjson.test, strings2_resjson.another); /******/ })() ;", - "/release/main-foo.js": "/******/ (() => { // webpackBootstrap + "/release/main-default-fc50d2a48e11f2b086ea.js": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./a/strings1.resjson -const strings = {\\"test\\":\\"return:\\\\r,newline:\\\\n,tab:\\\\t,backslash:\\\\\\\\,apos:\\\\u0027,quote:\\\\u0022\\"}; +const strings = {\\"test\\":\\"test\\"}; /* harmony default export */ const strings1_resjson = (strings); ;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_strings = {\\"another\\":\\"something else\\"}; +const strings2_resjson_strings = {\\"another\\":\\"another\\"}; /* harmony default export */ const strings2_resjson = (strings2_resjson_strings); ;// CONCATENATED MODULE: ./a/entry.js console.log(strings1_resjson.test, strings2_resjson.another); /******/ })() ;", - "/release/main-qps-ploc.js": "/******/ (() => { // webpackBootstrap + "/release/main-qps-ploc-7e43fa8e6919d74fccb9.js": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntime.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntime.test.ts.snap index 5a90e29e530..d34aedfd5f0 100644 --- a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntime.test.ts.snap +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntime.test.ts.snap @@ -2,10 +2,14 @@ exports[`LocalizationPlugin Handles async localized chunks (minified): Content 1`] = ` Object { - "/release/chunks/async-en-us.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":(_,s,e)=>{e.r(s);console.log(\\"blah\\",\\"something else\\")}}]);", - "/release/chunks/async-foo.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":(_,s,e)=>{e.r(s);console.log(\\"baz\\",\\"some random translation\\")}}]);", - "/release/main-en-us.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async-\\"+\\"en-us\\"+\\".js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),u=0;u{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={179:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,s]=t,u=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);s&&s(o)}for(r&&r(t);u{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async-\\"+\\"foo\\"+\\".js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),u=0;u{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={179:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,s]=t,u=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);s&&s(o)}for(r&&r(t);u{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test,t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"blah\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"something else\\"}}}]);", + "/release/chunks/async1-LOCALE2-8b94b0a6bc0d7c5b4c44.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test,t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"baz\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"some random translation\\"}}}]);", + "/release/chunks/async2-LOCALE1-fd27edad5b9ce4d9eec1.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test+t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"blah\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"something else\\"}}}]);", + "/release/chunks/async2-LOCALE2-cd16fef4b4d31d50c7ff.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test+t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"baz\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"some random translation\\"}}}]);", + "/release/mainSingleChunk-LOCALE1-c99f691a28e0096500b0.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async1-\\"+\\"LOCALE1\\"+\\"-e795ad0fdd98b21e2d14.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async1-\\"+\\"LOCALE2\\"+\\"-8b94b0a6bc0d7c5b4c44.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>\\"chunks/\\"+{515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+\\"LOCALE1\\"+\\"-\\"+{515:\\"e795ad0fdd98b21e2d14\\",989:\\"fd27edad5b9ce4d9eec1\\"}[e]+\\".js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},n.l=(r,t,o,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==o)for(var s=document.getElementsByTagName(\\"script\\"),l=0;l{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={903:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,s]=t,l=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);s&&s(n)}for(r&&r(t);l{var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>\\"chunks/\\"+{515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+\\"LOCALE2\\"+\\"-\\"+{515:\\"8b94b0a6bc0d7c5b4c44\\",989:\\"cd16fef4b4d31d50c7ff\\"}[e]+\\".js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},n.l=(r,t,o,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==o)for(var s=document.getElementsByTagName(\\"script\\"),l=0;l{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={903:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,s]=t,l=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);s&&s(n)}for(r&&r(t);l { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); -;// CONCATENATED MODULE: ./a/strings1.resjson +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/async1-LOCALE2-09e4b8b6df2295cc04fb.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[515],{ + +/***/ \\"./a/async1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/async2-LOCALE1-923fbcff1c3f86213cea.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); const strings = {\\"test\\":\\"blah\\"}; -/* harmony default export */ const strings1_resjson = (strings); -;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_strings = {\\"another\\":\\"something else\\"}; -/* harmony default export */ const strings2_resjson = (strings2_resjson_strings); -;// CONCATENATED MODULE: ./a/async.js - console.log(strings1_resjson.test, strings2_resjson.another); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); /***/ }) }]);", - "/release/chunks/async-foo.js": "\\"use strict\\"; -(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[931],{ + "/release/chunks/async2-LOCALE2-839abaf0fa6cdd8179ba.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ -/***/ \\"./a/async.js\\": +/***/ \\"./a/async2.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), -;// CONCATENATED MODULE: ./a/strings1.resjson +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); const strings = {\\"test\\":\\"baz\\"}; -/* harmony default export */ const strings1_resjson = (strings); -;// CONCATENATED MODULE: ./a/strings2.resjson -const strings2_resjson_strings = {\\"another\\":\\"some random translation\\"}; -/* harmony default export */ const strings2_resjson = (strings2_resjson_strings); -;// CONCATENATED MODULE: ./a/async.js - console.log(strings1_resjson.test, strings2_resjson.another); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); /***/ }) }]);", - "/release/main-en-us.js": "/******/ (() => { // webpackBootstrap + "/release/mainSingleChunk-LOCALE1-4381513f6b3bf5b0694e.js": "/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache @@ -88,6 +194,18 @@ const strings2_resjson_strings = {\\"another\\":\\"some random translation\\"}; /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/ensure chunk */ /******/ (() => { /******/ __webpack_require__.f = {}; @@ -106,7 +224,7 @@ const strings2_resjson_strings = {\\"another\\":\\"some random translation\\"}; /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template -/******/ return \\"chunks/\\" + \\"async\\" + \\"-\\" + \\"en-us\\" + \\".js\\"; +/******/ return \\"chunks/\\" + \\"async1\\" + \\"-\\" + \\"LOCALE1\\" + \\"-\\" + \\"a0dc7ce0f9ce060c986e\\" + \\".js\\"; /******/ }; /******/ })(); /******/ @@ -214,7 +332,7 @@ const strings2_resjson_strings = {\\"another\\":\\"some random translation\\"}; /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { -/******/ 179: 0 +/******/ 315: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { @@ -298,10 +416,10 @@ const strings2_resjson_strings = {\\"another\\":\\"some random translation\\"}; /******/ /************************************************************************/ var __webpack_exports__ = {}; -__webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind(__webpack_require__, \\"./a/async.js\\")); +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\")); /******/ })() ;", - "/release/main-foo.js": "/******/ (() => { // webpackBootstrap + "/release/mainSingleChunk-LOCALE2-0d704129faccb075adae.js": "/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache @@ -332,6 +450,530 @@ __webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind( /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + \\"async1\\" + \\"-\\" + \\"LOCALE2\\" + \\"-\\" + \\"09e4b8b6df2295cc04fb\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\")); +/******/ })() +;", + "/release/mainTwoChunks-LOCALE1-bf1aac04abcf9d7d1208.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + \\"LOCALE1\\" + \\"-\\" + {\\"515\\":\\"a0dc7ce0f9ce060c986e\\",\\"989\\":\\"923fbcff1c3f86213cea\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 903: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\"));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./a/async2.js\\")); +/******/ })() +;", + "/release/mainTwoChunks-LOCALE2-8c66f5e4e8a79ed4f133.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/ensure chunk */ /******/ (() => { /******/ __webpack_require__.f = {}; @@ -350,7 +992,7 @@ __webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind( /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template -/******/ return \\"chunks/\\" + \\"async\\" + \\"-\\" + \\"foo\\" + \\".js\\"; +/******/ return \\"chunks/\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + \\"LOCALE2\\" + \\"-\\" + {\\"515\\":\\"09e4b8b6df2295cc04fb\\",\\"989\\":\\"839abaf0fa6cdd8179ba\\"}[chunkId] + \\".js\\"; /******/ }; /******/ })(); /******/ @@ -458,7 +1100,7 @@ __webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind( /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { -/******/ 179: 0 +/******/ 903: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { @@ -542,7 +1184,7 @@ __webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind( /******/ /************************************************************************/ var __webpack_exports__ = {}; -__webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind(__webpack_require__, \\"./a/async.js\\")); +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\"));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./a/async2.js\\")); /******/ })() ;", } diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntimeDifferentHashLengths.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntimeDifferentHashLengths.test.ts.snap new file mode 100644 index 00000000000..d90888ee4d5 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/LocalizedRuntimeDifferentHashLengths.test.ts.snap @@ -0,0 +1,1195 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`LocalizationPlugin Handles async localized chunks (minified): Content 1`] = ` +Object { + "/release/chunks/async1-LOCALE1-48e154cefa3c631967269f65a0c807e9808494fe15cc376120c80fbd79ecca73.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test,t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"blah\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"something else\\"}}}]);", + "/release/chunks/async1-LOCALE2-bf3e076643c7481ea6bb930aefa8021d22ebf337962bd5a8a9cf50ec8877b0a5.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test,t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"baz\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"some random translation\\"}}}]);", + "/release/chunks/async2-LOCALE1-9c88f2a4de2a3a86966bd3dd006dbd59508d34571c439f035b96e9a68edb7d62.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test+t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"blah\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"something else\\"}}}]);", + "/release/chunks/async2-LOCALE2-e498cb54def3d623beb5295624626826129dd1e7a9a849831259397b14ab0d88.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":(s,_,n)=>{n.r(_);var e=n(\\"./a/strings1.resjson\\"),t=n(\\"./a/strings2.resjson\\");console.log(e.Z.test+t.Z.another)},\\"./a/strings1.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={test:\\"baz\\"}},\\"./a/strings2.resjson\\":(s,_,n)=>{n.d(_,{Z:()=>e});const e={another:\\"some random translation\\"}}}]);", + "/release/mainSingleChunk-LOCALE1-8878293491cf90535f3985f4681c1f41556d1f68483460051662bfbff830651a.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async1-\\"+\\"LOCALE1\\"+\\"-48e154cefa3c631967269f65a0c807e9808494fe15cc376120c80fbd79ecca73.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/async1-\\"+\\"LOCALE2\\"+\\"-bf3e076643c7481ea6bb930aefa8021d22ebf337962bd5a8a9cf50ec8877b0a5.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,c]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);c&&c(o)}for(r&&r(t);s{var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>\\"chunks/\\"+{515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+\\"LOCALE1\\"+\\"-\\"+{515:\\"48e154cefa3c631967269f65a0c807e9808494fe15cc376120c80fbd79ecca73\\",989:\\"9c88f2a4de2a3a86966bd3dd006dbd59508d34571c439f035b96e9a68edb7d62\\"}[e]+\\".js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},n.l=(r,t,o,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==o)for(var s=document.getElementsByTagName(\\"script\\"),l=0;l{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={903:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,s]=t,l=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);s&&s(n)}for(r&&r(t);l{var e,r={},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>\\"chunks/\\"+{515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+\\"LOCALE2\\"+\\"-\\"+{515:\\"bf3e076643c7481ea6bb930aefa8021d22ebf337962bd5a8a9cf50ec8877b0a5\\",989:\\"e498cb54def3d623beb5295624626826129dd1e7a9a849831259397b14ab0d88\\"}[e]+\\".js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},n.l=(r,t,o,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==o)for(var s=document.getElementsByTagName(\\"script\\"),l=0;l{i.onerror=i.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={903:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,s]=t,l=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);s&&s(n)}for(r&&r(t);l { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/async1-LOCALE2-9036e26b6287a4856c2477fe8af07d7f272eb51e38162b68c58ab6b45b6eedd6.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[515],{ + +/***/ \\"./a/async1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/async2-LOCALE1-c6f2ba01a69ea8170907f54734f3f539a7f44d9d9aa463963ec63181294f748a.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/async2-LOCALE2-0496c0d557f60f54802c2f22ae7a0d5186ada796cb053da5f964ce070e79de2c.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_resjson__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.resjson\\"); +/* harmony import */ var _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.resjson\\"); + console.log(_strings1_resjson__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_resjson__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.resjson\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/mainSingleChunk-LOCALE1-ef330c84c7be4ba6480ccb6ab98e80fd2c5d37f1f8bc695a2a50ee28f626a49c.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + \\"async1\\" + \\"-\\" + \\"LOCALE1\\" + \\"-\\" + \\"64cd1683fc081fb426519e5f5e38154a0a9db67429cf60140b6a7a393f3a745d\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\")); +/******/ })() +;", + "/release/mainSingleChunk-LOCALE2-8d15f7d9fb0abec48f14f96c434703a91b57a15dcc07c641a720eff4990206e3.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + \\"async1\\" + \\"-\\" + \\"LOCALE2\\" + \\"-\\" + \\"9036e26b6287a4856c2477fe8af07d7f272eb51e38162b68c58ab6b45b6eedd6\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\")); +/******/ })() +;", + "/release/mainTwoChunks-LOCALE1-d219354be7e0457bbd2da6966f4135606649cf44c4e0d88fea0fadfcfe168931.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + \\"LOCALE1\\" + \\"-\\" + {\\"515\\":\\"64cd1683fc081fb426519e5f5e38154a0a9db67429cf60140b6a7a393f3a745d\\",\\"989\\":\\"c6f2ba01a69ea8170907f54734f3f539a7f44d9d9aa463963ec63181294f748a\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 903: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\"));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./a/async2.js\\")); +/******/ })() +;", + "/release/mainTwoChunks-LOCALE2-4c93c79b8e1da15251daa8d02960191bceddc14a71b29991ad6ea6fa535ee0aa.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + \\"LOCALE2\\" + \\"-\\" + {\\"515\\":\\"9036e26b6287a4856c2477fe8af07d7f272eb51e38162b68c58ab6b45b6eedd6\\",\\"989\\":\\"0496c0d557f60f54802c2f22ae7a0d5186ada796cb053da5f964ce070e79de2c\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 903: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./a/async1.js\\"));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./a/async2.js\\")); +/******/ })() +;", +} +`; + +exports[`LocalizationPlugin Handles async localized chunks (unminified): Errors 1`] = `Array []`; + +exports[`LocalizationPlugin Handles async localized chunks (unminified): Warnings 1`] = `Array []`; diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsync.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsync.test.ts.snap new file mode 100644 index 00000000000..f092c2e0e53 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsync.test.ts.snap @@ -0,0 +1,817 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`LocalizationPlugin Handles async localized and non-localized chunks (minified): Content 1`] = ` +Object { + "/release/chunks/async1-none-cae03d2626cc2ffa3508.js": "(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":()=>{console.log(\\"blah1\\")}}]);", + "/release/chunks/async2-none-a3af93683846f20fd06d.js": "(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":()=>{console.log(\\"blah2\\")}}]);", + "/release/chunks/asyncLoc1-LOCALE1-42ac7deedbceee724ebe.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[14],{\\"./a/asyncLoc1.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test,t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"blah\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"something else\\"}}}]);", + "/release/chunks/asyncLoc1-LOCALE2-9569ed1013c7d99991f0.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[14],{\\"./a/asyncLoc1.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test,t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"baz\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"some random translation\\"}}}]);", + "/release/chunks/asyncLoc2-LOCALE1-fbbf37c75a89cefa3a8b.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[5],{\\"./a/asyncLoc2.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test+t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"blah\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"something else\\"}}}]);", + "/release/chunks/asyncLoc2-LOCALE2-6f7d6cb21f686f18a3de.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[5],{\\"./a/asyncLoc2.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test+t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"baz\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"some random translation\\"}}}]);", + "/release/main-LOCALE1-db5fee2775538b16fa56.js": "(()=>{var e,r,t,n={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.m=n,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if(\\"object\\"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&\\"function\\"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var c=2&n&&t;\\"object\\"==typeof c&&!~e.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>\\"chunks/\\"+{5:\\"asyncLoc2\\",14:\\"asyncLoc1\\",515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+({5:1,14:1}[e]?\\"LOCALE1\\":\\"none\\")+\\"-\\"+{5:\\"fbbf37c75a89cefa3a8b\\",14:\\"42ac7deedbceee724ebe\\",515:\\"cae03d2626cc2ffa3508\\",989:\\"a3af93683846f20fd06d\\"}[e]+\\".js\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a.l=(e,r,n,o)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),f=0;f{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(l.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),c&&document.head.appendChild(i)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e})(),(()=>{var e={179:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=a.p+a.u(r),c=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+o+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=o,c.request=i,n[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,o,[i,c,s]=t,f=0;if(i.some((r=>0!==e[r]))){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);s&&s(a)}for(r&&r(t);f{var e,r,t,n={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.m=n,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if(\\"object\\"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&\\"function\\"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var c=2&n&&t;\\"object\\"==typeof c&&!~e.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>\\"chunks/\\"+{5:\\"asyncLoc2\\",14:\\"asyncLoc1\\",515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+({5:1,14:1}[e]?\\"LOCALE2\\":\\"none\\")+\\"-\\"+{5:\\"6f7d6cb21f686f18a3de\\",14:\\"9569ed1013c7d99991f0\\",515:\\"cae03d2626cc2ffa3508\\",989:\\"a3af93683846f20fd06d\\"}[e]+\\".js\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a.l=(e,r,n,o)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),f=0;f{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(l.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),c&&document.head.appendChild(i)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e})(),(()=>{var e={179:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=a.p+a.u(r),c=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+o+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=o,c.request=i,n[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,o,[i,c,s]=t,f=0;if(i.some((r=>0!==e[r]))){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);s&&s(a)}for(r&&r(t);f { + +console.log(\\"blah1\\"); + +/***/ }) + +}]);", + "/release/chunks/async2-none-c9e2b0fb2741b17cb7ae.js": "(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ (() => { + +console.log(\\"blah2\\"); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc1-LOCALE1-0e3f6d729d9a8d850e0d.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[14],{ + +/***/ \\"./a/asyncLoc1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc1-LOCALE2-2eebf33f2db768152544.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[14],{ + +/***/ \\"./a/asyncLoc1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc2-LOCALE1-862fa13951f910022c37.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[5],{ + +/***/ \\"./a/asyncLoc2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc2-LOCALE2-c21e197905c17fe34ef7.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[5],{ + +/***/ \\"./a/asyncLoc2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/main-LOCALE1-8345e579c701b1d78cf4.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __webpack_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"5\\":\\"asyncLoc2\\",\\"14\\":\\"asyncLoc1\\",\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + ({\\"5\\":1,\\"14\\":1}[chunkId]?\\"LOCALE1\\":\\"none\\") + \\"-\\" + {\\"5\\":\\"862fa13951f910022c37\\",\\"14\\":\\"0e3f6d729d9a8d850e0d\\",\\"515\\":\\"38a5bffea2da0af62512\\",\\"989\\":\\"c9e2b0fb2741b17cb7ae\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 179: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | asyncLoc1 */ 14).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc1.js\\"));__webpack_require__.e(/* import() | asyncLoc2 */ 5).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc2.js\\"));__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async1.js\\", 23));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async2.js\\", 23)); +/******/ })() +;", + "/release/main-LOCALE2-9f3e7cd89069987e6049.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __webpack_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"5\\":\\"asyncLoc2\\",\\"14\\":\\"asyncLoc1\\",\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + ({\\"5\\":1,\\"14\\":1}[chunkId]?\\"LOCALE2\\":\\"none\\") + \\"-\\" + {\\"5\\":\\"c21e197905c17fe34ef7\\",\\"14\\":\\"2eebf33f2db768152544\\",\\"515\\":\\"38a5bffea2da0af62512\\",\\"989\\":\\"c9e2b0fb2741b17cb7ae\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 179: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | asyncLoc1 */ 14).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc1.js\\"));__webpack_require__.e(/* import() | asyncLoc2 */ 5).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc2.js\\"));__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async1.js\\", 23));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async2.js\\", 23)); +/******/ })() +;", +} +`; + +exports[`LocalizationPlugin Handles async localized and non-localized chunks (unminified): Errors 1`] = `Array []`; + +exports[`LocalizationPlugin Handles async localized and non-localized chunks (unminified): Localization Stats 1`] = ` +Object { + "entrypoints": Object { + "main": Object { + "localizedAssets": Object { + "LOCALE1": "main-LOCALE1-8345e579c701b1d78cf4.js", + "LOCALE2": "main-LOCALE2-9f3e7cd89069987e6049.js", + }, + }, + }, + "namedChunkGroups": Object { + "asyncLoc1": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/asyncLoc1-LOCALE1-0e3f6d729d9a8d850e0d.js", + "LOCALE2": "chunks/asyncLoc1-LOCALE2-2eebf33f2db768152544.js", + }, + }, + "asyncLoc2": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/asyncLoc2-LOCALE1-862fa13951f910022c37.js", + "LOCALE2": "chunks/asyncLoc2-LOCALE2-c21e197905c17fe34ef7.js", + }, + }, + }, +} +`; + +exports[`LocalizationPlugin Handles async localized and non-localized chunks (unminified): Warnings 1`] = `Array []`; diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncDynamic.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncDynamic.test.ts.snap index 6e76e5e9275..96d8d02cbf7 100644 --- a/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncDynamic.test.ts.snap +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncDynamic.test.ts.snap @@ -2,72 +2,208 @@ exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression (minified): Content 1`] = ` Object { - "/release/chunks/async-none.js": "(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./a/async.js\\":()=>{console.log(\\"blah\\")}}]);", - "/release/chunks/asyncLoc-en-us.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[548],{\\"./a/asyncLoc.js\\":(_,s,e)=>{e.r(s);console.log(\\"blah\\",\\"something else\\")}}]);", - "/release/chunks/asyncLoc-foo.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[548],{\\"./a/asyncLoc.js\\":(_,s,e)=>{e.r(s);console.log(\\"baz\\",\\"some random translation\\")}}]);", - "/release/main-none.js": "(()=>{var e,r,t,o={},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={exports:{}};return o[e](t,t.exports,a),t.exports}a.m=o,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,o){if(1&o&&(t=this(t)),8&o)return t;if(\\"object\\"==typeof t&&t){if(4&o&&t.__esModule)return t;if(16&o&&\\"function\\"==typeof t.then)return t}var n=Object.create(null);a.r(n);var i={};e=e||[null,r({}),r([]),r(r)];for(var c=2&o&&t;\\"object\\"==typeof c&&!~e.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,a.d(n,i),n},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>\\"chunks/\\"+{548:\\"asyncLoc\\",931:\\"async\\"}[e]+\\"-\\"+({548:1}[e]?self.__locale:\\"none\\")+\\".js\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a.l=(e,r,o,n)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==o)for(var l=document.getElementsByTagName(\\"script\\"),u=0;u{i.onerror=i.onload=null,clearTimeout(p);var n=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},p=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),c&&document.head.appendChild(i)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var o=t.length-1;o>-1&&!e;)e=t[o--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e})(),(()=>{var e={179:0};a.f.j=(r,t)=>{var o=a.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var i=a.p+a.u(r),c=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+n+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=n,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,n,[i,c,l]=t,u=0;if(i.some((r=>0!==e[r]))){for(o in c)a.o(c,o)&&(a.m[o]=c[o]);l&&l(a)}for(r&&r(t);u{console.log(\\"blah1\\")}}]);", + "/release/chunks/async2-none-66c46648c2b1b5a023ca.js": "(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":()=>{console.log(\\"blah2\\")}}]);", + "/release/chunks/asyncLoc1-LOCALE1-3bacd1d3213fe0fdaab4.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[14],{\\"./a/asyncLoc1.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test,t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"blah\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"something else\\"}}}]);", + "/release/chunks/asyncLoc1-LOCALE2-3bacd1d3213fe0fdaab4.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[14],{\\"./a/asyncLoc1.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test,t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"baz\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"some random translation\\"}}}]);", + "/release/chunks/asyncLoc2-LOCALE1-97e541e9dcd77c08a0f9.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[5],{\\"./a/asyncLoc2.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test+t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"blah\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"something else\\"}}}]);", + "/release/chunks/asyncLoc2-LOCALE2-97e541e9dcd77c08a0f9.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[5],{\\"./a/asyncLoc2.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test+t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"baz\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"some random translation\\"}}}]);", + "/release/mainFourChunks-none-d58865d38f40e8144df9.js": "(()=>{var e,r,t,n={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.m=n,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if(\\"object\\"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&\\"function\\"==typeof t.then)return t}var o=Object.create(null);a.r(o);var c={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;\\"object\\"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>c[e]=()=>t[e]));return c.default=()=>t,a.d(o,c),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>\\"chunks/\\"+{5:\\"asyncLoc2\\",14:\\"asyncLoc1\\",515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+({5:1,14:1}[e]?self.__locale:\\"none\\")+\\"-\\"+{5:\\"97e541e9dcd77c08a0f9\\",14:\\"3bacd1d3213fe0fdaab4\\",515:\\"ff5c89a3cf5e2abb1912\\",989:\\"66c46648c2b1b5a023ca\\"}[e]+\\".js\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a.l=(e,r,n,o)=>{if(t[e])t[e].push(r);else{var c,i;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{c.onerror=c.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:c}),12e4);c.onerror=f.bind(null,c.onerror),c.onload=f.bind(null,c.onload),i&&document.head.appendChild(c)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e})(),(()=>{var e={550:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var c=a.p+a.u(r),i=new Error;a.l(c,(t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&(\\"load\\"===t.type?\\"missing\\":t.type),c=t&&t.target&&t.target.src;i.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+o+\\": \\"+c+\\")\\",i.name=\\"ChunkLoadError\\",i.type=o,i.request=c,n[1](i)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,o,[c,i,l]=t,s=0;if(c.some((r=>0!==e[r]))){for(n in i)a.o(i,n)&&(a.m[n]=i[n]);l&&l(a)}for(r&&r(t);s{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var a=t[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"chunks/\\"+{5:\\"asyncLoc2\\",14:\\"asyncLoc1\\"}[e]+\\"-\\"+self.__locale+\\"-\\"+{5:\\"97e541e9dcd77c08a0f9\\",14:\\"3bacd1d3213fe0fdaab4\\"}[e]+\\".js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,a)=>{if(e[r])e[r].push(t);else{var i,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{i.onerror=i.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={903:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var a=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=a);var i=o.p+o.u(r),c=new Error;o.l(i,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,n[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,a,[i,c,l]=t,s=0;if(i.some((r=>0!==e[r]))){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);l&&l(o)}for(r&&r(t);s { + +console.log(\\"blah1\\"); + +/***/ }) + +}]);", + "/release/chunks/async2-none-1a5cac0840478360fcd4.js": "(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ -/***/ \\"./a/async.js\\": +/***/ \\"./a/async2.js\\": /***/ (() => { -console.log(\\"blah\\"); +console.log(\\"blah2\\"); /***/ }) }]);", - "/release/chunks/asyncLoc-en-us.js": "\\"use strict\\"; -(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[548],{ + "/release/chunks/asyncLoc1-LOCALE1-5491741ac467873e0e20.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[14],{ -/***/ \\"./a/asyncLoc.js\\": +/***/ \\"./a/asyncLoc1.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { -;// CONCATENATED MODULE: ./a/strings1.loc.json +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); const strings = {\\"test\\":\\"blah\\"}; -/* harmony default export */ const strings1_loc = (strings); -;// CONCATENATED MODULE: ./a/strings2.loc.json -const strings2_loc_strings = {\\"another\\":\\"something else\\"}; -/* harmony default export */ const strings2_loc = (strings2_loc_strings); -;// CONCATENATED MODULE: ./a/asyncLoc.js - console.log(strings1_loc.test, strings2_loc.another); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); /***/ }) }]);", - "/release/chunks/asyncLoc-foo.js": "\\"use strict\\"; -(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[548],{ + "/release/chunks/asyncLoc1-LOCALE2-5491741ac467873e0e20.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[14],{ -/***/ \\"./a/asyncLoc.js\\": +/***/ \\"./a/asyncLoc1.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { -;// CONCATENATED MODULE: ./a/strings1.loc.json +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); const strings = {\\"test\\":\\"baz\\"}; -/* harmony default export */ const strings1_loc = (strings); -;// CONCATENATED MODULE: ./a/strings2.loc.json -const strings2_loc_strings = {\\"another\\":\\"some random translation\\"}; -/* harmony default export */ const strings2_loc = (strings2_loc_strings); -;// CONCATENATED MODULE: ./a/asyncLoc.js - console.log(strings1_loc.test, strings2_loc.another); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); /***/ }) }]);", - "/release/main-none.js": "/******/ (() => { // webpackBootstrap + "/release/chunks/asyncLoc2-LOCALE1-cd7bb284d09a7eab49e4.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[5],{ + +/***/ \\"./a/asyncLoc2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc2-LOCALE2-cd7bb284d09a7eab49e4.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[5],{ + +/***/ \\"./a/asyncLoc2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/mainFourChunks-none-6e2099e8b5f8f28baad5.js": "/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache @@ -158,7 +294,7 @@ const strings2_loc_strings = {\\"another\\":\\"some random translation\\"}; /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template -/******/ return \\"chunks/\\" + {\\"548\\":\\"asyncLoc\\",\\"931\\":\\"async\\"}[chunkId] + \\"-\\" + ({\\"548\\":1}[chunkId]?self.__locale:\\"none\\") + \\".js\\"; +/******/ return \\"chunks/\\" + {\\"5\\":\\"asyncLoc2\\",\\"14\\":\\"asyncLoc1\\",\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + ({\\"5\\":1,\\"14\\":1}[chunkId]?self.__locale:\\"none\\") + \\"-\\" + {\\"5\\":\\"cd7bb284d09a7eab49e4\\",\\"14\\":\\"5491741ac467873e0e20\\",\\"515\\":\\"fd1b1af302665cb4e2e3\\",\\"989\\":\\"1a5cac0840478360fcd4\\"}[chunkId] + \\".js\\"; /******/ }; /******/ })(); /******/ @@ -266,7 +402,7 @@ const strings2_loc_strings = {\\"another\\":\\"some random translation\\"}; /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { -/******/ 179: 0 +/******/ 550: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { @@ -350,7 +486,263 @@ const strings2_loc_strings = {\\"another\\":\\"some random translation\\"}; /******/ /************************************************************************/ var __webpack_exports__ = {}; -__webpack_require__.e(/* import() | asyncLoc */ 548).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc.js\\"));__webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async.js\\", 23)); +__webpack_require__.e(/* import() | asyncLoc1 */ 14).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc1.js\\"));__webpack_require__.e(/* import() | asyncLoc2 */ 5).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc2.js\\"));__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async1.js\\", 23));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async2.js\\", 23)); +/******/ })() +;", + "/release/mainTwoChunks-none-9f1d368ff4afdae73e34.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"5\\":\\"asyncLoc2\\",\\"14\\":\\"asyncLoc1\\"}[chunkId] + \\"-\\" + self.__locale + \\"-\\" + {\\"5\\":\\"cd7bb284d09a7eab49e4\\",\\"14\\":\\"5491741ac467873e0e20\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 903: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | asyncLoc1 */ 14).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc1.js\\"));__webpack_require__.e(/* import() | asyncLoc2 */ 5).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc2.js\\")); /******/ })() ;", } @@ -358,4 +750,24 @@ __webpack_require__.e(/* import() | asyncLoc */ 548).then(__webpack_require__.bi exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression (unminified): Errors 1`] = `Array []`; +exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression (unminified): Localization Stats 1`] = ` +Object { + "entrypoints": Object {}, + "namedChunkGroups": Object { + "asyncLoc1": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/asyncLoc1-LOCALE1-5491741ac467873e0e20.js", + "LOCALE2": "chunks/asyncLoc1-LOCALE2-5491741ac467873e0e20.js", + }, + }, + "asyncLoc2": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/asyncLoc2-LOCALE1-cd7bb284d09a7eab49e4.js", + "LOCALE2": "chunks/asyncLoc2-LOCALE2-cd7bb284d09a7eab49e4.js", + }, + }, + }, +} +`; + exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression (unminified): Warnings 1`] = `Array []`; diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncNonHashed.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncNonHashed.test.ts.snap new file mode 100644 index 00000000000..3a732228ad6 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/MixedAsyncNonHashed.test.ts.snap @@ -0,0 +1,817 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression and without an asset filename hash (minified): Content 1`] = ` +Object { + "/release/chunks/async1-none.js": "(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./a/async1.js\\":()=>{console.log(\\"blah1\\")}}]);", + "/release/chunks/async2-none.js": "(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./a/async2.js\\":()=>{console.log(\\"blah2\\")}}]);", + "/release/chunks/asyncLoc1-LOCALE1.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[14],{\\"./a/asyncLoc1.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test,t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"blah\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"something else\\"}}}]);", + "/release/chunks/asyncLoc1-LOCALE2.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[14],{\\"./a/asyncLoc1.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test,t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"baz\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"some random translation\\"}}}]);", + "/release/chunks/asyncLoc2-LOCALE1.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[5],{\\"./a/asyncLoc2.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test+t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"blah\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"something else\\"}}}]);", + "/release/chunks/asyncLoc2-LOCALE2.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[5],{\\"./a/asyncLoc2.js\\":(s,_,n)=>{n.r(_);var o=n(\\"./a/strings1.loc.json\\"),t=n(\\"./a/strings2.loc.json\\");console.log(o.Z.test+t.Z.another)},\\"./a/strings1.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={test:\\"baz\\"}},\\"./a/strings2.loc.json\\":(s,_,n)=>{n.d(_,{Z:()=>o});const o={another:\\"some random translation\\"}}}]);", + "/release/main-LOCALE1.js": "(()=>{var e,r,t,n={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.m=n,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if(\\"object\\"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&\\"function\\"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var c=2&n&&t;\\"object\\"==typeof c&&!~e.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>\\"chunks/\\"+{5:\\"asyncLoc2\\",14:\\"asyncLoc1\\",515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+({5:1,14:1}[e]?\\"LOCALE1\\":\\"none\\")+\\".js\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a.l=(e,r,n,o)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),u=0;u{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),c&&document.head.appendChild(i)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e})(),(()=>{var e={179:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=a.p+a.u(r),c=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+o+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=o,c.request=i,n[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,o,[i,c,s]=t,u=0;if(i.some((r=>0!==e[r]))){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);s&&s(a)}for(r&&r(t);u{var e,r,t,n={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.m=n,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if(\\"object\\"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&\\"function\\"==typeof t.then)return t}var o=Object.create(null);a.r(o);var i={};e=e||[null,r({}),r([]),r(r)];for(var c=2&n&&t;\\"object\\"==typeof c&&!~e.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((e=>i[e]=()=>t[e]));return i.default=()=>t,a.d(o,i),o},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>\\"chunks/\\"+{5:\\"asyncLoc2\\",14:\\"asyncLoc1\\",515:\\"async1\\",989:\\"async2\\"}[e]+\\"-\\"+({5:1,14:1}[e]?\\"LOCALE2\\":\\"none\\")+\\".js\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a.l=(e,r,n,o)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),u=0;u{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),c&&document.head.appendChild(i)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e})(),(()=>{var e={179:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var i=a.p+a.u(r),c=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+o+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=o,c.request=i,n[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,o,[i,c,s]=t,u=0;if(i.some((r=>0!==e[r]))){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);s&&s(a)}for(r&&r(t);u { + +console.log(\\"blah1\\"); + +/***/ }) + +}]);", + "/release/chunks/async2-none.js": "(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./a/async2.js\\": +/***/ (() => { + +console.log(\\"blah2\\"); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc1-LOCALE1.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[14],{ + +/***/ \\"./a/asyncLoc1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc1-LOCALE2.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[14],{ + +/***/ \\"./a/asyncLoc1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test, _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc2-LOCALE1.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[5],{ + +/***/ \\"./a/asyncLoc2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"blah\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"something else\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/chunks/asyncLoc2-LOCALE2.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[5],{ + +/***/ \\"./a/asyncLoc2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(\\"./a/strings1.loc.json\\"); +/* harmony import */ var _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(\\"./a/strings2.loc.json\\"); + console.log(_strings1_loc_json__WEBPACK_IMPORTED_MODULE_0__/* [\\"default\\"].test */ .Z.test + _strings2_loc_json__WEBPACK_IMPORTED_MODULE_1__/* [\\"default\\"].another */ .Z.another); + +/***/ }), + +/***/ \\"./a/strings1.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"test\\":\\"baz\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }), + +/***/ \\"./a/strings2.loc.json\\": +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"Z\\": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +const strings = {\\"another\\":\\"some random translation\\"}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (strings); + +/***/ }) + +}]);", + "/release/main-LOCALE1.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __webpack_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"5\\":\\"asyncLoc2\\",\\"14\\":\\"asyncLoc1\\",\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + ({\\"5\\":1,\\"14\\":1}[chunkId]?\\"LOCALE1\\":\\"none\\") + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 179: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | asyncLoc1 */ 14).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc1.js\\"));__webpack_require__.e(/* import() | asyncLoc2 */ 5).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc2.js\\"));__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async1.js\\", 23));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async2.js\\", 23)); +/******/ })() +;", + "/release/main-LOCALE2.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __webpack_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"chunks/\\" + {\\"5\\":\\"asyncLoc2\\",\\"14\\":\\"asyncLoc1\\",\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-\\" + ({\\"5\\":1,\\"14\\":1}[chunkId]?\\"LOCALE2\\":\\"none\\") + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 179: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.e(/* import() | asyncLoc1 */ 14).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc1.js\\"));__webpack_require__.e(/* import() | asyncLoc2 */ 5).then(__webpack_require__.bind(__webpack_require__, \\"./a/asyncLoc2.js\\"));__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async1.js\\", 23));__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.t.bind(__webpack_require__, \\"./a/async2.js\\", 23)); +/******/ })() +;", +} +`; + +exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression and without an asset filename hash (unminified): Errors 1`] = `Array []`; + +exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression and without an asset filename hash (unminified): Localization Stats 1`] = ` +Object { + "entrypoints": Object { + "main": Object { + "localizedAssets": Object { + "LOCALE1": "main-LOCALE1.js", + "LOCALE2": "main-LOCALE2.js", + }, + }, + }, + "namedChunkGroups": Object { + "asyncLoc1": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/asyncLoc1-LOCALE1.js", + "LOCALE2": "chunks/asyncLoc1-LOCALE2.js", + }, + }, + "asyncLoc2": Object { + "localizedAssets": Object { + "LOCALE1": "chunks/asyncLoc2-LOCALE1.js", + "LOCALE2": "chunks/asyncLoc2-LOCALE2.js", + }, + }, + }, +} +`; + +exports[`LocalizationPlugin Handles async localized and non-localized chunks with a runtime locale expression and without an asset filename hash (unminified): Warnings 1`] = `Array []`; diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/NoLocalizedFiles.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/NoLocalizedFiles.test.ts.snap index 56b72e9f35a..3204e84d5ae 100644 --- a/webpack/webpack5-localization-plugin/src/test/__snapshots__/NoLocalizedFiles.test.ts.snap +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/NoLocalizedFiles.test.ts.snap @@ -2,8 +2,10 @@ exports[`LocalizationPlugin Handles non-localized compilations (minified): Content 1`] = ` Object { - "/release/async-none.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[931],{\\"./async.js\\":(o,s,c)=>{function e(){console.log(\\"foo\\")}c.r(s),c.d(s,{foo:()=>e})}}]);", - "/release/main-none.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"async-none.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{a.onerror=a.onload=null,clearTimeout(d);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={179:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);u&&u(o)}for(r&&r(t);ce.foo()))})();", + "/release/async1-none-48a722dc54a6c9ffce23.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./async1.js\\":(o,s,c)=>{function e(){console.log(\\"foo1\\")}c.r(s),c.d(s,{foo:()=>e})}}]);", + "/release/async2-none-533c236877cb65c0fb15.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./async2.js\\":(o,s,c)=>{function e(){console.log(\\"foo2\\")}c.r(s),c.d(s,{foo:()=>e})}}]);", + "/release/mainSingleChunk-none-7d6f7e2f26055818203c.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"async1-none-48a722dc54a6c9ffce23.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);u&&u(o)}for(r&&r(t);ce.foo()))})();", + "/release/mainTwoChunks-none-e08b212d84344c842772.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>({515:\\"async1\\",989:\\"async2\\"}[e]+\\"-none-\\"+{515:\\"48a722dc54a6c9ffce23\\",989:\\"533c236877cb65c0fb15\\"}[e]+\\".js\\"),o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),s=0;s{a.onerror=a.onload=null,clearTimeout(f);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={903:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),c=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",c.name=\\"ChunkLoadError\\",c.type=i,c.request=a,n[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,c,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);l&&l(o)}for(r&&r(t);se.foo())),o.e(989).then(o.bind(o,\\"./async2.js\\")).then((e=>e.foo()))})();", } `; @@ -13,22 +15,293 @@ exports[`LocalizationPlugin Handles non-localized compilations (minified): Warni exports[`LocalizationPlugin Handles non-localized compilations (unminified): Content 1`] = ` Object { - "/release/async-none.js": "\\"use strict\\"; -(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[931],{ + "/release/async1-none-a138af13bd80cae8310a.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[515],{ -/***/ \\"./async.js\\": +/***/ \\"./async1.js\\": /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ \\"foo\\": () => (/* binding */ foo) /* harmony export */ }); -function foo() { console.log('foo'); } +function foo() { console.log('foo1'); } /***/ }) }]);", - "/release/main-none.js": "/******/ (() => { // webpackBootstrap + "/release/async2-none-0c142ab36ce8fdb6d445.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"foo\\": () => (/* binding */ foo) +/* harmony export */ }); +function foo() { console.log('foo2'); } + +/***/ }) + +}]);", + "/release/mainSingleChunk-none-508ef9a361c3744d4242.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"\\" + \\"async1\\" + \\"-none-\\" + \\"a138af13bd80cae8310a\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +console.log(\\"Do stuff\\");__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./async1.js\\")).then(mod => mod.foo()); +/******/ })() +;", + "/release/mainTwoChunks-none-b149e5d15775d7f6fd87.js": "/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache @@ -89,7 +362,7 @@ function foo() { console.log('foo'); } /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template -/******/ return \\"\\" + \\"async\\" + \\"-none.js\\"; +/******/ return \\"\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\"-none-\\" + {\\"515\\":\\"a138af13bd80cae8310a\\",\\"989\\":\\"0c142ab36ce8fdb6d445\\"}[chunkId] + \\".js\\"; /******/ }; /******/ })(); /******/ @@ -197,7 +470,7 @@ function foo() { console.log('foo'); } /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { -/******/ 179: 0 +/******/ 903: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { @@ -281,7 +554,7 @@ function foo() { console.log('foo'); } /******/ /************************************************************************/ var __webpack_exports__ = {}; -console.log(\\"Do stuff\\");__webpack_require__.e(/* import() | async */ 931).then(__webpack_require__.bind(__webpack_require__, \\"./async.js\\")).then(mod => mod.foo()); +console.log(\\"Do stuff\\");__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./async1.js\\")).then(mod => mod.foo());__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./async2.js\\")).then(mod => mod.foo()); /******/ })() ;", } diff --git a/webpack/webpack5-localization-plugin/src/test/__snapshots__/NonHashedNonLocalizedAssets.test.ts.snap b/webpack/webpack5-localization-plugin/src/test/__snapshots__/NonHashedNonLocalizedAssets.test.ts.snap new file mode 100644 index 00000000000..93dbcb8b05b --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/test/__snapshots__/NonHashedNonLocalizedAssets.test.ts.snap @@ -0,0 +1,565 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TrueHashPlugin Handles non-localized non-hashed compilations (minified): Content 1`] = ` +Object { + "/release/async1.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[515],{\\"./async1.js\\":(o,s,c)=>{function e(){console.log(\\"foo1\\")}c.r(s),c.d(s,{foo:()=>e})}}]);", + "/release/async2.js": "\\"use strict\\";(self.webpackChunk=self.webpackChunk||[]).push([[989],{\\"./async2.js\\":(o,s,c)=>{function e(){console.log(\\"foo2\\")}c.r(s),c.d(s,{foo:()=>e})}}]);", + "/release/mainSingleChunk.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>\\"async1.js\\",o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{a.onerror=a.onload=null,clearTimeout(d);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={315:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);u&&u(o)}for(r&&r(t);ce.foo()))})();", + "/release/mainTwoChunks.js": "(()=>{var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>({515:\\"async1\\",989:\\"async2\\"}[e]+\\".js\\"),o.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},o.l=(r,t,n,i)=>{if(e[r])e[r].push(t);else{var a,l;if(void 0!==n)for(var s=document.getElementsByTagName(\\"script\\"),c=0;c{a.onerror=a.onload=null,clearTimeout(p);var n=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+\\"\\");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),o.p=e})(),(()=>{var e={903:0};o.f.j=(r,t)=>{var n=o.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=i);var a=o.p+o.u(r),l=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,n[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var n,i,[a,l,s]=t,c=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);s&&s(o)}for(r&&r(t);ce.foo())),o.e(989).then(o.bind(o,\\"./async2.js\\")).then((e=>e.foo()))})();", +} +`; + +exports[`TrueHashPlugin Handles non-localized non-hashed compilations (minified): Errors 1`] = `Array []`; + +exports[`TrueHashPlugin Handles non-localized non-hashed compilations (minified): Warnings 1`] = `Array []`; + +exports[`TrueHashPlugin Handles non-localized non-hashed compilations (unminified): Content 1`] = ` +Object { + "/release/async1.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[515],{ + +/***/ \\"./async1.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"foo\\": () => (/* binding */ foo) +/* harmony export */ }); +function foo() { console.log('foo1'); } + +/***/ }) + +}]);", + "/release/async2.js": "\\"use strict\\"; +(self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []).push([[989],{ + +/***/ \\"./async2.js\\": +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ \\"foo\\": () => (/* binding */ foo) +/* harmony export */ }); +function foo() { console.log('foo2'); } + +/***/ }) + +}]);", + "/release/mainSingleChunk.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"\\" + \\"async1\\" + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 315: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +console.log(\\"Do stuff\\");__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./async1.js\\")).then(mod => mod.foo()); +/******/ })() +;", + "/release/mainTwoChunks.js": "/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({}); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __webpack_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { +/******/ __webpack_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __webpack_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return \\"\\" + {\\"515\\":\\"async1\\",\\"989\\":\\"async2\\"}[chunkId] + \\".js\\"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key, chunkId) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute(\\"src\\") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute(\\"nonce\\", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); +/******/ if(prev) return prev(event); +/******/ } +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ var scriptUrl; +/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \\"\\"; +/******/ var document = __webpack_require__.g.document; +/******/ if (!scriptUrl && document) { +/******/ if (document.currentScript) +/******/ scriptUrl = document.currentScript.src; +/******/ if (!scriptUrl) { +/******/ var scripts = document.getElementsByTagName(\\"script\\"); +/******/ if(scripts.length) { +/******/ var i = scripts.length - 1; +/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; +/******/ } +/******/ } +/******/ } +/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration +/******/ // or pass an empty string (\\"\\") and set the __webpack_public_path__ variable from your code to use your own logic. +/******/ if (!scriptUrl) throw new Error(\\"Automatic publicPath is not supported in this browser\\"); +/******/ scriptUrl = scriptUrl.replace(/#.*$/, \\"\\").replace(/\\\\?.*$/, \\"\\").replace(/\\\\/[^\\\\/]+$/, \\"/\\"); +/******/ __webpack_require__.p = scriptUrl; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 903: 0 +/******/ }; +/******/ +/******/ __webpack_require__.f.j = (chunkId, promises) => { +/******/ // JSONP chunk loading for javascript +/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means \\"already installed\\". +/******/ +/******/ // a Promise means \\"currently loading\\". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[2]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); +/******/ promises.push(installedChunkData[2] = promise); +/******/ +/******/ // start chunk loading +/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { +/******/ if(__webpack_require__.o(installedChunks, chunkId)) { +/******/ installedChunkData = installedChunks[chunkId]; +/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\\\\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } +/******/ } +/******/ }; +/******/ __webpack_require__.l(url, loadingEnded, \\"chunk-\\" + chunkId, chunkId); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ // no on chunks loaded +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add \\"moreModules\\" to the modules object, +/******/ // then flag all \\"chunkIds\\" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ var chunkLoadingGlobal = self[\\"webpackChunk\\"] = self[\\"webpackChunk\\"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +console.log(\\"Do stuff\\");__webpack_require__.e(/* import() | async1 */ 515).then(__webpack_require__.bind(__webpack_require__, \\"./async1.js\\")).then(mod => mod.foo());__webpack_require__.e(/* import() | async2 */ 989).then(__webpack_require__.bind(__webpack_require__, \\"./async2.js\\")).then(mod => mod.foo()); +/******/ })() +;", +} +`; + +exports[`TrueHashPlugin Handles non-localized non-hashed compilations (unminified): Errors 1`] = `Array []`; + +exports[`TrueHashPlugin Handles non-localized non-hashed compilations (unminified): Warnings 1`] = `Array []`; diff --git a/webpack/webpack5-localization-plugin/src/trueHashes.ts b/webpack/webpack5-localization-plugin/src/trueHashes.ts new file mode 100644 index 00000000000..d6eb3ad447f --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/trueHashes.ts @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import type { default as webpack, Compilation, Chunk, Asset, sources, util } from 'webpack'; +import { Text } from '@rushstack/node-core-library'; + +import type { ILocalizedWebpackChunk } from './webpackInterfaces'; +import { chunkIsJs } from './utilities/chunkUtilities'; + +interface IHashReplacement { + existingHash: string; + trueHashByLocale: string | Record | undefined; +} + +type WebpackHash = ReturnType; + +export type HashFn = (contents: string | Buffer) => string; + +export interface IGetHashFunctionOptions { + thisWebpack: typeof webpack; + compilation: Compilation; +} + +export function getHashFunction({ thisWebpack, compilation }: IGetHashFunctionOptions): HashFn { + const { hashFunction = 'md5', hashDigest = 'hex', hashDigestLength, hashSalt } = compilation.outputOptions; + return (contents: string | Buffer) => { + const hash: WebpackHash = thisWebpack.util.createHash(hashFunction); + if (hashSalt) { + hash.update(hashSalt, 'utf-8'); + } + + return hash.update(contents).digest(hashDigest).toString().slice(0, hashDigestLength); + }; +} + +export interface IUpdateAssetHashesOptions { + thisWebpack: typeof webpack; + compilation: Compilation; + hashFn: HashFn; + filesByChunkName?: Map>; +} + +interface IProcessChunkAssetResult { + trueHash: string; + newJsFilename: string; +} + +export function updateAssetHashes({ + thisWebpack, + compilation, + hashFn, + filesByChunkName +}: IUpdateAssetHashesOptions): void { + const unprocessedDependenciesByChunk: Map> = new Map(); + const dependenciesByChunk: Map> = new Map(); + const dependentsByChunk: Map> = new Map(); + const unprocessedChunks: Set = new Set(); + const nonJsChunks: Set = new Set(); + + for (const chunk of compilation.chunks) { + if (!chunkIsJs(chunk, compilation.chunkGraph)) { + nonJsChunks.add(chunk); + } else { + unprocessedChunks.add(chunk); + } + } + + for (const chunk of compilation.chunks) { + let unprocessedDependencies: Set | undefined = unprocessedDependenciesByChunk.get(chunk); + if (!unprocessedDependencies) { + unprocessedDependencies = new Set(); + unprocessedDependenciesByChunk.set(chunk, unprocessedDependencies); + } + + let dependencies: Set | undefined = dependenciesByChunk.get(chunk); + if (!dependencies) { + dependencies = new Set(); + dependenciesByChunk.set(chunk, dependencies); + } + + if (chunk.hasRuntime()) { + for (const asyncChunk of chunk.getAllAsyncChunks()) { + if (!nonJsChunks.has(asyncChunk)) { + unprocessedDependencies.add(asyncChunk); + dependencies.add(asyncChunk); + + let dependents: Set | undefined = dependentsByChunk.get(asyncChunk); + if (!dependents) { + dependents = new Set(); + dependentsByChunk.set(asyncChunk, dependents); + } + + dependents.add(chunk); + + if (!unprocessedChunks.has(asyncChunk)) { + compilation.errors.push( + new thisWebpack.WebpackError( + `Found an async chunk that was not included in the compilation: ${asyncChunk.id} ` + + `(reason: ${asyncChunk.chunkReason}).` + ) + ); + } + } + } + } + } + + const hashReplacementsByChunk: Map = new Map(); + let previousSize: number = -1; + while (unprocessedChunks.size > 0) { + const currentSize: number = unprocessedChunks.size; + if (currentSize === previousSize) { + compilation.errors.push( + new thisWebpack.WebpackError( + `Detected a cycle in the chunk dependencies. This should not be possible.` + ) + ); + + break; + } + + previousSize = currentSize; + + for (const chunk of unprocessedChunks) { + if (unprocessedDependenciesByChunk.get(chunk)?.size === 0) { + // TODO: do we need to check if the chunk is rendered? + if (!chunk.renderedHash) { + compilation.errors.push( + new thisWebpack.WebpackError(`Could not find the hash for chunk ${chunk.id}.`) + ); + } else { + const existingHash: string = chunk.contentHash.javascript; + const chunkDependencies: Set | undefined = dependenciesByChunk.get(chunk); + if (!chunkDependencies) { + compilation.errors.push( + new thisWebpack.WebpackError(`Could not find dependencies for chunk ${chunk.id}.`) + ); + } else { + function processChunkAsset( + jsAssetName: string, + locale: string | undefined + ): IProcessChunkAssetResult | undefined { + const asset: Readonly | undefined = compilation.getAsset(jsAssetName); + if (!asset) { + compilation.errors.push( + new thisWebpack.WebpackError(`Could not find asset "${jsAssetName}" for chunk ${chunk.id}.`) + ); + } else { + let assetSource: sources.Source = asset.source; + const assetName: string = asset.name; + if (chunkDependencies!.size > 0) { + const relevantHashReplacements: Map = new Map(); + let hasAnyReplacements: boolean = false; + for (const dependency of chunkDependencies!) { + const asyncChunkHashReplacements: IHashReplacement | undefined = + hashReplacementsByChunk.get(dependency); + if (!asyncChunkHashReplacements) { + compilation.errors.push( + new thisWebpack.WebpackError( + `Could not find hash replacements for chunk ${dependency.id}.` + ) + ); + } else { + const { existingHash: otherChunkExistingHash, trueHashByLocale } = + asyncChunkHashReplacements; + let replacementHash: string | undefined; + if (typeof trueHashByLocale === 'object') { + if (locale) { + replacementHash = trueHashByLocale[locale]; + } + } else { + replacementHash = trueHashByLocale; + } + + if (replacementHash) { + if (relevantHashReplacements.has(otherChunkExistingHash)) { + compilation.errors.push( + new thisWebpack.WebpackError( + `Found multiple replacements for hash ${otherChunkExistingHash} ` + + `in chunk ${chunk.id}.` + ) + ); + } else { + relevantHashReplacements.set(otherChunkExistingHash, replacementHash); + hasAnyReplacements = true; + } + } + } + } + + if (hasAnyReplacements) { + const sourceString: string = assetSource.source().toString(); + const replaceSource: sources.ReplaceSource = new thisWebpack.sources.ReplaceSource( + assetSource, + assetName + ); + + const regexp: RegExp = new RegExp( + Array.from(relevantHashReplacements.keys()) + .map((hashToReplace) => Text.escapeRegExp(hashToReplace)) + .join('|'), + 'g' + ); + let match: RegExpMatchArray | null; + while ((match = regexp.exec(sourceString)) !== null) { + const { 0: originalHash, index } = match; + const matchStart: number = index!; + const matchEnd: number = matchStart + originalHash.length - 1; + const replacement: string = relevantHashReplacements.get(originalHash)!; + replaceSource.replace(matchStart, matchEnd, replacement); + } + + assetSource = replaceSource; + compilation.updateAsset(jsAssetName, assetSource); + } + } + + if (jsAssetName.includes(existingHash)) { + const trueHash: string = hashFn(assetSource.buffer()); + if (trueHash !== existingHash) { + const newJsFilename: string = jsAssetName.replace(existingHash, trueHash); + compilation.renameAsset(jsAssetName, newJsFilename); + + if (locale) { + const filesForChunkName: Record | undefined = filesByChunkName?.get( + chunk.name + ); + if (filesForChunkName) { + filesForChunkName[locale] = newJsFilename; + } + } + + return { + trueHash, + newJsFilename + }; + } + } + } + } + + const localizedFiles: Record | undefined = (chunk as ILocalizedWebpackChunk) + .localizedFiles; + if (localizedFiles) { + const trueHashByLocale: Record = {}; + hashReplacementsByChunk.set(chunk, { + existingHash, + trueHashByLocale + }); + for (const [locale, jsAssetName] of Object.entries(localizedFiles)) { + const processAssetResult: IProcessChunkAssetResult | undefined = processChunkAsset( + jsAssetName, + locale + ); + if (processAssetResult) { + const { trueHash, newJsFilename } = processAssetResult; + trueHashByLocale[locale] = trueHash; + localizedFiles[locale] = newJsFilename; + } + } + } else { + const assetNames: string[] = Array.from(chunk.files); + let jsAssetName: string | undefined; + for (const assetName of assetNames) { + if (assetName.endsWith('.js')) { + if (jsAssetName) { + compilation.errors.push( + new thisWebpack.WebpackError(`Found multiple .js assets for chunk ${chunk.id}.`) + ); + } else { + jsAssetName = assetName; + } + } + } + + if (!jsAssetName) { + compilation.errors.push( + new thisWebpack.WebpackError(`Could not find a .js asset for chunk ${chunk.id}.`) + ); + } else { + const { trueHash, newJsFilename } = processChunkAsset(jsAssetName, undefined) ?? {}; + hashReplacementsByChunk.set(chunk, { existingHash, trueHashByLocale: trueHash }); + if (newJsFilename) { + chunk.files.delete(jsAssetName); + chunk.files.add(newJsFilename); + } + } + } + } + + unprocessedChunks.delete(chunk); + const dependents: Set | undefined = dependentsByChunk.get(chunk); + if (dependents) { + for (const dependent of dependents) { + unprocessedDependenciesByChunk.get(dependent)?.delete(chunk); + } + } + } + } + } + } +} diff --git a/webpack/webpack5-localization-plugin/src/utilities/LoaderTerminalProvider.ts b/webpack/webpack5-localization-plugin/src/utilities/LoaderTerminalProvider.ts index a390215895d..74812ad9ff0 100644 --- a/webpack/webpack5-localization-plugin/src/utilities/LoaderTerminalProvider.ts +++ b/webpack/webpack5-localization-plugin/src/utilities/LoaderTerminalProvider.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import type { LoaderContext } from 'webpack'; -import { type ITerminalProvider, TerminalProviderSeverity } from '@rushstack/node-core-library'; +import { type ITerminalProvider, TerminalProviderSeverity } from '@rushstack/terminal'; export class LoaderTerminalProvider { public static getTerminalProviderForLoader(loaderContext: LoaderContext<{}>): ITerminalProvider { diff --git a/webpack/webpack5-localization-plugin/src/utilities/chunkUtilities.ts b/webpack/webpack5-localization-plugin/src/utilities/chunkUtilities.ts new file mode 100644 index 00000000000..d9334fb7865 --- /dev/null +++ b/webpack/webpack5-localization-plugin/src/utilities/chunkUtilities.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import type { Chunk, ChunkGraph } from 'webpack'; + +export function chunkIsJs(chunk: Chunk, chunkGraph: ChunkGraph): boolean { + return !!chunkGraph.getChunkModulesIterableBySourceType(chunk, 'javascript'); +} diff --git a/webpack/webpack5-module-minifier-plugin/CHANGELOG.json b/webpack/webpack5-module-minifier-plugin/CHANGELOG.json index afd5caee737..69da2290d4d 100644 --- a/webpack/webpack5-module-minifier-plugin/CHANGELOG.json +++ b/webpack/webpack5-module-minifier-plugin/CHANGELOG.json @@ -1,6 +1,153 @@ { "name": "@rushstack/webpack5-module-minifier-plugin", "entries": [ + { + "version": "5.5.27", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.27", + "date": "Tue, 20 Feb 2024 21:45:10 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.27`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.1`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.27`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, + { + "version": "5.5.26", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.26", + "date": "Tue, 20 Feb 2024 16:10:53 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.26`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.65.0`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.26`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, + { + "version": "5.5.25", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.25", + "date": "Mon, 19 Feb 2024 21:54:27 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.25`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.8`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.25`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, + { + "version": "5.5.24", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.24", + "date": "Sat, 17 Feb 2024 06:24:35 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.24`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.7`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.24`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, + { + "version": "5.5.23", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.23", + "date": "Thu, 08 Feb 2024 01:09:21 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.23`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.6`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.23`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, + { + "version": "5.5.22", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.22", + "date": "Wed, 07 Feb 2024 01:11:18 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.22`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.5`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.22`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, + { + "version": "5.5.21", + "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.21", + "date": "Mon, 05 Feb 2024 23:46:52 GMT", + "comments": { + "dependency": [ + { + "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.21`" + }, + { + "comment": "Updating dependency \"@rushstack/heft\" to `0.64.4`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.4.21`" + }, + { + "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `*`" + } + ] + } + }, { "version": "5.5.20", "tag": "@rushstack/webpack5-module-minifier-plugin_v5.5.20", diff --git a/webpack/webpack5-module-minifier-plugin/CHANGELOG.md b/webpack/webpack5-module-minifier-plugin/CHANGELOG.md index a57bc497ad5..0478759b601 100644 --- a/webpack/webpack5-module-minifier-plugin/CHANGELOG.md +++ b/webpack/webpack5-module-minifier-plugin/CHANGELOG.md @@ -1,6 +1,41 @@ # Change Log - @rushstack/webpack5-module-minifier-plugin -This log was last generated on Thu, 25 Jan 2024 01:09:30 GMT and should not be manually modified. +This log was last generated on Tue, 20 Feb 2024 21:45:10 GMT and should not be manually modified. + +## 5.5.27 +Tue, 20 Feb 2024 21:45:10 GMT + +_Version update only_ + +## 5.5.26 +Tue, 20 Feb 2024 16:10:53 GMT + +_Version update only_ + +## 5.5.25 +Mon, 19 Feb 2024 21:54:27 GMT + +_Version update only_ + +## 5.5.24 +Sat, 17 Feb 2024 06:24:35 GMT + +_Version update only_ + +## 5.5.23 +Thu, 08 Feb 2024 01:09:21 GMT + +_Version update only_ + +## 5.5.22 +Wed, 07 Feb 2024 01:11:18 GMT + +_Version update only_ + +## 5.5.21 +Mon, 05 Feb 2024 23:46:52 GMT + +_Version update only_ ## 5.5.20 Thu, 25 Jan 2024 01:09:30 GMT diff --git a/webpack/webpack5-module-minifier-plugin/package.json b/webpack/webpack5-module-minifier-plugin/package.json index ad0d2866888..64d5f4dcc81 100644 --- a/webpack/webpack5-module-minifier-plugin/package.json +++ b/webpack/webpack5-module-minifier-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@rushstack/webpack5-module-minifier-plugin", - "version": "5.5.20", + "version": "5.5.27", "description": "This plugin splits minification of webpack compilations into smaller units.", "main": "lib/index.js", "typings": "dist/webpack5-module-minifier-plugin.d.ts",