@nrwl/angular 14.4.0-beta.8 → 14.4.0-beta.9
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/CHANGELOG.md +1 -1
- package/package.json +9 -9
- package/src/generators/scam/lib/normalize-options.js +2 -2
- package/src/generators/scam/lib/normalize-options.js.map +1 -1
- package/src/generators/scam/scam.js +1 -1
- package/src/generators/scam/scam.js.map +1 -1
- package/src/generators/scam/schema.d.ts +2 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.d.ts +4 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +43 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js.map +1 -0
- package/src/generators/scam-directive/lib/index.d.ts +2 -0
- package/src/generators/scam-directive/lib/index.js +5 -0
- package/src/generators/scam-directive/lib/index.js.map +1 -1
- package/src/generators/scam-directive/lib/normalize-options.d.ts +3 -0
- package/src/generators/scam-directive/lib/normalize-options.js +16 -0
- package/src/generators/scam-directive/lib/normalize-options.js.map +1 -0
- package/src/generators/scam-directive/scam-directive.d.ts +1 -1
- package/src/generators/scam-directive/scam-directive.js +11 -6
- package/src/generators/scam-directive/scam-directive.js.map +1 -1
- package/src/generators/scam-directive/schema.d.ts +9 -0
- package/src/generators/scam-pipe/lib/normalize-options.js +2 -2
- package/src/generators/scam-pipe/lib/normalize-options.js.map +1 -1
- package/src/generators/scam-pipe/scam-pipe.js +1 -1
- package/src/generators/scam-pipe/scam-pipe.js.map +1 -1
- package/src/generators/scam-pipe/schema.d.ts +2 -0
- package/src/generators/utils/file-info.d.ts +1 -0
- package/src/generators/utils/file-info.js +5 -1
- package/src/generators/utils/file-info.js.map +1 -1
- package/src/generators/scam-directive/lib/create-module.d.ts +0 -3
- package/src/generators/scam-directive/lib/create-module.js +0 -90
- package/src/generators/scam-directive/lib/create-module.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [14.4.0-beta.
|
|
6
|
+
# [14.4.0-beta.9](https://github.com/nrwl/nx/compare/14.3.6...14.4.0-beta.9) (2022-07-01)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/angular
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "14.4.0-beta.
|
|
3
|
+
"version": "14.4.0-beta.9",
|
|
4
4
|
"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, Cypress, Karma, and Protractor. \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.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@angular-devkit/schematics": "~14.0.0",
|
|
68
|
-
"@nrwl/cypress": "14.4.0-beta.
|
|
69
|
-
"@nrwl/devkit": "14.4.0-beta.
|
|
70
|
-
"@nrwl/jest": "14.4.0-beta.
|
|
71
|
-
"@nrwl/linter": "14.4.0-beta.
|
|
72
|
-
"@nrwl/storybook": "14.4.0-beta.
|
|
73
|
-
"@nrwl/web": "14.4.0-beta.
|
|
74
|
-
"@nrwl/workspace": "14.4.0-beta.
|
|
68
|
+
"@nrwl/cypress": "14.4.0-beta.9",
|
|
69
|
+
"@nrwl/devkit": "14.4.0-beta.9",
|
|
70
|
+
"@nrwl/jest": "14.4.0-beta.9",
|
|
71
|
+
"@nrwl/linter": "14.4.0-beta.9",
|
|
72
|
+
"@nrwl/storybook": "14.4.0-beta.9",
|
|
73
|
+
"@nrwl/web": "14.4.0-beta.9",
|
|
74
|
+
"@nrwl/workspace": "14.4.0-beta.9",
|
|
75
75
|
"@phenomnomnominal/tsquery": "4.1.1",
|
|
76
76
|
"@schematics/angular": "~14.0.0",
|
|
77
77
|
"chalk": "4.1.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"fesm2015": "fesm2015/nrwl-angular.mjs",
|
|
95
95
|
"typings": "index.d.ts",
|
|
96
96
|
"sideEffects": false,
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "7a945e2e44258081ce93c193ad9ce6e7e089be78"
|
|
98
98
|
}
|
|
@@ -3,12 +3,12 @@ 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;
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
7
|
const project = (_a = options.project) !== null && _a !== void 0 ? _a : (0, devkit_1.readWorkspaceConfiguration)(tree).defaultProject;
|
|
8
8
|
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
9
9
|
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
10
|
const path = (_b = options.path) !== null && _b !== void 0 ? _b : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
11
|
-
return Object.assign(Object.assign({}, options), { path,
|
|
11
|
+
return Object.assign(Object.assign({}, options), { export: (_c = options.export) !== null && _c !== void 0 ? _c : true, inlineScam: (_d = options.inlineScam) !== null && _d !== void 0 ? _d : true, path,
|
|
12
12
|
project,
|
|
13
13
|
projectSourceRoot });
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAIsB;AAGtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CACR,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,IAAI;QACJ,OAAO;QACP,iBAAiB,IACjB;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAIsB;AAGtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CACR,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,OAAO;QACP,iBAAiB,IACjB;AACJ,CAAC;AA1BD,4CA0BC"}
|
|
@@ -14,7 +14,7 @@ function scamGenerator(tree, rawOptions) {
|
|
|
14
14
|
const { inlineScam, projectSourceRoot } = options, schematicOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
|
|
15
15
|
checkPathUnderProjectRoot(tree, options);
|
|
16
16
|
const angularComponentSchematic = (0, ngcli_adapter_1.wrapAngularDevkitSchematic)('@schematics/angular', 'component');
|
|
17
|
-
yield angularComponentSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false }));
|
|
17
|
+
yield angularComponentSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false, standalone: false }));
|
|
18
18
|
const componentFileInfo = (0, file_info_1.getComponentFileInfo)(tree, options);
|
|
19
19
|
(0, lib_1.convertComponentToScam)(tree, componentFileInfo, options);
|
|
20
20
|
(0, export_scam_1.exportScam)(tree, componentFileInfo, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,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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MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAtBD,sCAsBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;;IACrE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO;KACR;IAED,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEzD,IAAI,eAAe,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,eAAe,GAAG,eAAe,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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Tree } from '@nrwl/devkit';
|
|
2
|
+
import type { FileInfo } from '../../utils/file-info';
|
|
3
|
+
import type { NormalizedSchema } from '../schema';
|
|
4
|
+
export declare function convertDirectiveToScam(tree: Tree, directiveFileInfo: FileInfo, options: NormalizedSchema): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertDirectiveToScam = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
|
|
6
|
+
const typescript_1 = require("typescript");
|
|
7
|
+
function convertDirectiveToScam(tree, directiveFileInfo, options) {
|
|
8
|
+
if (!tree.exists(directiveFileInfo.filePath)) {
|
|
9
|
+
throw new Error(`Couldn't find directive at path ${directiveFileInfo.filePath} to add SCAM setup.`);
|
|
10
|
+
}
|
|
11
|
+
const directiveNames = (0, devkit_1.names)(options.name);
|
|
12
|
+
const typeNames = (0, devkit_1.names)('directive');
|
|
13
|
+
const directiveClassName = `${directiveNames.className}${typeNames.className}`;
|
|
14
|
+
if (options.inlineScam) {
|
|
15
|
+
const currentDirectiveContents = tree.read(directiveFileInfo.filePath, 'utf-8');
|
|
16
|
+
let source = (0, typescript_1.createSourceFile)(directiveFileInfo.filePath, currentDirectiveContents, typescript_1.ScriptTarget.Latest, true);
|
|
17
|
+
source = (0, ast_utils_1.insertImport)(tree, source, directiveFileInfo.filePath, 'NgModule', '@angular/core');
|
|
18
|
+
source = (0, ast_utils_1.insertImport)(tree, source, directiveFileInfo.filePath, 'CommonModule', '@angular/common');
|
|
19
|
+
let updatedDirectiveSource = source.getText();
|
|
20
|
+
updatedDirectiveSource = `${updatedDirectiveSource}${getNgModuleDeclaration(directiveClassName)}`;
|
|
21
|
+
tree.write(directiveFileInfo.filePath, updatedDirectiveSource);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const scamFilePath = (0, devkit_1.joinPathFragments)(directiveFileInfo.directory, `${directiveNames.fileName}.module.ts`);
|
|
25
|
+
tree.write(scamFilePath, getModuleFileContent(directiveClassName, directiveFileInfo.fileName));
|
|
26
|
+
}
|
|
27
|
+
exports.convertDirectiveToScam = convertDirectiveToScam;
|
|
28
|
+
function getModuleFileContent(directiveClassName, directiveFileName) {
|
|
29
|
+
return `import { NgModule } from '@angular/core';
|
|
30
|
+
import { CommonModule } from '@angular/common';
|
|
31
|
+
import { ${directiveClassName} } from './${directiveFileName}';
|
|
32
|
+
${getNgModuleDeclaration(directiveClassName)}`;
|
|
33
|
+
}
|
|
34
|
+
function getNgModuleDeclaration(directiveClassName) {
|
|
35
|
+
return `
|
|
36
|
+
@NgModule({
|
|
37
|
+
imports: [CommonModule],
|
|
38
|
+
declarations: [${directiveClassName}],
|
|
39
|
+
exports: [${directiveClassName}],
|
|
40
|
+
})
|
|
41
|
+
export class ${directiveClassName}Module {}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=convert-directive-to-scam.js.map
|
|
@@ -0,0 +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,uEAAuE;AACvE,2CAA4D;AAI5D,SAAgB,sBAAsB,CACpC,IAAU,EACV,iBAA2B,EAC3B,OAAyB;IAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC5C,MAAM,IAAI,KAAK,CACb,mCAAmC,iBAAiB,CAAC,QAAQ,qBAAqB,CACnF,CAAC;KACH;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,CACxC,iBAAiB,CAAC,QAAQ,EAC1B,OAAO,CACR,CAAC;QACF,IAAI,MAAM,GAAG,IAAA,6BAAgB,EAC3B,iBAAiB,CAAC,QAAQ,EAC1B,wBAAwB,EACxB,yBAAY,CAAC,MAAM,EACnB,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,wBAAY,EACnB,IAAI,EACJ,MAAM,EACN,iBAAiB,CAAC,QAAQ,EAC1B,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,wBAAY,EACnB,IAAI,EACJ,MAAM,EACN,iBAAiB,CAAC,QAAQ,EAC1B,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,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;QAC/D,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,iBAAiB,CAAC,SAAS,EAC3B,GAAG,cAAc,CAAC,QAAQ,YAAY,CACvC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,oBAAoB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CACrE,CAAC;AACJ,CAAC;AA5DD,wDA4DC;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"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./convert-directive-to-scam"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
1
6
|
//# 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":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,8DAAoC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function normalizeOptions(tree, options) {
|
|
6
|
+
var _a, _b, _c, _d, _e;
|
|
7
|
+
const project = (_a = options.project) !== null && _a !== void 0 ? _a : (0, devkit_1.readWorkspaceConfiguration)(tree).defaultProject;
|
|
8
|
+
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
9
|
+
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
|
+
const path = (_b = options.path) !== null && _b !== void 0 ? _b : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
11
|
+
return Object.assign(Object.assign({}, options), { export: (_c = options.export) !== null && _c !== void 0 ? _c : true, flat: (_d = options.flat) !== null && _d !== void 0 ? _d : true, inlineScam: (_e = options.inlineScam) !== null && _e !== void 0 ? _e : true, path,
|
|
12
|
+
project,
|
|
13
|
+
projectSourceRoot });
|
|
14
|
+
}
|
|
15
|
+
exports.normalizeOptions = normalizeOptions;
|
|
16
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAIsB;AAGtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CACR,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,OAAO;QACP,iBAAiB,IACjB;AACJ,CAAC;AA3BD,4CA2BC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
2
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function scamDirectiveGenerator(tree: Tree,
|
|
3
|
+
export declare function scamDirectiveGenerator(tree: Tree, rawOptions: Schema): Promise<void>;
|
|
4
4
|
export default scamDirectiveGenerator;
|
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.scamDirectiveGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const ngcli_adapter_1 = require("@nrwl/devkit/ngcli-adapter");
|
|
6
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const
|
|
6
|
+
const ngcli_adapter_1 = require("@nrwl/devkit/ngcli-adapter");
|
|
7
|
+
const export_scam_1 = require("../utils/export-scam");
|
|
8
|
+
const file_info_1 = require("../utils/file-info");
|
|
8
9
|
const path_1 = require("../utils/path");
|
|
9
|
-
|
|
10
|
+
const lib_1 = require("./lib");
|
|
11
|
+
function scamDirectiveGenerator(tree, rawOptions) {
|
|
10
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
-
const
|
|
13
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
14
|
+
const { inlineScam, projectSourceRoot } = options, schematicOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
|
|
12
15
|
checkPathUnderProjectRoot(tree, options);
|
|
13
16
|
const angularDirectiveSchematic = (0, ngcli_adapter_1.wrapAngularDevkitSchematic)('@schematics/angular', 'directive');
|
|
14
|
-
yield angularDirectiveSchematic(tree, Object.assign(Object.assign({},
|
|
15
|
-
(0,
|
|
17
|
+
yield angularDirectiveSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false, standalone: false }));
|
|
18
|
+
const pipeFileInfo = (0, file_info_1.getDirectiveFileInfo)(tree, options);
|
|
19
|
+
(0, lib_1.convertDirectiveToScam)(tree, pipeFileInfo, options);
|
|
20
|
+
(0, export_scam_1.exportScam)(tree, pipeFileInfo, options);
|
|
16
21
|
yield (0, devkit_1.formatFiles)(tree);
|
|
17
22
|
});
|
|
18
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-directive/scam-directive.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"scam-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-directive/scam-directive.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,sDAAkD;AAClD,kDAA0D;AAC1D,wCAA+C;AAC/C,+BAAiE;AAGjE,SAAsB,sBAAsB,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AC,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,sBAAsB,CAAC"}
|
|
@@ -9,3 +9,12 @@ export interface Schema {
|
|
|
9
9
|
selector?: string;
|
|
10
10
|
export?: boolean;
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
export interface NormalizedSchema extends Schema {
|
|
14
|
+
export: boolean;
|
|
15
|
+
flat: boolean;
|
|
16
|
+
inlineScam: boolean;
|
|
17
|
+
path: string;
|
|
18
|
+
project: string;
|
|
19
|
+
projectSourceRoot: string;
|
|
20
|
+
}
|
|
@@ -3,12 +3,12 @@ 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;
|
|
6
|
+
var _a, _b, _c, _d, _e;
|
|
7
7
|
const project = (_a = options.project) !== null && _a !== void 0 ? _a : (0, devkit_1.readWorkspaceConfiguration)(tree).defaultProject;
|
|
8
8
|
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
9
9
|
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
10
|
const path = (_b = options.path) !== null && _b !== void 0 ? _b : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
11
|
-
return Object.assign(Object.assign({}, options), {
|
|
11
|
+
return Object.assign(Object.assign({}, options), { export: (_c = options.export) !== null && _c !== void 0 ? _c : true, flat: (_d = options.flat) !== null && _d !== void 0 ? _d : true, inlineScam: (_e = options.inlineScam) !== null && _e !== void 0 ? _e : true, path,
|
|
12
12
|
project,
|
|
13
13
|
projectSourceRoot });
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAIsB;AAGtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CACR,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,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,IAAI;QACJ,OAAO;QACP,iBAAiB,IACjB;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAIsB;AAGtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CACR,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,OAAO;QACP,iBAAiB,IACjB;AACJ,CAAC;AA3BD,4CA2BC"}
|
|
@@ -14,7 +14,7 @@ function scamPipeGenerator(tree, rawOptions) {
|
|
|
14
14
|
const { inlineScam, projectSourceRoot } = options, schematicOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
|
|
15
15
|
checkPathUnderProjectRoot(tree, options);
|
|
16
16
|
const angularPipeSchematic = (0, ngcli_adapter_1.wrapAngularDevkitSchematic)('@schematics/angular', 'pipe');
|
|
17
|
-
yield angularPipeSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false }));
|
|
17
|
+
yield angularPipeSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false, standalone: false }));
|
|
18
18
|
const pipeFileInfo = (0, file_info_1.getPipeFileInfo)(tree, options);
|
|
19
19
|
(0, lib_1.convertPipeToScam)(tree, pipeFileInfo, options);
|
|
20
20
|
(0, export_scam_1.exportScam)(tree, pipeFileInfo, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,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,oBAAoB,GAAG,IAAA,0CAA0B,EACrD,qBAAqB,EACrB,MAAM,CACP,CAAC;QACF,MAAM,oBAAoB,CAAC,IAAI,kCAC1B,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,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,oBAAoB,GAAG,IAAA,0CAA0B,EACrD,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;AAtBD,8CAsBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;;IACrE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO;KACR;IAED,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEzD,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"}
|
|
@@ -12,4 +12,5 @@ export declare type FileInfo = {
|
|
|
12
12
|
filePath: string;
|
|
13
13
|
};
|
|
14
14
|
export declare function getComponentFileInfo(tree: Tree, options: GenerationOptions): FileInfo;
|
|
15
|
+
export declare function getDirectiveFileInfo(tree: Tree, options: GenerationOptions): FileInfo;
|
|
15
16
|
export declare function getPipeFileInfo(tree: Tree, options: GenerationOptions): FileInfo;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPipeFileInfo = exports.getComponentFileInfo = void 0;
|
|
3
|
+
exports.getPipeFileInfo = exports.getDirectiveFileInfo = exports.getComponentFileInfo = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
function getComponentFileInfo(tree, options) {
|
|
6
6
|
return getFileInfo(tree, options, 'component');
|
|
7
7
|
}
|
|
8
8
|
exports.getComponentFileInfo = getComponentFileInfo;
|
|
9
|
+
function getDirectiveFileInfo(tree, options) {
|
|
10
|
+
return getFileInfo(tree, options, 'directive');
|
|
11
|
+
}
|
|
12
|
+
exports.getDirectiveFileInfo = getDirectiveFileInfo;
|
|
9
13
|
function getPipeFileInfo(tree, options) {
|
|
10
14
|
return getFileInfo(tree, options, 'pipe');
|
|
11
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-info.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/file-info.ts"],"names":[],"mappings":";;;AAAA,yCAOsB;AAetB,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,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAA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AiB,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"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createScamDirective = void 0;
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const devkit_2 = require("@nrwl/devkit");
|
|
6
|
-
const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
|
|
7
|
-
const typescript_1 = require("typescript");
|
|
8
|
-
function createScamDirective(tree, schema) {
|
|
9
|
-
var _a;
|
|
10
|
-
const project = (_a = schema.project) !== null && _a !== void 0 ? _a : (0, devkit_2.readWorkspaceConfiguration)(tree).defaultProject;
|
|
11
|
-
const projectConfig = (0, devkit_2.readProjectConfiguration)(tree, project);
|
|
12
|
-
const directiveNames = (0, devkit_2.names)(schema.name);
|
|
13
|
-
const typeNames = (0, devkit_2.names)('directive');
|
|
14
|
-
const directiveFileName = `${directiveNames.fileName}.directive`;
|
|
15
|
-
let directiveDirectory = schema.flat
|
|
16
|
-
? (0, devkit_2.joinPathFragments)(projectConfig.sourceRoot, projectConfig.projectType === 'application' ? 'app' : 'lib')
|
|
17
|
-
: (0, devkit_2.joinPathFragments)(projectConfig.sourceRoot, projectConfig.projectType === 'application' ? 'app' : 'lib', directiveNames.fileName);
|
|
18
|
-
if (schema.path) {
|
|
19
|
-
directiveDirectory = schema.flat
|
|
20
|
-
? (0, devkit_2.normalizePath)(schema.path)
|
|
21
|
-
: (0, devkit_2.joinPathFragments)(schema.path, directiveNames.fileName);
|
|
22
|
-
}
|
|
23
|
-
const directiveFilePath = (0, devkit_2.joinPathFragments)(directiveDirectory, `${directiveFileName}.ts`);
|
|
24
|
-
if (!tree.exists(directiveFilePath)) {
|
|
25
|
-
throw new Error(`Couldn't find directive at path ${directiveFilePath} to add SCAM setup.`);
|
|
26
|
-
}
|
|
27
|
-
if (schema.inlineScam) {
|
|
28
|
-
const currentDirectiveContents = tree.read(directiveFilePath, 'utf-8');
|
|
29
|
-
let source = (0, typescript_1.createSourceFile)(directiveFilePath, currentDirectiveContents, typescript_1.ScriptTarget.Latest, true);
|
|
30
|
-
source = (0, ast_utils_1.insertImport)(tree, source, directiveFilePath, 'NgModule', '@angular/core');
|
|
31
|
-
source = (0, ast_utils_1.insertImport)(tree, source, directiveFilePath, 'CommonModule', '@angular/common');
|
|
32
|
-
let updatedDirectiveSource = source.getText();
|
|
33
|
-
updatedDirectiveSource = `${updatedDirectiveSource}${createAngularDirectiveModule(`${directiveNames.className}${typeNames.className}`)}`;
|
|
34
|
-
tree.write(directiveFilePath, updatedDirectiveSource);
|
|
35
|
-
exportScam(tree, schema, directiveFilePath);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const scamFilePath = (0, devkit_2.joinPathFragments)(directiveDirectory, `${directiveNames.fileName}.module.ts`);
|
|
39
|
-
tree.write(scamFilePath, createSeparateAngularDirectiveModuleFile(`${directiveNames.className}${typeNames.className}`, directiveFileName));
|
|
40
|
-
exportScam(tree, schema, scamFilePath);
|
|
41
|
-
}
|
|
42
|
-
exports.createScamDirective = createScamDirective;
|
|
43
|
-
function exportScam(tree, schema, scamFilePath) {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
if (!schema.export) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const project = (_a = schema.project) !== null && _a !== void 0 ? _a : (0, devkit_2.readWorkspaceConfiguration)(tree).defaultProject;
|
|
49
|
-
const { root, sourceRoot, projectType } = (0, devkit_2.readProjectConfiguration)(tree, project);
|
|
50
|
-
if (projectType === 'application') {
|
|
51
|
-
devkit_1.logger.warn('--export=true was ignored as the project the SCAM is being generated in is not a library.');
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const ngPackageJsonPath = (0, devkit_2.joinPathFragments)(root, 'ng-package.json');
|
|
55
|
-
const ngPackageEntryPoint = tree.exists(ngPackageJsonPath)
|
|
56
|
-
? (_b = (0, devkit_1.readJson)(tree, ngPackageJsonPath).lib) === null || _b === void 0 ? void 0 : _b.entryFile
|
|
57
|
-
: undefined;
|
|
58
|
-
const projectEntryPoint = ngPackageEntryPoint
|
|
59
|
-
? (0, devkit_2.joinPathFragments)(root, ngPackageEntryPoint)
|
|
60
|
-
: (0, devkit_2.joinPathFragments)(sourceRoot, `index.ts`);
|
|
61
|
-
if (!tree.exists(projectEntryPoint)) {
|
|
62
|
-
// Let's not error, simply warn the user
|
|
63
|
-
// It's not too much effort to manually do this
|
|
64
|
-
// It would be more frustrating to have to find the correct path and re-run the command
|
|
65
|
-
devkit_1.logger.warn(`Could not export SCAM. Unable to determine project's entry point. Path ${projectEntryPoint} does not exist. SCAM has still been created.`);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const relativePathFromEntryPoint = `.${scamFilePath
|
|
69
|
-
.split(sourceRoot)[1]
|
|
70
|
-
.replace('.ts', '')}`;
|
|
71
|
-
const updateEntryPointContent = `${tree.read(projectEntryPoint, 'utf-8')}
|
|
72
|
-
export * from "${relativePathFromEntryPoint}";`;
|
|
73
|
-
tree.write(projectEntryPoint, updateEntryPointContent);
|
|
74
|
-
}
|
|
75
|
-
function createAngularDirectiveModule(name) {
|
|
76
|
-
return `
|
|
77
|
-
@NgModule({
|
|
78
|
-
imports: [CommonModule],
|
|
79
|
-
declarations: [${name}],
|
|
80
|
-
exports: [${name}],
|
|
81
|
-
})
|
|
82
|
-
export class ${name}Module {}`;
|
|
83
|
-
}
|
|
84
|
-
function createSeparateAngularDirectiveModuleFile(name, directiveFileName) {
|
|
85
|
-
return `import { NgModule } from '@angular/core';
|
|
86
|
-
import { CommonModule } from '@angular/common';
|
|
87
|
-
import { ${name} } from './${directiveFileName}';
|
|
88
|
-
${createAngularDirectiveModule(name)}`;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=create-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-module.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/create-module.ts"],"names":[],"mappings":";;;AAAA,yCAAsD;AAGtD,yCAMsB;AACtB,uEAAuE;AACvE,2CAA4D;AAE5D,SAAgB,mBAAmB,CAAC,IAAU,EAAE,MAAc;;IAC5D,MAAM,OAAO,GACX,MAAA,MAAM,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACpE,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE9D,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,WAAW,CAAC,CAAC;IAErC,MAAM,iBAAiB,GAAG,GAAG,cAAc,CAAC,QAAQ,YAAY,CAAC;IAEjE,IAAI,kBAAkB,GAAG,MAAM,CAAC,IAAI;QAClC,CAAC,CAAC,IAAA,0BAAiB,EACf,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC5D;QACH,CAAC,CAAC,IAAA,0BAAiB,EACf,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAC3D,cAAc,CAAC,QAAQ,CACxB,CAAC;IAEN,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,kBAAkB,GAAG,MAAM,CAAC,IAAI;YAC9B,CAAC,CAAC,IAAA,sBAAa,EAAC,MAAM,CAAC,IAAI,CAAC;YAC5B,CAAC,C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