@nx/angular-rspack-compiler 23.0.0-pr.35465.2bc2643 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"augments.d.ts","sourceRoot":"","sources":["../../src/compilation/augments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,EAAE,CAAC,YAAY,EACrB,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,KACxB,MAAM,GAAG,IAAI,EAClB,OAAO,GAAE,EAAE,GAAG;IACZ,qBAAqB,CAAC,EAAE,mBAAmB,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;CACb,QA+CP;AAGD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,IAAI,CActE;AAGD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,CAAC,YAAY,EACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAChC,IAAI,CA4BN"}
1
+ {"version":3,"file":"augments.d.ts","sourceRoot":"","sources":["../../src/compilation/augments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAmBhD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,EAAE,CAAC,YAAY,EACrB,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,KACxB,MAAM,GAAG,IAAI,EAClB,OAAO,GAAE,EAAE,GAAG;IACZ,qBAAqB,CAAC,EAAE,mBAAmB,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;CACb,QA+CP;AAGD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,IAAI,CActE;AAGD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,CAAC,YAAY,EACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAChC,IAAI,CA4BN"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-and-analyze.d.ts","sourceRoot":"","sources":["../../src/compilation/build-and-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAsB,eAAe,CACnC,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,EACrD,qBAAqB,EAAE,qBAAqB,iBA4B7C"}
1
+ {"version":3,"file":"build-and-analyze.d.ts","sourceRoot":"","sources":["../../src/compilation/build-and-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAK/C,wBAAsB,eAAe,CACnC,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,EACrD,qBAAqB,EAAE,qBAAqB,iBA8B7C"}
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildAndAnalyze = buildAndAnalyze;
4
4
  const path_1 = require("path");
5
+ const assert_supported_versions_1 = require("../utils/assert-supported-versions");
5
6
  const JS_TS_FILE_PATTERN = /\.[cm]?[jt]sx?$/;
6
7
  async function buildAndAnalyze(angularCompilation, typescriptFileCache, javascriptTransformer) {
8
+ (0, assert_supported_versions_1.assertSupportedAngularRspackCompilerVersions)();
7
9
  for (const { filename, contents, } of await angularCompilation.emitAffectedFiles()) {
8
10
  const normalizedFilename = (0, path_1.normalize)(filename.replace(/^[A-Z]:/, ''));
9
11
  // Skip JavaScript transformation for non-JS/TS files (JSON, CSS, etc.)
@@ -22,9 +22,21 @@ export interface SetupCompilationOptions {
22
22
  }
23
23
  export declare const DEFAULT_NG_COMPILER_OPTIONS: ts.CompilerOptions;
24
24
  export declare function setupCompilation(config: Pick<RsbuildConfig, 'mode' | 'source'>, options: SetupCompilationOptions): Promise<{
25
- rootNames: string[];
26
- compilerOptions: import("@angular/compiler-cli").AngularCompilerOptions;
25
+ rootNames: readonly string[];
26
+ compilerOptions: ts.CompilerOptions;
27
27
  componentStylesheetBundler: ComponentStylesheetBundler;
28
28
  }>;
29
+ /**
30
+ * Dispose the shared component stylesheet bundler and reset the singleton.
31
+ *
32
+ * `@angular/build` >= 21.2.14 backs `ComponentStylesheetBundler` with a
33
+ * persistent esbuild build context (it previously used a one-shot
34
+ * `esbuild.build()` for non-incremental bundling). That context keeps an
35
+ * esbuild service - a child process and its sockets - alive until disposed,
36
+ * which prevents a one-shot `rspack build` from exiting once the bundle is
37
+ * written. Angular's own application builder disposes it in a `finally` block;
38
+ * we must do the same since we drive the bundler directly.
39
+ */
40
+ export declare function disposeComponentStylesheetBundler(): Promise<void>;
29
41
  export declare function styleTransform(componentStylesheetBundler: ComponentStylesheetBundler): (styles: string, containingFile: string, stylesheetFile?: string) => Promise<StylesheetTransformResult>;
30
42
  //# sourceMappingURL=setup-compilation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-compilation.d.ts","sourceRoot":"","sources":["../../src/compilation/setup-compilation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EACL,0BAA0B,EAI3B,MAAM,wBAAwB,CAAC;AAKhC,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,gBAAgB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACzC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,eAc5C,CAAC;AAKF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC,EAC9C,OAAO,EAAE,uBAAuB;;;;GAuEjC;AAED,wBAAgB,cAAc,CAC5B,0BAA0B,EAAE,0BAA0B,IAGpD,QAAQ,MAAM,EACd,gBAAgB,MAAM,EACtB,iBAAiB,MAAM,KACtB,OAAO,CAAC,yBAAyB,CAAC,CAmCtC"}
1
+ {"version":3,"file":"setup-compilation.d.ts","sourceRoot":"","sources":["../../src/compil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
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_NG_COMPILER_OPTIONS = void 0;
4
4
  exports.setupCompilation = setupCompilation;
5
+ exports.disposeComponentStylesheetBundler = disposeComponentStylesheetBundler;
5
6
  exports.styleTransform = styleTransform;
6
7
  const utils_1 = require("../utils");
8
+ const assert_supported_versions_1 = require("../utils/assert-supported-versions");
7
9
  const private_1 = require("@angular/build/private");
8
10
  const targets_from_browsers_1 = require("../utils/targets-from-browsers");
9
11
  const private_2 = require("@angular/build/private");
@@ -25,6 +27,7 @@ exports.DEFAULT_NG_COMPILER_OPTIONS = {
25
27
  };
26
28
  let COMPONENT_STYLESHEET_BUNDLER = undefined;
27
29
  async function setupCompilation(config, options) {
30
+ (0, assert_supported_versions_1.assertSupportedAngularRspackCompilerVersions)();
28
31
  const { readConfiguration } = await (0, utils_1.loadCompilerCli)();
29
32
  const { options: tsCompilerOptions, rootNames } = readConfiguration(config.source?.tsconfigPath ?? options.tsConfig, {
30
33
  ...exports.DEFAULT_NG_COMPILER_OPTIONS,
@@ -80,6 +83,24 @@ async function setupCompilation(config, options) {
80
83
  componentStylesheetBundler: COMPONENT_STYLESHEET_BUNDLER,
81
84
  };
82
85
  }
86
+ /**
87
+ * Dispose the shared component stylesheet bundler and reset the singleton.
88
+ *
89
+ * `@angular/build` >= 21.2.14 backs `ComponentStylesheetBundler` with a
90
+ * persistent esbuild build context (it previously used a one-shot
91
+ * `esbuild.build()` for non-incremental bundling). That context keeps an
92
+ * esbuild service - a child process and its sockets - alive until disposed,
93
+ * which prevents a one-shot `rspack build` from exiting once the bundle is
94
+ * written. Angular's own application builder disposes it in a `finally` block;
95
+ * we must do the same since we drive the bundler directly.
96
+ */
97
+ async function disposeComponentStylesheetBundler() {
98
+ if (COMPONENT_STYLESHEET_BUNDLER) {
99
+ const bundler = COMPONENT_STYLESHEET_BUNDLER;
100
+ COMPONENT_STYLESHEET_BUNDLER = undefined;
101
+ await bundler.dispose();
102
+ }
103
+ }
83
104
  function styleTransform(componentStylesheetBundler) {
84
105
  return async (styles, containingFile, stylesheetFile) => {
85
106
  try {
@@ -5,7 +5,7 @@ const models_1 = require("../models");
5
5
  const setup_compilation_1 = require("./setup-compilation");
6
6
  async function setupCompilationWithAngularCompilation(config, options, sourceFileCache, angularCompilation, modifiedFiles) {
7
7
  const { rootNames, compilerOptions, componentStylesheetBundler } = await (0, setup_compilation_1.setupCompilation)(config, options);
8
- angularCompilation ?? (angularCompilation = await (0, models_1.createAngularCompilation)(!options.aot, options.hasServer, false));
8
+ angularCompilation ?? (angularCompilation = await (0, models_1.createAngularCompilation)(!options.aot, !options.hasServer, false));
9
9
  modifiedFiles ?? (modifiedFiles = new Set(rootNames));
10
10
  const fileReplacements = options.fileReplacements.reduce((r, f) => {
11
11
  r[f.replace] = f.with;
@@ -0,0 +1,2 @@
1
+ export declare function assertSupportedAngularRspackCompilerVersions(): void;
2
+ //# sourceMappingURL=assert-supported-versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-supported-versions.d.ts","sourceRoot":"","sources":["../../src/utils/assert-supported-versions.ts"],"names":[],"mappings":"AAMA,wBAAgB,4CAA4C,IAAI,IAAI,CASnE"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertSupportedAngularRspackCompilerVersions = assertSupportedAngularRspackCompilerVersions;
4
+ const internal_1 = require("@nx/devkit/internal");
5
+ const versions_1 = require("./versions");
6
+ function assertSupportedAngularRspackCompilerVersions() {
7
+ (0, internal_1.assertSupportedInstalledPackageVersion)('@angular/build', versions_1.minSupportedAngularBuildVersion);
8
+ (0, internal_1.assertSupportedInstalledPackageVersion)('@rsbuild/core', versions_1.minSupportedRsbuildCoreVersion);
9
+ }
@@ -1,2 +1,16 @@
1
- export declare function loadCompilerCli(): Promise<typeof import('@angular/compiler-cli')>;
1
+ import type * as ts from 'typescript';
2
+ /**
3
+ * Minimal shape of `@angular/compiler-cli` that we consume. Hand-declared
4
+ * because the package ships `"type": "module"` typings whose extensionless
5
+ * `export *` re-exports don't resolve under `nodenext`, so `readConfiguration`
6
+ * is not visible via `typeof import('@angular/compiler-cli')`.
7
+ */
8
+ interface AngularCompilerCli {
9
+ readConfiguration(project: string, existingOptions?: ts.CompilerOptions): {
10
+ options: ts.CompilerOptions;
11
+ rootNames: readonly string[];
12
+ };
13
+ }
14
+ export declare function loadCompilerCli(): Promise<AngularCompilerCli>;
15
+ export {};
2
16
  //# sourceMappingURL=load-compiler-cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-compiler-cli.d.ts","sourceRoot":"","sources":["../../src/utils/load-compiler-cli.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,IAAI,OAAO,CACxC,cAAc,uBAAuB,CAAC,CACvC,CAOA"}
1
+ {"version":3,"file":"load-compiler-cli.d.ts","sourceRoot":"","sources":["../../src/utils/load-compiler-cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,UAAU,kBAAkB;IAC1B,iBAAiB,CACf,OAAO,EAAE,MAAM,EACf,eAAe,CAAC,EAAE,EAAE,CAAC,eAAe,GACnC;QAAE,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC;QAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CAClE;AAGD,wBAAgB,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAO7D"}
@@ -0,0 +1,3 @@
1
+ export declare const minSupportedAngularBuildVersion = "19.0.0";
2
+ export declare const minSupportedRsbuildCoreVersion = "1.0.5";
3
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,WAAW,CAAC;AACxD,eAAO,MAAM,8BAA8B,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.minSupportedRsbuildCoreVersion = exports.minSupportedAngularBuildVersion = void 0;
4
+ exports.minSupportedAngularBuildVersion = '19.0.0';
5
+ exports.minSupportedRsbuildCoreVersion = '1.0.5';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nx/angular-rspack-compiler",
3
3
  "private": false,
4
- "version": "23.0.0-pr.35465.2bc2643",
4
+ "version": "23.0.0-rc.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,26 +27,33 @@
27
27
  "main": "./dist/index.js",
28
28
  "types": "./dist/index.d.ts",
29
29
  "module": "./dist/index.js",
30
+ "files": [
31
+ "dist",
32
+ "!dist/tsconfig.lib.tsbuildinfo",
33
+ "patch"
34
+ ],
30
35
  "exports": {
31
36
  ".": {
37
+ "@nx/nx-source": "./src/index.ts",
32
38
  "types": "./dist/index.d.ts",
33
39
  "default": "./dist/index.js"
34
40
  }
35
41
  },
36
42
  "dependencies": {
37
- "@angular/build": ">= 19.0.0 < 22.0.0",
38
- "sass-embedded": "^1.79.3",
43
+ "sass-embedded": "^1.97.2",
39
44
  "semver": "^7.6.3",
40
45
  "ts-morph": "^27.0.2",
41
46
  "tslib": "^2.3.0",
42
- "typescript": "~5.9.2"
47
+ "typescript": "~5.9.2",
48
+ "@nx/devkit": "23.0.0-rc.0"
43
49
  },
44
50
  "devDependencies": {
45
51
  "jsonc-eslint-parser": "^2.4.0",
46
- "vitest": "^4.0.8",
52
+ "vitest": "^4.0.0",
47
53
  "memfs": "^4.17.0"
48
54
  },
49
55
  "peerDependencies": {
56
+ "@angular/build": ">= 19.0.0 < 22.0.0",
50
57
  "@angular/compiler-cli": ">= 19.0.0 < 22.0.0",
51
58
  "@rsbuild/core": ">=1.0.5 <2.0.0"
52
59
  },
@@ -54,14 +61,6 @@
54
61
  "sourceRoot": "packages/angular-rspack-compiler/src",
55
62
  "projectType": "library",
56
63
  "name": "angular-rspack-compiler",
57
- "release": {
58
- "version": {
59
- "preserveLocalDependencyProtocols": true,
60
- "manifestRootsToUpdate": [
61
- "packages/{projectName}"
62
- ]
63
- }
64
- },
65
64
  "targets": {
66
65
  "build": {
67
66
  "command": "node ./scripts/copy-readme.js angular-rspack-compiler packages/angular-rspack-compiler/readme-template.md packages/angular-rspack-compiler/README.md",
@@ -81,15 +80,6 @@
81
80
  "--passWithNoTests"
82
81
  ]
83
82
  }
84
- },
85
- "nx-release-publish": {
86
- "executor": "@nx/js:release-publish",
87
- "options": {
88
- "packageRoot": "packages/angular-rspack-compiler"
89
- },
90
- "dependsOn": [
91
- "^nx-release-publish"
92
- ]
93
83
  }
94
84
  }
95
85
  },
package/eslint.config.mjs DELETED
@@ -1,48 +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
- '@angular/core',
33
- 'jsonc-eslint-parser',
34
- 'semver',
35
- 'vitest',
36
- 'memfs',
37
- ],
38
- },
39
- ],
40
- },
41
- languageOptions: {
42
- parser: jsoncEslintParser,
43
- },
44
- },
45
- {
46
- ignores: ['dist'],
47
- },
48
- ];