@nx/angular-rspack 20.7.0 → 20.8.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.
- package/dist/lib/config/create-config.d.ts +75 -2
- package/dist/lib/config/create-config.d.ts.map +1 -1
- package/dist/lib/config/create-config.js +166 -138
- package/dist/lib/config/dev-server-config-utils.d.ts.map +1 -1
- package/dist/lib/config/dev-server-config-utils.js +3 -7
- package/dist/lib/config/entry-points.d.ts +9 -0
- package/dist/lib/config/entry-points.d.ts.map +1 -0
- package/dist/lib/config/entry-points.js +36 -0
- package/dist/lib/config/i18n/create-i18n-options.d.ts +1 -1
- package/dist/lib/config/i18n/create-i18n-options.d.ts.map +1 -1
- package/dist/lib/config/i18n/create-i18n-options.js +8 -6
- package/dist/lib/config/style-config-utils.d.ts +12 -306
- package/dist/lib/config/style-config-utils.d.ts.map +1 -1
- package/dist/lib/config/style-config-utils.js +180 -93
- package/dist/lib/models/angular-rspack-plugin-options.d.ts +39 -1
- package/dist/lib/models/angular-rspack-plugin-options.d.ts.map +1 -1
- package/dist/lib/models/normalize-options.d.ts +2 -2
- package/dist/lib/models/normalize-options.d.ts.map +1 -1
- package/dist/lib/models/normalize-options.js +68 -119
- package/dist/lib/models/unsupported-options.d.ts +0 -6
- package/dist/lib/models/unsupported-options.d.ts.map +1 -1
- package/dist/lib/models/unsupported-options.js +0 -6
- package/dist/lib/plugins/angular-rspack-plugin.d.ts +2 -2
- package/dist/lib/plugins/angular-rspack-plugin.d.ts.map +1 -1
- package/dist/lib/plugins/angular-rspack-plugin.js +33 -26
- package/dist/lib/plugins/i18n-inline-plugin.d.ts +2 -2
- package/dist/lib/plugins/i18n-inline-plugin.d.ts.map +1 -1
- package/dist/lib/plugins/i18n-inline-plugin.js +24 -58
- package/dist/lib/plugins/index-html-plugin.d.ts +21 -0
- package/dist/lib/plugins/index-html-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/index-html-plugin.js +114 -0
- package/dist/lib/plugins/ng-rspack.d.ts +8 -4
- package/dist/lib/plugins/ng-rspack.d.ts.map +1 -1
- package/dist/lib/plugins/ng-rspack.js +41 -39
- package/dist/lib/utils/find-project-for-path.d.ts +1 -1
- package/dist/lib/utils/find-project-for-path.d.ts.map +1 -1
- package/dist/lib/utils/find-project-for-path.js +2 -4
- package/dist/lib/utils/get-locale-base-href.d.ts +3 -0
- package/dist/lib/utils/get-locale-base-href.d.ts.map +1 -0
- package/dist/lib/utils/get-locale-base-href.js +17 -0
- package/dist/lib/utils/graph.d.ts +3 -0
- package/dist/lib/utils/graph.d.ts.map +1 -0
- package/dist/lib/utils/graph.js +25 -0
- package/dist/lib/utils/i18n.d.ts +4 -0
- package/dist/lib/utils/i18n.d.ts.map +1 -0
- package/dist/lib/utils/i18n.js +25 -0
- package/dist/lib/utils/index-file/add-event-dispatch-contract.d.ts +9 -0
- package/dist/lib/utils/index-file/add-event-dispatch-contract.d.ts.map +1 -0
- package/dist/lib/utils/index-file/add-event-dispatch-contract.js +27 -0
- package/dist/lib/utils/index-file/html-rewriting-stream.d.ts +16 -0
- package/dist/lib/utils/index-file/html-rewriting-stream.d.ts.map +1 -0
- package/dist/lib/utils/index-file/html-rewriting-stream.js +27 -0
- package/dist/lib/utils/misc-helpers.d.ts +6 -0
- package/dist/lib/utils/misc-helpers.d.ts.map +1 -0
- package/dist/lib/utils/misc-helpers.js +30 -0
- package/dist/lib/utils/rspack-diagnostics.d.ts +4 -0
- package/dist/lib/utils/rspack-diagnostics.d.ts.map +1 -0
- package/dist/lib/utils/rspack-diagnostics.js +10 -0
- package/dist/lib/utils/tailwind.d.ts +2 -0
- package/dist/lib/utils/tailwind.d.ts.map +1 -0
- package/dist/lib/utils/tailwind.js +31 -0
- package/dist/lib/utils/url-join.d.ts +9 -0
- package/dist/lib/utils/url-join.d.ts.map +1 -0
- package/dist/lib/utils/url-join.js +17 -0
- package/package.json +23 -6
|
@@ -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.htmlRewritingStream = htmlRewritingStream;
|
|
11
|
+
const node_stream_1 = require("node:stream");
|
|
12
|
+
const promises_1 = require("node:stream/promises");
|
|
13
|
+
const misc_helpers_1 = require("../misc-helpers");
|
|
14
|
+
async function htmlRewritingStream(content) {
|
|
15
|
+
const { RewritingStream } = await (0, misc_helpers_1.loadEsmModule)('parse5-html-rewriting-stream');
|
|
16
|
+
const rewriter = new RewritingStream();
|
|
17
|
+
return {
|
|
18
|
+
rewriter,
|
|
19
|
+
transformedContent: () => (0, promises_1.pipeline)(node_stream_1.Readable.from(content), rewriter, async function (source) {
|
|
20
|
+
const chunks = [];
|
|
21
|
+
for await (const chunk of source) {
|
|
22
|
+
chunks.push(Buffer.from(chunk));
|
|
23
|
+
}
|
|
24
|
+
return Buffer.concat(chunks).toString('utf-8');
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function loadEsmModule<T>(modulePath: string | URL): Promise<T>;
|
|
2
|
+
export declare function assertIsError(value: unknown): asserts value is Error & {
|
|
3
|
+
code?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function isPackageInstalled(root: string, name: string): boolean;
|
|
6
|
+
//# sourceMappingURL=misc-helpers.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadEsmModule = loadEsmModule;
|
|
4
|
+
exports.assertIsError = assertIsError;
|
|
5
|
+
exports.isPackageInstalled = isPackageInstalled;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
|
|
8
|
+
let load;
|
|
9
|
+
function loadEsmModule(modulePath) {
|
|
10
|
+
load ??= new Function('modulePath', `return import(modulePath);`);
|
|
11
|
+
return load(modulePath);
|
|
12
|
+
}
|
|
13
|
+
function assertIsError(value) {
|
|
14
|
+
const isError = value instanceof Error ||
|
|
15
|
+
// The following is needed to identify errors coming from RxJs
|
|
16
|
+
(typeof value === 'object' &&
|
|
17
|
+
value &&
|
|
18
|
+
'name' in value &&
|
|
19
|
+
'message' in value);
|
|
20
|
+
(0, node_assert_1.default)(isError, 'catch clause variable is not an Error instance');
|
|
21
|
+
}
|
|
22
|
+
function isPackageInstalled(root, name) {
|
|
23
|
+
try {
|
|
24
|
+
require.resolve(name, { paths: [root] });
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addError = addError;
|
|
4
|
+
exports.addWarning = addWarning;
|
|
5
|
+
function addError(compilation, message) {
|
|
6
|
+
compilation.errors.push(new compilation.compiler.rspack.WebpackError(message));
|
|
7
|
+
}
|
|
8
|
+
function addWarning(compilation, message) {
|
|
9
|
+
compilation.warnings.push(new compilation.compiler.rspack.WebpackError(message));
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/tailwind.ts"],"names":[],"mappings":"AAUA,wBAAsB,6BAA6B,CACjD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAsB7B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findTailwindConfigurationFile = findTailwindConfigurationFile;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const tailwindConfigFiles = [
|
|
7
|
+
'tailwind.config.js',
|
|
8
|
+
'tailwind.config.cjs',
|
|
9
|
+
'tailwind.config.mjs',
|
|
10
|
+
'tailwind.config.ts',
|
|
11
|
+
];
|
|
12
|
+
async function findTailwindConfigurationFile(workspaceRoot, projectRoot) {
|
|
13
|
+
try {
|
|
14
|
+
const dirEntries = [projectRoot, workspaceRoot].map((root) => (0, promises_1.readdir)(root, { withFileTypes: false }).then((entries) => ({
|
|
15
|
+
root,
|
|
16
|
+
files: new Set(entries),
|
|
17
|
+
})));
|
|
18
|
+
// A configuration file can exist in the project or workspace root
|
|
19
|
+
for (const { root, files } of await Promise.all(dirEntries)) {
|
|
20
|
+
for (const potentialConfig of tailwindConfigFiles) {
|
|
21
|
+
if (files.has(potentialConfig)) {
|
|
22
|
+
return (0, node_path_1.join)(root, potentialConfig);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// ignore
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 function urlJoin(...parts: string[]): string;
|
|
9
|
+
//# sourceMappingURL=url-join.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-join.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/url-join.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAOlD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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.urlJoin = urlJoin;
|
|
11
|
+
function urlJoin(...parts) {
|
|
12
|
+
const [p, ...rest] = parts;
|
|
13
|
+
// Remove trailing slash from first part
|
|
14
|
+
// Join all parts with `/`
|
|
15
|
+
// Dedupe double slashes from path names
|
|
16
|
+
return p.replace(/\/$/, '') + ('/' + rest.join('/')).replace(/\/\/+/g, '/');
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular-rspack",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -46,12 +46,17 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@ampproject/remapping": "2.3.0",
|
|
48
48
|
"@babel/core": "7.26.10",
|
|
49
|
-
"@nx/devkit": "
|
|
49
|
+
"@nx/devkit": "21.0.0-beta.8",
|
|
50
|
+
"autoprefixer": "10.4.21",
|
|
51
|
+
"deepmerge": "^4.3.1",
|
|
50
52
|
"express": "4.21.1",
|
|
51
53
|
"css-loader": "^7.1.2",
|
|
52
54
|
"jsonc-parser": "^3.3.1",
|
|
53
55
|
"less-loader": "^12.2.0",
|
|
54
56
|
"license-webpack-plugin": "^4.0.2",
|
|
57
|
+
"parse5-html-rewriting-stream": "7.0.0",
|
|
58
|
+
"postcss": "8.5.3",
|
|
59
|
+
"postcss-loader": "8.1.1",
|
|
55
60
|
"resolve-url-loader": "^5.0.0",
|
|
56
61
|
"sass-embedded": "^1.79.3",
|
|
57
62
|
"sass-loader": "^16.0.2",
|
|
@@ -59,17 +64,29 @@
|
|
|
59
64
|
"tslib": "^2.3.0",
|
|
60
65
|
"webpack-merge": "^6.0.1",
|
|
61
66
|
"ws": "^8.18.0",
|
|
62
|
-
"@nx/angular-rspack-compiler": "20.
|
|
67
|
+
"@nx/angular-rspack-compiler": "20.8.0"
|
|
63
68
|
},
|
|
64
69
|
"devDependencies": {
|
|
70
|
+
"@code-pushup/models": "^0.63.0",
|
|
71
|
+
"@code-pushup/utils": "^0.63.0",
|
|
72
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
65
73
|
"@ng-rspack/testing-setup": "0.0.1"
|
|
66
74
|
},
|
|
67
75
|
"peerDependencies": {
|
|
68
|
-
"@rspack/core": ">=1.0.5 <2.0.0",
|
|
69
76
|
"@angular/common": ">=19.0.0 <20.0.0",
|
|
70
|
-
"@angular/ssr": ">=19.0.0 <20.0.0",
|
|
71
77
|
"@angular/build": ">=19.0.0 <20.0.0",
|
|
72
|
-
"@angular/localize": ">=19.0.0 <20.0.0"
|
|
78
|
+
"@angular/localize": ">=19.0.0 <20.0.0",
|
|
79
|
+
"@angular/ssr": ">=19.0.0 <20.0.0",
|
|
80
|
+
"@rspack/core": ">=1.0.5 <2.0.0",
|
|
81
|
+
"tailwindcss": "^2.0.0 || ^3.0.0"
|
|
82
|
+
},
|
|
83
|
+
"peerDependenciesMeta": {
|
|
84
|
+
"tailwindcss": {
|
|
85
|
+
"optional": true
|
|
86
|
+
},
|
|
87
|
+
"@angular/localize": {
|
|
88
|
+
"optional": true
|
|
89
|
+
}
|
|
73
90
|
},
|
|
74
91
|
"nx": {
|
|
75
92
|
"name": "angular-rspack",
|