@nrwl/angular 15.9.0-beta.4 → 15.9.0-beta.6
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 +6 -0
- package/package.json +9 -9
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +1 -1
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js.map +1 -1
- package/src/generators/application/application.js +3 -47
- package/src/generators/application/application.js.map +1 -1
- package/src/generators/application/files/base/src/assets/.gitkeep__tpl__ +0 -0
- package/src/generators/application/files/base/src/index.html__tpl__ +13 -0
- package/src/generators/application/files/base/src/styles.__style__ +1 -0
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +10 -0
- package/src/generators/application/files/base/tsconfig.editor.json__tpl__ +5 -0
- package/src/generators/application/files/base/tsconfig.json__tpl__ +14 -0
- package/src/generators/application/files/ng-module/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/ng-module/src/app/app.component.html__tpl__ +1 -0
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +26 -0
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +13 -0
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +17 -0
- package/src/generators/application/files/{src → ng-module/src}/app/app.routes.ts__tpl__ +1 -1
- package/src/generators/application/{lib/nrwl-home-tpl.js → files/ng-module/src/app/nx-welcome.component.ts__tpl__} +11 -29
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +6 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.html__tpl__ +1 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +25 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +17 -0
- package/src/generators/application/files/standalone-components/src/app/app.routes.ts__tpl__ +3 -0
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +808 -0
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +11 -0
- package/src/generators/application/lib/create-files.d.ts +1 -1
- package/src/generators/application/lib/create-files.js +71 -5
- package/src/generators/application/lib/create-files.js.map +1 -1
- package/src/generators/application/lib/create-project.d.ts +3 -0
- package/src/generators/application/lib/create-project.js +85 -0
- package/src/generators/application/lib/create-project.js.map +1 -0
- package/src/generators/application/lib/enable-strict-type-checking.js +26 -16
- package/src/generators/application/lib/enable-strict-type-checking.js.map +1 -1
- package/src/generators/application/lib/index.d.ts +1 -7
- package/src/generators/application/lib/index.js +1 -7
- package/src/generators/application/lib/index.js.map +1 -1
- package/src/generators/library/files/base/README.md__tpl__ +9 -0
- package/src/generators/library/files/base/ng-package.json__tpl__ +7 -0
- package/src/generators/library/files/base/package.json__tpl__ +12 -0
- package/src/generators/library/files/base/tsconfig.json__tpl__ +14 -0
- package/src/generators/library/files/base/tsconfig.lib.json__tpl__ +17 -0
- package/src/generators/library/files/base/tsconfig.lib.prod.json__tpl__ +9 -0
- package/src/generators/library/files/ng-module/src/index.ts__tpl__ +2 -0
- package/src/generators/library/files/ng-module/src/lib/__libFileName__.module.ts__tpl__ +9 -0
- package/src/generators/library/files/ng-module/src/lib/lib.routes.ts__tpl__ +5 -0
- package/src/generators/library/files/standalone-components/src/index.ts__tpl__ +1 -0
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +6 -0
- package/src/generators/library/lib/add-project.d.ts +5 -0
- package/src/generators/library/lib/add-project.js +40 -0
- package/src/generators/library/lib/add-project.js.map +1 -0
- package/src/generators/library/lib/add-standalone-component.js +0 -14
- package/src/generators/library/lib/add-standalone-component.js.map +1 -1
- package/src/generators/library/lib/create-files.d.ts +5 -0
- package/src/generators/library/lib/create-files.js +50 -0
- package/src/generators/library/lib/create-files.js.map +1 -0
- package/src/generators/library/library.js +4 -15
- package/src/generators/library/library.js.map +1 -1
- package/src/generators/web-worker/files/config/tsconfig.worker.json__tpl__ +14 -0
- package/src/generators/web-worker/files/worker/__name__.worker.ts__tpl__ +6 -0
- package/src/generators/web-worker/lib/add-snippet.d.ts +2 -0
- package/src/generators/web-worker/lib/add-snippet.js +34 -0
- package/src/generators/web-worker/lib/add-snippet.js.map +1 -0
- package/src/generators/web-worker/lib/index.d.ts +1 -1
- package/src/generators/web-worker/lib/index.js +1 -1
- package/src/generators/web-worker/lib/index.js.map +1 -1
- package/src/generators/web-worker/lib/normalize-options.d.ts +2 -1
- package/src/generators/web-worker/lib/normalize-options.js +17 -3
- package/src/generators/web-worker/lib/normalize-options.js.map +1 -1
- package/src/generators/web-worker/web-worker.js +23 -7
- package/src/generators/web-worker/web-worker.js.map +1 -1
- package/src/migrations/update-15-9-0/update-testing-tsconfig.d.ts +3 -0
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js +38 -0
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js.map +1 -0
- package/src/generators/application/lib/convert-to-standalone-app.d.ts +0 -3
- package/src/generators/application/lib/convert-to-standalone-app.js +0 -82
- package/src/generators/application/lib/convert-to-standalone-app.js.map +0 -1
- package/src/generators/application/lib/nrwl-home-tpl.d.ts +0 -4
- package/src/generators/application/lib/nrwl-home-tpl.js.map +0 -1
- package/src/generators/application/lib/root-router-config.d.ts +0 -3
- package/src/generators/application/lib/root-router-config.js +0 -20
- package/src/generators/application/lib/root-router-config.js.map +0 -1
- package/src/generators/application/lib/update-app-component-template.d.ts +0 -3
- package/src/generators/application/lib/update-app-component-template.js +0 -29
- package/src/generators/application/lib/update-app-component-template.js.map +0 -1
- package/src/generators/application/lib/update-component-spec.d.ts +0 -3
- package/src/generators/application/lib/update-component-spec.js +0 -33
- package/src/generators/application/lib/update-component-spec.js.map +0 -1
- package/src/generators/application/lib/update-config-files.d.ts +0 -3
- package/src/generators/application/lib/update-config-files.js +0 -71
- package/src/generators/application/lib/update-config-files.js.map +0 -1
- package/src/generators/application/lib/update-nx-component-template.d.ts +0 -3
- package/src/generators/application/lib/update-nx-component-template.js +0 -35
- package/src/generators/application/lib/update-nx-component-template.js.map +0 -1
- package/src/generators/library/files/lib/README.md__tpl__ +0 -9
- package/src/generators/library/lib/update-ng-package.d.ts +0 -3
- package/src/generators/library/lib/update-ng-package.js +0 -20
- package/src/generators/library/lib/update-ng-package.js.map +0 -1
- package/src/generators/library/lib/update-project.d.ts +0 -3
- package/src/generators/library/lib/update-project.js +0 -150
- package/src/generators/library/lib/update-project.js.map +0 -1
- package/src/generators/web-worker/lib/update-tsconfig.d.ts +0 -2
- package/src/generators/web-worker/lib/update-tsconfig.js +0 -15
- package/src/generators/web-worker/lib/update-tsconfig.js.map +0 -1
- /package/src/generators/application/files/{src → base/src}/favicon.ico +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library/library.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library/library.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,qCAAkD;AAClD,yCAAsC;AACtC,iCAA8C;AAC9C,mCAA4B;AAC5B,qDAA8C;AAC9C,2DAAyD;AACzD,6DAAgF;AAChF,4DAA6D;AAC7D,qEAAsE;AACtE,0DAAwE;AACxE,wDAAiF;AACjF,iDAA6C;AAC7C,6EAAwE;AACxE,mFAG2C;AAC3C,+DAA2D;AAE3D,qFAA8E;AAC9E,2DAAuD;AAEvD,qDAAiD;AACjD,mDAA+C;AAE/C,SAAsB,gBAAgB,CACpC,IAAU,EACV,MAAc;;QAEd,4BAA4B;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;SAC1E;QAED,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACrD,MAAM,IAAI,KAAK,CACb,oJAAoJ,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AI,OAAO,CAAC,WAAW,EAAE;QAC5C,IAAA,uDAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACzC;AACH,CAAC;AAED,SAAS,aAAa,CACpB,IAAU,EACV,OAA2C;IAE3C,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,IAAA,sDAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACzC;SAAM;QACL,IAAA,qDAAuB,EAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;KAC/C;AACH,CAAC;AAED,SAAe,UAAU,CACvB,IAAU,EACV,OAA2C;;QAE3C,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,IAAI,EAAE;YAClC,OAAO;SACR;QACD,MAAM,IAAA,qBAAmB,EAAC,IAAI,EAAE;YAC9B,WAAW,EAAE,OAAO,CAAC,IAAI;YACzB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;YACxD,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,OAAO,CAAC,eAAe;SACzC,CAAC,CAAC;IACL,CAAC;CAAA;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addSnippet = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function addSnippet(tree, name, path) {
|
|
6
|
+
const fileRegExp = new RegExp(`^${name}.*\\.ts`);
|
|
7
|
+
const children = tree.children(path);
|
|
8
|
+
const siblingModules = children
|
|
9
|
+
.filter((f) => fileRegExp.test(f) && !/(module|spec)\.ts$/.test(f))
|
|
10
|
+
.sort();
|
|
11
|
+
if (siblingModules.length === 0) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const siblingModulePath = (0, devkit_1.joinPathFragments)(path, siblingModules[0]);
|
|
15
|
+
const logMessage = 'console.log(`page got message ${data}`);';
|
|
16
|
+
const workerCreationSnippet = (0, devkit_1.stripIndents) `
|
|
17
|
+
if (typeof Worker !== 'undefined') {
|
|
18
|
+
// Create a new
|
|
19
|
+
const worker = new Worker(new URL('./${name}.worker', import.meta.url));
|
|
20
|
+
worker.onmessage = ({ data }) => {
|
|
21
|
+
${logMessage}
|
|
22
|
+
};
|
|
23
|
+
worker.postMessage('hello');
|
|
24
|
+
} else {
|
|
25
|
+
// Web Workers are not supported in this environment.
|
|
26
|
+
// You should add a fallback so that your program still executes correctly.
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const originalContent = tree.read(siblingModulePath, 'utf-8');
|
|
30
|
+
tree.write(siblingModulePath, (0, devkit_1.stripIndents) `${originalContent}
|
|
31
|
+
${workerCreationSnippet}`);
|
|
32
|
+
}
|
|
33
|
+
exports.addSnippet = addSnippet;
|
|
34
|
+
//# sourceMappingURL=add-snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-snippet.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/add-snippet.ts"],"names":[],"mappings":";;;AACA,yCAA+D;AAE/D,SAAgB,UAAU,CAAC,IAAU,EAAE,IAAY,EAAE,IAAY;IAC/D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,cAAc,GAAG,QAAQ;SAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAClE,IAAI,EAAE,CAAC;IAEV,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/B,OAAO;KACR;IAED,MAAM,iBAAiB,GAAG,IAAA,0BAAiB,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,0CAA0C,CAAC;IAC9D,MAAM,qBAAqB,GAAG,IAAA,qBAAY,EAAA;;;+CAGG,IAAI;;YAEvC,UAAU;;;;;;;KAOjB,CAAC;IAEJ,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CACR,iBAAiB,EACjB,IAAA,qBAAY,EAAA,GAAG,eAAe;IAC9B,qBAAqB,EAAE,CACxB,CAAC;AACJ,CAAC;AAlCD,gCAkCC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './normalize-options';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './add-snippet';
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./
|
|
5
|
+
tslib_1.__exportStar(require("./add-snippet"), exports);
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,wDAA8B"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { WebWorkerGeneratorOptions } from '../schema';
|
|
2
|
-
|
|
2
|
+
import type { Tree } from '@nrwl/devkit';
|
|
3
|
+
export declare function normalizeOptions(tree: Tree, options: WebWorkerGeneratorOptions): WebWorkerGeneratorOptions;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function normalizeOptions(tree, options) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (!(0, devkit_1.getProjects)(tree).has(options.project)) {
|
|
8
|
+
throw new Error(`Project '${options.project}' does not exist!`);
|
|
9
|
+
}
|
|
10
|
+
const { projectType, sourceRoot, root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
11
|
+
if (projectType !== 'application') {
|
|
12
|
+
throw new Error(`Web Worker can only be added to an application. Project '${options.project}' is a library.`);
|
|
13
|
+
}
|
|
14
|
+
const path = ((_a = options.path) !== null && _a !== void 0 ? _a : sourceRoot)
|
|
15
|
+
? (0, devkit_1.joinPathFragments)(sourceRoot, 'app')
|
|
16
|
+
: (0, devkit_1.joinPathFragments)(root, 'src', 'app');
|
|
17
|
+
if (!tree.exists(path)) {
|
|
18
|
+
throw new Error(`Path '${options.path}' does not exist!`);
|
|
19
|
+
}
|
|
20
|
+
return Object.assign(Object.assign({}, options), { path, snippet: (_b = options.snippet) !== null && _b !== void 0 ? _b : true });
|
|
7
21
|
}
|
|
8
22
|
exports.normalizeOptions = normalizeOptions;
|
|
9
23
|
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/normalize-options.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB,CAC9B,OAAkC;;IAElC,uCACK,OAAO,KACV,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAI,IAChC;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/normalize-options.ts"],"names":[],"mappings":";;;AAEA,yCAIsB;AAEtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAkC;;IAElC,IAAI,CAAC,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;KACjE;IAED,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,IAAI,WAAW,KAAK,aAAa,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,4DAA4D,OAAO,CAAC,OAAO,iBAAiB,CAC7F,CAAC;KACH;IAED,MAAM,IAAI,GACR,CAAA,MAAA,OAAO,CAAC,IAAI,mCAAI,UAAU;QACxB,CAAC,CAAC,IAAA,0BAAiB,EAAC,UAAU,EAAE,KAAK,CAAC;QACtC,CAAC,CAAC,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAE5C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,CAAC,IAAI,mBAAmB,CAAC,CAAC;KAC3D;IAED,uCACK,OAAO,KACV,IAAI,EACJ,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAI,IAChC;AACJ,CAAC;AAhCD,4CAgCC"}
|
|
@@ -4,15 +4,31 @@ exports.webWorkerGenerator = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
6
|
const lib_1 = require("./lib");
|
|
7
|
+
const js_1 = require("@nrwl/js");
|
|
7
8
|
function webWorkerGenerator(tree, rawOptions) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
var _c, _d;
|
|
8
11
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
13
|
+
const workerNames = (0, devkit_1.names)(options.name);
|
|
14
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
15
|
+
const substitutions = {
|
|
16
|
+
rootOffset: (0, devkit_1.offsetFromRoot)(projectConfig.root),
|
|
17
|
+
rootTsConfig: (0, js_1.getRelativePathToRootTsConfig)(tree, projectConfig.root),
|
|
18
|
+
name: workerNames.fileName,
|
|
19
|
+
tpl: '',
|
|
20
|
+
};
|
|
21
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/worker'), options.path, substitutions);
|
|
22
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/config'), projectConfig.root, substitutions);
|
|
23
|
+
if (options.snippet) {
|
|
24
|
+
(0, lib_1.addSnippet)(tree, workerNames.fileName, options.path);
|
|
25
|
+
}
|
|
26
|
+
(_a = (_c = projectConfig.targets['build'].options).webWorkerTsConfig) !== null && _a !== void 0 ? _a : (_c.webWorkerTsConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.worker.json'));
|
|
27
|
+
if (projectConfig.targets['test']) {
|
|
28
|
+
(_b = (_d = projectConfig.targets['test'].options).webWorkerTsConfig) !== null && _b !== void 0 ? _b : (_d.webWorkerTsConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.worker.json'));
|
|
29
|
+
}
|
|
30
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
|
31
|
+
if (!options.skipFormat) {
|
|
16
32
|
yield (0, devkit_1.formatFiles)(tree);
|
|
17
33
|
}
|
|
18
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-worker.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/web-worker/web-worker.ts"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"web-worker.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/web-worker/web-worker.ts"],"names":[],"mappings":";;;;AACA,yCAQsB;AACtB,+BAAqD;AAErD,iCAAyD;AAEzD,SAAsB,kBAAkB,CACtC,IAAU,EACV,UAAqC;;;;QAErC,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtE,MAAM,aAAa,GAAG;YACpB,UAAU,EAAE,IAAA,uBAAc,EAAC,aAAa,CAAC,IAAI,CAAC;YAC9C,YAAY,EAAE,IAAA,kCAA6B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;YACrE,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,GAAG,EAAE,EAAE;SACR,CAAC;QAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,gBAAgB,CAAC,EAC9C,OAAO,CAAC,IAAI,EACZ,aAAa,CACd,CAAC;QACF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,gBAAgB,CAAC,EAC9C,aAAa,CAAC,IAAI,EAClB,aAAa,CACd,CAAC;QAEF,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,IAAA,gBAAU,EAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;SACtD;QAED,YAAA,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAC,iBAAiB,uCAAjB,iBAAiB,GACtD,IAAA,0BAAiB,EAAC,aAAa,CAAC,IAAI,EAAE,sBAAsB,CAAC,EAAC;QAChE,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACjC,YAAA,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAC,iBAAiB,uCAAjB,iBAAiB,GACrD,IAAA,0BAAiB,EAAC,aAAa,CAAC,IAAI,EAAE,sBAAsB,CAAC,EAAC;SACjE;QACD,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAEjE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;;CACF;AA3CD,gDA2CC;AAED,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTestingTsconfigForJest = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const executor_options_utils_1 = require("@nrwl/devkit/src/generators/executor-options-utils");
|
|
7
|
+
function updateTestingTsconfigForJest(tree) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
const graph = yield (0, devkit_1.createProjectGraphAsync)();
|
|
10
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
+
(0, executor_options_utils_1.forEachExecutorOptionsInGraph)(graph, '@nrwl/jest:jest', (options, projectName) => {
|
|
12
|
+
const projectConfig = projects.get(projectName);
|
|
13
|
+
if (!isJestPresetAngular(tree, options.jestConfig)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const tsconfigPath = (0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.spec.json');
|
|
17
|
+
if (tree.exists(tsconfigPath)) {
|
|
18
|
+
(0, devkit_1.updateJson)(tree, tsconfigPath, (json) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
var _c;
|
|
21
|
+
(_a = json.compilerOptions) !== null && _a !== void 0 ? _a : (json.compilerOptions = {});
|
|
22
|
+
(_b = (_c = json.compilerOptions).target) !== null && _b !== void 0 ? _b : (_c.target = 'es2016');
|
|
23
|
+
return json;
|
|
24
|
+
}, { expectComments: true, allowTrailingComma: true });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.updateTestingTsconfigForJest = updateTestingTsconfigForJest;
|
|
30
|
+
function isJestPresetAngular(tree, jestConfigPath) {
|
|
31
|
+
if (jestConfigPath && tree.exists(jestConfigPath)) {
|
|
32
|
+
const contents = tree.read(jestConfigPath, 'utf-8');
|
|
33
|
+
return contents.includes('jest-preset-angular');
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
exports.default = updateTestingTsconfigForJest;
|
|
38
|
+
//# sourceMappingURL=update-testing-tsconfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-testing-tsconfig.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-15-9-0/update-testing-tsconfig.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AACtB,+FAAmG;AAGnG,SAAsB,4BAA4B,CAAC,IAAU;;QAC3D,MAAM,KAAK,GAAG,MAAM,IAAA,gCAAuB,GAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,IAAA,sDAA6B,EAC3B,KAAK,EACL,iBAAiB,EACjB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;YACvB,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YAEhD,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE;gBAClD,OAAO;aACR;YACD,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,aAAa,CAAC,IAAI,EAClB,oBAAoB,CACrB,CAAC;YAEF,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;gBAC7B,IAAA,mBAAU,EACR,IAAI,EACJ,YAAY,EACZ,CAAC,IAAI,EAAE,EAAE;;;oBACP,MAAA,IAAI,CAAC,eAAe,oCAApB,IAAI,CAAC,eAAe,GAAK,EAAE,EAAC;oBAC5B,YAAA,IAAI,CAAC,eAAe,EAAC,MAAM,uCAAN,MAAM,GAAK,QAAQ,EAAC;oBAEzC,OAAO,IAAI,CAAC;gBACd,CAAC,EACD,EAAE,cAAc,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CACnD,CAAC;aACH;QACH,CAAC,CACF,CAAC;IACJ,CAAC;CAAA;AAhCD,oEAgCC;AAED,SAAS,mBAAmB,CAAC,IAAU,EAAE,cAAsB;IAC7D,IAAI,cAAc,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEpD,OAAO,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;KACjD;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,kBAAe,4BAA4B,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToStandaloneApp = void 0;
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
6
|
-
function convertToStandaloneApp(tree, options) {
|
|
7
|
-
const pathToAppModule = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/app/app.module.ts');
|
|
8
|
-
updateMainEntrypoint(options, tree, pathToAppModule);
|
|
9
|
-
updateAppComponent(tree, options);
|
|
10
|
-
if (!options.skipTests) {
|
|
11
|
-
updateAppComponentSpec(tree, options);
|
|
12
|
-
}
|
|
13
|
-
tree.delete(pathToAppModule);
|
|
14
|
-
}
|
|
15
|
-
exports.convertToStandaloneApp = convertToStandaloneApp;
|
|
16
|
-
function updateMainEntrypoint(options, tree, pathToAppModule) {
|
|
17
|
-
(0, ensure_typescript_1.ensureTypescript)();
|
|
18
|
-
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
19
|
-
let routerModuleSetup;
|
|
20
|
-
if (options.routing) {
|
|
21
|
-
const appModuleContents = tree.read(pathToAppModule, 'utf-8');
|
|
22
|
-
const ast = tsquery.ast(appModuleContents);
|
|
23
|
-
const ROUTER_MODULE_SELECTOR = 'PropertyAssignment:has(Identifier[name=imports]) CallExpression:has(PropertyAccessExpression > Identifier[name=RouterModule])';
|
|
24
|
-
const nodes = tsquery(ast, ROUTER_MODULE_SELECTOR, {
|
|
25
|
-
visitAllChildren: true,
|
|
26
|
-
});
|
|
27
|
-
if (nodes.length > 0) {
|
|
28
|
-
routerModuleSetup = nodes[0].getText();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
tree.write((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/main.ts'), standaloneComponentMainContents(routerModuleSetup));
|
|
32
|
-
}
|
|
33
|
-
const standaloneComponentMainContents = (routerModuleSetup) => `import { bootstrapApplication } from '@angular/platform-browser';${routerModuleSetup
|
|
34
|
-
? `
|
|
35
|
-
import { provideRouter, withEnabledBlockingInitialNavigation } from '@angular/router'`
|
|
36
|
-
: ``};
|
|
37
|
-
import { AppComponent } from './app/app.component';
|
|
38
|
-
${routerModuleSetup ? `import { appRoutes } from './app/app.routes';` : ''}
|
|
39
|
-
|
|
40
|
-
bootstrapApplication(AppComponent${routerModuleSetup
|
|
41
|
-
? `, {
|
|
42
|
-
providers: [provideRouter(appRoutes, withEnabledBlockingInitialNavigation())],
|
|
43
|
-
}`
|
|
44
|
-
: ''}).catch((err) => console.error(err));`;
|
|
45
|
-
function updateAppComponent(tree, options) {
|
|
46
|
-
(0, ensure_typescript_1.ensureTypescript)();
|
|
47
|
-
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
48
|
-
const pathToAppComponent = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/app/app.component.ts');
|
|
49
|
-
const appComponentContents = tree.read(pathToAppComponent, 'utf-8');
|
|
50
|
-
const ast = tsquery.ast(appComponentContents);
|
|
51
|
-
const COMPONENT_DECORATOR_SELECTOR = 'Decorator > CallExpression:has(Identifier[name=Component]) ObjectLiteralExpression';
|
|
52
|
-
const nodes = tsquery(ast, COMPONENT_DECORATOR_SELECTOR, {
|
|
53
|
-
visitAllChildren: true,
|
|
54
|
-
});
|
|
55
|
-
if (nodes.length === 0) {
|
|
56
|
-
throw new Error('Could not find Component decorator within app.component.ts for standalone app generation.');
|
|
57
|
-
}
|
|
58
|
-
const startPos = nodes[0].getStart() + 1;
|
|
59
|
-
const newAppComponentContents = `import { NxWelcomeComponent } from './nx-welcome.component';${options.routing
|
|
60
|
-
? `
|
|
61
|
-
import { RouterModule } from '@angular/router';`
|
|
62
|
-
: ''}
|
|
63
|
-
${appComponentContents.slice(0, startPos)}
|
|
64
|
-
standalone: true,
|
|
65
|
-
imports: [NxWelcomeComponent${options.routing ? ', RouterModule' : ''}],${appComponentContents.slice(startPos, -1)}`;
|
|
66
|
-
tree.write(pathToAppComponent, newAppComponentContents);
|
|
67
|
-
}
|
|
68
|
-
function updateAppComponentSpec(tree, options) {
|
|
69
|
-
const pathToAppComponentSpec = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/app/app.component.spec.ts');
|
|
70
|
-
const appComponentSpecContents = tree.read(pathToAppComponentSpec, 'utf-8');
|
|
71
|
-
let newAppComponentSpecContents;
|
|
72
|
-
if (!options.routing) {
|
|
73
|
-
newAppComponentSpecContents = appComponentSpecContents.replace('declarations', 'imports');
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
newAppComponentSpecContents = appComponentSpecContents
|
|
77
|
-
.replace('imports: [RouterTestingModule],', 'imports: [AppComponent, NxWelcomeComponent, RouterTestingModule]')
|
|
78
|
-
.replace('declarations: [AppComponent, NxWelcomeComponent]', '');
|
|
79
|
-
}
|
|
80
|
-
tree.write(pathToAppComponentSpec, newAppComponentSpecContents);
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=convert-to-standalone-app.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-standalone-app.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/convert-to-standalone-app.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AAEjD,uFAAmF;AAEnF,SAAgB,sBAAsB,CAAC,IAAU,EAAE,OAAyB;IAC1E,MAAM,eAAe,GAAG,IAAA,0BAAiB,EACvC,OAAO,CAAC,cAAc,EACtB,uBAAuB,CACxB,CAAC;IACF,oBAAoB,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IACrD,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;QACtB,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACvC;IAED,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC/B,CAAC;AAZD,wDAYC;AAED,SAAS,oBAAoB,CAC3B,OAAyB,EACzB,IAAU,EACV,eAAuB;IAEvB,IAAA,oCAAgB,GAAE,CAAC;IACnB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACzD,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiYxB;CACF,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addRouterRootConfiguration = void 0;
|
|
4
|
-
const js_1 = require("@nrwl/js");
|
|
5
|
-
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
6
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
7
|
-
let tsModule;
|
|
8
|
-
function addRouterRootConfiguration(host, options) {
|
|
9
|
-
const modulePath = `${options.appProjectRoot}/src/app/app.module.ts`;
|
|
10
|
-
const moduleSource = host.read(modulePath, 'utf-8');
|
|
11
|
-
if (!tsModule) {
|
|
12
|
-
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
13
|
-
}
|
|
14
|
-
let sourceFile = tsModule.createSourceFile(modulePath, moduleSource, tsModule.ScriptTarget.Latest, true);
|
|
15
|
-
sourceFile = (0, js_1.insertImport)(host, sourceFile, modulePath, 'RouterModule', '@angular/router');
|
|
16
|
-
sourceFile = (0, js_1.insertImport)(host, sourceFile, modulePath, 'appRoutes', './app.routes');
|
|
17
|
-
sourceFile = (0, ast_utils_1.addImportToModule)(host, sourceFile, modulePath, `RouterModule.forRoot(appRoutes, {initialNavigation: 'enabledBlocking'})`);
|
|
18
|
-
}
|
|
19
|
-
exports.addRouterRootConfiguration = addRouterRootConfiguration;
|
|
20
|
-
//# sourceMappingURL=root-router-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root-router-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/root-router-config.ts"],"names":[],"mappings":";;;AAGA,iCAAwC;AACxC,kEAAuE;AACvE,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,0BAA0B,CACxC,IAAU,EACV,OAAyB;IAEzB,MAAM,UAAU,GAAG,GAAG,OAAO,CAAC,cAAc,wBAAwB,CAAC;IACrE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEpD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IACD,IAAI,UAAU,GAAG,QAAQ,CAAC,gBAAgB,CACxC,UAAU,EACV,YAAY,EACZ,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;IAEF,UAAU,GAAG,IAAA,iBAAY,EACvB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,CAClB,CAAC;IACF,UAAU,GAAG,IAAA,iBAAY,EACvB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,CACf,CAAC;IACF,UAAU,GAAG,IAAA,6BAAiB,EAC5B,IAAI,EACJ,UAAU,EACV,UAAU,EACV,yEAAyE,CAC1E,CAAC;AACJ,CAAC;AArCD,gEAqCC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateAppComponentTemplate = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const js_1 = require("@nrwl/js");
|
|
6
|
-
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
7
|
-
const nrwl_home_tpl_1 = require("./nrwl-home-tpl");
|
|
8
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
9
|
-
let tsModule;
|
|
10
|
-
function updateAppComponentTemplate(host, options) {
|
|
11
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
if (!tsModule) {
|
|
13
|
-
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
14
|
-
}
|
|
15
|
-
const content = options.routing
|
|
16
|
-
? `${nrwl_home_tpl_1.nrwlHomeTemplate.getSelector(options.prefix)}\n<router-outlet></router-outlet>`
|
|
17
|
-
: nrwl_home_tpl_1.nrwlHomeTemplate.getSelector(options.prefix);
|
|
18
|
-
if (!options.inlineTemplate) {
|
|
19
|
-
host.write(`${options.appProjectRoot}/src/app/app.component.html`, content);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
// Inline component update
|
|
23
|
-
const componentPath = `${options.appProjectRoot}/src/app/app.component.ts`;
|
|
24
|
-
const templateNodeValue = (0, ast_utils_1.getDecoratorPropertyValueNode)(host, componentPath, 'Component', 'template', '@angular/core');
|
|
25
|
-
(0, js_1.replaceNodeValue)(host, tsModule.createSourceFile(componentPath, host.read(componentPath, 'utf-8'), tsModule.ScriptTarget.Latest, true), componentPath, templateNodeValue, `\`\n${nrwl_home_tpl_1.nrwlHomeTemplate.getSelector(options.prefix)}\n\``);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.updateAppComponentTemplate = updateAppComponentTemplate;
|
|
29
|
-
//# sourceMappingURL=update-app-component-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-app-component-template.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/update-app-component-template.ts"],"names":[],"mappings":";;;;AAGA,iCAA4C;AAC5C,kEAAmF;AAEnF,mDAAmD;AACnD,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAE1C,SAAsB,0BAA0B,CAC9C,IAAU,EACV,OAAyB;;QAEzB,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;SAC/B;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO;YAC7B,CAAC,CAAC,GAAG,gCAAgB,CAAC,WAAW,CAC7B,OAAO,CAAC,MAAM,CACf,mCAAmC;YACtC,CAAC,CAAC,gCAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEjD,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,cAAc,6BAA6B,EAAE,OAAO,CAAC,CAAC;YAE5E,OAAO;SACR;QAED,0BAA0B;QAC1B,MAAM,aAAa,GAAG,GAAG,OAAO,CAAC,cAAc,2BAA2B,CAAC;QAC3E,MAAM,iBAAiB,GAAG,IAAA,yCAA6B,EACrD,IAAI,EACJ,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,CAChB,CAAC;QAEF,IAAA,qBAAgB,EACd,IAAI,EACJ,QAAQ,CAAC,gBAAgB,CACvB,aAAa,EACb,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EACjC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,EACD,aAAa,EACb,iBAAiB,EACjB,OAAO,gCAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAC1D,CAAC;IACJ,CAAC;CAAA;AA1CD,gEA0CC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateComponentSpec = void 0;
|
|
4
|
-
const js_1 = require("@nrwl/js");
|
|
5
|
-
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
6
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
7
|
-
let tsModule;
|
|
8
|
-
function updateComponentSpec(host, options) {
|
|
9
|
-
if (!tsModule) {
|
|
10
|
-
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
11
|
-
}
|
|
12
|
-
if (options.skipTests !== true) {
|
|
13
|
-
const componentSpecPath = `${options.appProjectRoot}/src/app/app.component.spec.ts`;
|
|
14
|
-
const componentSpecSource = host.read(componentSpecPath, 'utf-8');
|
|
15
|
-
let componentSpecSourceFile = tsModule.createSourceFile(componentSpecPath, componentSpecSource, tsModule.ScriptTarget.Latest, true);
|
|
16
|
-
host.write(componentSpecPath, componentSpecSource
|
|
17
|
-
.replace('.content span', 'h1')
|
|
18
|
-
.replace(`${options.name} app is running!`, `Welcome ${options.name}`));
|
|
19
|
-
// Adding NxWelcome component to app.component.spec
|
|
20
|
-
componentSpecSourceFile = (0, js_1.insertImport)(host, componentSpecSourceFile, componentSpecPath, 'NxWelcomeComponent', './nx-welcome.component');
|
|
21
|
-
componentSpecSourceFile = (0, ast_utils_1.replaceIntoToTestBed)(host, componentSpecSourceFile, componentSpecPath, `declarations: [AppComponent, NxWelcomeComponent]`, `
|
|
22
|
-
declarations: [
|
|
23
|
-
AppComponent
|
|
24
|
-
],
|
|
25
|
-
`);
|
|
26
|
-
if (options.routing) {
|
|
27
|
-
componentSpecSourceFile = (0, js_1.insertImport)(host, componentSpecSourceFile, componentSpecPath, 'RouterTestingModule', '@angular/router/testing');
|
|
28
|
-
componentSpecSourceFile = (0, ast_utils_1.addImportToTestBed)(host, componentSpecSourceFile, componentSpecPath, `RouterTestingModule`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.updateComponentSpec = updateComponentSpec;
|
|
33
|
-
//# sourceMappingURL=update-component-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-component-spec.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/update-component-spec.ts"],"names":[],"mappings":";;;AACA,iCAAwC;AACxC,kEAG4C;AAE5C,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,mBAAmB,CAAC,IAAU,EAAE,OAAyB;IACvE,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GA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|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const js_1 = require("@nrwl/js");
|
|
7
|
-
const test_runners_1 = require("../../../utils/test-runners");
|
|
8
|
-
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
9
|
-
const cli_config_utils_1 = require("../../../utils/cli-config-utils");
|
|
10
|
-
function updateConfigFiles(host, options) {
|
|
11
|
-
updateTsConfigOptions(host, options);
|
|
12
|
-
updateAppAndE2EProjectConfigurations(host, options);
|
|
13
|
-
}
|
|
14
|
-
exports.updateConfigFiles = updateConfigFiles;
|
|
15
|
-
function updateTsConfigOptions(host, options) {
|
|
16
|
-
// tsconfig.app.json
|
|
17
|
-
(0, devkit_1.updateJson)(host, `${options.appProjectRoot}/tsconfig.app.json`, (json) => (Object.assign(Object.assign({}, json), { extends: './tsconfig.json', compilerOptions: Object.assign(Object.assign({}, json.compilerOptions), { outDir: `${(0, devkit_1.offsetFromRoot)(options.appProjectRoot)}dist/out-tsc` }), exclude: [
|
|
18
|
-
...new Set([
|
|
19
|
-
...(json.exclude || []),
|
|
20
|
-
'jest.config.ts',
|
|
21
|
-
'src/**/*.test.ts',
|
|
22
|
-
'src/**/*.spec.ts',
|
|
23
|
-
]),
|
|
24
|
-
] })));
|
|
25
|
-
// tsconfig.json
|
|
26
|
-
(0, create_ts_config_1.createTsConfig)(host, options.appProjectRoot, 'app', options, (0, js_1.getRelativePathToRootTsConfig)(host, options.appProjectRoot));
|
|
27
|
-
}
|
|
28
|
-
function updateAppAndE2EProjectConfigurations(host, options) {
|
|
29
|
-
let project = (0, devkit_1.readProjectConfiguration)(host, options.name);
|
|
30
|
-
if (options.ngCliSchematicAppRoot !== options.appProjectRoot) {
|
|
31
|
-
project = (0, cli_config_utils_1.replaceAppNameWithPath)(project, options.ngCliSchematicAppRoot, options.appProjectRoot);
|
|
32
|
-
// project already has the right root, but the above function, makes it incorrect.
|
|
33
|
-
// This corrects it.
|
|
34
|
-
project.root = options.appProjectRoot;
|
|
35
|
-
}
|
|
36
|
-
delete project.targets.test;
|
|
37
|
-
// Ensure the outputs property comes after the executor for
|
|
38
|
-
// better readability.
|
|
39
|
-
const _a = project.targets.build, { executor } = _a, rest = tslib_1.__rest(_a, ["executor"]);
|
|
40
|
-
project.targets.build = Object.assign(Object.assign({ executor, outputs: ['{options.outputPath}'] }, rest), { options: Object.assign(Object.assign({}, rest.options), { outputPath: (0, devkit_1.joinPathFragments)('dist', !options.rootProject ? options.appProjectRoot : options.name) }) });
|
|
41
|
-
if (project.generators) {
|
|
42
|
-
delete project.generators;
|
|
43
|
-
}
|
|
44
|
-
if (options.port) {
|
|
45
|
-
project.targets.serve = Object.assign(Object.assign({}, project.targets.serve), { options: Object.assign(Object.assign({}, project.targets.serve.options), { port: options.port }) });
|
|
46
|
-
}
|
|
47
|
-
project.tags = options.parsedTags;
|
|
48
|
-
/**
|
|
49
|
-
* The "$schema" property on our configuration files is only added when the
|
|
50
|
-
* project configuration is added and not when updating it. It's done this
|
|
51
|
-
* way to avoid re-adding "$schema" when updating a project configuration
|
|
52
|
-
* and that property was intentionally removed by the devs.
|
|
53
|
-
*
|
|
54
|
-
* Since the project gets created by the Angular application schematic,
|
|
55
|
-
* the "$schema" property is not added, so we remove the project and add
|
|
56
|
-
* it back to workaround that.
|
|
57
|
-
*/
|
|
58
|
-
(0, devkit_1.removeProjectConfiguration)(host, options.name);
|
|
59
|
-
(0, devkit_1.addProjectConfiguration)(host, options.name, project);
|
|
60
|
-
if (options.unitTestRunner === test_runners_1.UnitTestRunner.None) {
|
|
61
|
-
host.delete(`${options.appProjectRoot}/src/app/app.component.spec.ts`);
|
|
62
|
-
host.delete(`${options.appProjectRoot}/tsconfig.spec.json`);
|
|
63
|
-
}
|
|
64
|
-
if (options.e2eTestRunner === test_runners_1.E2eTestRunner.None) {
|
|
65
|
-
const projects = (0, devkit_1.getProjects)(host);
|
|
66
|
-
if (projects.has(options.e2eProjectName)) {
|
|
67
|
-
(0, devkit_1.removeProjectConfiguration)(host, options.e2eProjectName);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=update-config-files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-config-files.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/update-config-files.ts"],"names":[],"mappings":";;;;AACA,yCAQsB;AACtB,iCAAyD;AACzD,8DAA4E;AAE5E,mEAA8D;AAC9D,sEAAyE;AAEzE,SAAgB,iBAAiB,CAAC,IAAU,EAAE,OAAyB;IACrE,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrC,oCAAoC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAHD,8CAGC;AAED,SAAS,qBAAqB,CAAC,IAAU,EAAE,OAAyB;IAClE,oBAAoB;IACpB,IAAA,mBAAU,EAAC,IAAI,EAAE,GAAG,OAAO,CAAC,cAAc,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iCACrE,IAAI,KACP,OAAO,EAAE,iBAAiB,EAC1B,eAAe,kCACV,IAAI,CAAC,eAAe,KACvB,MAAM,EAAE,GAAG,IAAA,uBAAc,EAAC,OAAO,CAAC,cAAc,CAAC,cAAc,KAEjE,OAAO,EAAE;YACP,GAAG,IAAI,GAAG,CAAC;gBACT,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;gBACvB,gBAAgB;gBAChB,kBAAkB;gBAClB,kBAAkB;aACnB,CAAC;SACH,IACD,CAAC,CAAC;IAEJ,gBAAgB;IAChB,IAAA,iCAAc,EACZ,IAAI,EACJ,OAAO,CAAC,cAAc,EACtB,KAAK,EACL,OAAO,EACP,IAAA,kCAA6B,EAAC,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,CAC5D,CAAC;AACJ,CAAC;AAED,SAAS,oCAAoC,CAC3C,IAAU,EACV,OAAyB;IAEzB,I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,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAA,gCAAuB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAErD,IAAI,OAAO,CAAC,cAAc,KAAK,6BAAc,CAAC,IAAI,EAAE;QAClD,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,gCAAgC,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,qBAAqB,CAAC,CAAC;KAC7D;IAED,IAAI,OAAO,CAAC,aAAa,KAAK,4BAAa,CAAC,IAAI,EAAE;QAChD,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,IAAI,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;YACxC,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;SAC1D;KACF;AACH,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateNxComponentTemplate = void 0;
|
|
4
|
-
const js_1 = require("@nrwl/js");
|
|
5
|
-
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
6
|
-
const nrwl_home_tpl_1 = require("./nrwl-home-tpl");
|
|
7
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
8
|
-
let tsModule;
|
|
9
|
-
function updateNxComponentTemplate(host, options) {
|
|
10
|
-
if (!tsModule) {
|
|
11
|
-
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
12
|
-
}
|
|
13
|
-
const componentPath = `${options.appProjectRoot}/src/app/nx-welcome.component.ts`;
|
|
14
|
-
const templateNodeValue = (0, ast_utils_1.getDecoratorPropertyValueNode)(host, componentPath, 'Component', 'template', '@angular/core');
|
|
15
|
-
(0, js_1.replaceNodeValue)(host, tsModule.createSourceFile(componentPath, host.read(componentPath, 'utf-8'), tsModule.ScriptTarget.Latest, true), componentPath, templateNodeValue, `\`\n${nrwl_home_tpl_1.nrwlHomeTemplate.template(options.name)}\n\``);
|
|
16
|
-
// Fixing extra comma issue `,,`
|
|
17
|
-
let sourceFile = tsModule.createSourceFile(componentPath, host.read(componentPath, 'utf-8'), tsModule.ScriptTarget.Latest, true);
|
|
18
|
-
const componentFile = host
|
|
19
|
-
.read(componentPath, 'utf-8')
|
|
20
|
-
.toString()
|
|
21
|
-
.replace(/,,/gi, ',');
|
|
22
|
-
host.write(componentPath, componentFile);
|
|
23
|
-
sourceFile.update(componentFile, {
|
|
24
|
-
newLength: componentFile.length,
|
|
25
|
-
span: {
|
|
26
|
-
length: sourceFile.text.length,
|
|
27
|
-
start: 0,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
// Add ESLint ignore to pass the lint step
|
|
31
|
-
sourceFile = tsModule.createSourceFile(componentPath, host.read(componentPath, 'utf-8'), tsModule.ScriptTarget.Latest, true);
|
|
32
|
-
(0, js_1.addGlobal)(host, sourceFile, componentPath, '/* eslint-disable */');
|
|
33
|
-
}
|
|
34
|
-
exports.updateNxComponentTemplate = updateNxComponentTemplate;
|
|
35
|
-
//# sourceMappingURL=update-nx-component-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-nx-component-template.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/update-nx-component-template.ts"],"names":[],"mappings":";;;AAGA,iCAAuD;AACvD,kEAAmF;AACnF,mDAAmD;AACnD,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,yBAAyB,CACvC,IAAU,EACV,OAAyB;IAEzB,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,aAAa,GAAG,GAAG,OAAO,CAAC,cA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