@nx/angular 0.0.0-pr-29860-43e1fcb → 0.0.0-pr-29464-a8559fe
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/generators.json +0 -5
- package/package.json +8 -9
- package/src/utils/backward-compatible-versions.js +0 -2
- package/src/utils/versions.d.ts +0 -1
- package/src/utils/versions.js +1 -2
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts +0 -4
- package/src/generators/convert-to-rspack/convert-to-rspack.js +0 -62
- package/src/generators/convert-to-rspack/lib/create-config.d.ts +0 -17
- package/src/generators/convert-to-rspack/lib/create-config.js +0 -50
- package/src/generators/convert-to-rspack/schema.d.ts +0 -3
- package/src/generators/convert-to-rspack/schema.json +0 -22
package/generators.json
CHANGED
|
@@ -38,11 +38,6 @@
|
|
|
38
38
|
"schema": "./src/generators/convert-to-application-executor/schema.json",
|
|
39
39
|
"description": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder."
|
|
40
40
|
},
|
|
41
|
-
"convert-to-rspack": {
|
|
42
|
-
"factory": "./src/generators/convert-to-rspack/convert-to-rspack",
|
|
43
|
-
"schema": "./src/generators/convert-to-rspack/schema.json",
|
|
44
|
-
"description": "Converts Angular Webpack projects to use Rspack."
|
|
45
|
-
},
|
|
46
41
|
"directive": {
|
|
47
42
|
"factory": "./src/generators/directive/directive",
|
|
48
43
|
"schema": "./src/generators/directive/schema.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-29464-a8559fe",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -71,14 +71,13 @@
|
|
|
71
71
|
"semver": "^7.5.3",
|
|
72
72
|
"tslib": "^2.3.0",
|
|
73
73
|
"webpack-merge": "^5.8.0",
|
|
74
|
-
"@nx/devkit": "0.0.0-pr-
|
|
75
|
-
"@nx/js": "0.0.0-pr-
|
|
76
|
-
"@nx/eslint": "0.0.0-pr-
|
|
77
|
-
"@nx/webpack": "0.0.0-pr-
|
|
78
|
-
"@nx/
|
|
79
|
-
"@nx/
|
|
80
|
-
"@nx/
|
|
81
|
-
"@nx/workspace": "0.0.0-pr-29860-43e1fcb",
|
|
74
|
+
"@nx/devkit": "0.0.0-pr-29464-a8559fe",
|
|
75
|
+
"@nx/js": "0.0.0-pr-29464-a8559fe",
|
|
76
|
+
"@nx/eslint": "0.0.0-pr-29464-a8559fe",
|
|
77
|
+
"@nx/webpack": "0.0.0-pr-29464-a8559fe",
|
|
78
|
+
"@nx/module-federation": "0.0.0-pr-29464-a8559fe",
|
|
79
|
+
"@nx/web": "0.0.0-pr-29464-a8559fe",
|
|
80
|
+
"@nx/workspace": "0.0.0-pr-29464-a8559fe",
|
|
82
81
|
"piscina": "^4.4.0"
|
|
83
82
|
},
|
|
84
83
|
"peerDependencies": {
|
|
@@ -6,7 +6,6 @@ exports.backwardCompatibleVersions = {
|
|
|
6
6
|
angularVersion: '~17.3.0',
|
|
7
7
|
angularDevkitVersion: '~17.3.0',
|
|
8
8
|
ngPackagrVersion: '~17.3.0',
|
|
9
|
-
ngRspackVersion: '~19.0.0-alpha.26',
|
|
10
9
|
ngrxVersion: '~17.0.0',
|
|
11
10
|
rxjsVersion: '~7.8.0',
|
|
12
11
|
zoneJsVersion: '~0.14.3',
|
|
@@ -34,7 +33,6 @@ exports.backwardCompatibleVersions = {
|
|
|
34
33
|
angularVersion: '~18.2.0',
|
|
35
34
|
angularDevkitVersion: '~18.2.0',
|
|
36
35
|
ngPackagrVersion: '~18.2.0',
|
|
37
|
-
ngRspackVersion: '~19.0.0-alpha.26',
|
|
38
36
|
ngrxVersion: '~18.0.2',
|
|
39
37
|
rxjsVersion: '~7.8.0',
|
|
40
38
|
zoneJsVersion: '~0.14.3',
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export declare const nxVersion: any;
|
|
|
2
2
|
export declare const angularVersion = "~19.1.0";
|
|
3
3
|
export declare const angularDevkitVersion = "~19.1.0";
|
|
4
4
|
export declare const ngPackagrVersion = "~19.1.0";
|
|
5
|
-
export declare const ngRspackVersion = "~19.0.0-alpha.26";
|
|
6
5
|
export declare const ngrxVersion = "^19.0.0";
|
|
7
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
8
7
|
export declare const zoneJsVersion = "~0.15.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.
|
|
3
|
+
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
5
|
exports.angularVersion = '~19.1.0';
|
|
6
6
|
exports.angularDevkitVersion = '~19.1.0';
|
|
7
7
|
exports.ngPackagrVersion = '~19.1.0';
|
|
8
|
-
exports.ngRspackVersion = '~19.0.0-alpha.26';
|
|
9
8
|
exports.ngrxVersion = '^19.0.0';
|
|
10
9
|
exports.rxjsVersion = '~7.8.0';
|
|
11
10
|
exports.zoneJsVersion = '~0.15.0';
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToRspack = convertToRspack;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const versions_1 = require("../../utils/versions");
|
|
6
|
-
const create_config_1 = require("./lib/create-config");
|
|
7
|
-
async function convertToRspack(tree, schema) {
|
|
8
|
-
const { project: projectName } = schema;
|
|
9
|
-
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
10
|
-
const tasks = [];
|
|
11
|
-
const createConfigOptions = {
|
|
12
|
-
root: project.root,
|
|
13
|
-
};
|
|
14
|
-
const buildAndServeTargetNames = [];
|
|
15
|
-
for (const [targetName, target] of Object.entries(project.targets)) {
|
|
16
|
-
if (target.executor === '@angular-devkit/build-angular:browser' ||
|
|
17
|
-
target.executor === '@nx/angular:webpack-browser') {
|
|
18
|
-
createConfigOptions.browser = target.options.main;
|
|
19
|
-
createConfigOptions.index = target.options.index;
|
|
20
|
-
createConfigOptions.assets = target.options.assets.map((asset) => {
|
|
21
|
-
if (typeof asset === 'string') {
|
|
22
|
-
return asset;
|
|
23
|
-
}
|
|
24
|
-
return asset.input;
|
|
25
|
-
});
|
|
26
|
-
createConfigOptions.styles = target.options.styles;
|
|
27
|
-
createConfigOptions.scripts = target.options.scripts;
|
|
28
|
-
createConfigOptions.polyfills = target.options.polyfills;
|
|
29
|
-
createConfigOptions.tsconfigPath = target.options.tsConfig;
|
|
30
|
-
createConfigOptions.jit =
|
|
31
|
-
target.options.aot === undefined ? false : !target.options.aot;
|
|
32
|
-
createConfigOptions.inlineStylesExtension =
|
|
33
|
-
target.options.inlineStyleLanguage === undefined
|
|
34
|
-
? 'css'
|
|
35
|
-
: target.options.inlineStyleLanguage;
|
|
36
|
-
// TODO: Add more options that can be correctly mapped
|
|
37
|
-
buildAndServeTargetNames.push(targetName);
|
|
38
|
-
}
|
|
39
|
-
else if (target.executor === '@angular-devkit/build-angular:dev-server' ||
|
|
40
|
-
target.executor === '@nx/angular:dev-server') {
|
|
41
|
-
buildAndServeTargetNames.push(targetName);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
(0, create_config_1.createConfig)(tree, createConfigOptions);
|
|
45
|
-
for (const targetName of buildAndServeTargetNames) {
|
|
46
|
-
delete project.targets[targetName];
|
|
47
|
-
}
|
|
48
|
-
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
|
49
|
-
const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
|
|
50
|
-
await rspackInitGenerator(tree, {
|
|
51
|
-
addPlugin: true,
|
|
52
|
-
});
|
|
53
|
-
// TODO: Add skipInstall flag
|
|
54
|
-
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
55
|
-
'@ng-rspack/build': versions_1.ngRspackVersion,
|
|
56
|
-
});
|
|
57
|
-
tasks.push(installTask);
|
|
58
|
-
// TODO: Add skipFormatting flag
|
|
59
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
60
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
61
|
-
}
|
|
62
|
-
exports.default = convertToRspack;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Tree } from '@nx/devkit';
|
|
2
|
-
export interface CreateConfigOptions {
|
|
3
|
-
root: string;
|
|
4
|
-
index: string;
|
|
5
|
-
browser: string;
|
|
6
|
-
server?: string;
|
|
7
|
-
ssrEntry?: string;
|
|
8
|
-
polyfills: string[];
|
|
9
|
-
tsconfigPath: string;
|
|
10
|
-
assets: string[];
|
|
11
|
-
styles: string[];
|
|
12
|
-
scripts: string[];
|
|
13
|
-
jit?: boolean;
|
|
14
|
-
inlineStylesExtension?: string;
|
|
15
|
-
fileReplacements?: string[];
|
|
16
|
-
}
|
|
17
|
-
export declare function createConfig(tree: Tree, opts: Partial<CreateConfigOptions>): void;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createConfig = createConfig;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function createConfig(tree, opts) {
|
|
6
|
-
const configContents = `const { createConfig } = require('@ng-rspack/build');
|
|
7
|
-
|
|
8
|
-
module.exports = createConfig({
|
|
9
|
-
root: __dirname,
|
|
10
|
-
index: '${normalizeFromProjectRoot(opts.index, opts.root)}',
|
|
11
|
-
browser: '${normalizeFromProjectRoot(opts.browser, opts.root)}',
|
|
12
|
-
${opts.server
|
|
13
|
-
? `server: '${normalizeFromProjectRoot(opts.server, opts.root)}',`
|
|
14
|
-
: ''}
|
|
15
|
-
${opts.ssrEntry
|
|
16
|
-
? `ssrEntry: '${normalizeFromProjectRoot(opts.ssrEntry, opts.root)}',`
|
|
17
|
-
: ''}
|
|
18
|
-
tsconfigPath: '${normalizeFromProjectRoot(opts.tsconfigPath, opts.root)}',
|
|
19
|
-
polyfills: ${JSON.stringify(opts.polyfills)},
|
|
20
|
-
assets: ${JSON.stringify(opts.assets.map((a) => normalizeFromProjectRoot(a, opts.root)))},
|
|
21
|
-
styles: ${JSON.stringify(opts.styles.map((s) => normalizeFromProjectRoot(s, opts.root)))},
|
|
22
|
-
scripts: ${JSON.stringify(opts.scripts.map((s) => normalizeFromProjectRoot(s, opts.root)))},
|
|
23
|
-
jit: ${opts.jit},
|
|
24
|
-
${opts.inlineStylesExtension
|
|
25
|
-
? `inlineStylesExtension: '${opts.inlineStylesExtension}'`
|
|
26
|
-
: ''},
|
|
27
|
-
fileReplacements: ${JSON.stringify(opts.fileReplacements ?? [])},
|
|
28
|
-
hasServer: ${opts.server || opts.ssrEntry ? true : false},
|
|
29
|
-
skipTypeChecking: false,
|
|
30
|
-
});
|
|
31
|
-
`;
|
|
32
|
-
tree.write((0, devkit_1.joinPathFragments)(opts.root, 'rspack.config.ts'), configContents);
|
|
33
|
-
}
|
|
34
|
-
function normalizeFromProjectRoot(path, projectRoot) {
|
|
35
|
-
if (projectRoot === '.') {
|
|
36
|
-
if (!path.startsWith('./')) {
|
|
37
|
-
return `./${path}`;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return path;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else if (path.startsWith(projectRoot)) {
|
|
44
|
-
return path.replace(projectRoot, '.');
|
|
45
|
-
}
|
|
46
|
-
else if (!path.startsWith('./')) {
|
|
47
|
-
return `./${path}`;
|
|
48
|
-
}
|
|
49
|
-
return path;
|
|
50
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "GeneratorNxApp",
|
|
4
|
-
"title": "Creates an Angular application.",
|
|
5
|
-
"description": "Creates an Angular application.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"cli": "nx",
|
|
8
|
-
"properties": {
|
|
9
|
-
"project": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"aliases": ["name", "projectName"],
|
|
12
|
-
"description": "Project for which to convert to rspack.",
|
|
13
|
-
"$default": {
|
|
14
|
-
"$source": "argv",
|
|
15
|
-
"index": 0
|
|
16
|
-
},
|
|
17
|
-
"x-prompt": "Which project do you want to convert to rspack?",
|
|
18
|
-
"x-dropdown": "projects",
|
|
19
|
-
"x-priority": "important"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|