@nx/angular-rspack 20.9.0 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/lib/config/config-utils/browser-config.d.ts.map +1 -1
  2. package/dist/lib/config/config-utils/browser-config.js +11 -0
  3. package/dist/lib/config/config-utils/common-config.d.ts.map +1 -1
  4. package/dist/lib/config/config-utils/common-config.js +32 -0
  5. package/dist/lib/config/config-utils/dev-server-config-utils.d.ts.map +1 -1
  6. package/dist/lib/config/config-utils/dev-server-config-utils.js +3 -1
  7. package/dist/lib/config/config-utils/get-stats-options.d.ts +3 -0
  8. package/dist/lib/config/config-utils/get-stats-options.d.ts.map +1 -0
  9. package/dist/lib/config/config-utils/get-stats-options.js +39 -0
  10. package/dist/lib/config/config-utils/optimization-config.d.ts.map +1 -1
  11. package/dist/lib/config/config-utils/optimization-config.js +3 -1
  12. package/dist/lib/config/config-utils/server-config.d.ts.map +1 -1
  13. package/dist/lib/config/config-utils/server-config.js +2 -1
  14. package/dist/lib/config/config-utils/style-config-utils.d.ts.map +1 -1
  15. package/dist/lib/config/config-utils/style-config-utils.js +8 -9
  16. package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts +7 -14
  17. package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts.map +1 -1
  18. package/dist/lib/models/angular-rspack-plugin-options.d.ts +100 -6
  19. package/dist/lib/models/angular-rspack-plugin-options.d.ts.map +1 -1
  20. package/dist/lib/models/augmented-compilation.d.ts +2 -2
  21. package/dist/lib/models/augmented-compilation.d.ts.map +1 -1
  22. package/dist/lib/models/normalize-options.d.ts +2 -2
  23. package/dist/lib/models/normalize-options.d.ts.map +1 -1
  24. package/dist/lib/models/normalize-options.js +63 -28
  25. package/dist/lib/plugins/angular-rspack-plugin.d.ts.map +1 -1
  26. package/dist/lib/plugins/angular-rspack-plugin.js +58 -12
  27. package/dist/lib/plugins/any-component-style-budget-checker-plugin.d.ts +19 -0
  28. package/dist/lib/plugins/any-component-style-budget-checker-plugin.d.ts.map +1 -0
  29. package/dist/lib/plugins/any-component-style-budget-checker-plugin.js +65 -0
  30. package/dist/lib/plugins/i18n-inline-plugin.d.ts.map +1 -1
  31. package/dist/lib/plugins/i18n-inline-plugin.js +5 -3
  32. package/dist/lib/plugins/loaders/angular-partial-transform.loader.d.ts.map +1 -1
  33. package/dist/lib/plugins/loaders/angular-partial-transform.loader.js +4 -1
  34. package/dist/lib/plugins/loaders/hmr-accept-loader.d.ts +11 -0
  35. package/dist/lib/plugins/loaders/hmr-accept-loader.d.ts.map +1 -0
  36. package/dist/lib/plugins/loaders/hmr-accept-loader.js +24 -0
  37. package/dist/lib/plugins/loaders/hmr-accept.d.ts +9 -0
  38. package/dist/lib/plugins/loaders/hmr-accept.d.ts.map +1 -0
  39. package/dist/lib/plugins/loaders/hmr-accept.js +183 -0
  40. package/dist/lib/plugins/ng-rspack.d.ts.map +1 -1
  41. package/dist/lib/plugins/ng-rspack.js +35 -15
  42. package/dist/lib/plugins/prerender-plugin.d.ts.map +1 -1
  43. package/dist/lib/plugins/prerender-plugin.js +75 -10
  44. package/dist/lib/plugins/progress-plugin.d.ts +12 -0
  45. package/dist/lib/plugins/progress-plugin.d.ts.map +1 -0
  46. package/dist/lib/plugins/progress-plugin.js +36 -0
  47. package/dist/lib/plugins/stats-json-plugin.d.ts +14 -0
  48. package/dist/lib/plugins/stats-json-plugin.d.ts.map +1 -0
  49. package/dist/lib/plugins/stats-json-plugin.js +70 -0
  50. package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.d.ts +5 -0
  51. package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.d.ts.map +1 -0
  52. package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.js +34 -0
  53. package/dist/lib/plugins/tools/dev-tools-ignore-plugin.d.ts.map +1 -1
  54. package/dist/lib/plugins/tools/dev-tools-ignore-plugin.js +1 -1
  55. package/dist/lib/plugins/transfer-size-plugin.d.ts +12 -0
  56. package/dist/lib/plugins/transfer-size-plugin.d.ts.map +1 -0
  57. package/dist/lib/plugins/transfer-size-plugin.js +49 -0
  58. package/dist/lib/plugins/watch-file-logs-plugin.d.ts +12 -0
  59. package/dist/lib/plugins/watch-file-logs-plugin.d.ts.map +1 -0
  60. package/dist/lib/plugins/watch-file-logs-plugin.js +27 -0
  61. package/dist/lib/utils/async-chunks.d.ts +17 -0
  62. package/dist/lib/utils/async-chunks.d.ts.map +1 -0
  63. package/dist/lib/utils/async-chunks.js +44 -0
  64. package/dist/lib/utils/color.d.ts +11 -0
  65. package/dist/lib/utils/color.d.ts.map +1 -0
  66. package/dist/lib/utils/color.js +41 -0
  67. package/dist/lib/utils/index-file/get-index-input-file.d.ts +3 -0
  68. package/dist/lib/utils/index-file/get-index-input-file.d.ts.map +1 -0
  69. package/dist/lib/utils/index-file/get-index-input-file.js +9 -0
  70. package/dist/lib/utils/misc-helpers.d.ts +1 -0
  71. package/dist/lib/utils/misc-helpers.d.ts.map +1 -1
  72. package/dist/lib/utils/misc-helpers.js +4 -0
  73. package/dist/lib/utils/rspack-diagnostics.d.ts +3 -3
  74. package/dist/lib/utils/rspack-diagnostics.d.ts.map +1 -1
  75. package/dist/lib/utils/rspack-diagnostics.js +16 -4
  76. package/dist/lib/utils/spinner.d.ts +21 -0
  77. package/dist/lib/utils/spinner.d.ts.map +1 -0
  78. package/dist/lib/utils/spinner.js +53 -0
  79. package/dist/lib/utils/stats.d.ts +35 -0
  80. package/dist/lib/utils/stats.d.ts.map +1 -0
  81. package/dist/lib/utils/stats.js +312 -0
  82. package/dist/lib/utils/tty.d.ts +9 -0
  83. package/dist/lib/utils/tty.d.ts.map +1 -0
  84. package/dist/lib/utils/tty.js +22 -0
  85. package/package.json +6 -2
  86. package/dist/lib/models/unsupported-options.d.ts +0 -39
  87. package/dist/lib/models/unsupported-options.d.ts.map +0 -1
  88. package/dist/lib/models/unsupported-options.js +0 -22
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import type { Compiler, RspackPluginInstance } from '@rspack/core';
9
+ export declare class WatchFilesLogsPlugin implements RspackPluginInstance {
10
+ apply(compiler: Compiler): void;
11
+ }
12
+ //# sourceMappingURL=watch-file-logs-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-file-logs-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/watch-file-logs-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAInE,qBAAa,oBAAqB,YAAW,oBAAoB;IAC/D,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAiBzB"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.WatchFilesLogsPlugin = void 0;
11
+ const PLUGIN_NAME = 'AngularRspackWatchFilesLogsPlugin';
12
+ class WatchFilesLogsPlugin {
13
+ apply(compiler) {
14
+ compiler.hooks.watchRun.tap(PLUGIN_NAME, ({ modifiedFiles, removedFiles }) => {
15
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
16
+ const logger = compilation.getLogger(PLUGIN_NAME);
17
+ if (modifiedFiles?.size) {
18
+ logger.log(`Modified files:\n${[...modifiedFiles].join('\n')}\n`);
19
+ }
20
+ if (removedFiles?.size) {
21
+ logger.log(`Removed files:\n${[...removedFiles].join('\n')}\n`);
22
+ }
23
+ });
24
+ });
25
+ }
26
+ }
27
+ exports.WatchFilesLogsPlugin = WatchFilesLogsPlugin;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { StatsChunk, StatsCompilation } from '@rspack/core';
9
+ import { NormalizedEntryPoint } from '../models/angular-rspack-plugin-options';
10
+ /**
11
+ * Webpack stats may incorrectly mark extra entry points `initial` chunks, when
12
+ * they are actually loaded asynchronously and thus not in the main bundle. This
13
+ * function finds extra entry points in Webpack stats and corrects this value
14
+ * whereever necessary. Does not modify {@param webpackStats}.
15
+ */
16
+ export declare function markAsyncChunksNonInitial(webpackStats: StatsCompilation, extraEntryPoints: NormalizedEntryPoint[]): StatsChunk[];
17
+ //# sourceMappingURL=async-chunks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-chunks.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/async-chunks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,gBAAgB,EAC9B,gBAAgB,EAAE,oBAAoB,EAAE,GACvC,UAAU,EAAE,CAqCd"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.markAsyncChunksNonInitial = markAsyncChunksNonInitial;
11
+ /**
12
+ * Webpack stats may incorrectly mark extra entry points `initial` chunks, when
13
+ * they are actually loaded asynchronously and thus not in the main bundle. This
14
+ * function finds extra entry points in Webpack stats and corrects this value
15
+ * whereever necessary. Does not modify {@param webpackStats}.
16
+ */
17
+ function markAsyncChunksNonInitial(webpackStats, extraEntryPoints) {
18
+ const { chunks = [], entrypoints: entryPoints = {} } = webpackStats;
19
+ // Find all Webpack chunk IDs not injected into the main bundle. We don't have
20
+ // to worry about transitive dependencies because extra entry points cannot be
21
+ // depended upon in Webpack, thus any extra entry point with `inject: false`,
22
+ // **cannot** be loaded in main bundle.
23
+ const asyncChunkIds = extraEntryPoints
24
+ .filter((entryPoint) => !entryPoint.inject && entryPoints[entryPoint.bundleName])
25
+ .flatMap((entryPoint) => entryPoints[entryPoint.bundleName].chunks?.filter((n) => n !== 'runtime'));
26
+ // Find chunks for each ID.
27
+ const asyncChunks = asyncChunkIds.map((chunkId) => {
28
+ const chunk = chunks.find((chunk) => chunk.id === chunkId);
29
+ if (!chunk) {
30
+ throw new Error(`Failed to find chunk (${chunkId}) in set:\n${JSON.stringify(chunks)}`);
31
+ }
32
+ return chunk;
33
+ });
34
+ // A chunk is considered `initial` only if Webpack already belives it to be initial
35
+ // and the application developer did not mark it async via an extra entry point.
36
+ return chunks.map((chunk) => {
37
+ return asyncChunks.find((asyncChunk) => asyncChunk === chunk)
38
+ ? {
39
+ ...chunk,
40
+ initial: false,
41
+ }
42
+ : chunk;
43
+ });
44
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import * as ansiColors from 'ansi-colors';
9
+ declare const colors: typeof ansiColors;
10
+ export { colors };
11
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/color.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AA+B1C,QAAA,MAAM,MAAM,mBAAsB,CAAC;AAGnC,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.colors = void 0;
11
+ const tslib_1 = require("tslib");
12
+ const ansiColors = tslib_1.__importStar(require("ansi-colors"));
13
+ const node_tty_1 = require("node:tty");
14
+ function supportColor() {
15
+ if (process.env.FORCE_COLOR !== undefined) {
16
+ // 2 colors: FORCE_COLOR = 0 (Disables colors), depth 1
17
+ // 16 colors: FORCE_COLOR = 1, depth 4
18
+ // 256 colors: FORCE_COLOR = 2, depth 8
19
+ // 16,777,216 colors: FORCE_COLOR = 3, depth 16
20
+ // See: https://nodejs.org/dist/latest-v12.x/docs/api/tty.html#tty_writestream_getcolordepth_env
21
+ // and https://github.com/nodejs/node/blob/b9f36062d7b5c5039498e98d2f2c180dca2a7065/lib/internal/tty.js#L106;
22
+ switch (process.env.FORCE_COLOR) {
23
+ case '':
24
+ case 'true':
25
+ case '1':
26
+ case '2':
27
+ case '3':
28
+ return true;
29
+ default:
30
+ return false;
31
+ }
32
+ }
33
+ if (process.stdout instanceof node_tty_1.WriteStream) {
34
+ return process.stdout.hasColors();
35
+ }
36
+ return false;
37
+ }
38
+ // Create a separate instance to prevent unintended global changes to the color configuration
39
+ const colors = ansiColors.create();
40
+ exports.colors = colors;
41
+ colors.enabled = supportColor();
@@ -0,0 +1,3 @@
1
+ import type { IndexExpandedDefinition } from '../../models';
2
+ export declare function getIndexInputFile(index: IndexExpandedDefinition): string;
3
+ //# sourceMappingURL=get-index-input-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-index-input-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/index-file/get-index-input-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAMxE"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIndexInputFile = getIndexInputFile;
4
+ function getIndexInputFile(index) {
5
+ if (typeof index === 'string') {
6
+ return index;
7
+ }
8
+ return index.input;
9
+ }
@@ -3,4 +3,5 @@ export declare function assertIsError(value: unknown): asserts value is Error &
3
3
  code?: string;
4
4
  };
5
5
  export declare function isPackageInstalled(root: string, name: string): boolean;
6
+ export declare function assertNever(input: never): never;
6
7
  //# sourceMappingURL=misc-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc-helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/misc-helpers.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAOrE;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAS5C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQtE"}
1
+ {"version":3,"file":"misc-helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/misc-helpers.ts"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAOrE;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAS5C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQtE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAQ/C"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadEsmModule = loadEsmModule;
4
4
  exports.assertIsError = assertIsError;
5
5
  exports.isPackageInstalled = isPackageInstalled;
6
+ exports.assertNever = assertNever;
6
7
  const tslib_1 = require("tslib");
7
8
  const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
8
9
  let load;
@@ -28,3 +29,6 @@ function isPackageInstalled(root, name) {
28
29
  return false;
29
30
  }
30
31
  }
32
+ function assertNever(input) {
33
+ throw new Error(`Unexpected call to assertNever() with input: ${JSON.stringify(input, null /* replacer */, 4 /* tabSize */)}`);
34
+ }
@@ -1,4 +1,4 @@
1
- import type { Compilation } from '@rspack/core';
2
- export declare function addError(compilation: Compilation, message: string): void;
3
- export declare function addWarning(compilation: Compilation, message: string): void;
1
+ import type { Compilation, RspackError } from '@rspack/core';
2
+ export declare function addError(compilation: Compilation, messageOrError: RspackError | string): void;
3
+ export declare function addWarning(compilation: Compilation, messageOrError: RspackError | string): void;
4
4
  //# sourceMappingURL=rspack-diagnostics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rspack-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/rspack-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIxE;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI1E"}
1
+ {"version":3,"file":"rspack-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/rspack-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7D,wBAAgB,QAAQ,CACtB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,WAAW,GAAG,MAAM,GACnC,IAAI,CAUN;AAED,wBAAgB,UAAU,CACxB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,WAAW,GAAG,MAAM,GACnC,IAAI,CAUN"}
@@ -2,9 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addError = addError;
4
4
  exports.addWarning = addWarning;
5
- function addError(compilation, message) {
6
- compilation.errors.push(new compilation.compiler.rspack.WebpackError(message));
5
+ function addError(compilation, messageOrError) {
6
+ const error = new compilation.compiler.rspack.WebpackError(typeof messageOrError === 'string' ? messageOrError : messageOrError.message);
7
+ if (typeof messageOrError !== 'string') {
8
+ if (messageOrError.hideStack) {
9
+ error.hideStack = true;
10
+ }
11
+ }
12
+ compilation.errors.push(error);
7
13
  }
8
- function addWarning(compilation, message) {
9
- compilation.warnings.push(new compilation.compiler.rspack.WebpackError(message));
14
+ function addWarning(compilation, messageOrError) {
15
+ const warning = new compilation.compiler.rspack.WebpackError(typeof messageOrError === 'string' ? messageOrError : messageOrError.message);
16
+ if (typeof messageOrError !== 'string') {
17
+ if (messageOrError.hideStack) {
18
+ warning.hideStack = true;
19
+ }
20
+ }
21
+ compilation.warnings.push(warning);
10
22
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ export declare class Spinner {
9
+ #private;
10
+ private readonly spinner;
11
+ /** When false, only fail messages will be displayed. */
12
+ enabled: boolean;
13
+ constructor(text?: string);
14
+ set text(text: string);
15
+ get isSpinning(): boolean;
16
+ succeed(text?: string): void;
17
+ fail(text?: string): void;
18
+ stop(): void;
19
+ start(text?: string): void;
20
+ }
21
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/spinner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,qBAAa,OAAO;;IAClB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,wDAAwD;IACxD,OAAO,UAAQ;gBAGH,IAAI,CAAC,EAAE,MAAM;IAWzB,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAEpB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAM5B,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAIzB,IAAI,IAAI,IAAI;IAIZ,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;CAK3B"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Spinner = void 0;
11
+ const tslib_1 = require("tslib");
12
+ const ora_1 = tslib_1.__importDefault(require("ora"));
13
+ const color_1 = require("./color");
14
+ const tty_1 = require("./tty");
15
+ class Spinner {
16
+ spinner;
17
+ /** When false, only fail messages will be displayed. */
18
+ enabled = true;
19
+ #isTTY = (0, tty_1.isTTY)();
20
+ constructor(text) {
21
+ this.spinner = (0, ora_1.default)({
22
+ text: text === undefined ? undefined : text + '\n',
23
+ // The below 2 options are needed because otherwise CTRL+C will be delayed
24
+ // when the underlying process is sync.
25
+ hideCursor: false,
26
+ discardStdin: false,
27
+ isEnabled: this.#isTTY,
28
+ });
29
+ }
30
+ set text(text) {
31
+ this.spinner.text = text;
32
+ }
33
+ get isSpinning() {
34
+ return this.spinner.isSpinning || !this.#isTTY;
35
+ }
36
+ succeed(text) {
37
+ if (this.enabled) {
38
+ this.spinner.succeed(text);
39
+ }
40
+ }
41
+ fail(text) {
42
+ this.spinner.fail(text && color_1.colors.redBright(text));
43
+ }
44
+ stop() {
45
+ this.spinner.stop();
46
+ }
47
+ start(text) {
48
+ if (this.enabled) {
49
+ this.spinner.start(text);
50
+ }
51
+ }
52
+ }
53
+ exports.Spinner = Spinner;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { BudgetCalculatorResult } from '@angular/build/private';
9
+ import { Configuration, StatsCompilation, Stats, StatsOptions } from '@rspack/core';
10
+ import { NormalizedAngularRspackPluginOptions, NormalizedEntryPoint, ScriptOrStyleEntry } from '../models/angular-rspack-plugin-options';
11
+ export interface RspackLoggingCallback {
12
+ (stats: Stats, config: Configuration): void;
13
+ }
14
+ export type RspackStatsOptions = Exclude<Configuration['stats'], string | boolean | undefined>;
15
+ export declare function normalizeExtraEntryPoints(extraEntryPoints: ScriptOrStyleEntry[], defaultBundleName: string): NormalizedEntryPoint[];
16
+ export declare function statsWarningsToString(json: StatsCompilation, statsConfig: RspackStatsOptions): string;
17
+ export declare function statsErrorsToString(json: StatsCompilation, statsConfig: RspackStatsOptions): string;
18
+ export declare function statsHasErrors(json: StatsCompilation): boolean;
19
+ export declare function statsHasWarnings(json: StatsCompilation): boolean;
20
+ export declare function createRspackLoggingCallback(options: NormalizedAngularRspackPluginOptions): (stats: any, config: any) => void;
21
+ export interface BuildEventStats {
22
+ aot: boolean;
23
+ optimization: boolean;
24
+ allChunksCount: number;
25
+ lazyChunksCount: number;
26
+ initialChunksCount: number;
27
+ changedChunksCount?: number;
28
+ durationInMs: number;
29
+ cssSizeInBytes: number;
30
+ jsSizeInBytes: number;
31
+ ngComponentCount: number;
32
+ }
33
+ export declare function generateBuildEventStats(rspackStats: StatsCompilation, options: NormalizedAngularRspackPluginOptions): BuildEventStats;
34
+ export declare function rspackStatsLogger(stats: Stats, statOptions: StatsOptions, budgetFailures?: BudgetCalculatorResult[]): void;
35
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,sBAAsB,EAGvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oCAAoC,EACpC,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,yCAAyC,CAAC;AAMjD,MAAM,WAAW,qBAAqB;IACpC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,aAAa,CAAC,OAAO,CAAC,EACtB,MAAM,GAAG,OAAO,GAAG,SAAS,CAC7B,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,kBAAkB,EAAE,EACtC,iBAAiB,EAAE,MAAM,GACxB,oBAAoB,EAAE,CAmBxB;AA+HD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,kBAAkB,GAC9B,MAAM,CAsDR;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,kBAAkB,GAC9B,MAAM,CA4DR;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAI9D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAIhE;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,oCAAoC,qCAsB9C;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,OAAO,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,oCAAoC,GAC5C,eAAe,CAoDjB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,YAAY,EACzB,cAAc,CAAC,EAAE,sBAAsB,EAAE,GACxC,IAAI,CAgBN"}