@nrwl/angular 15.9.0-beta.0 → 15.9.0-beta.2
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 +2 -0
- package/generators.js +2 -0
- package/generators.js.map +1 -1
- package/generators.json +12 -0
- package/package.json +9 -9
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +12 -15
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js.map +1 -1
- package/src/generators/application/angular-v14/lib/nrwl-home-tpl.js +26 -5
- package/src/generators/application/angular-v14/lib/nrwl-home-tpl.js.map +1 -1
- package/src/generators/application/lib/nrwl-home-tpl.js +26 -5
- package/src/generators/application/lib/nrwl-home-tpl.js.map +1 -1
- package/src/generators/component/component.js +3 -19
- package/src/generators/component/component.js.map +1 -1
- package/src/generators/component/lib/normalize-options.js +3 -24
- package/src/generators/component/lib/normalize-options.js.map +1 -1
- package/src/generators/component/schema.d.ts +1 -2
- package/src/generators/component/schema.json +3 -0
- package/src/generators/component-cypress-spec/schema.json +3 -0
- package/src/generators/component-test/schema.json +3 -0
- package/src/generators/cypress-component-configuration/schema.json +3 -0
- package/src/generators/directive/directive.d.ts +4 -0
- package/src/generators/directive/directive.js +51 -0
- package/src/generators/directive/directive.js.map +1 -0
- package/src/generators/directive/files/__directiveFileName__/__directiveFileName__.directive.spec.ts__tpl__ +8 -0
- package/src/generators/directive/files/__directiveFileName__/__directiveFileName__.directive.ts__tpl__ +11 -0
- package/src/generators/directive/schema.d.ts +14 -0
- package/src/generators/directive/schema.json +92 -0
- package/src/generators/pipe/files/__pipeFileName__/__pipeFileName__.pipe.spec.ts__tpl__ +8 -0
- package/src/generators/pipe/files/__pipeFileName__/__pipeFileName__.pipe.ts__tpl__ +13 -0
- package/src/generators/pipe/pipe.d.ts +4 -0
- package/src/generators/pipe/pipe.js +45 -0
- package/src/generators/pipe/pipe.js.map +1 -0
- package/src/generators/pipe/schema.d.ts +12 -0
- package/src/generators/pipe/schema.json +73 -0
- package/src/generators/scam/lib/normalize-options.js +4 -6
- package/src/generators/scam/lib/normalize-options.js.map +1 -1
- package/src/generators/scam/scam.js +1 -3
- package/src/generators/scam/scam.js.map +1 -1
- package/src/generators/scam/schema.d.ts +1 -2
- package/src/generators/scam/schema.json +3 -0
- package/src/generators/scam-directive/lib/normalize-options.js +4 -6
- package/src/generators/scam-directive/lib/normalize-options.js.map +1 -1
- package/src/generators/scam-directive/scam-directive.js +1 -3
- package/src/generators/scam-directive/scam-directive.js.map +1 -1
- package/src/generators/scam-directive/schema.d.ts +1 -2
- package/src/generators/scam-directive/schema.json +3 -0
- package/src/generators/scam-pipe/lib/normalize-options.js +4 -6
- package/src/generators/scam-pipe/lib/normalize-options.js.map +1 -1
- package/src/generators/scam-pipe/scam-pipe.js +1 -3
- package/src/generators/scam-pipe/scam-pipe.js.map +1 -1
- package/src/generators/scam-pipe/schema.d.ts +1 -2
- package/src/generators/scam-pipe/schema.json +3 -0
- package/src/generators/storybook-configuration/schema.json +2 -1
- package/src/generators/utils/file-info.d.ts +1 -1
- package/src/generators/utils/file-info.js +3 -4
- package/src/generators/utils/file-info.js.map +1 -1
- package/src/generators/utils/find-module.d.ts +4 -0
- package/src/generators/utils/find-module.js +59 -0
- package/src/generators/utils/find-module.js.map +1 -0
- package/src/generators/utils/index.d.ts +1 -0
- package/src/generators/utils/index.js +1 -0
- package/src/generators/utils/index.js.map +1 -1
- package/src/generators/utils/insert-ngmodule-import.d.ts +1 -2
- package/src/generators/utils/insert-ngmodule-import.js +42 -21
- package/src/generators/utils/insert-ngmodule-import.js.map +1 -1
- package/src/generators/utils/path.d.ts +2 -0
- package/src/generators/utils/path.js +16 -1
- package/src/generators/utils/path.js.map +1 -1
- package/src/generators/utils/testing.js +5 -0
- package/src/generators/utils/testing.js.map +1 -1
- package/src/generators/web-worker/schema.json +3 -0
- package/src/utils/mf/utils.js +8 -0
- package/src/utils/mf/utils.js.map +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "GeneratorAngularDirective",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Nx Angular Directive Options Schema",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"description": "Creates a new, generic directive definition in the given project.",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "The name of the new directive.",
|
|
13
|
+
"$default": {
|
|
14
|
+
"$source": "argv",
|
|
15
|
+
"index": 0
|
|
16
|
+
},
|
|
17
|
+
"x-prompt": "What name would you like to use for the directive?"
|
|
18
|
+
},
|
|
19
|
+
"path": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"format": "path",
|
|
22
|
+
"$default": {
|
|
23
|
+
"$source": "workingDirectory"
|
|
24
|
+
},
|
|
25
|
+
"description": "The path at which to create the interface that defines the directive, relative to the workspace root.",
|
|
26
|
+
"visible": false
|
|
27
|
+
},
|
|
28
|
+
"project": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The name of the project.",
|
|
31
|
+
"$default": {
|
|
32
|
+
"$source": "projectName"
|
|
33
|
+
},
|
|
34
|
+
"x-dropdown": "projects"
|
|
35
|
+
},
|
|
36
|
+
"prefix": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "A prefix to apply to generated selectors.",
|
|
39
|
+
"alias": "p",
|
|
40
|
+
"oneOf": [
|
|
41
|
+
{
|
|
42
|
+
"maxLength": 0
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"minLength": 1,
|
|
46
|
+
"format": "html-selector"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"skipTests": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Do not create \"spec.ts\" test files for the new class.",
|
|
53
|
+
"default": false
|
|
54
|
+
},
|
|
55
|
+
"skipImport": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"description": "Do not import this directive into the owning NgModule.",
|
|
58
|
+
"default": false
|
|
59
|
+
},
|
|
60
|
+
"selector": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"format": "html-selector",
|
|
63
|
+
"description": "The HTML selector to use for this directive."
|
|
64
|
+
},
|
|
65
|
+
"standalone": {
|
|
66
|
+
"description": "Whether the generated directive is standalone.",
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"default": false
|
|
69
|
+
},
|
|
70
|
+
"flat": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "When true (the default), creates the new files at the top level of the current project.",
|
|
73
|
+
"default": true
|
|
74
|
+
},
|
|
75
|
+
"module": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "The filename of the declaring NgModule.",
|
|
78
|
+
"alias": "m"
|
|
79
|
+
},
|
|
80
|
+
"export": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": false,
|
|
83
|
+
"description": "The declaring NgModule exports this directive."
|
|
84
|
+
},
|
|
85
|
+
"skipFormat": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": false,
|
|
88
|
+
"description": "Skip formatting of files."
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"required": ["name", "project"]
|
|
92
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: '<%= pipePropertyName %>'<% if(standalone) {%>,
|
|
5
|
+
standalone: true<%}%>
|
|
6
|
+
})
|
|
7
|
+
export class <%= pipeClassName %>Pipe implements PipeTransform {
|
|
8
|
+
|
|
9
|
+
transform(value: unknown, ...args: unknown[]): unknown {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pipeGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const path_1 = require("../utils/path");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
let tsModule;
|
|
9
|
+
function pipeGenerator(tree, schema) {
|
|
10
|
+
var _a;
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
13
|
+
if (!projects.has(schema.project)) {
|
|
14
|
+
throw new Error(`Project "${schema.project}" does not exist!`);
|
|
15
|
+
}
|
|
16
|
+
(0, path_1.checkPathUnderProjectRoot)(tree, schema.project, schema.path);
|
|
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 pipeNames = (0, devkit_1.names)(schema.name);
|
|
20
|
+
const pathToGenerateFiles = schema.flat
|
|
21
|
+
? './files/__pipeFileName__'
|
|
22
|
+
: './files';
|
|
23
|
+
yield (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, pathToGenerateFiles), path, {
|
|
24
|
+
pipeClassName: pipeNames.className,
|
|
25
|
+
pipeFileName: pipeNames.fileName,
|
|
26
|
+
pipePropertyName: pipeNames.propertyName,
|
|
27
|
+
standalone: schema.standalone,
|
|
28
|
+
tpl: '',
|
|
29
|
+
});
|
|
30
|
+
if (schema.skipTests) {
|
|
31
|
+
const pathToSpecFile = (0, devkit_1.joinPathFragments)(path, `${!schema.flat ? `${pipeNames.fileName}/` : ``}${pipeNames.fileName}.pipe.spec.ts`);
|
|
32
|
+
tree.delete(pathToSpecFile);
|
|
33
|
+
}
|
|
34
|
+
if (!schema.skipImport && !schema.standalone) {
|
|
35
|
+
const modulePath = (0, utils_1.findModule)(tree, path, schema.module);
|
|
36
|
+
(0, utils_1.addToNgModule)(tree, path, modulePath, pipeNames.fileName, `${pipeNames.className}Pipe`, `${pipeNames.fileName}.pipe`, 'declarations', schema.flat, schema.export);
|
|
37
|
+
}
|
|
38
|
+
if (!schema.skipFormat) {
|
|
39
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.pipeGenerator = pipeGenerator;
|
|
44
|
+
exports.default = pipeGenerator;
|
|
45
|
+
//# sourceMappingURL=pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/pipe/pipe.ts"],"names":[],"mappings":";;;;AACA,yCAOsB;AAEtB,wCAA0D;AAC1D,oCAAqD;AAErD,IAAI,QAAqC,CAAC;AAE1C,SAAsB,aAAa,CAAC,IAAU,EAAE,MAAc;;;QAC5D,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,YAAY,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;SAChE;QAED,IAAA,gCAAyB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAE7D,MAAM,OAAO,GAAG,IAAA,iCAAwB,EACtC,IAAI,EACJ,MAAM,CAAC,OAAO,CAC+B,CAAC;QAEhD,MAAM,IAAI,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAErC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI;YACrC,CAAC,CAAC,0BAA0B;YAC5B,CAAC,CAAC,SAAS,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$id": "SchematicsAngularPipe",
|
|
4
|
+
"title": "Angular Pipe Options Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"description": "Creates a new, generic pipe definition in the given project.",
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "The name of the pipe.",
|
|
13
|
+
"$default": {
|
|
14
|
+
"$source": "argv",
|
|
15
|
+
"index": 0
|
|
16
|
+
},
|
|
17
|
+
"x-prompt": "What name would you like to use for the pipe?"
|
|
18
|
+
},
|
|
19
|
+
"path": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"format": "path",
|
|
22
|
+
"$default": {
|
|
23
|
+
"$source": "workingDirectory"
|
|
24
|
+
},
|
|
25
|
+
"description": "The path at which to create the pipe, relative to the workspace root.",
|
|
26
|
+
"visible": false
|
|
27
|
+
},
|
|
28
|
+
"project": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The name of the project.",
|
|
31
|
+
"$default": {
|
|
32
|
+
"$source": "projectName"
|
|
33
|
+
},
|
|
34
|
+
"x-dropdown": "projects"
|
|
35
|
+
},
|
|
36
|
+
"flat": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": true,
|
|
39
|
+
"description": "When true (the default) creates files at the top level of the project."
|
|
40
|
+
},
|
|
41
|
+
"skipTests": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Do not create \"spec.ts\" test files for the new pipe.",
|
|
44
|
+
"default": false
|
|
45
|
+
},
|
|
46
|
+
"skipImport": {
|
|
47
|
+
"type": "boolean",
|
|
48
|
+
"default": false,
|
|
49
|
+
"description": "Do not import this pipe into the owning NgModule."
|
|
50
|
+
},
|
|
51
|
+
"standalone": {
|
|
52
|
+
"description": "Whether the generated pipe is standalone.",
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": false
|
|
55
|
+
},
|
|
56
|
+
"module": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "The filename of the declaring NgModule.",
|
|
59
|
+
"alias": "m"
|
|
60
|
+
},
|
|
61
|
+
"export": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"default": false,
|
|
64
|
+
"description": "The declaring NgModule exports this pipe."
|
|
65
|
+
},
|
|
66
|
+
"skipFormat": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"default": false,
|
|
69
|
+
"description": "Skip formatting of files."
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": ["name", "project"]
|
|
73
|
+
}
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
|
-
var _a, _b, _c
|
|
7
|
-
const
|
|
8
|
-
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
9
8
|
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
|
-
const path = (
|
|
11
|
-
return Object.assign(Object.assign({}, options), { export: (
|
|
12
|
-
project,
|
|
9
|
+
const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
10
|
+
return Object.assign(Object.assign({}, options), { export: (_b = options.export) !== null && _b !== void 0 ? _b : true, inlineScam: (_c = options.inlineScam) !== null && _c !== void 0 ? _c : true, path,
|
|
13
11
|
projectSourceRoot });
|
|
14
12
|
}
|
|
15
13
|
exports.normalizeOptions = normalizeOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAG3E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,IAAI;QACJ,iBAAiB,IACjB;AACJ,CAAC;AAvBD,4CAuBC"}
|
|
@@ -23,12 +23,10 @@ function scamGenerator(tree, rawOptions) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.scamGenerator = scamGenerator;
|
|
25
25
|
function checkPathUnderProjectRoot(tree, options) {
|
|
26
|
-
var _a;
|
|
27
26
|
if (!options.path) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
const
|
|
31
|
-
const { root } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
29
|
+
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
32
30
|
let pathToComponent = (0, devkit_1.normalizePath)(options.path);
|
|
33
31
|
pathToComponent = pathToComponent.startsWith('/')
|
|
34
32
|
? pathToComponent.slice(1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,sDAAkD;AAClD,kDAA0D;AAC1D,wCAA+C;AAC/C,+BAAiE;AAGjE,SAAsB,aAAa,CAAC,IAAU,EAAE,UAAkB;;QAChE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAA0B,OAAO,EAA5B,gBAAgB,kBAAK,OAAO,EAAhE,mCAAsD,CAAU,CAAC;QAEvE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC7E,MAAM,yBAAyB,GAAG,0BAA0B,CAC1D,qBAAqB,EACrB,WAAW,CACZ,CAAC;QACF,MAAM,yBAAyB,CAAC,IAAI,kCAC/B,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,IACjB,CAAC;QAEH,MAAM,iBAAiB,GAAG,IAAA,gCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,IAAA,4BAAsB,EAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACzD,IAAA,wBAAU,EAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAE7C,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAvBD,sCAuBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB
|
|
1
|
+
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,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,CAAC,UAAU,CAAC,GAAG,CAAC;QAC/C,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,eAAe,CAAC;IAEpB,IAAI,CAAC,IAAA,qBAAc,EAAC,eAAe,EAAE,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,IAAI,4CAA4C,IAAI,IAAI,CACpG,CAAC;KACH;AACH,CAAC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Schema {
|
|
2
2
|
name: string;
|
|
3
|
+
project: string;
|
|
3
4
|
path?: string;
|
|
4
|
-
project?: string;
|
|
5
5
|
displayBlock?: boolean;
|
|
6
6
|
inlineStyle?: boolean;
|
|
7
7
|
inlineTemplate?: boolean;
|
|
@@ -22,6 +22,5 @@ export interface NormalizedSchema extends Schema {
|
|
|
22
22
|
export: boolean;
|
|
23
23
|
inlineScam: boolean;
|
|
24
24
|
path: string;
|
|
25
|
-
project: string;
|
|
26
25
|
projectSourceRoot: string;
|
|
27
26
|
}
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
|
-
var _a, _b, _c, _d
|
|
7
|
-
const
|
|
8
|
-
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
9
8
|
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
|
-
const path = (
|
|
11
|
-
return Object.assign(Object.assign({}, options), { export: (
|
|
12
|
-
project,
|
|
9
|
+
const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
10
|
+
return Object.assign(Object.assign({}, options), { export: (_b = options.export) !== null && _b !== void 0 ? _b : true, flat: (_c = options.flat) !== null && _c !== void 0 ? _c : true, inlineScam: (_d = options.inlineScam) !== null && _d !== void 0 ? _d : true, path,
|
|
13
11
|
projectSourceRoot });
|
|
14
12
|
}
|
|
15
13
|
exports.normalizeOptions = normalizeOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAG3E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,IAAI;QACJ,iBAAiB,IACjB;AACJ,CAAC;AAxBD,4CAwBC"}
|
|
@@ -23,12 +23,10 @@ function scamDirectiveGenerator(tree, rawOptions) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.scamDirectiveGenerator = scamDirectiveGenerator;
|
|
25
25
|
function checkPathUnderProjectRoot(tree, options) {
|
|
26
|
-
var _a;
|
|
27
26
|
if (!options.path) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
const
|
|
31
|
-
const { root } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
29
|
+
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
32
30
|
let pathToDirective = (0, devkit_1.normalizePath)(options.path);
|
|
33
31
|
pathToDirective = pathToDirective.startsWith('/')
|
|
34
32
|
? pathToDirective.slice(1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-directive/scam-directive.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"scam-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-directive/scam-directive.ts"],"names":[],"mappings":";;;;AACA,yCAIsB;AACtB,sDAAkD;AAClD,kDAA0D;AAC1D,wCAA+C;AAC/C,+BAAiE;AAGjE,SAAsB,sBAAsB,CAAC,IAAU,EAAE,UAAkB;;QACzE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAA0B,OAAO,EAA5B,gBAAgB,kBAAK,OAAO,EAAhE,mCAAsD,CAAU,CAAC;QAEvE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC7E,MAAM,yBAAyB,GAAG,0BAA0B,CAC1D,qBAAqB,EACrB,WAAW,CACZ,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7
|
flat?: boolean;
|
|
@@ -15,6 +15,5 @@ export interface NormalizedSchema extends Schema {
|
|
|
15
15
|
flat: boolean;
|
|
16
16
|
inlineScam: boolean;
|
|
17
17
|
path: string;
|
|
18
|
-
project: string;
|
|
19
18
|
projectSourceRoot: string;
|
|
20
19
|
}
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
|
-
var _a, _b, _c, _d
|
|
7
|
-
const
|
|
8
|
-
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
9
8
|
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
|
-
const path = (
|
|
11
|
-
return Object.assign(Object.assign({}, options), { export: (
|
|
12
|
-
project,
|
|
9
|
+
const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
10
|
+
return Object.assign(Object.assign({}, options), { export: (_b = options.export) !== null && _b !== void 0 ? _b : true, flat: (_c = options.flat) !== null && _c !== void 0 ? _c : true, inlineScam: (_d = options.inlineScam) !== null && _d !== void 0 ? _d : true, path,
|
|
13
11
|
projectSourceRoot });
|
|
14
12
|
}
|
|
15
13
|
exports.normalizeOptions = normalizeOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAG3E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,IAAI;QACJ,iBAAiB,IACjB;AACJ,CAAC;AAxBD,4CAwBC"}
|
|
@@ -23,12 +23,10 @@ function scamPipeGenerator(tree, rawOptions) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.scamPipeGenerator = scamPipeGenerator;
|
|
25
25
|
function checkPathUnderProjectRoot(tree, options) {
|
|
26
|
-
var _a;
|
|
27
26
|
if (!options.path) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
const
|
|
31
|
-
const { root } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
29
|
+
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
32
30
|
let pathToPipe = (0, devkit_1.normalizePath)(options.path);
|
|
33
31
|
pathToPipe = pathToPipe.startsWith('/') ? pathToPipe.slice(1) : pathToPipe;
|
|
34
32
|
if (!(0, path_1.pathStartsWith)(pathToPipe, root)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,yCAIsB;AACtB,sDAAkD;AAClD,kDAAqD;AACrD,wCAA+C;AAC/C,+BAA4D;AAG5D,SAAsB,iBAAiB,CAAC,IAAU,EAAE,UAAkB;;QACpE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAA0B,OAAO,EAA5B,gBAAgB,kBAAK,OAAO,EAAhE,mCAAsD,CAAU,CAAC;QAEvE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC7E,MAAM,oBAAoB,GAAG,0BAA0B,CACrD,qBAAqB,EACrB,MAAM,CACP,CAAC;QACF,MAAM,oBAAoB,CAAC,IAAI,kCAC1B,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,IACjB,CAAC;QAEH,MAAM,YAAY,GAAG,IAAA,2BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpD,IAAA,uBAAiB,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAA,wBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAvBD,8CAuBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;IACrE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO;KACR;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjE,IAAI,UAAU,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAE3E,IAAI,CAAC,IAAA,qBAAc,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE;QACrC,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,IAAI,4CAA4C,IAAI,IAAI,CACpG,CAAC;KACH;AACH,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Schema {
|
|
2
2
|
name: string;
|
|
3
|
+
project: string;
|
|
3
4
|
path?: string;
|
|
4
|
-
project?: string;
|
|
5
5
|
skipTests?: boolean;
|
|
6
6
|
inlineScam?: boolean;
|
|
7
7
|
flat?: boolean;
|
|
@@ -13,6 +13,5 @@ export interface NormalizedSchema extends Schema {
|
|
|
13
13
|
flat: boolean;
|
|
14
14
|
inlineScam: boolean;
|
|
15
15
|
path: string;
|
|
16
|
-
project: string;
|
|
17
16
|
projectSourceRoot: string;
|
|
18
17
|
}
|
|
@@ -15,13 +15,12 @@ function getPipeFileInfo(tree, options) {
|
|
|
15
15
|
}
|
|
16
16
|
exports.getPipeFileInfo = getPipeFileInfo;
|
|
17
17
|
function getFileInfo(tree, options, defaultType) {
|
|
18
|
-
var _a
|
|
19
|
-
const
|
|
20
|
-
const { root, sourceRoot, projectType } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
18
|
+
var _a;
|
|
19
|
+
const { root, sourceRoot, projectType } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
21
20
|
const { fileName: normalizedName } = (0, devkit_1.names)(options.name);
|
|
22
21
|
const fileName = `${normalizedName}.${options.type ? (0, devkit_1.names)(options.type).fileName : defaultType}`;
|
|
23
22
|
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
24
|
-
const path = (
|
|
23
|
+
const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
25
24
|
const directory = options.flat
|
|
26
25
|
? (0, devkit_1.normalizePath)(path)
|
|
27
26
|
: (0, devkit_1.joinPathFragments)(path, normalizedName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-info.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/file-info.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"file-info.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/file-info.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AAetB,SAAgB,oBAAoB,CAClC,IAAU,EACV,OAA0B;IAE1B,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AALD,oDAKC;AAED,SAAgB,oBAAoB,CAClC,IAAU,EACV,OAA0B;IAE1B,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AALD,oDAKC;AAED,SAAgB,eAAe,CAC7B,IAAU,EACV,OAA0B;IAE1B,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AALD,0CAKC;AAED,SAAS,WAAW,CAClB,IAAU,EACV,OAA0B,EAC1B,WAAmB;;IAEnB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD,MAAM,QAAQ,GAAG,GAAG,cAAc,IAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAChD,EAAE,CAAC;IAEH,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IACJ,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI;QAC5B,CAAC,CAAC,IAAA,sBAAa,EAAC,IAAI,CAAC;QACrB,CAAC,CAAC,IAAA,0BAAiB,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAE5C,MAAM,QAAQ,GAAG,IAAA,0BAAiB,EAAC,SAAS,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAC;IAEhE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Tree } from '@nrwl/devkit';
|
|
2
|
+
import { ngModuleDecoratorProperty } from './insert-ngmodule-import';
|
|
3
|
+
export declare function findModule(tree: Tree, path: string, module?: string): string;
|
|
4
|
+
export declare function addToNgModule(tree: Tree, path: string, modulePath: string, name: string, className: string, fileName: string, ngModuleProperty: ngModuleDecoratorProperty, isFlat?: boolean, isExported?: boolean): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addToNgModule = exports.findModule = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
7
|
+
const js_1 = require("@nrwl/js");
|
|
8
|
+
const insert_ngmodule_import_1 = require("./insert-ngmodule-import");
|
|
9
|
+
let tsModule;
|
|
10
|
+
function findModule(tree, path, module) {
|
|
11
|
+
let modulePath = '';
|
|
12
|
+
let pathToSearch = path;
|
|
13
|
+
while (pathToSearch !== '/') {
|
|
14
|
+
if (module) {
|
|
15
|
+
const pathToModule = (0, devkit_1.joinPathFragments)(pathToSearch, module);
|
|
16
|
+
if (tree.exists(pathToModule)) {
|
|
17
|
+
modulePath = pathToModule;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const potentialOptions = tree
|
|
23
|
+
.children(pathToSearch)
|
|
24
|
+
.filter((f) => f.endsWith('.module.ts'));
|
|
25
|
+
if (potentialOptions.length > 1) {
|
|
26
|
+
throw new Error(`More than one NgModule was found. Please provide the NgModule you wish to use.`);
|
|
27
|
+
}
|
|
28
|
+
else if (potentialOptions.length === 1) {
|
|
29
|
+
modulePath = (0, devkit_1.joinPathFragments)(pathToSearch, potentialOptions[0]);
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
pathToSearch = (0, path_1.dirname)(pathToSearch);
|
|
34
|
+
}
|
|
35
|
+
const moduleContents = tree.read(modulePath, 'utf-8');
|
|
36
|
+
if (!moduleContents.includes('@NgModule')) {
|
|
37
|
+
throw new Error(`Declaring module file (${modulePath}) does not contain an @NgModule Declaration.`);
|
|
38
|
+
}
|
|
39
|
+
return modulePath;
|
|
40
|
+
}
|
|
41
|
+
exports.findModule = findModule;
|
|
42
|
+
function addToNgModule(tree, path, modulePath, name, className, fileName, ngModuleProperty, isFlat = true, isExported = false) {
|
|
43
|
+
if (!tsModule) {
|
|
44
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
45
|
+
}
|
|
46
|
+
let relativePath = `${(0, devkit_1.joinPathFragments)(path.replace((0, path_1.dirname)(modulePath), ''), !isFlat ? name : '', `${fileName}`)}`;
|
|
47
|
+
relativePath = relativePath.startsWith('/')
|
|
48
|
+
? `.${relativePath}`
|
|
49
|
+
: `./${relativePath}`;
|
|
50
|
+
const moduleContents = tree.read(modulePath, 'utf-8');
|
|
51
|
+
const source = tsModule.createSourceFile(modulePath, moduleContents, tsModule.ScriptTarget.Latest, true);
|
|
52
|
+
(0, js_1.insertImport)(tree, source, modulePath, className, relativePath);
|
|
53
|
+
(0, insert_ngmodule_import_1.insertNgModuleProperty)(tree, modulePath, className, ngModuleProperty);
|
|
54
|
+
if (isExported) {
|
|
55
|
+
(0, insert_ngmodule_import_1.insertNgModuleProperty)(tree, modulePath, className, 'exports');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.addToNgModule = addToNgModule;
|
|
59
|
+
//# sourceMappingURL=find-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-module.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/find-module.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AACjD,+BAA+B;AAC/B,uFAAmF;AACnF,iCAAwC;AACxC,qEAGkC;AAElC,IAAI,QAAqC,CAAC;AAE1C,SAAgB,UAAU,CAAC,IAAU,EAAE,IAAY,EAAE,MAAe;IAClE,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,YAAY,GAAG,IAAI,CAAC;IACxB,OAAO,YAAY,KAAK,GAAG,EAAE;QAC3B,IAAI,MAAM,EAAE;YACV,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,YAAY,EAAE,MAAM,C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