@nrwl/angular 15.9.2 → 16.0.0-beta.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/migrations.json +2 -2
- package/package.json +11 -10
- package/src/generators/application/lib/create-project.d.ts +1 -1
- package/src/generators/application/lib/create-project.js.map +1 -1
- package/src/generators/component/component.compat.js +3 -3
- package/src/generators/component/component.compat.js.map +1 -1
- package/src/generators/component/component.js +10 -31
- package/src/generators/component/component.js.map +1 -1
- package/src/generators/component/lib/component.js +16 -6
- package/src/generators/component/lib/component.js.map +1 -1
- package/src/generators/component/lib/index.d.ts +4 -0
- package/src/generators/component/lib/index.js +8 -0
- package/src/generators/component/lib/index.js.map +1 -0
- package/src/generators/component/lib/module.js +2 -3
- package/src/generators/component/lib/module.js.map +1 -1
- package/src/generators/component/lib/normalize-options.d.ts +1 -1
- package/src/generators/component/lib/normalize-options.js +9 -11
- package/src/generators/component/lib/normalize-options.js.map +1 -1
- package/src/generators/component/lib/validate-options.d.ts +3 -0
- package/src/generators/component/lib/validate-options.js +12 -0
- package/src/generators/component/lib/validate-options.js.map +1 -0
- package/src/generators/component/schema.d.ts +3 -1
- package/src/generators/component/schema.json +1 -1
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +1 -1
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js.map +1 -1
- package/src/generators/directive/directive.js +13 -29
- package/src/generators/directive/directive.js.map +1 -1
- package/src/generators/directive/lib/index.d.ts +2 -0
- package/src/generators/directive/lib/index.js +6 -0
- package/src/generators/directive/lib/index.js.map +1 -0
- package/src/generators/directive/lib/normalize-options.d.ts +3 -0
- package/src/generators/directive/lib/normalize-options.js +18 -0
- package/src/generators/directive/lib/normalize-options.js.map +1 -0
- package/src/generators/directive/lib/validate-options.d.ts +3 -0
- package/src/generators/directive/lib/validate-options.js +12 -0
- package/src/generators/directive/lib/validate-options.js.map +1 -0
- package/src/generators/directive/schema.d.ts +5 -0
- package/src/generators/directive/schema.json +1 -1
- package/src/generators/host/host.js +2 -1
- package/src/generators/host/host.js.map +1 -1
- package/src/generators/library/lib/add-project.d.ts +4 -5
- package/src/generators/library/lib/add-project.js.map +1 -1
- package/src/generators/library/lib/create-files.d.ts +4 -5
- package/src/generators/library/lib/create-files.js +1 -1
- package/src/generators/library/lib/create-files.js.map +1 -1
- package/src/generators/pipe/lib/index.d.ts +2 -0
- package/src/generators/pipe/lib/index.js +6 -0
- package/src/generators/pipe/lib/index.js.map +1 -0
- package/src/generators/pipe/lib/normalize-options.d.ts +3 -0
- package/src/generators/pipe/lib/normalize-options.js +12 -0
- package/src/generators/pipe/lib/normalize-options.js.map +1 -0
- package/src/generators/pipe/lib/validate-options.d.ts +3 -0
- package/src/generators/pipe/lib/validate-options.js +12 -0
- package/src/generators/pipe/lib/validate-options.js.map +1 -0
- package/src/generators/pipe/pipe.d.ts +1 -1
- package/src/generators/pipe/pipe.js +13 -23
- package/src/generators/pipe/pipe.js.map +1 -1
- package/src/generators/pipe/schema.d.ts +5 -0
- package/src/generators/pipe/schema.json +1 -1
- package/src/generators/remote/remote.js +2 -1
- package/src/generators/remote/remote.js.map +1 -1
- package/src/generators/scam/lib/convert-component-to-scam.d.ts +1 -2
- package/src/generators/scam/lib/convert-component-to-scam.js +11 -11
- package/src/generators/scam/lib/convert-component-to-scam.js.map +1 -1
- package/src/generators/scam/lib/index.d.ts +1 -0
- package/src/generators/scam/lib/index.js +1 -0
- package/src/generators/scam/lib/index.js.map +1 -1
- package/src/generators/scam/lib/normalize-options.js +6 -6
- package/src/generators/scam/lib/normalize-options.js.map +1 -1
- package/src/generators/scam/lib/validate-options.d.ts +3 -0
- package/src/generators/scam/lib/validate-options.js +11 -0
- package/src/generators/scam/lib/validate-options.js.map +1 -0
- package/src/generators/scam/scam.js +9 -24
- package/src/generators/scam/scam.js.map +1 -1
- package/src/generators/scam/schema.d.ts +4 -2
- package/src/generators/scam/schema.json +6 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.d.ts +1 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +11 -11
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js.map +1 -1
- package/src/generators/scam-directive/lib/index.d.ts +1 -0
- package/src/generators/scam-directive/lib/index.js +1 -0
- package/src/generators/scam-directive/lib/index.js.map +1 -1
- package/src/generators/scam-directive/lib/normalize-options.js +8 -7
- package/src/generators/scam-directive/lib/normalize-options.js.map +1 -1
- package/src/generators/scam-directive/lib/validate-options.d.ts +3 -0
- package/src/generators/scam-directive/lib/validate-options.js +11 -0
- package/src/generators/scam-directive/lib/validate-options.js.map +1 -0
- package/src/generators/scam-directive/scam-directive.js +6 -22
- package/src/generators/scam-directive/scam-directive.js.map +1 -1
- package/src/generators/scam-directive/schema.d.ts +3 -1
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.d.ts +1 -2
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +11 -11
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js.map +1 -1
- package/src/generators/scam-pipe/lib/index.d.ts +1 -0
- package/src/generators/scam-pipe/lib/index.js +1 -0
- package/src/generators/scam-pipe/lib/index.js.map +1 -1
- package/src/generators/scam-pipe/lib/normalize-options.js +8 -7
- package/src/generators/scam-pipe/lib/normalize-options.js.map +1 -1
- package/src/generators/scam-pipe/lib/validate-options.d.ts +3 -0
- package/src/generators/scam-pipe/lib/validate-options.js +11 -0
- package/src/generators/scam-pipe/lib/validate-options.js.map +1 -0
- package/src/generators/scam-pipe/scam-pipe.js +6 -20
- package/src/generators/scam-pipe/scam-pipe.js.map +1 -1
- package/src/generators/scam-pipe/schema.d.ts +3 -1
- package/src/generators/setup-mf/lib/add-remote-entry.d.ts +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js.map +1 -1
- package/src/generators/storybook-configuration/schema.json +1 -1
- package/src/generators/utils/export-scam.d.ts +3 -2
- package/src/generators/utils/export-scam.js +4 -4
- package/src/generators/utils/export-scam.js.map +1 -1
- package/src/generators/utils/names.d.ts +5 -0
- package/src/generators/utils/names.js +12 -0
- package/src/generators/utils/names.js.map +1 -0
- package/src/generators/utils/path.d.ts +18 -1
- package/src/generators/utils/path.js +26 -1
- package/src/generators/utils/path.js.map +1 -1
- package/src/generators/utils/selector.d.ts +3 -0
- package/src/generators/utils/selector.js +15 -0
- package/src/generators/utils/selector.js.map +1 -0
- package/src/generators/utils/validations.d.ts +3 -0
- package/src/generators/utils/validations.js +25 -0
- package/src/generators/utils/validations.js.map +1 -0
- package/src/migrations/update-15-7-0/install-required-packages.js +1 -1
- package/src/migrations/update-15-7-0/install-required-packages.js.map +1 -1
- package/src/utils/mf/utils.js +2 -2
- package/src/utils/mf/utils.js.map +1 -1
- package/src/utils/nx-devkit/ast-utils.d.ts +53 -0
- package/src/utils/nx-devkit/ast-utils.js +62 -10
- package/src/utils/nx-devkit/ast-utils.js.map +1 -1
- package/src/utils/nx-devkit/route-utils.d.ts +16 -0
- package/src/utils/nx-devkit/route-utils.js +16 -0
- package/src/utils/nx-devkit/route-utils.js.map +1 -1
- package/src/utils/public-api.d.ts +2 -0
- package/src/utils/public-api.js +16 -0
- package/src/utils/public-api.js.map +1 -0
- package/src/utils/types.d.ts +4 -0
- package/src/utils/types.js +3 -0
- package/src/utils/types.js.map +1 -0
- package/src/generators/component/lib/entry-point.d.ts +0 -2
- package/src/generators/component/lib/entry-point.js +0 -19
- package/src/generators/component/lib/entry-point.js.map +0 -1
- package/src/generators/utils/file-info.d.ts +0 -16
- package/src/generators/utils/file-info.js +0 -30
- package/src/generators/utils/file-info.js.map +0 -1
- /package/src/generators/component/files/{__fileName__/__fileName__.__type__.__style__ → __fileName__.__type__.__style__} +0 -0
- /package/src/generators/component/files/{__fileName__/__fileName__.__type__.html__tpl__ → __fileName__.__type__.html__tpl__} +0 -0
- /package/src/generators/component/files/{__fileName__/__fileName__.__type__.spec.ts__tpl__ → __fileName__.__type__.spec.ts__tpl__} +0 -0
- /package/src/generators/component/files/{__fileName__/__fileName__.__type__.ts__tpl__ → __fileName__.__type__.ts__tpl__} +0 -0
- /package/src/generators/directive/files/{__directiveFileName__/__directiveFileName__.directive.spec.ts__tpl__ → __directiveFileName__.directive.spec.ts__tpl__} +0 -0
- /package/src/generators/directive/files/{__directiveFileName__/__directiveFileName__.directive.ts__tpl__ → __directiveFileName__.directive.ts__tpl__} +0 -0
- /package/src/generators/pipe/files/{__pipeFileName__/__pipeFileName__.pipe.spec.ts__tpl__ → __pipeFileName__.pipe.spec.ts__tpl__} +0 -0
- /package/src/generators/pipe/files/{__pipeFileName__/__pipeFileName__.pipe.ts__tpl__ → __pipeFileName__.pipe.ts__tpl__} +0 -0
package/migrations.json
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"factory": "./src/migrations/update-15-2-0/update-workspace-config"
|
|
122
122
|
},
|
|
123
123
|
"update-platform-server-exports": {
|
|
124
|
-
"cli": "
|
|
124
|
+
"cli": "nx",
|
|
125
125
|
"version": "15.2.0-beta.0",
|
|
126
126
|
"requires": {
|
|
127
127
|
"@angular/core": ">=15.0.0"
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"factory": "./src/migrations/update-15-2-0/remove-platform-server-exports"
|
|
131
131
|
},
|
|
132
132
|
"update-karma-main-file": {
|
|
133
|
-
"cli": "
|
|
133
|
+
"cli": "nx",
|
|
134
134
|
"version": "15.2.0-beta.0",
|
|
135
135
|
"requires": {
|
|
136
136
|
"@angular/core": ">=15.0.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0-beta.0",
|
|
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, 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- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"./executors": "./executors.js",
|
|
21
21
|
"./tailwind": "./tailwind.js",
|
|
22
22
|
"./src/generators/utils": "./src/generators/utils/index.js",
|
|
23
|
+
"./src/utils": "./src/utils/public-api.js",
|
|
23
24
|
"./module-federation": "./module-federation/index.js",
|
|
24
25
|
"./plugins/component-testing": "./plugins/component-testing.js",
|
|
25
26
|
"./package.json": {
|
|
@@ -63,14 +64,14 @@
|
|
|
63
64
|
"migrations": "./migrations.json"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@nrwl/cypress": "
|
|
67
|
-
"@nrwl/devkit": "
|
|
68
|
-
"@nrwl/jest": "
|
|
69
|
-
"@nrwl/js": "
|
|
70
|
-
"@nrwl/linter": "
|
|
71
|
-
"@nrwl/webpack": "
|
|
72
|
-
"@nrwl/workspace": "
|
|
73
|
-
"@phenomnomnominal/tsquery": "
|
|
67
|
+
"@nrwl/cypress": "16.0.0-beta.0",
|
|
68
|
+
"@nrwl/devkit": "16.0.0-beta.0",
|
|
69
|
+
"@nrwl/jest": "16.0.0-beta.0",
|
|
70
|
+
"@nrwl/js": "16.0.0-beta.0",
|
|
71
|
+
"@nrwl/linter": "16.0.0-beta.0",
|
|
72
|
+
"@nrwl/webpack": "16.0.0-beta.0",
|
|
73
|
+
"@nrwl/workspace": "16.0.0-beta.0",
|
|
74
|
+
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
74
75
|
"chalk": "^4.1.0",
|
|
75
76
|
"chokidar": "^3.5.1",
|
|
76
77
|
"enquirer": "^2.3.6",
|
|
@@ -108,5 +109,5 @@
|
|
|
108
109
|
"fesm2015": "fesm2015/nrwl-angular.mjs",
|
|
109
110
|
"typings": "index.d.ts",
|
|
110
111
|
"sideEffects": false,
|
|
111
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "1e31d4726f2c623ede0c515429aa842e943dba47"
|
|
112
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/create-project.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/create-project.ts"],"names":[],"mappings":";;;AACA,yCAAuD;AAEvD,6DAA2E;AAG3E,SAAgB,aAAa,CAAC,IAAU,EAAE,OAAyB;IACjE,MAAM,oBAAoB,GAAG,IAAA,8CAA8B,EAAC,IAAI,CAAC,CAAC;IAClE,MAAM,OAAO,GAAgC;QAC3C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,aAAa;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,cAAc;QAC5B,UAAU,EAAE,GAAG,OAAO,CAAC,cAAc,MAAM;QAC3C,IAAI,EAAE,OAAO,CAAC,UAAU;QACxB,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,QAAQ,EAAE,uCAAuC;gBACjD,OAAO,EAAE,CAAC,sBAAsB,CAAC;gBACjC,OAAO,EAAE;oBACP,UAAU,EAAE,QACV,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,IAC1D,EAAE;oBACF,KAAK,EAAE,GAAG,OAAO,CAAC,cAAc,iBAAiB;oBACjD,IAAI,EAAE,GAAG,OAAO,CAAC,cAAc,cAAc;oBAC7C,SAAS,EACP,oBAAoB,CAAC,KAAK,KAAK,EAAE;wBAC/B,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,mBAAmB;wBAC9C,CAAC,CAAC,C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AI,mBAAmB;qBAClD;oBACD,WAAW,EAAE;wBACX,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,oBAAoB;qBACnD;iBACF;gBACD,oBAAoB,EAAE,aAAa;aACpC;YACD,cAAc,EAAE;gBACd,QAAQ,EAAE,4CAA4C;gBACtD,OAAO,EAAE;oBACP,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,QAAQ;iBACvC;aACF;SACF;KACF,CAAC;IAEF,IAAA,gCAAuB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AA9FD,sCA8FC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const component_1 = require("./component");
|
|
4
|
-
const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
|
|
5
3
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
|
|
4
|
+
const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
|
|
5
|
+
const component_1 = require("./component");
|
|
6
|
+
exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(component_1.componentGenerator));
|
|
7
7
|
//# sourceMappingURL=component.compat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.compat.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/component/component.compat.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"component.compat.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/component/component.compat.ts"],"names":[],"mappings":";;AAAA,yCAAkD;AAClD,gFAA0E;AAC1E,2CAAiD;AAEjD,kBAAe,IAAA,gDAAqB,EAAC,IAAA,2BAAkB,EAAC,8BAAkB,CAAC,CAAC,CAAC"}
|
|
@@ -3,31 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const semver_1 = require("semver");
|
|
7
|
-
const path_1 = require("../utils/path");
|
|
8
|
-
const version_utils_1 = require("../utils/version-utils");
|
|
9
|
-
const component_1 = require("./lib/component");
|
|
10
|
-
const normalize_options_1 = require("./lib/normalize-options");
|
|
11
6
|
const utils_1 = require("../utils");
|
|
12
|
-
const
|
|
7
|
+
const lib_1 = require("./lib");
|
|
13
8
|
function componentGenerator(tree, rawOptions) {
|
|
14
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
rawOptions.standalone) {
|
|
18
|
-
throw new Error((0, devkit_1.stripIndents) `The "standalone" option is only supported in Angular >= 14.1.0. You are currently using ${installedAngularVersionInfo.version}.
|
|
19
|
-
You can resolve this error by removing the "standalone" option or by migrating to Angular 14.1.0.`);
|
|
20
|
-
}
|
|
21
|
-
const options = yield (0, normalize_options_1.normalizeOptions)(tree, rawOptions);
|
|
22
|
-
(0, path_1.checkPathUnderProjectRoot)(tree, options.project, options.path);
|
|
23
|
-
const pathToGenerate = options.flat
|
|
24
|
-
? (0, devkit_1.joinPathFragments)(__dirname, './files/__fileName__')
|
|
25
|
-
: (0, devkit_1.joinPathFragments)(__dirname, './files');
|
|
10
|
+
(0, lib_1.validateOptions)(tree, rawOptions);
|
|
11
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
26
12
|
const componentNames = (0, devkit_1.names)(options.name);
|
|
27
13
|
const typeNames = (0, devkit_1.names)(options.type);
|
|
28
|
-
|
|
29
|
-
buildSelector(tree, componentNames.fileName, options.prefix);
|
|
30
|
-
(0, devkit_1.generateFiles)(tree, pathToGenerate, options.path, {
|
|
14
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.directory, {
|
|
31
15
|
fileName: componentNames.fileName,
|
|
32
16
|
className: componentNames.className,
|
|
33
17
|
type: typeNames.fileName,
|
|
@@ -40,38 +24,33 @@ function componentGenerator(tree, rawOptions) {
|
|
|
40
24
|
changeDetection: options.changeDetection,
|
|
41
25
|
viewEncapsulation: options.viewEncapsulation,
|
|
42
26
|
displayBlock: options.displayBlock,
|
|
43
|
-
selector,
|
|
27
|
+
selector: options.selector,
|
|
44
28
|
tpl: '',
|
|
45
29
|
});
|
|
46
30
|
if (options.skipTests) {
|
|
47
|
-
const pathToSpecFile = (0, devkit_1.joinPathFragments)(options.
|
|
31
|
+
const pathToSpecFile = (0, devkit_1.joinPathFragments)(options.directory, `${componentNames.fileName}.${typeNames.fileName}.spec.ts`);
|
|
48
32
|
tree.delete(pathToSpecFile);
|
|
49
33
|
}
|
|
50
34
|
if (options.inlineTemplate) {
|
|
51
|
-
const pathToTemplateFile = (0, devkit_1.joinPathFragments)(options.
|
|
35
|
+
const pathToTemplateFile = (0, devkit_1.joinPathFragments)(options.directory, `${componentNames.fileName}.${typeNames.fileName}.html`);
|
|
52
36
|
tree.delete(pathToTemplateFile);
|
|
53
37
|
}
|
|
54
38
|
if (options.inlineStyle) {
|
|
55
|
-
const pathToStyleFile = (0, devkit_1.joinPathFragments)(options.
|
|
39
|
+
const pathToStyleFile = (0, devkit_1.joinPathFragments)(options.directory, `${componentNames.fileName}.${typeNames.fileName}.${options.style}`);
|
|
56
40
|
tree.delete(pathToStyleFile);
|
|
57
41
|
}
|
|
58
42
|
if (!options.skipImport && !options.standalone) {
|
|
59
|
-
const modulePath = (0,
|
|
43
|
+
const modulePath = (0, lib_1.findModuleFromOptions)(tree, options, options.projectRoot);
|
|
60
44
|
(0, utils_1.addToNgModule)(tree, options.path, modulePath, componentNames.fileName, `${componentNames.className}${typeNames.className}`, options.flat
|
|
61
45
|
? `${componentNames.fileName}.${typeNames.fileName}`
|
|
62
46
|
: (0, devkit_1.joinPathFragments)(componentNames.fileName, `${componentNames.fileName}.${typeNames.fileName}`), 'declarations', options.flat, options.export);
|
|
63
47
|
}
|
|
64
|
-
(0,
|
|
48
|
+
(0, lib_1.exportComponentInEntryPoint)(tree, options);
|
|
65
49
|
if (!options.skipFormat) {
|
|
66
50
|
yield (0, devkit_1.formatFiles)(tree);
|
|
67
51
|
}
|
|
68
52
|
});
|
|
69
53
|
}
|
|
70
54
|
exports.componentGenerator = componentGenerator;
|
|
71
|
-
function buildSelector(tree, name, prefix) {
|
|
72
|
-
var _a;
|
|
73
|
-
const selectorPrefix = (0, devkit_1.names)((_a = prefix !== null && prefix !== void 0 ? prefix : (0, devkit_1.readNxJson)(tree).npmScope) !== null && _a !== void 0 ? _a : 'app').fileName;
|
|
74
|
-
return (0, devkit_1.names)(`${selectorPrefix}-${name}`).fileName;
|
|
75
|
-
}
|
|
76
55
|
exports.default = componentGenerator;
|
|
77
56
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/component/component.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/component/component.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,oCAAyC;AACzC,+BAKe;AAGf,SAAsB,kBAAkB,CAAC,IAAU,EAAE,UAAkB;;QACrE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAEnD,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EACrC,OAAO,CAAC,SAAS,EACjB;YACE,QAAQ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AAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC9C,MAAM,UAAU,GAAG,IAAA,2BAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CAAC,WAAW,CACpB,CAAC;YACF,IAAA,qBAAa,EACX,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,UAAU,EACV,cAAc,CAAC,QAAQ,EACvB,GAAG,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,EACnD,OAAO,CAAC,IAAI;gBACV,CAAC,CAAC,GAAG,cAAc,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ,EAAE;gBACpD,CAAC,CAAC,IAAA,0BAAiB,EACf,cAAc,CAAC,QAAQ,EACvB,GAAG,cAAc,CAAC,QAAQ,IAAI,SAAS,CAAC,QAAQ,EAAE,CACnD,EACL,cAAc,EACd,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,MAAM,CACf,CAAC;SACH;QAED,IAAA,iCAA2B,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AArFD,gDAqFC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.exportComponentInEntryPoint = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const
|
|
5
|
+
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
6
6
|
const entry_point_1 = require("../../utils/entry-point");
|
|
7
7
|
const path_1 = require("../../utils/path");
|
|
8
|
-
const entry_point_2 = require("./entry-point");
|
|
9
8
|
const module_1 = require("./module");
|
|
10
9
|
function exportComponentInEntryPoint(tree, schema) {
|
|
11
10
|
if (!schema.export || schema.skipImport) {
|
|
@@ -15,8 +14,7 @@ function exportComponentInEntryPoint(tree, schema) {
|
|
|
15
14
|
if (projectType === 'application') {
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
|
-
const
|
|
19
|
-
const entryPointPath = (0, entry_point_1.locateLibraryEntryPointFromDirectory)(tree, directory, root, schema.projectSourceRoot);
|
|
17
|
+
const entryPointPath = (0, entry_point_1.locateLibraryEntryPointFromDirectory)(tree, schema.directory, root, schema.projectSourceRoot);
|
|
20
18
|
if (!entryPointPath) {
|
|
21
19
|
devkit_1.logger.warn(`Unable to determine whether the component should be exported in the library entry point file. ` +
|
|
22
20
|
`The library's entry point file could not be found. Skipping exporting the component in the entry point file.`);
|
|
@@ -24,14 +22,26 @@ function exportComponentInEntryPoint(tree, schema) {
|
|
|
24
22
|
}
|
|
25
23
|
if (!schema.standalone) {
|
|
26
24
|
const modulePath = (0, module_1.findModuleFromOptions)(tree, schema, root);
|
|
27
|
-
if (!
|
|
25
|
+
if (!shouldExportInEntryPoint(tree, entryPointPath, modulePath)) {
|
|
28
26
|
return;
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
|
-
const relativePathFromEntryPoint = (0, path_1.getRelativeImportToFile)(entryPointPath, filePath);
|
|
29
|
+
const relativePathFromEntryPoint = (0, path_1.getRelativeImportToFile)(entryPointPath, schema.filePath);
|
|
32
30
|
const updateEntryPointContent = (0, devkit_1.stripIndents) `${tree.read(entryPointPath, 'utf-8')}
|
|
33
31
|
export * from "${relativePathFromEntryPoint}";`;
|
|
34
32
|
tree.write(entryPointPath, updateEntryPointContent);
|
|
35
33
|
}
|
|
36
34
|
exports.exportComponentInEntryPoint = exportComponentInEntryPoint;
|
|
35
|
+
function shouldExportInEntryPoint(tree, entryPoint, modulePath) {
|
|
36
|
+
if (!modulePath) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
(0, ensure_typescript_1.ensureTypescript)();
|
|
40
|
+
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
41
|
+
const moduleImportPath = (0, path_1.getRelativeImportToFile)(entryPoint, modulePath);
|
|
42
|
+
const entryPointContent = tree.read(entryPoint, 'utf-8');
|
|
43
|
+
const entryPointAst = tsquery.ast(entryPointContent);
|
|
44
|
+
const moduleExport = tsquery(entryPointAst, `ExportDeclaration StringLiteral[value='${moduleImportPath}']`, { visitAllChildren: true })[0];
|
|
45
|
+
return Boolean(moduleExport);
|
|
46
|
+
}
|
|
37
47
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/component.ts"],"names":[],"mappings":";;;AACA,yCAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/component.ts"],"names":[],"mappings":";;;AACA,yCAA8E;AAC9E,uFAAmF;AAEnF,yDAA+E;AAC/E,2CAA2D;AAE3D,qCAAiD;AAEjD,SAAgB,2BAA2B,CACzC,IAAU,EACV,MAAwB;IAExB,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,EAAE;QACvC,OAAO;KACR;IAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAE7E,IAAI,WAAW,KAAK,aAAa,EAAE;QACjC,OAAO;KACR;IAED,MAAM,cAAc,GAAG,IAAA,kDAAoC,EACzD,IAAI,EACJ,MAAM,CAAC,SAAS,EAChB,IAAI,EACJ,MAAM,CAAC,iBAAiB,CACzB,CAAC;IACF,IAAI,CAAC,cAAc,EAAE;QACnB,eAAM,CAAC,IAAI,CACT,gGAAgG;YAC9F,8GAA8G,CACjH,CAAC;QAEF,OAAO;KACR;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;QACtB,MAAM,UAAU,GAAG,IAAA,8BAAqB,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE;YAC/D,OAAO;SACR;KACF;IAED,MAAM,0BAA0B,GAAG,IAAA,8BAAuB,EACxD,cAAc,EACd,MAAM,CAAC,QAAQ,CAChB,CAAC;IACF,MAAM,uBAAuB,GAAG,IAAA,qBAAY,EAAA,GAAG,IAAI,CAAC,IAAI,CACtD,cAAc,EACd,OAAO,CACR;qBACkB,0BAA0B,IAAI,CAAC;IAElD,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC;AACtD,CAAC;AA/CD,kEA+CC;AAED,SAAS,wBAAwB,CAC/B,IAAU,EACV,UAAkB,EAClB,UAAkB;IAElB,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,KAAK,CAAC;KACd;IAED,IAAA,oCAAgB,GAAE,CAAC;IACnB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACzD,MAAM,gBAAgB,GAAG,IAAA,8BAAuB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACzE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,OAAO,CAC1B,aAAa,EACb,0CAA0C,gBAAgB,IAAI,EAC9D,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAC3B,CAAC,CAAC,CAAkB,CAAC;IAEtB,OAAO,OAAO,CAAC,YAAY,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./component"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./module"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./validate-options"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,mDAAyB;AACzB,8DAAoC;AACpC,6DAAmC"}
|
|
@@ -10,12 +10,11 @@ const moduleExt = '.module.ts';
|
|
|
10
10
|
const routingModuleExt = '-routing.module.ts';
|
|
11
11
|
function findModuleFromOptions(tree, options, projectRoot) {
|
|
12
12
|
if (!options.module) {
|
|
13
|
-
|
|
14
|
-
return (0, devkit_1.normalizePath)(findModule(tree, pathToCheck, projectRoot));
|
|
13
|
+
return (0, devkit_1.normalizePath)(findModule(tree, options.directory, projectRoot));
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
17
16
|
const modulePath = (0, devkit_1.joinPathFragments)(options.path, options.module);
|
|
18
|
-
const componentPath =
|
|
17
|
+
const componentPath = options.directory;
|
|
19
18
|
const moduleBaseName = (0, path_1.basename)(modulePath);
|
|
20
19
|
const candidateSet = new Set([options.path]);
|
|
21
20
|
const projectRootParent = (0, path_1.dirname)(projectRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/module.ts"],"names":[],"mappings":";;;AACA,yCAAgE;AAChE,+BAAyC;AAGzC,uHAAuH;AACvH,8EAA8E;AAC9E,2EAA2E;AAC3E,MAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAyB,EACzB,WAAmB;IAEnB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/module.ts"],"names":[],"mappings":";;;AACA,yCAAgE;AAChE,+BAAyC;AAGzC,uHAAuH;AACvH,8EAA8E;AAC9E,2EAA2E;AAC3E,MAAM,SAAS,GAAG,YAAY,CAAC;AAC/B,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAyB,EACzB,WAAmB;IAEnB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,OAAO,IAAA,sBAAa,EAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;KACxE;SAAM;QACL,MAAM,UAAU,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACnE,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC;QACxC,MAAM,cAAc,GAAG,IAAA,eAAQ,EAAC,UAAU,CAAC,CAAC;QAE5C,MAAM,YAAY,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,MAAM,iBAAiB,GAAG,IAAA,cAAO,EAAC,WAAW,CAAC,CAAC;QAC/C,KAAK,IAAI,GAAG,GAAG,UAAU,EAAE,GAAG,KAAK,iBAAiB,EAAE,GAAG,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,EAAE;YACxE,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,KAAK,IAAI,GAAG,GAAG,aAAa,EAAE,GAAG,KAAK,WAAW,EAAE,GAAG,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,EAAE;YACrE,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACvB;QAED,MAAM,cAAc,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAA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AC,MAAM,IAAI,CAAC,EAAE;YAC/B,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;SAC3B;aAAM,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;YACrC,OAAO,IAAI,CAAC;SACb;QAED,GAAG,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,CAAC;KACpB;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
2
|
import type { NormalizedSchema, Schema } from '../schema';
|
|
3
|
-
export declare function normalizeOptions(tree: Tree, options: Schema):
|
|
3
|
+
export declare function normalizeOptions(tree: Tree, options: Schema): NormalizedSchema;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("../../utils/path");
|
|
6
|
+
const selector_1 = require("../../utils/selector");
|
|
6
7
|
function normalizeOptions(tree, options) {
|
|
7
8
|
var _a, _b, _c, _d;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return Object.assign(Object.assign({}, options), { name, type: (_b = options.type) !== null && _b !== void 0 ? _b : 'component', changeDetection: (_c = options.changeDetection) !== null && _c !== void 0 ? _c : 'Default', style: (_d = options.style) !== null && _d !== void 0 ? _d : 'css', path,
|
|
16
|
-
projectSourceRoot, projectRoot: root });
|
|
17
|
-
});
|
|
9
|
+
(_a = options.type) !== null && _a !== void 0 ? _a : (options.type = 'component');
|
|
10
|
+
const { directory, filePath, name, path, root, sourceRoot } = (0, path_1.normalizeNameAndPaths)(tree, options);
|
|
11
|
+
const { prefix } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
12
|
+
const selector = (_b = options.selector) !== null && _b !== void 0 ? _b : (0, selector_1.buildSelector)(tree, name, options.prefix, prefix, 'fileName');
|
|
13
|
+
return Object.assign(Object.assign({}, options), { name, changeDetection: (_c = options.changeDetection) !== null && _c !== void 0 ? _c : 'Default', style: (_d = options.style) !== null && _d !== void 0 ? _d : 'css', directory,
|
|
14
|
+
filePath,
|
|
15
|
+
path, projectSourceRoot: sourceRoot, projectRoot: root, selector });
|
|
18
16
|
}
|
|
19
17
|
exports.normalizeOptions = normalizeOptions;
|
|
20
18
|
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/normalize-options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AAExD,2CAAyD;AACzD,mDAAqD;AAGrD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAA,OAAO,CAAC,IAAI,oCAAZ,OAAO,CAAC,IAAI,GAAK,WAAW,EAAC;IAC7B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GACzD,IAAA,4BAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEvC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,iCAAwB,EACzC,IAAI,EACJ,OAAO,CAAC,OAAO,CACe,CAAC;IAEjC,MAAM,QAAQ,GACZ,MAAA,OAAO,CAAC,QAAQ,mCAChB,IAAA,wBAAa,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAEhE,uCACK,OAAO,KACV,IAAI,EACJ,eAAe,EAAE,MAAA,OAAO,CAAC,eAAe,mCAAI,SAAS,EACrD,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,KAAK,EAC7B,SAAS;QACT,QAAQ;QACR,IAAI,EACJ,iBAAiB,EAAE,UAAU,EAC7B,WAAW,EAAE,IAAI,EACjB,QAAQ,IACR;AACJ,CAAC;AA7BD,4CA6BC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateOptions = void 0;
|
|
4
|
+
const path_1 = require("../../utils/path");
|
|
5
|
+
const validations_1 = require("../../utils/validations");
|
|
6
|
+
function validateOptions(tree, options) {
|
|
7
|
+
(0, validations_1.validateProject)(tree, options.project);
|
|
8
|
+
(0, path_1.checkPathUnderProjectRoot)(tree, options.project, options.path);
|
|
9
|
+
(0, validations_1.validateStandaloneOption)(tree, options.standalone);
|
|
10
|
+
}
|
|
11
|
+
exports.validateOptions = validateOptions;
|
|
12
|
+
//# sourceMappingURL=validate-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/component/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAGiC;AAGjC,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAe;IACzD,IAAA,6BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAA,gCAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,IAAA,sCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AACrD,CAAC;AAJD,0CAIC"}
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"alias": "t"
|
|
55
55
|
},
|
|
56
56
|
"standalone": {
|
|
57
|
-
"description": "Whether the generated component is standalone. _Note: This is only supported in Angular versions >= 14.1.0_",
|
|
57
|
+
"description": "Whether the generated component is standalone. _Note: This is only supported in Angular versions >= 14.1.0_.",
|
|
58
58
|
"type": "boolean",
|
|
59
59
|
"default": false,
|
|
60
60
|
"x-priority": "important"
|
|
@@ -4,9 +4,9 @@ exports.conversionSchematic = exports.conversionGenerator = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cypress_1 = require("@nrwl/cypress");
|
|
6
6
|
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
|
|
8
7
|
const linter_1 = require("@nrwl/linter");
|
|
9
8
|
const add_linting_1 = require("../add-linting/add-linting");
|
|
9
|
+
const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
|
|
10
10
|
function conversionGenerator(host, options) {
|
|
11
11
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-tslint-to-eslint.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts"],"names":[],"mappings":";;;;AAAA,2CAAkF;AAClF,yCAMsB;AACtB,
|
|
1
|
+
{"version":3,"file":"convert-tslint-to-eslint.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts"],"names":[],"mappings":";;;;AAAA,2CAAkF;AAClF,yCAMsB;AACtB,yCAA6E;AAG7E,4DAAiE;AACjE,gFAA0E;AAE1E,SAAsB,mBAAmB,CACvC,IAAU,EACV,OAAoC;;QAEpC;;;;;;;;;WASG;QACH,MAAM,gBAAgB,GAAG,IAAI,yBAAgB,CAAC;YAC5C,IAAI;YACJ,WAAW,EAAE,OAAO,CAAC,OAAO;YAC5B,0BAA0B,EAAE,OAAO,CAAC,0BAA0B;YAC9D,iBAAiB,EAAE,CAAO,EAAE,WAAW,EAAE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CAAwC,CAAC,EAC/D;gBACA,QAAQ,CAAC,OAAO,GAAG,CAAC,wCAAwC,CAAC,CAAC;aAC/D;SACF;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;IAED;;;OAGG;IACH,OAAO,IAAI,CAAC,KAAK,CAAC;IAClB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -3,49 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.directiveGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const path_1 = require("../utils/path");
|
|
7
6
|
const utils_1 = require("../utils");
|
|
8
|
-
|
|
7
|
+
const lib_1 = require("./lib");
|
|
9
8
|
function directiveGenerator(tree, schema) {
|
|
10
|
-
var _a, _b, _c;
|
|
11
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const project = (0, devkit_1.readProjectConfiguration)(tree, schema.project);
|
|
18
|
-
const path = (_a = schema.path) !== null && _a !== void 0 ? _a : `${project.sourceRoot}`;
|
|
19
|
-
const directiveNames = (0, devkit_1.names)(schema.name);
|
|
20
|
-
const selector = (_b = schema.selector) !== null && _b !== void 0 ? _b : buildSelector(tree, schema.name, (_c = schema.prefix) !== null && _c !== void 0 ? _c : project.prefix);
|
|
21
|
-
const pathToGenerateFiles = schema.flat
|
|
22
|
-
? './files/__directiveFileName__'
|
|
23
|
-
: './files';
|
|
24
|
-
yield (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, pathToGenerateFiles), path, {
|
|
25
|
-
selector,
|
|
10
|
+
(0, lib_1.validateOptions)(tree, schema);
|
|
11
|
+
const options = (0, lib_1.normalizeOptions)(tree, schema);
|
|
12
|
+
const directiveNames = (0, devkit_1.names)(options.name);
|
|
13
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.directory, {
|
|
14
|
+
selector: options.selector,
|
|
26
15
|
directiveClassName: directiveNames.className,
|
|
27
16
|
directiveFileName: directiveNames.fileName,
|
|
28
|
-
standalone:
|
|
17
|
+
standalone: options.standalone,
|
|
29
18
|
tpl: '',
|
|
30
19
|
});
|
|
31
|
-
if (
|
|
32
|
-
const pathToSpecFile = (0, devkit_1.joinPathFragments)(
|
|
20
|
+
if (options.skipTests) {
|
|
21
|
+
const pathToSpecFile = (0, devkit_1.joinPathFragments)(options.directory, `${directiveNames.fileName}.directive.spec.ts`);
|
|
33
22
|
tree.delete(pathToSpecFile);
|
|
34
23
|
}
|
|
35
|
-
if (!
|
|
36
|
-
const modulePath = (0, utils_1.findModule)(tree, path,
|
|
37
|
-
(0, utils_1.addToNgModule)(tree, path, modulePath, directiveNames.fileName, `${directiveNames.className}Directive`, `${directiveNames.fileName}.directive`, 'declarations',
|
|
24
|
+
if (!options.skipImport && !options.standalone) {
|
|
25
|
+
const modulePath = (0, utils_1.findModule)(tree, options.path, options.module);
|
|
26
|
+
(0, utils_1.addToNgModule)(tree, options.path, modulePath, directiveNames.fileName, `${directiveNames.className}Directive`, `${directiveNames.fileName}.directive`, 'declarations', options.flat, options.export);
|
|
38
27
|
}
|
|
39
|
-
if (!
|
|
28
|
+
if (!options.skipFormat) {
|
|
40
29
|
yield (0, devkit_1.formatFiles)(tree);
|
|
41
30
|
}
|
|
42
31
|
});
|
|
43
32
|
}
|
|
44
33
|
exports.directiveGenerator = directiveGenerator;
|
|
45
|
-
function buildSelector(tree, name, prefix) {
|
|
46
|
-
let selector = (0, devkit_1.names)(name).fileName;
|
|
47
|
-
const selectorPrefix = (0, devkit_1.names)(prefix !== null && prefix !== void 0 ? prefix : (0, devkit_1.readNxJson)(tree).npmScope).fileName;
|
|
48
|
-
return (0, devkit_1.names)(`${selectorPrefix}-${selector}`).propertyName;
|
|
49
|
-
}
|
|
50
34
|
exports.default = directiveGenerator;
|
|
51
35
|
//# sourceMappingURL=directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/directive/directive.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/directive/directive.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,oCAAqD;AACrD,+BAA0D;AAG1D,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,IAAA,qBAAe,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE/C,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EACrC,OAAO,CAAC,SAAS,EACjB;YACE,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,kBAAkB,EAAE,cAAc,CAAC,SAAS;YAC5C,iBAAiB,EAAE,cAAc,CAAC,QAAQ;YAC1C,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,GAAG,EAAE,EAAE;SACR,CACF,CAAC;QAEF,IAAI,OAAO,CAAC,SAAS,EAAE;YACrB,MAAM,cAAc,GAAG,IAAA,0BAAiB,EACtC,OAAO,CAAC,SAAS,EACjB,GAAG,cAAc,CAAC,QAAQ,oBAAoB,CAC/C,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;SAC7B;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC9C,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAClE,IAAA,qBAAa,EACX,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,UAAU,EACV,cAAc,CAAC,QAAQ,EACvB,GAAG,cAAc,CAAC,SAAS,WAAW,EACtC,GAAG,cAAc,CAAC,QAAQ,YAAY,EACtC,cAAc,EACd,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,MAAM,CACf,CAAC;SACH;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AA9CD,gDA8CC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./validate-options"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/directive/lib/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("../../utils/path");
|
|
6
|
+
const selector_1 = require("../../utils/selector");
|
|
7
|
+
function normalizeOptions(tree, options) {
|
|
8
|
+
var _a;
|
|
9
|
+
const { directory, name, path } = (0, path_1.normalizeNameAndPaths)(tree, Object.assign(Object.assign({}, options), { type: 'directive' }));
|
|
10
|
+
const { prefix } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
11
|
+
const selector = (_a = options.selector) !== null && _a !== void 0 ? _a : (0, selector_1.buildSelector)(tree, name, options.prefix, prefix, 'propertyName');
|
|
12
|
+
return Object.assign(Object.assign({}, options), { directory,
|
|
13
|
+
name,
|
|
14
|
+
path,
|
|
15
|
+
selector });
|
|
16
|
+
}
|
|
17
|
+
exports.normalizeOptions = normalizeOptions;
|
|
18
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/directive/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AAExD,2CAAyD;AACzD,mDAAqD;AAGrD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EAAC,IAAI,kCACvD,OAAO,KACV,IAAI,EAAE,WAAW,IACjB,CAAC;IAEH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,iCAAwB,EACzC,IAAI,EACJ,OAAO,CAAC,OAAO,CACe,CAAC;IAEjC,MAAM,QAAQ,GACZ,MAAA,OAAO,CAAC,QAAQ,mCAChB,IAAA,wBAAa,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IAEpE,uCACK,OAAO,KACV,SAAS;QACT,IAAI;QACJ,IAAI;QACJ,QAAQ,IACR;AACJ,CAAC;AAzBD,4CAyBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateOptions = void 0;
|
|
4
|
+
const path_1 = require("../../utils/path");
|
|
5
|
+
const validations_1 = require("../../utils/validations");
|
|
6
|
+
function validateOptions(tree, options) {
|
|
7
|
+
(0, validations_1.validateProject)(tree, options.project);
|
|
8
|
+
(0, path_1.checkPathUnderProjectRoot)(tree, options.project, options.path);
|
|
9
|
+
(0, validations_1.validateStandaloneOption)(tree, options.standalone);
|
|
10
|
+
}
|
|
11
|
+
exports.validateOptions = validateOptions;
|
|
12
|
+
//# sourceMappingURL=validate-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/directive/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAGiC;AAGjC,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAe;IACzD,IAAA,6BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAA,gCAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,IAAA,sCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AACrD,CAAC;AAJD,0CAIC"}
|