@nx/angular 23.0.0-beta.2 → 23.0.0-beta.4
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.d.ts +0 -1
- package/generators.d.ts.map +1 -1
- package/generators.js +0 -1
- package/generators.json +0 -7
- package/migrations.json +5 -0
- package/package.json +8 -10
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts.map +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +3 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +1 -1
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.d.ts +3 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.js +45 -0
- package/module-federation/index.d.ts +0 -6
- package/module-federation/index.d.ts.map +0 -1
- package/module-federation/index.js +0 -6
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +0 -16
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts.map +0 -1
- package/src/generators/add-linting/lib/create-eslint-configuration.js +0 -121
- package/src/generators/move/move.d.ts +0 -7
- package/src/generators/move/move.d.ts.map +0 -1
- package/src/generators/move/move.js +0 -11
- package/src/generators/move/schema.d.ts +0 -8
- package/src/generators/move/schema.json +0 -56
package/generators.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export * from './src/generators/host/host';
|
|
|
8
8
|
export * from './src/generators/init/init';
|
|
9
9
|
export * from './src/generators/library-secondary-entry-point/library-secondary-entry-point';
|
|
10
10
|
export * from './src/generators/library/library';
|
|
11
|
-
export * from './src/generators/move/move';
|
|
12
11
|
export * from './src/generators/ngrx/ngrx';
|
|
13
12
|
export * from './src/generators/ngrx-feature-store/ngrx-feature-store';
|
|
14
13
|
export * from './src/generators/ngrx-root-store/ngrx-root-store';
|
package/generators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../packages/angular/generators.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8EAA8E,CAAC;AAC7F,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,
|
|
1
|
+
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../packages/angular/generators.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8EAA8E,CAAC;AAC7F,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,wDAAwD,CAAC;AACvE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kEAAkE,CAAC;AACjF,cAAc,wCAAwC,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kFAAkF,CAAC;AACjI,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0BAA0B,CAAC"}
|
package/generators.js
CHANGED
|
@@ -12,7 +12,6 @@ tslib_1.__exportStar(require("./src/generators/host/host"), exports);
|
|
|
12
12
|
tslib_1.__exportStar(require("./src/generators/init/init"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./src/generators/library-secondary-entry-point/library-secondary-entry-point"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./src/generators/library/library"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./src/generators/move/move"), exports);
|
|
16
15
|
tslib_1.__exportStar(require("./src/generators/ngrx/ngrx"), exports);
|
|
17
16
|
tslib_1.__exportStar(require("./src/generators/ngrx-feature-store/ngrx-feature-store"), exports);
|
|
18
17
|
tslib_1.__exportStar(require("./src/generators/ngrx-root-store/ngrx-root-store"), exports);
|
package/generators.json
CHANGED
|
@@ -81,13 +81,6 @@
|
|
|
81
81
|
"description": "Generate a Remote Angular Module Federation Application.",
|
|
82
82
|
"aliases": ["producer"]
|
|
83
83
|
},
|
|
84
|
-
"move": {
|
|
85
|
-
"factory": "./src/generators/move/move#angularMoveGenerator",
|
|
86
|
-
"schema": "./src/generators/move/schema.json",
|
|
87
|
-
"aliases": ["mv"],
|
|
88
|
-
"description": "Moves an Angular application or library to another folder within the workspace and updates the project configuration.",
|
|
89
|
-
"x-deprecated": "Use the `@nx/workspace:move` generator instead. This generator will be removed in Nx v22."
|
|
90
|
-
},
|
|
91
84
|
"convert-to-with-mf": {
|
|
92
85
|
"factory": "./src/generators/convert-to-with-mf/convert-to-with-mf",
|
|
93
86
|
"schema": "./src/generators/convert-to-with-mf/schema.json",
|
package/migrations.json
CHANGED
|
@@ -389,6 +389,11 @@
|
|
|
389
389
|
},
|
|
390
390
|
"description": "Replace 'jest-preset-angular/setup-jest' imports with the new 'setupZoneTestEnv' function.",
|
|
391
391
|
"factory": "./src/migrations/update-22-3-0/update-jest-preset-angular-setup"
|
|
392
|
+
},
|
|
393
|
+
"update-23-0-0-update-with-module-federation-import": {
|
|
394
|
+
"version": "23.0.0-beta.0",
|
|
395
|
+
"description": "Update the @nx/angular/module-federation import to use @nx/module-federation/angular.",
|
|
396
|
+
"factory": "./src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package"
|
|
392
397
|
}
|
|
393
398
|
},
|
|
394
399
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.4",
|
|
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, 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": {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"./executors": "./executors.js",
|
|
25
25
|
"./plugin": "./plugin.js",
|
|
26
26
|
"./tailwind": "./tailwind.js",
|
|
27
|
-
"./module-federation": "./module-federation/index.js",
|
|
28
27
|
"./src/utils": "./src/utils/index.js",
|
|
29
28
|
"./plugins/component-testing": "./plugins/component-testing.js",
|
|
30
29
|
"./src/generators/utils": "./src/generators/utils/index.js",
|
|
@@ -62,14 +61,13 @@
|
|
|
62
61
|
"migrations": "./migrations.json"
|
|
63
62
|
},
|
|
64
63
|
"dependencies": {
|
|
65
|
-
"@nx/devkit": "23.0.0-beta.
|
|
66
|
-
"@nx/eslint": "23.0.0-beta.
|
|
67
|
-
"@nx/js": "23.0.0-beta.
|
|
68
|
-
"@nx/module-federation": "23.0.0-beta.
|
|
69
|
-
"@nx/rspack": "23.0.0-beta.
|
|
70
|
-
"@nx/web": "23.0.0-beta.
|
|
71
|
-
"@nx/webpack": "23.0.0-beta.
|
|
72
|
-
"@nx/workspace": "23.0.0-beta.2",
|
|
64
|
+
"@nx/devkit": "23.0.0-beta.4",
|
|
65
|
+
"@nx/eslint": "23.0.0-beta.4",
|
|
66
|
+
"@nx/js": "23.0.0-beta.4",
|
|
67
|
+
"@nx/module-federation": "23.0.0-beta.4",
|
|
68
|
+
"@nx/rspack": "23.0.0-beta.4",
|
|
69
|
+
"@nx/web": "23.0.0-beta.4",
|
|
70
|
+
"@nx/webpack": "23.0.0-beta.4",
|
|
73
71
|
"@phenomnomnominal/tsquery": "~6.1.4",
|
|
74
72
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
75
73
|
"enquirer": "~2.3.6",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function convertToWithMF(tree: Tree, schema: Schema): Promise<
|
|
3
|
+
export declare function convertToWithMF(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
4
|
export default convertToWithMF;
|
|
5
5
|
//# sourceMappingURL=convert-to-with-mf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-with-mf.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"convert-to-with-mf.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYvC,wBAAsB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mDAqD/D;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.convertToWithMF = convertToWithMF;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const get_mf_projects_1 = require("../../utils/get-mf-projects");
|
|
6
|
+
const versions_1 = require("../../utils/versions");
|
|
6
7
|
const lib_1 = require("./lib");
|
|
7
8
|
async function convertToWithMF(tree, schema) {
|
|
8
9
|
const projects = new Set((0, get_mf_projects_1.getMFProjects)(tree, { legacy: true }));
|
|
@@ -24,8 +25,10 @@ async function convertToWithMF(tree, schema) {
|
|
|
24
25
|
const [updatedWebpackConfig, mfConfig] = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
|
|
25
26
|
tree.write(pathToWebpackConfig, updatedWebpackConfig);
|
|
26
27
|
tree.write((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js'), mfConfig);
|
|
28
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/module-federation': versions_1.nxVersion });
|
|
27
29
|
if (!schema.skipFormat) {
|
|
28
30
|
await (0, devkit_1.formatFiles)(tree);
|
|
29
31
|
}
|
|
32
|
+
return installTask;
|
|
30
33
|
}
|
|
31
34
|
exports.default = convertToWithMF;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.writeNewWebpackConfig = writeNewWebpackConfig;
|
|
4
4
|
const is_host_remote_config_1 = require("./is-host-remote-config");
|
|
5
5
|
function writeNewWebpackConfig(ast, mfType, projectName) {
|
|
6
|
-
const webpackConfig = `const { withModuleFederation } = require('@nx/
|
|
6
|
+
const webpackConfig = `const { withModuleFederation } = require('@nx/module-federation/angular');
|
|
7
7
|
const config = require('./module-federation.config');
|
|
8
8
|
module.exports = withModuleFederation(config);
|
|
9
9
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-with-mf-import-to-new-package.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAIV,MAAM,YAAY,CAAC;AASpB,wBAA8B,mBAAmB,CAAC,IAAI,EAAE,IAAI,iBAmD3D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateWithMfImport;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
6
|
+
const projects_1 = require("../utils/projects");
|
|
7
|
+
const versions_1 = require("../../utils/versions");
|
|
8
|
+
const NX_ANGULAR_MODULE_FEDERATION_IMPORT_SELECTOR = 'ImportDeclaration > StringLiteral[value=@nx/angular/module-federation], VariableStatement CallExpression:has(Identifier[name=require]) > StringLiteral[value=@nx/angular/module-federation]';
|
|
9
|
+
const NEW_IMPORT_PATH = `'@nx/module-federation/angular'`;
|
|
10
|
+
async function migrateWithMfImport(tree) {
|
|
11
|
+
const angularProjects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
12
|
+
'npm:@nx/angular',
|
|
13
|
+
]);
|
|
14
|
+
if (!angularProjects.length) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let anyUpdated = false;
|
|
18
|
+
for (const { data } of angularProjects) {
|
|
19
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, data.root, (filePath) => {
|
|
20
|
+
if (!filePath.endsWith('.ts') && !filePath.endsWith('.js')) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let contents = tree.read(filePath, 'utf-8');
|
|
24
|
+
if (!contents.includes('@nx/angular/module-federation')) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const sourceFile = (0, tsquery_1.ast)(contents);
|
|
28
|
+
const importNodes = (0, tsquery_1.query)(sourceFile, NX_ANGULAR_MODULE_FEDERATION_IMPORT_SELECTOR);
|
|
29
|
+
if (importNodes.length === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Iterate end-to-start so earlier replacements don't shift later offsets.
|
|
33
|
+
for (let i = importNodes.length - 1; i >= 0; i--) {
|
|
34
|
+
const node = importNodes[i];
|
|
35
|
+
contents = `${contents.slice(0, node.getStart())}${NEW_IMPORT_PATH}${contents.slice(node.getEnd())}`;
|
|
36
|
+
}
|
|
37
|
+
tree.write(filePath, contents);
|
|
38
|
+
anyUpdated = true;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (anyUpdated) {
|
|
42
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/module-federation': versions_1.nxVersion });
|
|
43
|
+
}
|
|
44
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
45
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { withModuleFederation, withModuleFederationForSSR } from '@nx/module-federation/angular';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Update the import path to `@nx/module-federation/angular` instead. This import path will be removed in Nx v22.
|
|
4
|
-
*/
|
|
5
|
-
export { withModuleFederation, withModuleFederationForSSR };
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/angular/module-federation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withModuleFederationForSSR = exports.withModuleFederation = void 0;
|
|
4
|
-
const angular_1 = require("@nx/module-federation/angular");
|
|
5
|
-
Object.defineProperty(exports, "withModuleFederation", { enumerable: true, get: function () { return angular_1.withModuleFederation; } });
|
|
6
|
-
Object.defineProperty(exports, "withModuleFederationForSSR", { enumerable: true, get: function () { return angular_1.withModuleFederationForSSR; } });
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '@nx/devkit';
|
|
2
|
-
import type { Linter } from 'eslint';
|
|
3
|
-
import type { AddLintingGeneratorSchema } from '../schema';
|
|
4
|
-
type EslintExtensionSchema = {
|
|
5
|
-
prefix: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use tools from `@nx/eslint/src/generators/utils/eslint-file` instead. It will be removed in Nx v22.
|
|
9
|
-
*/
|
|
10
|
-
export declare const extendAngularEslintJson: (json: Linter.LegacyConfig, options: EslintExtensionSchema) => Linter.LegacyConfig;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use {@link extendAngularEslintJson} instead. It will be removed in Nx v22.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createEsLintConfiguration(tree: Tree, options: AddLintingGeneratorSchema): void;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=create-eslint-configuration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-eslint-configuration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAG3D,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,CAAC,YAAY,EACzB,SAAS,qBAAqB,KAC7B,MAAM,CAAC,YA4CT,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,GACjC,IAAI,CAqEN"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendAngularEslintJson = void 0;
|
|
4
|
-
exports.createEsLintConfiguration = createEsLintConfiguration;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const string_utils_1 = require("@nx/devkit/src/utils/string-utils");
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use tools from `@nx/eslint/src/generators/utils/eslint-file` instead. It will be removed in Nx v22.
|
|
9
|
-
*/
|
|
10
|
-
const extendAngularEslintJson = (json, options) => {
|
|
11
|
-
const overrides = [
|
|
12
|
-
{
|
|
13
|
-
...json.overrides[0],
|
|
14
|
-
files: ['*.ts'],
|
|
15
|
-
extends: [
|
|
16
|
-
...(json.overrides[0].extends || []),
|
|
17
|
-
'plugin:@nx/angular',
|
|
18
|
-
'plugin:@angular-eslint/template/process-inline-templates',
|
|
19
|
-
],
|
|
20
|
-
rules: {
|
|
21
|
-
'@angular-eslint/directive-selector': [
|
|
22
|
-
'error',
|
|
23
|
-
{
|
|
24
|
-
type: 'attribute',
|
|
25
|
-
prefix: (0, string_utils_1.camelize)(options.prefix),
|
|
26
|
-
style: 'camelCase',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
'@angular-eslint/component-selector': [
|
|
30
|
-
'error',
|
|
31
|
-
{
|
|
32
|
-
type: 'element',
|
|
33
|
-
prefix: (0, string_utils_1.dasherize)(options.prefix),
|
|
34
|
-
style: 'kebab-case',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
files: ['*.html'],
|
|
41
|
-
extends: ['plugin:@nx/angular-template'],
|
|
42
|
-
/**
|
|
43
|
-
* Having an empty rules object present makes it more obvious to the user where they would
|
|
44
|
-
* extend things from if they needed to
|
|
45
|
-
*/
|
|
46
|
-
rules: {},
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
return {
|
|
50
|
-
...json,
|
|
51
|
-
overrides,
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
exports.extendAngularEslintJson = extendAngularEslintJson;
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated Use {@link extendAngularEslintJson} instead. It will be removed in Nx v22.
|
|
57
|
-
*/
|
|
58
|
-
function createEsLintConfiguration(tree, options) {
|
|
59
|
-
const rootConfig = `${(0, devkit_1.offsetFromRoot)(options.projectRoot)}.eslintrc.json`;
|
|
60
|
-
// Include all project files to be linted (since they are turned off in the root eslintrc file).
|
|
61
|
-
const ignorePatterns = ['!**/*'];
|
|
62
|
-
const configJson = {
|
|
63
|
-
extends: [rootConfig],
|
|
64
|
-
ignorePatterns,
|
|
65
|
-
overrides: [
|
|
66
|
-
{
|
|
67
|
-
files: ['*.ts'],
|
|
68
|
-
extends: [
|
|
69
|
-
'plugin:@nx/angular',
|
|
70
|
-
'plugin:@angular-eslint/template/process-inline-templates',
|
|
71
|
-
],
|
|
72
|
-
/**
|
|
73
|
-
* NOTE: We no longer set parserOptions.project by default when creating new projects.
|
|
74
|
-
*
|
|
75
|
-
* We have observed that users rarely add rules requiring type-checking to their Nx workspaces, and therefore
|
|
76
|
-
* do not actually need the capabilites which parserOptions.project provides. When specifying parserOptions.project,
|
|
77
|
-
* typescript-eslint needs to create full TypeScript Programs for you. When omitting it, it can perform a simple
|
|
78
|
-
* parse (and AST tranformation) of the source files it encounters during a lint run, which is much faster and much
|
|
79
|
-
* less memory intensive.
|
|
80
|
-
*
|
|
81
|
-
* In the rare case that users attempt to add rules requiring type-checking to their setup later on (and haven't set
|
|
82
|
-
* parserOptions.project), the executor will attempt to look for the particular error typescript-eslint gives you
|
|
83
|
-
* and provide feedback to the user.
|
|
84
|
-
*/
|
|
85
|
-
parserOptions: !options.setParserOptionsProject
|
|
86
|
-
? undefined
|
|
87
|
-
: {
|
|
88
|
-
project: [`${options.projectRoot}/tsconfig.*?.json`],
|
|
89
|
-
},
|
|
90
|
-
rules: {
|
|
91
|
-
'@angular-eslint/directive-selector': [
|
|
92
|
-
'error',
|
|
93
|
-
{
|
|
94
|
-
type: 'attribute',
|
|
95
|
-
prefix: (0, string_utils_1.camelize)(options.prefix),
|
|
96
|
-
style: 'camelCase',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
'@angular-eslint/component-selector': [
|
|
100
|
-
'error',
|
|
101
|
-
{
|
|
102
|
-
type: 'element',
|
|
103
|
-
prefix: (0, string_utils_1.dasherize)(options.prefix),
|
|
104
|
-
style: 'kebab-case',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
files: ['*.html'],
|
|
111
|
-
extends: ['plugin:@nx/angular-template'],
|
|
112
|
-
/**
|
|
113
|
-
* Having an empty rules object present makes it more obvious to the user where they would
|
|
114
|
-
* extend things from if they needed to
|
|
115
|
-
*/
|
|
116
|
-
rules: {},
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
};
|
|
120
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, '.eslintrc.json'), configJson);
|
|
121
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '@nx/devkit';
|
|
2
|
-
import type { Schema } from './schema';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use the `@nx/workspace:move` generator instead. It will be removed in Nx v22.
|
|
5
|
-
*/
|
|
6
|
-
export declare function angularMoveGenerator(tree: Tree, schema: Schema): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=move.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/move/move.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.angularMoveGenerator = angularMoveGenerator;
|
|
4
|
-
const move_1 = require("@nx/workspace/src/generators/move/move");
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use the `@nx/workspace:move` generator instead. It will be removed in Nx v22.
|
|
7
|
-
*/
|
|
8
|
-
async function angularMoveGenerator(tree, schema) {
|
|
9
|
-
process.env.NX_ANGULAR_MOVE_INVOKED = 'true';
|
|
10
|
-
await (0, move_1.moveGenerator)(tree, schema);
|
|
11
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "NxAngularMove",
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"title": "Nx Angular Move",
|
|
6
|
-
"description": "Move an Angular project to another folder in the workspace.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g @nx/angular:move --project my-feature-lib --destination shared/my-feature-lib",
|
|
11
|
-
"description": "Move libs/my-feature-lib to libs/shared/my-feature-lib."
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"properties": {
|
|
15
|
-
"projectName": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"alias": "project",
|
|
18
|
-
"description": "The name of the Angular project to move.",
|
|
19
|
-
"x-dropdown": "projects",
|
|
20
|
-
"x-priority": "important"
|
|
21
|
-
},
|
|
22
|
-
"newProjectName": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"alias": "project",
|
|
25
|
-
"description": "The new name of the project after the move.",
|
|
26
|
-
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$",
|
|
27
|
-
"x-priority": "important"
|
|
28
|
-
},
|
|
29
|
-
"destination": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "The folder to move the Angular project into.",
|
|
32
|
-
"$default": {
|
|
33
|
-
"$source": "argv",
|
|
34
|
-
"index": 0
|
|
35
|
-
},
|
|
36
|
-
"x-priority": "important"
|
|
37
|
-
},
|
|
38
|
-
"importPath": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"description": "The new import path to use in the `tsconfig.base.json`."
|
|
41
|
-
},
|
|
42
|
-
"updateImportPath": {
|
|
43
|
-
"type": "boolean",
|
|
44
|
-
"description": "Update the import path to reflect the new location.",
|
|
45
|
-
"default": true
|
|
46
|
-
},
|
|
47
|
-
"skipFormat": {
|
|
48
|
-
"type": "boolean",
|
|
49
|
-
"aliases": ["skip-format"],
|
|
50
|
-
"description": "Skip formatting files.",
|
|
51
|
-
"default": false,
|
|
52
|
-
"x-priority": "internal"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"required": ["projectName", "destination"]
|
|
56
|
-
}
|