@nrwl/angular 15.9.1 → 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/add-e2e.js +5 -3
- package/src/generators/application/lib/add-e2e.js.map +1 -1
- 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/ngrx/files/{latest → base}/__directory__/__fileName__.effects.ts__tmpl__ +4 -4
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts +2 -1
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +5 -12
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js.map +1 -1
- package/src/generators/ngrx/lib/generate-files.js +1 -1
- package/src/generators/ngrx/lib/generate-files.js.map +1 -1
- package/src/generators/ngrx/lib/normalize-options.d.ts +3 -1
- package/src/generators/ngrx/lib/normalize-options.js +11 -2
- package/src/generators/ngrx/lib/normalize-options.js.map +1 -1
- package/src/generators/ngrx/ngrx.js +2 -2
- package/src/generators/ngrx/ngrx.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/ngrx/files/{latest → base}/__directory__/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.models.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.selectors.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.selectors.ts__tmpl__ +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
|
@@ -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,2CAAyD;AAGzD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EAAC,IAAI,kCACrE,OAAO,KACV,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,WAAW,IACjC,CAAC;IAEH,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI,IACJ;AACJ,CAAC;AAlBD,4CAkBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
10
|
+
exports.validateOptions = validateOptions;
|
|
11
|
+
//# sourceMappingURL=validate-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAA0D;AAG1D,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;AACjE,CAAC;AAHD,0CAGC"}
|
|
@@ -3,37 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.scamGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const component_1 = require("../component/component");
|
|
6
7
|
const export_scam_1 = require("../utils/export-scam");
|
|
7
|
-
const file_info_1 = require("../utils/file-info");
|
|
8
|
-
const path_1 = require("../utils/path");
|
|
9
8
|
const lib_1 = require("./lib");
|
|
10
9
|
function scamGenerator(tree, rawOptions) {
|
|
11
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
(0, lib_1.validateOptions)(tree, rawOptions);
|
|
12
|
+
const { inlineScam } = rawOptions, generatorOptions = tslib_1.__rest(rawOptions, ["inlineScam"]);
|
|
13
|
+
yield (0, component_1.componentGenerator)(tree, Object.assign(Object.assign({}, generatorOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
|
|
12
14
|
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const componentFileInfo = (0, file_info_1.getComponentFileInfo)(tree, options);
|
|
19
|
-
(0, lib_1.convertComponentToScam)(tree, componentFileInfo, options);
|
|
20
|
-
(0, export_scam_1.exportScam)(tree, componentFileInfo, options);
|
|
21
|
-
yield (0, devkit_1.formatFiles)(tree);
|
|
15
|
+
(0, lib_1.convertComponentToScam)(tree, options);
|
|
16
|
+
(0, export_scam_1.exportScam)(tree, options);
|
|
17
|
+
if (!options.skipFormat) {
|
|
18
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
19
|
+
}
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
22
|
exports.scamGenerator = scamGenerator;
|
|
25
|
-
function checkPathUnderProjectRoot(tree, options) {
|
|
26
|
-
if (!options.path) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
30
|
-
let pathToComponent = (0, devkit_1.normalizePath)(options.path);
|
|
31
|
-
pathToComponent = pathToComponent.startsWith('/')
|
|
32
|
-
? pathToComponent.slice(1)
|
|
33
|
-
: pathToComponent;
|
|
34
|
-
if (!(0, path_1.pathStartsWith)(pathToComponent, root)) {
|
|
35
|
-
throw new Error(`The path provided for the SCAM (${options.path}) does not exist under the project root (${root}).`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
23
|
exports.default = scamGenerator;
|
|
39
24
|
//# sourceMappingURL=scam.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,yCAA2C;AAC3C,sDAA4D;AAC5D,sDAAkD;AAClD,+BAIe;AAGf,SAAsB,aAAa,CAAC,IAAU,EAAE,UAAkB;;QAChE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAElC,MAAM,EAAE,UAAU,KAA0B,UAAU,EAA/B,gBAAgB,kBAAK,UAAU,EAAhD,cAAmC,CAAa,CAAC;QACvD,MAAM,IAAA,8BAAkB,EAAC,IAAI,kCACxB,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,IAAA,4BAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AAnBD,sCAmBC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -16,11 +16,13 @@ export interface Schema {
|
|
|
16
16
|
selector?: string;
|
|
17
17
|
skipSelector?: boolean;
|
|
18
18
|
export?: boolean;
|
|
19
|
+
skipFormat?: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export interface NormalizedSchema extends Schema {
|
|
23
|
+
directory: string;
|
|
24
|
+
fileName: string;
|
|
25
|
+
filePath: string;
|
|
22
26
|
export: boolean;
|
|
23
27
|
inlineScam: boolean;
|
|
24
|
-
path: string;
|
|
25
|
-
projectSourceRoot: string;
|
|
26
28
|
}
|
|
@@ -123,6 +123,12 @@
|
|
|
123
123
|
"description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
|
|
124
124
|
"default": true,
|
|
125
125
|
"x-priority": "important"
|
|
126
|
+
},
|
|
127
|
+
"skipFormat": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"description": "Skip formatting files.",
|
|
130
|
+
"default": false,
|
|
131
|
+
"x-priority": "internal"
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
134
|
"required": ["name", "project"]
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
|
-
import type { FileInfo } from '../../utils/file-info';
|
|
3
2
|
import type { NormalizedSchema } from '../schema';
|
|
4
|
-
export declare function convertDirectiveToScam(tree: Tree,
|
|
3
|
+
export declare function convertDirectiveToScam(tree: Tree, options: NormalizedSchema): void;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertDirectiveToScam = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
6
5
|
const js_1 = require("@nrwl/js");
|
|
6
|
+
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
7
7
|
let tsModule;
|
|
8
|
-
function convertDirectiveToScam(tree,
|
|
9
|
-
if (!tree.exists(
|
|
10
|
-
throw new Error(`Couldn't find directive at path ${
|
|
8
|
+
function convertDirectiveToScam(tree, options) {
|
|
9
|
+
if (!tree.exists(options.filePath)) {
|
|
10
|
+
throw new Error(`Couldn't find directive at path ${options.filePath} to add SCAM setup.`);
|
|
11
11
|
}
|
|
12
12
|
if (!tsModule) {
|
|
13
13
|
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
@@ -16,17 +16,17 @@ function convertDirectiveToScam(tree, directiveFileInfo, options) {
|
|
|
16
16
|
const typeNames = (0, devkit_1.names)('directive');
|
|
17
17
|
const directiveClassName = `${directiveNames.className}${typeNames.className}`;
|
|
18
18
|
if (options.inlineScam) {
|
|
19
|
-
const currentDirectiveContents = tree.read(
|
|
20
|
-
let source = tsModule.createSourceFile(
|
|
21
|
-
source = (0, js_1.insertImport)(tree, source,
|
|
22
|
-
source = (0, js_1.insertImport)(tree, source,
|
|
19
|
+
const currentDirectiveContents = tree.read(options.filePath, 'utf-8');
|
|
20
|
+
let source = tsModule.createSourceFile(options.filePath, currentDirectiveContents, tsModule.ScriptTarget.Latest, true);
|
|
21
|
+
source = (0, js_1.insertImport)(tree, source, options.filePath, 'NgModule', '@angular/core');
|
|
22
|
+
source = (0, js_1.insertImport)(tree, source, options.filePath, 'CommonModule', '@angular/common');
|
|
23
23
|
let updatedDirectiveSource = source.getText();
|
|
24
24
|
updatedDirectiveSource = `${updatedDirectiveSource}${getNgModuleDeclaration(directiveClassName)}`;
|
|
25
|
-
tree.write(
|
|
25
|
+
tree.write(options.filePath, updatedDirectiveSource);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const scamFilePath = (0, devkit_1.joinPathFragments)(
|
|
29
|
-
tree.write(scamFilePath, getModuleFileContent(directiveClassName,
|
|
28
|
+
const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${directiveNames.fileName}.module.ts`);
|
|
29
|
+
tree.write(scamFilePath, getModuleFileContent(directiveClassName, options.fileName));
|
|
30
30
|
}
|
|
31
31
|
exports.convertDirectiveToScam = convertDirectiveToScam;
|
|
32
32
|
function getModuleFileContent(directiveClassName, directiveFileName) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-directive-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"convert-directive-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,iCAAwC;AACxC,uFAAmF;AAGnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,sBAAsB,CACpC,IAAU,EACV,OAAyB;IAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,QAAQ,qBAAqB,CACzE,CAAC;KACH;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,WAAW,CAAC,CAAC;IACrC,MAAM,kBAAkB,GAAG,GAAG,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;IAE/E,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,MAAM,wBAAwB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CACpC,OAAO,CAAC,QAAQ,EAChB,wBAAwB,EACxB,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,cAAc,EACd,iBAAiB,CAClB,CAAC;QAEF,IAAI,sBAAsB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9C,sBAAsB,GAAG,GAAG,sBAAsB,GAAG,sBAAsB,CACzE,kBAAkB,CACnB,EAAE,CAAC;QAEJ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;QACrD,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,SAAS,EACjB,GAAG,cAAc,CAAC,QAAQ,YAAY,CACvC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,oBAAoB,CAAC,kBAAkB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAC3D,CAAC;AACJ,CAAC;AA3DD,wDA2DC;AAED,SAAS,oBAAoB,CAC3B,kBAA0B,EAC1B,iBAAyB;IAEzB,OAAO;;WAEE,kBAAkB,cAAc,iBAAiB;EAC1D,sBAAsB,CAAC,kBAAkB,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,sBAAsB,CAAC,kBAA0B;IACxD,OAAO;;;mBAGU,kBAAkB;cACvB,kBAAkB;;eAEjB,kBAAkB,WAAW,CAAC;AAC7C,CAAC"}
|
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./convert-directive-to-scam"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./validate-options"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,8DAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,8DAAoC;AACpC,6DAAmC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const path_1 = require("../../utils/path");
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
|
-
var _a, _b, _c
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const { directory, fileName, filePath, name, path } = (0, path_1.normalizeNameAndPaths)(tree, Object.assign(Object.assign({}, options), { type: 'directive' }));
|
|
8
|
+
return Object.assign(Object.assign({}, options), { export: (_a = options.export) !== null && _a !== void 0 ? _a : true, flat: (_b = options.flat) !== null && _b !== void 0 ? _b : true, inlineScam: (_c = options.inlineScam) !== null && _c !== void 0 ? _c : true, directory,
|
|
9
|
+
fileName,
|
|
10
|
+
filePath,
|
|
11
|
+
path,
|
|
12
|
+
name });
|
|
12
13
|
}
|
|
13
14
|
exports.normalizeOptions = normalizeOptions;
|
|
14
15
|
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -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,2CAAyD;AAGzD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EACzE,IAAI,kCAEC,OAAO,KACV,IAAI,EAAE,WAAW,IAEpB,CAAC;IAEF,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,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,IAAI,IACJ;AACJ,CAAC;AAvBD,4CAuBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
10
|
+
exports.validateOptions = validateOptions;
|
|
11
|
+
//# sourceMappingURL=validate-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAA0D;AAG1D,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;AACjE,CAAC;AAHD,0CAGC"}
|
|
@@ -3,36 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.scamDirectiveGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const directive_1 = require("../directive/directive");
|
|
6
7
|
const export_scam_1 = require("../utils/export-scam");
|
|
7
|
-
const file_info_1 = require("../utils/file-info");
|
|
8
|
-
const path_1 = require("../utils/path");
|
|
9
8
|
const lib_1 = require("./lib");
|
|
10
|
-
const directive_1 = require("../directive/directive");
|
|
11
9
|
function scamDirectiveGenerator(tree, rawOptions) {
|
|
12
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
(0, lib_1.validateOptions)(tree, rawOptions);
|
|
12
|
+
const { inlineScam } = rawOptions, directiveOptions = tslib_1.__rest(rawOptions, ["inlineScam"]);
|
|
13
|
+
yield (0, directive_1.directiveGenerator)(tree, Object.assign(Object.assign({}, directiveOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
|
|
13
14
|
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
yield (0, directive_1.default)(tree, Object.assign(Object.assign({}, directiveOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
|
|
17
|
-
const pipeFileInfo = (0, file_info_1.getDirectiveFileInfo)(tree, options);
|
|
18
|
-
(0, lib_1.convertDirectiveToScam)(tree, pipeFileInfo, options);
|
|
19
|
-
(0, export_scam_1.exportScam)(tree, pipeFileInfo, options);
|
|
15
|
+
(0, lib_1.convertDirectiveToScam)(tree, options);
|
|
16
|
+
(0, export_scam_1.exportScam)(tree, options);
|
|
20
17
|
yield (0, devkit_1.formatFiles)(tree);
|
|
21
18
|
});
|
|
22
19
|
}
|
|
23
20
|
exports.scamDirectiveGenerator = scamDirectiveGenerator;
|
|
24
|
-
function checkPathUnderProjectRoot(tree, options) {
|
|
25
|
-
if (!options.path) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
29
|
-
let pathToDirective = (0, devkit_1.normalizePath)(options.path);
|
|
30
|
-
pathToDirective = pathToDirective.startsWith('/')
|
|
31
|
-
? pathToDirective.slice(1)
|
|
32
|
-
: pathToDirective;
|
|
33
|
-
if (!(0, path_1.pathStartsWith)(pathToDirective, root)) {
|
|
34
|
-
throw new Error(`The path provided for the SCAM (${options.path}) does not exist under the project root (${root}).`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
21
|
exports.default = scamDirectiveGenerator;
|
|
38
22
|
//# sourceMappingURL=scam-directive.js.map
|
|
@@ -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,yCAA2C;AAC3C,sDAA4D;AAC5D,sDAAkD;AAClD,+BAIe;AAGf,SAAsB,sBAAsB,CAAC,IAAU,EAAE,UAAkB;;QACzE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAElC,MAAM,EAAE,UAAU,KAA0B,UAAU,EAA/B,gBAAgB,kBAAK,UAAU,EAAhD,cAAmC,CAAa,CAAC;QACvD,MAAM,IAAA,8BAAkB,EAAC,IAAI,kCACxB,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,IAAA,4BAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAjBD,wDAiBC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -11,9 +11,11 @@ export interface Schema {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface NormalizedSchema extends Schema {
|
|
14
|
+
directory: string;
|
|
14
15
|
export: boolean;
|
|
16
|
+
fileName: string;
|
|
17
|
+
filePath: string;
|
|
15
18
|
flat: boolean;
|
|
16
19
|
inlineScam: boolean;
|
|
17
20
|
path: string;
|
|
18
|
-
projectSourceRoot: string;
|
|
19
21
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
|
-
import type { FileInfo } from '../../utils/file-info';
|
|
3
2
|
import type { NormalizedSchema } from '../schema';
|
|
4
|
-
export declare function convertPipeToScam(tree: Tree,
|
|
3
|
+
export declare function convertPipeToScam(tree: Tree, options: NormalizedSchema): void;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertPipeToScam = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
6
5
|
const js_1 = require("@nrwl/js");
|
|
6
|
+
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
7
7
|
let tsModule;
|
|
8
|
-
function convertPipeToScam(tree,
|
|
9
|
-
if (!tree.exists(
|
|
10
|
-
throw new Error(`Couldn't find pipe at path ${
|
|
8
|
+
function convertPipeToScam(tree, options) {
|
|
9
|
+
if (!tree.exists(options.filePath)) {
|
|
10
|
+
throw new Error(`Couldn't find pipe at path ${options.filePath} to add SCAM setup.`);
|
|
11
11
|
}
|
|
12
12
|
if (!tsModule) {
|
|
13
13
|
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
@@ -16,17 +16,17 @@ function convertPipeToScam(tree, pipeFileInfo, options) {
|
|
|
16
16
|
const typeNames = (0, devkit_1.names)('pipe');
|
|
17
17
|
const pipeClassName = `${pipeNames.className}${typeNames.className}`;
|
|
18
18
|
if (options.inlineScam) {
|
|
19
|
-
const currentPipeContents = tree.read(
|
|
20
|
-
let source = tsModule.createSourceFile(
|
|
21
|
-
source = (0, js_1.insertImport)(tree, source,
|
|
22
|
-
source = (0, js_1.insertImport)(tree, source,
|
|
19
|
+
const currentPipeContents = tree.read(options.filePath, 'utf-8');
|
|
20
|
+
let source = tsModule.createSourceFile(options.filePath, currentPipeContents, tsModule.ScriptTarget.Latest, true);
|
|
21
|
+
source = (0, js_1.insertImport)(tree, source, options.filePath, 'NgModule', '@angular/core');
|
|
22
|
+
source = (0, js_1.insertImport)(tree, source, options.filePath, 'CommonModule', '@angular/common');
|
|
23
23
|
let updatedPipeSource = source.getText();
|
|
24
24
|
updatedPipeSource = `${updatedPipeSource}${getNgModuleDeclaration(pipeClassName)}`;
|
|
25
|
-
tree.write(
|
|
25
|
+
tree.write(options.filePath, updatedPipeSource);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const scamFilePath = (0, devkit_1.joinPathFragments)(
|
|
29
|
-
tree.write(scamFilePath, getModuleFileContent(pipeClassName,
|
|
28
|
+
const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${pipeNames.fileName}.module.ts`);
|
|
29
|
+
tree.write(scamFilePath, getModuleFileContent(pipeClassName, options.fileName));
|
|
30
30
|
}
|
|
31
31
|
exports.convertPipeToScam = convertPipeToScam;
|
|
32
32
|
function getModuleFileContent(pipeClassName, pipeFileName) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-pipe-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"convert-pipe-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,iCAAwC;AACxC,uFAAmF;AAGnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,iBAAiB,CAAC,IAAU,EAAE,OAAyB;IACrE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,8BAA8B,OAAO,CAAC,QAAQ,qBAAqB,CACpE,CAAC;KACH;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,MAAM,CAAC,CAAC;IAChC,MAAM,aAAa,GAAG,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;IAErE,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CACpC,OAAO,CAAC,QAAQ,EAChB,mBAAmB,EACnB,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,cAAc,EACd,iBAAiB,CAClB,CAAC;QAEF,IAAI,iBAAiB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QACzC,iBAAiB,GAAG,GAAG,iBAAiB,GAAG,sBAAsB,CAC/D,aAAa,CACd,EAAE,CAAC;QAEJ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAChD,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,SAAS,EACjB,GAAG,SAAS,CAAC,QAAQ,YAAY,CAClC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,oBAAoB,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,CACtD,CAAC;AACJ,CAAC;AAxDD,8CAwDC;AAED,SAAS,oBAAoB,CAC3B,aAAqB,EACrB,YAAoB;IAEpB,OAAO;;WAEE,aAAa,cAAc,YAAY;EAChD,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,sBAAsB,CAAC,aAAqB;IACnD,OAAO;;;mBAGU,aAAa;cAClB,aAAa;;eAEZ,aAAa,WAAW,CAAC;AACxC,CAAC"}
|
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./convert-pipe-to-scam"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./validate-options"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,8DAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,8DAAoC;AACpC,6DAAmC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const path_1 = require("../../utils/path");
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
|
-
var _a, _b, _c
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const { directory, fileName, filePath, name, path } = (0, path_1.normalizeNameAndPaths)(tree, Object.assign(Object.assign({}, options), { type: 'pipe' }));
|
|
8
|
+
return Object.assign(Object.assign({}, options), { export: (_a = options.export) !== null && _a !== void 0 ? _a : true, flat: (_b = options.flat) !== null && _b !== void 0 ? _b : true, inlineScam: (_c = options.inlineScam) !== null && _c !== void 0 ? _c : true, directory,
|
|
9
|
+
fileName,
|
|
10
|
+
filePath,
|
|
11
|
+
name,
|
|
12
|
+
path });
|
|
12
13
|
}
|
|
13
14
|
exports.normalizeOptions = normalizeOptions;
|
|
14
15
|
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -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,2CAAyD;AAGzD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EACzE,IAAI,kCAEC,OAAO,KACV,IAAI,EAAE,MAAM,IAEf,CAAC;IAEF,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,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,IAAI,IACJ;AACJ,CAAC;AAvBD,4CAuBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
10
|
+
exports.validateOptions = validateOptions;
|
|
11
|
+
//# sourceMappingURL=validate-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAA0D;AAG1D,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;AACjE,CAAC;AAHD,0CAGC"}
|
|
@@ -3,34 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.scamPipeGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const pipe_1 = require("../pipe/pipe");
|
|
6
7
|
const export_scam_1 = require("../utils/export-scam");
|
|
7
|
-
const file_info_1 = require("../utils/file-info");
|
|
8
|
-
const path_1 = require("../utils/path");
|
|
9
8
|
const lib_1 = require("./lib");
|
|
10
|
-
const pipe_1 = require("../pipe/pipe");
|
|
11
9
|
function scamPipeGenerator(tree, rawOptions) {
|
|
12
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
|
|
14
|
-
const { inlineScam
|
|
15
|
-
checkPathUnderProjectRoot(tree, options);
|
|
11
|
+
(0, lib_1.validateOptions)(tree, rawOptions);
|
|
12
|
+
const { inlineScam } = rawOptions, pipeOptions = tslib_1.__rest(rawOptions, ["inlineScam"]);
|
|
16
13
|
yield (0, pipe_1.pipeGenerator)(tree, Object.assign(Object.assign({}, pipeOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
|
|
17
|
-
const
|
|
18
|
-
(0, lib_1.convertPipeToScam)(tree,
|
|
19
|
-
(0, export_scam_1.exportScam)(tree,
|
|
14
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
15
|
+
(0, lib_1.convertPipeToScam)(tree, options);
|
|
16
|
+
(0, export_scam_1.exportScam)(tree, options);
|
|
20
17
|
yield (0, devkit_1.formatFiles)(tree);
|
|
21
18
|
});
|
|
22
19
|
}
|
|
23
20
|
exports.scamPipeGenerator = scamPipeGenerator;
|
|
24
|
-
function checkPathUnderProjectRoot(tree, options) {
|
|
25
|
-
if (!options.path) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
29
|
-
let pathToPipe = (0, devkit_1.normalizePath)(options.path);
|
|
30
|
-
pathToPipe = pathToPipe.startsWith('/') ? pathToPipe.slice(1) : pathToPipe;
|
|
31
|
-
if (!(0, path_1.pathStartsWith)(pathToPipe, root)) {
|
|
32
|
-
throw new Error(`The path provided for the SCAM (${options.path}) does not exist under the project root (${root}).`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
21
|
exports.default = scamPipeGenerator;
|
|
36
22
|
//# sourceMappingURL=scam-pipe.js.map
|
|
@@ -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,yCAA2C;AAC3C,uCAA6C;AAC7C,sDAAkD;AAClD,+BAA6E;AAG7E,SAAsB,iBAAiB,CAAC,IAAU,EAAE,UAAkB;;QACpE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAElC,MAAM,EAAE,UAAU,KAAqB,UAAU,EAA1B,WAAW,kBAAK,UAAU,EAA3C,cAA8B,CAAa,CAAC;QAClD,MAAM,IAAA,oBAAa,EAAC,IAAI,kCACnB,WAAW,KACd,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,IAAA,uBAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAjBD,8CAiBC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -9,9 +9,11 @@ export interface Schema {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface NormalizedSchema extends Schema {
|
|
12
|
+
directory: string;
|
|
12
13
|
export: boolean;
|
|
14
|
+
fileName: string;
|
|
15
|
+
filePath: string;
|
|
13
16
|
flat: boolean;
|
|
14
17
|
inlineScam: boolean;
|
|
15
18
|
path: string;
|
|
16
|
-
projectSourceRoot: string;
|
|
17
19
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
2
|
import type { Schema } from '../schema';
|
|
3
|
-
export declare function addRemoteEntry(tree: Tree, { appName, routing,
|
|
3
|
+
export declare function addRemoteEntry(tree: Tree, { appName, routing, prefix, standalone }: Schema, appRoot: string): void;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addRemoteEntry = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
|
|
6
|
-
function addRemoteEntry(tree, { appName, routing,
|
|
6
|
+
function addRemoteEntry(tree, { appName, routing, prefix, standalone }, appRoot) {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
prefix =
|
|
9
9
|
(_b = prefix !== null && prefix !== void 0 ? prefix : (_a = (0, devkit_1.readProjectConfiguration)(tree, appName)) === null || _a === void 0 ? void 0 : _a.prefix) !== null && _b !== void 0 ? _b : (0, devkit_1.readNxJson)(tree).npmScope;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-remote-entry.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts"],"names":[],"mappings":";;;AACA,yCAKsB;
|
|
1
|
+
{"version":3,"file":"add-remote-entry.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AACtB,sEAAgE;AAIhE,SAAgB,cAAc,CAC5B,IAAU,EACV,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAU,EAChD,OAAe;;IAEf,MAAM;QACJ,MAAA,MAAM,aAAN,MAAM,cAAN,MAAM,GACN,MAAC,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAiC,0CACpE,MAAM,mCACV,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC5B,IAAA,sBAAa,EACX,IAAI,EACJ,UAAU;QACR,CAAC,CAAC,IAAA,0BAAiB,EACf,SAAS,EACT,2CAA2C,CAC5C;QACH,CAAC,CAAC,IAAA,0BAAiB,EAAC,SAAS,EAAE,6BAA6B,CAAC,EAC/D,GAAG,OAAO,uBAAuB,EACjC;QACE,IAAI,EAAE,EAAE;QACR,OAAO;QACP,OAAO;QACP,MAAM;KACP,CACF,CAAC;IAEF,IAAI,UAAU,IAAI,OAAO,EAAE;QACzB,IAAA,sBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,EAAE,uBAAuB,CAAC,EACnD,iGAAiG,CAClG,CAAC;KACH;SAAM;QACL,IAAI,OAAO,EAAE;YACX,IAAA,sBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,EAAE,uBAAuB,CAAC,EACnD,sGAAsG,CACvG,CAAC;SACH;QAED,IAAI,CAAC,KAAK,CACR,GAAG,OAAO,wBAAwB,EAClC;;;;;;EAMJ,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,wBAAwB,EAAE,OAAO,CAAC,EAAE,CACrD,CAAC;KACH;AACH,CAAC;AArDD,wCAqDC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
|
-
import type { FileInfo } from './file-info';
|
|
3
2
|
export type GenerationOptions = {
|
|
3
|
+
directory: string;
|
|
4
|
+
filePath: string;
|
|
4
5
|
name: string;
|
|
5
6
|
project: string;
|
|
6
7
|
export?: boolean;
|
|
7
8
|
inlineScam?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare function exportScam(tree: Tree,
|
|
10
|
+
export declare function exportScam(tree: Tree, options: GenerationOptions): void;
|