@nx/angular-rspack 23.0.0-pr.35413.460eeef → 23.0.0-rc.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 (29) hide show
  1. package/dist/lib/config/config-utils/dev-server-config-utils.js +1 -1
  2. package/dist/lib/config/config-utils/style-config-utils.js +1 -1
  3. package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts +3 -3
  4. package/dist/lib/config/create-config.d.ts.map +1 -1
  5. package/dist/lib/config/create-config.js +2 -0
  6. package/dist/lib/plugins/angular-rspack-plugin.d.ts.map +1 -1
  7. package/dist/lib/plugins/angular-rspack-plugin.js +19 -0
  8. package/dist/lib/plugins/client/ssr-reload-client.d.ts +1 -1
  9. package/dist/lib/plugins/client/ssr-reload-client.d.ts.map +1 -1
  10. package/dist/lib/plugins/client/ssr-reload-client.js +2 -0
  11. package/dist/lib/plugins/i18n-inline-plugin.d.ts.map +1 -1
  12. package/dist/lib/plugins/i18n-inline-plugin.js +6 -5
  13. package/dist/lib/plugins/stats-json-plugin.js +1 -34
  14. package/dist/lib/plugins/tools/render-worker.d.ts.map +1 -1
  15. package/dist/lib/plugins/tools/render-worker.js +5 -3
  16. package/dist/lib/plugins/tools/routes-extractor-worker.d.ts.map +1 -1
  17. package/dist/lib/plugins/tools/routes-extractor-worker.js +4 -2
  18. package/dist/lib/utils/assert-supported-rspack-version.d.ts +2 -0
  19. package/dist/lib/utils/assert-supported-rspack-version.d.ts.map +1 -0
  20. package/dist/lib/utils/assert-supported-rspack-version.js +8 -0
  21. package/dist/lib/utils/misc-helpers.d.ts.map +1 -1
  22. package/dist/lib/utils/misc-helpers.js +18 -0
  23. package/dist/lib/utils/rspack-diagnostics.d.ts +3 -1
  24. package/dist/lib/utils/rspack-diagnostics.d.ts.map +1 -1
  25. package/dist/lib/utils/versions.d.ts +2 -0
  26. package/dist/lib/utils/versions.d.ts.map +1 -0
  27. package/dist/lib/utils/versions.js +4 -0
  28. package/package.json +21 -30
  29. package/eslint.config.mjs +0 -67
@@ -148,7 +148,7 @@ async function getProxyConfig(root, proxyConfig) {
148
148
  switch ((0, node_path_1.extname)(proxyPath)) {
149
149
  case '.json': {
150
150
  const content = await node_fs_1.promises.readFile(proxyPath, 'utf-8');
151
- const { parse, printParseErrorCode } = await Promise.resolve().then(() => tslib_1.__importStar(require('jsonc-parser')));
151
+ const { parse, printParseErrorCode } = await import('jsonc-parser');
152
152
  const parseErrors = [];
153
153
  proxyConfiguration = parse(content, parseErrors, {
154
154
  allowTrailingComma: true,
@@ -46,7 +46,7 @@ async function getStylesConfig(buildOptions, hashFormat, platform) {
46
46
  else {
47
47
  const tailwindConfig = await getTailwindConfig(searchDirectories, devkit_1.workspaceRoot);
48
48
  if (tailwindConfig) {
49
- const tailwind = await Promise.resolve(`${tailwindConfig.package}`).then(s => tslib_1.__importStar(require(s)));
49
+ const tailwind = await import(tailwindConfig.package);
50
50
  extraPostcssPlugins.push(tailwind.default({ config: tailwindConfig.file }));
51
51
  }
52
52
  }
@@ -25,9 +25,9 @@ export declare function handleConfigurations(defaultOptions: {
25
25
  devServer?: import("../../models").DevServerOptions;
26
26
  externalDependencies?: string[];
27
27
  extractLicenses?: boolean;
28
- fileReplacements?: import("@nx/angular-rspack-compiler").FileReplacement[];
28
+ fileReplacements?: import("packages/angular-rspack-compiler/dist").FileReplacement[];
29
29
  index?: import("../../models").IndexElement;
30
- inlineStyleLanguage?: import("@nx/angular-rspack-compiler").InlineStyleLanguage;
30
+ inlineStyleLanguage?: import("packages/angular-rspack-compiler/dist").InlineStyleLanguage;
31
31
  i18nMetadata?: import("../../models").I18nProjectMetadata;
32
32
  i18nMissingTranslation?: "warning" | "error" | "ignore";
33
33
  i18nDuplicateTranslation?: "warning" | "error" | "ignore";
@@ -57,7 +57,7 @@ export declare function handleConfigurations(defaultOptions: {
57
57
  experimentalPlatform?: "node" | "neutral";
58
58
  };
59
59
  statsJson?: boolean;
60
- stylePreprocessorOptions?: import("@nx/angular-rspack-compiler").StylePreprocessorOptions;
60
+ stylePreprocessorOptions?: import("packages/angular-rspack-compiler/dist").StylePreprocessorOptions;
61
61
  styles?: import("../../models").ScriptOrStyleEntry[];
62
62
  subresourceIntegrity?: boolean;
63
63
  tsConfig?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-config.d.ts","sourceRoot":"","sources":["../../../src/lib/config/create-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAc5D,wBAAsB,YAAY,CAChC,cAAc,EAAE;IACd,OAAO,EAAE,0BAA0B,CAAC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAChD,EACD,cAAc,GAAE,MAAM,CACpB,MAAM,EACN;IACE,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAChD,CACG,EACN,YAAY,SAAgB,GAC3B,OAAO,CAAC,aAAa,EAAE,CAAC,CAa1B;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,0BAA0B,EACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC7C,OAAO,CAAC,aAAa,EAAE,CAAC,CAuC1B"}
1
+ {"version":3,"file":"create-config.d.ts","sourceRoot":"","sources":["../../../src/lib/config/create-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAe5D,wBAAsB,YAAY,CAChC,cAAc,EAAE;IACd,OAAO,EAAE,0BAA0B,CAAC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAChD,EACD,cAAc,GAAE,MAAM,CACpB,MAAM,EACN;IACE,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAChD,CACG,EACN,YAAY,SAAgB,GAC3B,OAAO,CAAC,aAAa,EAAE,CAAC,CAa1B;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,0BAA0B,EACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC7C,OAAO,CAAC,aAAa,EAAE,CAAC,CAyC1B"}
@@ -8,6 +8,7 @@ const common_config_1 = require("./config-utils/common-config");
8
8
  const server_config_1 = require("./config-utils/server-config");
9
9
  const browser_config_1 = require("./config-utils/browser-config");
10
10
  const user_defined_config_helpers_1 = require("./config-utils/user-defined-config-helpers");
11
+ const assert_supported_rspack_version_1 = require("../utils/assert-supported-rspack-version");
11
12
  async function createConfig(defaultOptions, configurations = {}, configEnvVar = 'NGRS_CONFIG') {
12
13
  const configurationMode = process.env[configEnvVar] ??
13
14
  (process.env['WEBPACK_SERVE'] ? 'development' : 'production');
@@ -16,6 +17,7 @@ async function createConfig(defaultOptions, configurations = {}, configEnvVar =
16
17
  return _createConfig(mergedConfigurationBuildOptions, mergedRspackConfigOverrides);
17
18
  }
18
19
  async function _createConfig(options, rspackConfigOverrides) {
20
+ (0, assert_supported_rspack_version_1.assertSupportedRspackCoreVersion)();
19
21
  const { i18n, i18nHash, normalizedOptions } = await (0, helpers_1.normalizeOptionWithI18n)(options);
20
22
  const hashFormat = (0, helpers_1.getOutputHashFormat)(normalizedOptions.outputHashing);
21
23
  if (normalizedOptions.deleteOutputPath) {
@@ -1 +1 @@
1
- {"version":3,"file":"angular-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/angular-rspack-plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oCAAoC,EAC1C,MAAM,WAAW,CAAC;AAUnB,qBAAa,mBAAoB,YAAW,oBAAoB;;gBAU5D,OAAO,EAAE,oCAAoC,EAC7C,WAAW,CAAC,EAAE,WAAW;IAuB3B,KAAK,CAAC,QAAQ,EAAE,QAAQ;YAiVV,gBAAgB;CAkC/B"}
1
+ {"version":3,"file":"angular-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/angular-rspack-plugin.ts"],"names":[],"mappings":"AAiBA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oCAAoC,EAC1C,MAAM,WAAW,CAAC;AAUnB,qBAAa,mBAAoB,YAAW,oBAAoB;;gBAU5D,OAAO,EAAE,oCAAoC,EAC7C,WAAW,CAAC,EAAE,WAAW;IAuB3B,KAAK,CAAC,QAAQ,EAAE,QAAQ;YAuWV,gBAAgB;CAkC/B"}
@@ -233,6 +233,25 @@ class AngularRspackPlugin {
233
233
  process.exit(1);
234
234
  }
235
235
  });
236
+ // Dispose the shared component stylesheet bundler after a one-shot build so
237
+ // its esbuild service (a child process and sockets, with @angular/build >=
238
+ // 21.2.14) is released and `rspack build` can exit. Safe per-compiler: an
239
+ // SSR build runs the server compiler after the browser one
240
+ // (`dependencies: ['browser']`), never concurrently, and `setupCompilation`
241
+ // lazily recreates the singleton if a later compiler needs it again. Watch
242
+ // builds keep the bundler for incremental rebuilds and tear it down on
243
+ // process shutdown instead.
244
+ compiler.hooks.done.tapAsync(`${PLUGIN_NAME}_cleanup`, async (_stats, callback) => {
245
+ if (!watchRunInitialized) {
246
+ try {
247
+ await (0, angular_rspack_compiler_1.disposeComponentStylesheetBundler)();
248
+ }
249
+ catch {
250
+ // Best-effort cleanup - never fail an otherwise successful build.
251
+ }
252
+ }
253
+ callback();
254
+ });
236
255
  compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, (normalModuleFactory) => {
237
256
  normalModuleFactory.hooks.beforeResolve.tap(PLUGIN_NAME, (data) => {
238
257
  if (data.request.startsWith('angular:jit:')) {
@@ -1,2 +1,2 @@
1
- declare const socket: WebSocket;
1
+ export {};
2
2
  //# sourceMappingURL=ssr-reload-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-reload-client.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/client/ssr-reload-client.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,EAAE,SAAiD,CAAC"}
1
+ {"version":3,"file":"ssr-reload-client.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/client/ssr-reload-client.ts"],"names":[],"mappings":""}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  // casting is needed to force the type to be the global WebSocket and avoid type errors
2
4
  const socket = new WebSocket(`ws://localhost:60000`);
3
5
  socket.addEventListener('message', (event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-inline-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/i18n-inline-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,WAAW,EACX,oCAAoC,EACrC,MAAM,WAAW,CAAC;AAWnB,qBAAa,gBAAiB,YAAW,oBAAoB;;gBAWzD,aAAa,EAAE,oCAAoC,EACnD,WAAW,EAAE,WAAW;IAO1B,KAAK,CAAC,QAAQ,EAAE,QAAQ;CA2OzB"}
1
+ {"version":3,"file":"i18n-inline-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/i18n-inline-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,WAAW,EACX,oCAAoC,EACrC,MAAM,WAAW,CAAC;AAWnB,qBAAa,gBAAiB,YAAW,oBAAoB;;gBAWzD,aAAa,EAAE,oCAAoC,EACnD,WAAW,EAAE,WAAW;IAO1B,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAuPzB"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var _I18nInlinePlugin_instances, _I18nInlinePlugin_pluginOptions, _I18nInlinePlugin_i18n, _I18nInlinePlugin_localizeToolsModule, _I18nInlinePlugin_outputPaths, _I18nInlinePlugin_checkAssetHasBeenProcessed, _I18nInlinePlugin_loadLocalizeTools, _I18nInlinePlugin_createI18nPlugins, _I18nInlinePlugin_assertIsError, _I18nInlinePlugin_transformWithBabel;
2
+ var _I18nInlinePlugin_instances, _I18nInlinePlugin_pluginOptions, _I18nInlinePlugin_i18n, _I18nInlinePlugin_localizeToolsModule, _I18nInlinePlugin_outputPaths, _I18nInlinePlugin_shouldSkipPerLocaleEmit, _I18nInlinePlugin_loadLocalizeTools, _I18nInlinePlugin_createI18nPlugins, _I18nInlinePlugin_assertIsError, _I18nInlinePlugin_transformWithBabel;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.I18nInlinePlugin = void 0;
5
5
  const tslib_1 = require("tslib");
@@ -47,7 +47,7 @@ class I18nInlinePlugin {
47
47
  const locale = tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_i18n, "f").locales[localeKey];
48
48
  const localeFiles = new Map();
49
49
  for (const [filename, { text, map }] of filesToInline.entries()) {
50
- if (tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_instances, "m", _I18nInlinePlugin_checkAssetHasBeenProcessed).call(this, filename)) {
50
+ if (tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_instances, "m", _I18nInlinePlugin_shouldSkipPerLocaleEmit).call(this, filename)) {
51
51
  continue;
52
52
  }
53
53
  const result = await tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_instances, "m", _I18nInlinePlugin_transformWithBabel).call(this, text, map, filename, localeKey, locale.translation, tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_pluginOptions, "f").advancedOptimizations);
@@ -61,7 +61,7 @@ class I18nInlinePlugin {
61
61
  // TODO: Add support for diagnostics
62
62
  }
63
63
  for (const [filename, source] of additionalFiles.entries()) {
64
- if (tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_instances, "m", _I18nInlinePlugin_checkAssetHasBeenProcessed).call(this, filename)) {
64
+ if (tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_instances, "m", _I18nInlinePlugin_shouldSkipPerLocaleEmit).call(this, filename)) {
65
65
  continue;
66
66
  }
67
67
  localeFiles.set(filename, {
@@ -90,8 +90,9 @@ class I18nInlinePlugin {
90
90
  }
91
91
  }
92
92
  exports.I18nInlinePlugin = I18nInlinePlugin;
93
- _I18nInlinePlugin_pluginOptions = new WeakMap(), _I18nInlinePlugin_i18n = new WeakMap(), _I18nInlinePlugin_localizeToolsModule = new WeakMap(), _I18nInlinePlugin_outputPaths = new WeakMap(), _I18nInlinePlugin_instances = new WeakSet(), _I18nInlinePlugin_checkAssetHasBeenProcessed = function _I18nInlinePlugin_checkAssetHasBeenProcessed(filename) {
94
- return tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_outputPaths, "f").has(filename.split('/')[0]);
93
+ _I18nInlinePlugin_pluginOptions = new WeakMap(), _I18nInlinePlugin_i18n = new WeakMap(), _I18nInlinePlugin_localizeToolsModule = new WeakMap(), _I18nInlinePlugin_outputPaths = new WeakMap(), _I18nInlinePlugin_instances = new WeakSet(), _I18nInlinePlugin_shouldSkipPerLocaleEmit = function _I18nInlinePlugin_shouldSkipPerLocaleEmit(filename) {
94
+ const segments = filename.split('/');
95
+ return tslib_1.__classPrivateFieldGet(this, _I18nInlinePlugin_outputPaths, "f").has(segments[0]) || segments.includes('..');
95
96
  }, _I18nInlinePlugin_loadLocalizeTools =
96
97
  /**
97
98
  * Attempts to load the `@angular/localize/tools` module containing the functionality to
@@ -6,39 +6,6 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
9
  Object.defineProperty(exports, "__esModule", { value: true });
43
10
  exports.StatsJsonPlugin = void 0;
44
11
  const node_fs_1 = require("node:fs");
@@ -53,7 +20,7 @@ class StatsJsonPlugin {
53
20
  }
54
21
  apply(compiler) {
55
22
  compiler.hooks.done.tapPromise('AngularRspackStatsJsonPlugin', async (stats) => {
56
- const { stringifyChunked } = await Promise.resolve().then(() => __importStar(require('@discoveryjs/json-ext')));
23
+ const { stringifyChunked } = await import('@discoveryjs/json-ext');
57
24
  const data = stats.toJson('verbose');
58
25
  try {
59
26
  await (0, promises_1.mkdir)((0, node_path_1.dirname)(this.statsOutputPath), { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"render-worker.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/render-worker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AA2BD;;GAEG;AACH,iBAAe,MAAM,CAAC,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,KAAK,EACL,iBAAiB,GAClB,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAmGvC;AAuBD;;;GAGG;;AACH,wBAA4B"}
1
+ {"version":3,"file":"render-worker.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/render-worker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AA2BD;;GAEG;AACH,iBAAe,MAAM,CAAC,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,KAAK,EACL,iBAAiB,GAClB,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAqGvC;AAuBD;;;GAGG;;AACH,wBAA4B"}
@@ -25,7 +25,9 @@ async function render({ indexFile, deployUrl, minifyCss, outputPath, serverBundl
25
25
  const browserIndexOutputPath = path.join(outputPath, indexFile);
26
26
  const outputFolderPath = path.join(outputPath, route);
27
27
  const outputIndexPath = path.join(outputFolderPath, 'index.html');
28
- const { ɵSERVER_CONTEXT, AppServerModule, renderModule, renderApplication, default: bootstrapAppFn, } = (await Promise.resolve(`${serverBundlePath}`).then(s => tslib_1.__importStar(require(s))));
28
+ // rspack emits a CommonJS server bundle; load with `require` so its named
29
+ // exports resolve (a nodenext `import()` would leave them undefined).
30
+ const { ɵSERVER_CONTEXT, AppServerModule, renderModule, renderApplication, default: bootstrapAppFn, } = require(serverBundlePath);
29
31
  (0, node_assert_1.default)(ɵSERVER_CONTEXT, `ɵSERVER_CONTEXT was not exported from: ${serverBundlePath}.`);
30
32
  const indexBaseName = fs.existsSync(path.join(outputPath, 'index.original.html'))
31
33
  ? 'index.original.html'
@@ -59,7 +61,7 @@ async function render({ indexFile, deployUrl, minifyCss, outputPath, serverBundl
59
61
  });
60
62
  }
61
63
  if (inlineCriticalCss) {
62
- const { InlineCriticalCssProcessor } = await Promise.resolve().then(() => tslib_1.__importStar(require('@angular/build/private')));
64
+ const { InlineCriticalCssProcessor } = await import('@angular/build/private');
63
65
  const inlineCriticalCssProcessor = new InlineCriticalCssProcessor({
64
66
  deployUrl: deployUrl,
65
67
  minify: minifyCss,
@@ -93,7 +95,7 @@ function isBootstrapFn(value) {
93
95
  async function initialize() {
94
96
  // Setup Zone.js
95
97
  if (zonePackage) {
96
- await Promise.resolve(`${zonePackage}`).then(s => tslib_1.__importStar(require(s)));
98
+ await import(zonePackage);
97
99
  }
98
100
  // Return the render function for use
99
101
  return render;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-extractor-worker.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/routes-extractor-worker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAgBD,iBAAe,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CA8B1C;AAiBD;;;GAGG;;AACH,wBAA4B"}
1
+ {"version":3,"file":"routes-extractor-worker.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/routes-extractor-worker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAgBD,iBAAe,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAgC1C;AAiBD;;;GAGG;;AACH,wBAA4B"}
@@ -14,7 +14,9 @@ const path = tslib_1.__importStar(require("node:path"));
14
14
  const node_worker_threads_1 = require("node:worker_threads");
15
15
  const { zonePackage, serverBundlePath, outputPath, indexFile } = node_worker_threads_1.workerData;
16
16
  async function extract() {
17
- const { AppServerModule, ɵgetRoutesFromAngularRouterConfig: getRoutesFromAngularRouterConfig, default: bootstrapAppFn, } = (await Promise.resolve(`${serverBundlePath}`).then(s => tslib_1.__importStar(require(s))));
17
+ // rspack emits a CommonJS server bundle; load with `require` so its named
18
+ // exports resolve (a nodenext `import()` would leave them undefined).
19
+ const { AppServerModule, ɵgetRoutesFromAngularRouterConfig: getRoutesFromAngularRouterConfig, default: bootstrapAppFn, } = require(serverBundlePath);
18
20
  const browserIndexInputPath = path.join(outputPath, indexFile);
19
21
  const document = await fs.promises.readFile(browserIndexInputPath, 'utf8');
20
22
  const bootstrapAppFnOrModule = bootstrapAppFn || AppServerModule;
@@ -37,7 +39,7 @@ async function extract() {
37
39
  async function initialize() {
38
40
  // Setup Zone.js
39
41
  if (zonePackage) {
40
- await Promise.resolve(`${zonePackage}`).then(s => tslib_1.__importStar(require(s)));
42
+ await import(zonePackage);
41
43
  }
42
44
  return extract;
43
45
  }
@@ -0,0 +1,2 @@
1
+ export declare function assertSupportedRspackCoreVersion(): void;
2
+ //# sourceMappingURL=assert-supported-rspack-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-supported-rspack-version.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/assert-supported-rspack-version.ts"],"names":[],"mappings":"AAGA,wBAAgB,gCAAgC,IAAI,IAAI,CAKvD"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertSupportedRspackCoreVersion = assertSupportedRspackCoreVersion;
4
+ const internal_1 = require("@nx/devkit/internal");
5
+ const versions_1 = require("./versions");
6
+ function assertSupportedRspackCoreVersion() {
7
+ (0, internal_1.assertSupportedInstalledPackageVersion)('@rspack/core', versions_1.minSupportedRspackCoreVersion);
8
+ }
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"misc-helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/misc-helpers.ts"],"names":[],"mappings":"AAMA,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBrE;AAYD,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"}
@@ -6,11 +6,29 @@ exports.isPackageInstalled = isPackageInstalled;
6
6
  exports.assertNever = assertNever;
7
7
  const tslib_1 = require("tslib");
8
8
  const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
9
+ const node_path_1 = require("node:path");
10
+ const node_url_1 = require("node:url");
9
11
  let load;
10
12
  function loadEsmModule(modulePath) {
11
13
  load ??= new Function('modulePath', `return import(modulePath);`);
14
+ // The dynamic import lives inside `new Function(...)` to stop TypeScript from
15
+ // downleveling it to require(). A side effect is that bare specifiers are
16
+ // resolved against the location of the Function rather than this module, so
17
+ // under Node >= 26's stricter ESM resolver they fail with ERR_MODULE_NOT_FOUND
18
+ // even for declared dependencies. Resolve bare specifiers here, where this
19
+ // package's dependencies are reachable, and hand off an absolute file URL.
20
+ if (typeof modulePath === 'string' && isBareSpecifier(modulePath)) {
21
+ modulePath = (0, node_url_1.pathToFileURL)(require.resolve(modulePath)).href;
22
+ }
12
23
  return load(modulePath);
13
24
  }
25
+ function isBareSpecifier(specifier) {
26
+ return (!specifier.startsWith('.') &&
27
+ !(0, node_path_1.isAbsolute)(specifier) &&
28
+ !specifier.includes('://') &&
29
+ !specifier.startsWith('node:') &&
30
+ !specifier.startsWith('data:'));
31
+ }
14
32
  function assertIsError(value) {
15
33
  const isError = value instanceof Error ||
16
34
  // The following is needed to identify errors coming from RxJs
@@ -1,4 +1,6 @@
1
- import type { Compilation, RspackError } from '@rspack/core';
1
+ import type { Compilation } from '@rspack/core';
2
+ type RspackError = Compilation['errors'][number];
2
3
  export declare function addError(compilation: Compilation, messageOrError: RspackError | string): void;
3
4
  export declare function addWarning(compilation: Compilation, messageOrError: RspackError | string): void;
5
+ export {};
4
6
  //# 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,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"}
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;AAKhD,KAAK,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,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"}
@@ -0,0 +1,2 @@
1
+ export declare const minSupportedRspackCoreVersion = "1.3.5";
2
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.minSupportedRspackCoreVersion = void 0;
4
+ exports.minSupportedRspackCoreVersion = '1.3.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular-rspack",
3
- "version": "23.0.0-pr.35413.460eeef",
3
+ "version": "23.0.0-rc.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -26,52 +26,60 @@
26
26
  "main": "./dist/lib/index.js",
27
27
  "types": "./dist/lib/index.d.ts",
28
28
  "typings": "./dist/lib/index.d.ts",
29
+ "files": [
30
+ "dist",
31
+ "!dist/tsconfig.lib.tsbuildinfo"
32
+ ],
29
33
  "exports": {
30
34
  ".": {
35
+ "@nx/nx-source": "./src/lib/index.ts",
31
36
  "types": "./dist/lib/index.d.ts",
32
37
  "default": "./dist/lib/index.js"
33
38
  },
34
39
  "./loaders/angular-partial-transform-loader": {
40
+ "@nx/nx-source": "./src/lib/plugins/loaders/angular-partial-transform.loader.ts",
35
41
  "types": "./dist/lib/plugins/loaders/angular-partial-transform.loader.d.ts",
36
42
  "default": "./dist/lib/plugins/loaders/angular-partial-transform.loader.js"
37
43
  },
38
44
  "./loaders/angular-loader": {
45
+ "@nx/nx-source": "./src/lib/plugins/loaders/angular-transform.loader.ts",
39
46
  "types": "./dist/lib/plugins/loaders/angular-transform.loader.d.ts",
40
47
  "default": "./dist/lib/plugins/loaders/angular-transform.loader.js"
41
48
  },
42
49
  "./loaders/platform-server-exports-loader": {
50
+ "@nx/nx-source": "./src/lib/plugins/loaders/platform-server-exports.loader.ts",
43
51
  "types": "./dist/lib/plugins/loaders/platform-server-exports.loader.d.ts",
44
52
  "default": "./dist/lib/plugins/loaders/platform-server-exports.loader.js"
45
53
  }
46
54
  },
47
55
  "dependencies": {
48
56
  "@ampproject/remapping": "2.3.0",
49
- "@babel/core": "7.28.3",
57
+ "@babel/core": "^7.23.2",
50
58
  "@discoveryjs/json-ext": "0.6.3",
51
- "@nx/angular-rspack-compiler": "23.0.0-pr.35413.460eeef",
52
- "@nx/devkit": "23.0.0-pr.35413.460eeef",
53
59
  "ansi-colors": "4.1.3",
54
- "autoprefixer": "10.4.21",
60
+ "autoprefixer": "^10.4.9",
55
61
  "deepmerge": "^4.3.1",
56
62
  "css-loader": "^7.1.2",
57
- "jsonc-parser": "^3.3.1",
63
+ "jsonc-parser": "^3.2.0",
58
64
  "less-loader": "^12.2.0",
59
65
  "license-webpack-plugin": "^4.0.2",
60
66
  "loader-utils": "3.3.1",
61
67
  "open": "10.1.0",
62
- "ora": "5.4.1",
68
+ "ora": "^5.3.0",
63
69
  "parse5-html-rewriting-stream": "7.0.0",
64
70
  "piscina": "5.0.0",
65
- "postcss": "8.5.3",
66
- "postcss-loader": "8.1.1",
71
+ "postcss": "^8.4.38",
72
+ "postcss-loader": "^8.1.1",
67
73
  "resolve-url-loader": "^5.0.0",
68
- "sass": "1.89.2",
69
- "sass-embedded": "^1.79.3",
70
- "sass-loader": "^16.0.2",
74
+ "sass": "^1.97.2",
75
+ "sass-embedded": "^1.97.2",
76
+ "sass-loader": "^16.0.7",
71
77
  "source-map-loader": "^5.0.0",
72
78
  "tslib": "^2.3.0",
73
79
  "webpack-merge": "^6.0.1",
74
- "ws": "^8.18.0"
80
+ "ws": "^8.18.0",
81
+ "@nx/angular-rspack-compiler": "23.0.0-rc.0",
82
+ "@nx/devkit": "23.0.0-rc.0"
75
83
  },
76
84
  "devDependencies": {
77
85
  "jsonc-eslint-parser": "^2.4.0"
@@ -103,14 +111,6 @@
103
111
  "name": "angular-rspack",
104
112
  "sourceRoot": "packages/angular-rspack/src",
105
113
  "projectType": "library",
106
- "release": {
107
- "version": {
108
- "preserveLocalDependencyProtocols": false,
109
- "manifestRootsToUpdate": [
110
- "packages/{projectName}"
111
- ]
112
- }
113
- },
114
114
  "targets": {
115
115
  "build": {
116
116
  "command": "node ./scripts/copy-readme.js angular-rspack packages/angular-rspack/readme-template.md packages/angular-rspack/README.md",
@@ -132,15 +132,6 @@
132
132
  "--passWithNoTests"
133
133
  ]
134
134
  }
135
- },
136
- "nx-release-publish": {
137
- "executor": "@nx/js:release-publish",
138
- "options": {
139
- "packageRoot": "packages/angular-rspack"
140
- },
141
- "dependsOn": [
142
- "^nx-release-publish"
143
- ]
144
135
  }
145
136
  }
146
137
  },
package/eslint.config.mjs DELETED
@@ -1,67 +0,0 @@
1
- import { baseConfig } from '../../eslint.config.mjs';
2
- import * as jsoncEslintParser from 'jsonc-eslint-parser';
3
-
4
- export default [
5
- ...baseConfig,
6
- {
7
- files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
8
- rules: {
9
- 'no-restricted-imports': [
10
- 'error',
11
- {
12
- name: 'chalk',
13
- message:
14
- 'Please use `picocolors` in place of `chalk` for rendering terminal colors',
15
- },
16
- ],
17
- },
18
- },
19
- {
20
- files: ['./package.json'],
21
- rules: {
22
- '@nx/nx-plugin-checks': 'error',
23
- '@nx/dependency-checks': [
24
- 'error',
25
- {
26
- buildTargets: ['build-base'],
27
- ignoredFiles: [
28
- '{projectRoot}/eslint.config.mjs',
29
- '{projectRoot}/vite.config.{js,ts,mjs,mts}',
30
- ],
31
- ignoredDependencies: [
32
- '@rspack/core',
33
- '@angular/core',
34
- 'jsonc-eslint-parser',
35
- 'vitest',
36
- 'memfs',
37
- 'sass',
38
- 'tailwindcss',
39
- '@babel/core',
40
- 'autoprefixer',
41
- 'css-loader',
42
- 'jsonc-parser',
43
- 'less-loader',
44
- 'loader-utils',
45
- 'open',
46
- 'ora',
47
- 'parse5-html-rewriting-stream',
48
- 'piscina',
49
- 'postcss',
50
- 'postcss-loader',
51
- 'rxjs',
52
- 'sass-loader',
53
- 'sass-embedded',
54
- 'webpack-merge',
55
- 'ws',
56
- ],
57
- },
58
- ],
59
- },
60
- languageOptions: {
61
- parser: jsoncEslintParser,
62
- },
63
- },
64
- {
65
- ignores: ['dist'],
66
- },
67
- ];