@nrwl/angular 13.10.0-beta.5 → 13.10.0-beta.8
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/esm2020/mfe/index.mjs +2 -2
- package/executors.json +4 -4
- package/fesm2015/nrwl-angular-mfe.mjs +1 -1
- package/fesm2015/nrwl-angular-mfe.mjs.map +1 -1
- package/fesm2015/nrwl-angular-testing.mjs.map +1 -1
- package/fesm2015/nrwl-angular.mjs.map +1 -1
- package/fesm2020/nrwl-angular-mfe.mjs +1 -1
- package/fesm2020/nrwl-angular-mfe.mjs.map +1 -1
- package/fesm2020/nrwl-angular-testing.mjs.map +1 -1
- package/fesm2020/nrwl-angular.mjs.map +1 -1
- package/generators.json +8 -8
- package/mfe/index.d.ts +1 -1
- package/mfe/index.js +2 -1
- package/mfe/index.js.map +1 -1
- package/migrations.json +2 -407
- package/package.json +7 -7
- package/src/builders/webpack-browser/schema.json +18 -1
- package/src/builders/webpack-server/schema.json +6 -0
- package/src/executors/ng-packagr-lite/schema.json +14 -0
- package/src/executors/package/schema.json +14 -0
- package/src/generators/application/lib/add-mfe.js +1 -0
- package/src/generators/application/lib/add-mfe.js.map +1 -1
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +9 -3
- package/src/generators/component/schema.json +4 -4
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +2 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js.map +1 -1
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +1 -1
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +17 -14
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js.map +1 -1
- package/src/generators/convert-tslint-to-eslint/schema.json +4 -4
- package/src/generators/downgrade-module/schema.json +1 -0
- package/src/generators/init/schema.json +1 -1
- package/src/generators/karma/karma.d.ts +1 -1
- package/src/generators/karma/karma.js +17 -15
- package/src/generators/karma/karma.js.map +1 -1
- package/src/generators/karma/schema.json +1 -0
- package/src/generators/karma-project/karma-project.js +2 -0
- package/src/generators/karma-project/karma-project.js.map +1 -1
- package/src/generators/karma-project/schema.d.ts +1 -0
- package/src/generators/karma-project/schema.json +6 -0
- package/src/generators/library/schema.json +2 -1
- package/src/generators/library-secondary-entry-point/schema.json +1 -0
- package/src/generators/mfe-host/mfe-host.js +1 -0
- package/src/generators/mfe-host/mfe-host.js.map +1 -1
- package/src/generators/mfe-host/schema.d.ts +1 -0
- package/src/generators/mfe-host/schema.json +6 -1
- package/src/generators/mfe-remote/schema.json +2 -2
- package/src/generators/move/schema.json +3 -3
- package/src/generators/ng-add/compat.d.ts +1 -1
- package/src/generators/ng-add/files/{root → root-karma}/karma.conf.js__tmpl__ +0 -0
- package/src/generators/ng-add/migrate-from-angular-cli.d.ts +2 -2
- package/src/generators/ng-add/migrate-from-angular-cli.js +38 -607
- package/src/generators/ng-add/migrate-from-angular-cli.js.map +1 -1
- package/src/generators/ng-add/ng-add.d.ts +3 -3
- package/src/generators/ng-add/ng-add.js +2 -2
- package/src/generators/ng-add/ng-add.js.map +1 -1
- package/src/generators/ng-add/schema.d.ts +1 -1
- package/src/generators/ng-add/utilities/app.migrator.d.ts +18 -0
- package/src/generators/ng-add/utilities/app.migrator.js +182 -0
- package/src/generators/ng-add/utilities/app.migrator.js.map +1 -0
- package/src/generators/ng-add/utilities/e2e-project.migrator.d.ts +19 -0
- package/src/generators/ng-add/utilities/e2e-project.migrator.js +186 -0
- package/src/generators/ng-add/utilities/e2e-project.migrator.js.map +1 -0
- package/src/generators/ng-add/utilities/e2e-utils.d.ts +7 -0
- package/src/generators/ng-add/utilities/e2e-utils.js +46 -0
- package/src/generators/ng-add/utilities/e2e-utils.js.map +1 -0
- package/src/generators/ng-add/utilities/get-all-projects.d.ts +3 -0
- package/src/generators/ng-add/utilities/get-all-projects.js +26 -0
- package/src/generators/ng-add/utilities/get-all-projects.js.map +1 -0
- package/src/generators/ng-add/utilities/normalize-options.d.ts +3 -0
- package/src/generators/ng-add/utilities/normalize-options.js +24 -0
- package/src/generators/ng-add/utilities/normalize-options.js.map +1 -0
- package/src/generators/ng-add/utilities/project.migrator.d.ts +21 -0
- package/src/generators/ng-add/utilities/project.migrator.js +53 -0
- package/src/generators/ng-add/utilities/project.migrator.js.map +1 -0
- package/src/generators/ng-add/utilities/types.d.ts +10 -0
- package/src/generators/ng-add/utilities/types.js +3 -0
- package/src/generators/ng-add/utilities/types.js.map +1 -0
- package/src/generators/ng-add/utilities/workspace.d.ts +12 -0
- package/src/generators/ng-add/utilities/workspace.js +258 -0
- package/src/generators/ng-add/utilities/workspace.js.map +1 -0
- package/src/generators/ngrx/schema.json +1 -0
- package/src/generators/scam/schema.json +6 -6
- package/src/generators/scam-directive/schema.json +3 -3
- package/src/generators/scam-pipe/schema.json +1 -1
- package/src/generators/setup-mfe/files/webpack/mfe.config.js__tmpl__ +7 -0
- package/src/generators/setup-mfe/files/webpack/webpack.config.js__tmpl__ +2 -7
- package/src/generators/setup-mfe/lib/add-remote-to-host.d.ts +2 -2
- package/src/generators/setup-mfe/lib/add-remote-to-host.js +49 -24
- package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +1 -1
- package/src/generators/setup-mfe/lib/fix-bootstrap.d.ts +2 -1
- package/src/generators/setup-mfe/lib/fix-bootstrap.js +13 -4
- package/src/generators/setup-mfe/lib/fix-bootstrap.js.map +1 -1
- package/src/generators/setup-mfe/lib/generate-config.js +2 -1
- package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
- package/src/generators/setup-mfe/lib/index.d.ts +1 -0
- package/src/generators/setup-mfe/lib/index.js +1 -0
- package/src/generators/setup-mfe/lib/index.js.map +1 -1
- package/src/generators/setup-mfe/lib/setup-host-if-dynamic.d.ts +3 -0
- package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js +15 -0
- package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js.map +1 -0
- package/src/generators/setup-mfe/schema.d.ts +1 -0
- package/src/generators/setup-mfe/schema.json +7 -1
- package/src/generators/setup-mfe/setup-mfe.d.ts +1 -1
- package/src/generators/setup-mfe/setup-mfe.js +16 -13
- package/src/generators/setup-mfe/setup-mfe.js.map +1 -1
- package/src/generators/stories/schema.json +2 -0
- package/src/generators/storybook-configuration/schema.json +2 -0
- package/src/generators/storybook-migrate-defaults-5-to-6/schema.json +2 -0
- package/src/generators/storybook-migrate-stories-to-6-2/schema.json +2 -0
- package/src/generators/upgrade-module/schema.json +1 -0
- package/src/migrations/update-12-3-0/update-storybook.js +1 -1
- package/src/utils/mfe/with-module-federation.js +4 -1
- package/src/utils/mfe/with-module-federation.js.map +1 -1
- package/src/utils/versions.js +1 -1
- package/src/generators/ng-add/files/decorate-angular-cli/decorate-angular-cli.js__tmpl__ +0 -69
- package/src/generators/ng-add/files/root/nx.json__tmpl__ +0 -29
- package/src/migrations/update-10-0-0/update-10-0-0.d.ts +0 -1
- package/src/migrations/update-10-0-0/update-10-0-0.js +0 -15
- package/src/migrations/update-10-0-0/update-10-0-0.js.map +0 -1
- package/src/migrations/update-10-2-0/update-10-2-0.d.ts +0 -1
- package/src/migrations/update-10-2-0/update-10-2-0.js +0 -14
- package/src/migrations/update-10-2-0/update-10-2-0.js.map +0 -1
- package/src/migrations/update-10-3-0/files/tsconfig.editor.json +0 -11
- package/src/migrations/update-10-3-0/update-10-3-0.d.ts +0 -2
- package/src/migrations/update-10-3-0/update-10-3-0.js +0 -79
- package/src/migrations/update-10-3-0/update-10-3-0.js.map +0 -1
- package/src/migrations/update-10-4-0/update-10-4-0.d.ts +0 -2
- package/src/migrations/update-10-4-0/update-10-4-0.js +0 -36
- package/src/migrations/update-10-4-0/update-10-4-0.js.map +0 -1
- package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.d.ts +0 -2
- package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js +0 -118
- package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js.map +0 -1
- package/src/migrations/update-11-0-0/update-builders-config.d.ts +0 -2
- package/src/migrations/update-11-0-0/update-builders-config.js +0 -55
- package/src/migrations/update-11-0-0/update-builders-config.js.map +0 -1
- package/src/migrations/update-8-12-0/change-angular-lib-builder.d.ts +0 -2
- package/src/migrations/update-8-12-0/change-angular-lib-builder.js +0 -25
- package/src/migrations/update-8-12-0/change-angular-lib-builder.js.map +0 -1
- package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.d.ts +0 -1
- package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js +0 -49
- package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js.map +0 -1
- package/src/migrations/update-8-5-0/upgrade-cli-8-3.d.ts +0 -1
- package/src/migrations/update-8-5-0/upgrade-cli-8-3.js +0 -55
- package/src/migrations/update-8-5-0/upgrade-cli-8-3.js.map +0 -1
- package/src/migrations/update-9-0-0/add-postinstall.d.ts +0 -1
- package/src/migrations/update-9-0-0/add-postinstall.js +0 -22
- package/src/migrations/update-9-0-0/add-postinstall.js.map +0 -1
- package/src/migrations/update-9-0-0/update-9-0-0.d.ts +0 -2
- package/src/migrations/update-9-0-0/update-9-0-0.js +0 -18
- package/src/migrations/update-9-0-0/update-9-0-0.js.map +0 -1
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addRemoteToHost = exports.checkIsCommaNeeded = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const devkit_2 = require("@nrwl/devkit");
|
|
5
6
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
6
7
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
7
8
|
const ts = require("typescript");
|
|
9
|
+
const ast_utils_2 = require("@nrwl/workspace/src/utilities/ast-utils");
|
|
8
10
|
function checkIsCommaNeeded(mfeRemoteText) {
|
|
9
11
|
const remoteText = mfeRemoteText.replace(/\s+/g, '');
|
|
10
12
|
return !remoteText.endsWith(',]')
|
|
@@ -14,45 +16,68 @@ function checkIsCommaNeeded(mfeRemoteText) {
|
|
|
14
16
|
: false;
|
|
15
17
|
}
|
|
16
18
|
exports.checkIsCommaNeeded = checkIsCommaNeeded;
|
|
17
|
-
function addRemoteToHost(
|
|
18
|
-
var _a;
|
|
19
|
+
function addRemoteToHost(tree, options) {
|
|
19
20
|
if (options.mfeType === 'remote' && options.host) {
|
|
20
|
-
const hostProject = (0,
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const hostProject = (0, devkit_2.readProjectConfiguration)(tree, options.host);
|
|
22
|
+
const pathToMfeManifest = (0, devkit_2.joinPathFragments)(hostProject.sourceRoot, 'assets/mfe.manifest.json');
|
|
23
|
+
const hostFederationType = determineHostFederationType(tree, pathToMfeManifest);
|
|
24
|
+
if (hostFederationType === 'static') {
|
|
25
|
+
addRemoteToStaticHost(tree, options, hostProject);
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
host.write(hostWebpackPath, updatedConfig);
|
|
32
|
-
const declarationFilePath = (0, devkit_1.joinPathFragments)(hostProject.sourceRoot, 'decl.d.ts');
|
|
33
|
-
const declarationFileContent = (host.exists(declarationFilePath)
|
|
34
|
-
? host.read(declarationFilePath, 'utf-8')
|
|
27
|
+
else if (hostFederationType === 'dynamic') {
|
|
28
|
+
addRemoteToDynamicHost(tree, options, pathToMfeManifest);
|
|
29
|
+
}
|
|
30
|
+
const declarationFilePath = (0, devkit_2.joinPathFragments)(hostProject.sourceRoot, 'decl.d.ts');
|
|
31
|
+
const declarationFileContent = (tree.exists(declarationFilePath)
|
|
32
|
+
? tree.read(declarationFilePath, 'utf-8')
|
|
35
33
|
: '') + `\ndeclare module '${options.appName}/Module';`;
|
|
36
|
-
|
|
37
|
-
addLazyLoadedRouteToHostAppModule(
|
|
34
|
+
tree.write(declarationFilePath, declarationFileContent);
|
|
35
|
+
addLazyLoadedRouteToHostAppModule(tree, options, hostFederationType);
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
exports.addRemoteToHost = addRemoteToHost;
|
|
39
|
+
function determineHostFederationType(tree, pathToMfeManifest) {
|
|
40
|
+
return tree.exists(pathToMfeManifest) ? 'dynamic' : 'static';
|
|
41
|
+
}
|
|
42
|
+
function addRemoteToStaticHost(tree, options, hostProject) {
|
|
43
|
+
const hostMfeConfigPath = (0, devkit_2.joinPathFragments)(hostProject.root, 'mfe.config.js');
|
|
44
|
+
if (!hostMfeConfigPath || !tree.exists(hostMfeConfigPath)) {
|
|
45
|
+
throw new Error(`The selected host application, ${options.host}, does not contain a mfe.config.js or mfe.manifest.json file. Are you sure it has been set up as a host application?`);
|
|
46
|
+
}
|
|
47
|
+
const hostMFEConfig = tree.read(hostMfeConfigPath, 'utf-8');
|
|
48
|
+
const webpackAst = tsquery_1.tsquery.ast(hostMFEConfig);
|
|
49
|
+
const mfRemotesNode = (0, tsquery_1.tsquery)(webpackAst, 'Identifier[name=remotes] ~ ArrayLiteralExpression', { visitAllChildren: true })[0];
|
|
50
|
+
const endOfPropertiesPos = mfRemotesNode.getEnd() - 1;
|
|
51
|
+
const isCommaNeeded = checkIsCommaNeeded(mfRemotesNode.getText());
|
|
52
|
+
const updatedConfig = `${hostMFEConfig.slice(0, endOfPropertiesPos)}${isCommaNeeded ? ',' : ''}'${options.appName}',${hostMFEConfig.slice(endOfPropertiesPos)}`;
|
|
53
|
+
tree.write(hostMfeConfigPath, updatedConfig);
|
|
54
|
+
}
|
|
55
|
+
function addRemoteToDynamicHost(tree, options, pathToMfeManifest) {
|
|
56
|
+
(0, devkit_1.updateJson)(tree, pathToMfeManifest, (manifest) => {
|
|
57
|
+
return Object.assign(Object.assign({}, manifest), { [options.appName]: `http://localhost:${options.port}` });
|
|
58
|
+
});
|
|
59
|
+
}
|
|
41
60
|
// TODO(colum): future work: allow dev to pass to path to routing module
|
|
42
|
-
function addLazyLoadedRouteToHostAppModule(
|
|
43
|
-
const hostAppConfig = (0,
|
|
61
|
+
function addLazyLoadedRouteToHostAppModule(tree, options, hostFederationType) {
|
|
62
|
+
const hostAppConfig = (0, devkit_2.readProjectConfiguration)(tree, options.host);
|
|
44
63
|
const pathToHostAppModule = `${hostAppConfig.sourceRoot}/app/app.module.ts`;
|
|
45
|
-
if (!
|
|
64
|
+
if (!tree.exists(pathToHostAppModule)) {
|
|
46
65
|
return;
|
|
47
66
|
}
|
|
48
|
-
const hostAppModule =
|
|
67
|
+
const hostAppModule = tree.read(pathToHostAppModule, 'utf-8');
|
|
49
68
|
if (!hostAppModule.includes('RouterModule.forRoot(')) {
|
|
50
69
|
return;
|
|
51
70
|
}
|
|
52
71
|
let sourceFile = ts.createSourceFile(pathToHostAppModule, hostAppModule, ts.ScriptTarget.Latest, true);
|
|
53
|
-
|
|
72
|
+
if (hostFederationType === 'dynamic') {
|
|
73
|
+
sourceFile = (0, ast_utils_2.insertImport)(tree, sourceFile, pathToHostAppModule, 'loadRemoteModule', '@nrwl/angular/mfe');
|
|
74
|
+
}
|
|
75
|
+
const routeToAdd = hostFederationType === 'dynamic'
|
|
76
|
+
? `loadRemoteModule('${options.appName}', './Module')`
|
|
77
|
+
: `import('${options.appName}/Module')`;
|
|
78
|
+
sourceFile = (0, ast_utils_1.addRoute)(tree, pathToHostAppModule, sourceFile, `{
|
|
54
79
|
path: '${options.appName}',
|
|
55
|
-
loadChildren: () =>
|
|
80
|
+
loadChildren: () => ${routeToAdd}.then(m => m.RemoteEntryModule)
|
|
56
81
|
}`);
|
|
57
82
|
}
|
|
58
83
|
//# sourceMappingURL=add-remote-to-host.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-remote-to-host.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/add-remote-to-host.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"add-remote-to-host.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup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B,CAAC;KACH;IACD,MAAM,UAAU,GACd,kBAAkB,KAAK,SAAS;QAC9B,CAAC,CAAC,qBAAqB,OAAO,CAAC,OAAO,gBAAgB;QACtD,CAAC,CAAC,WAAW,OAAO,CAAC,OAAO,WAAW,CAAC;IAE5C,UAAU,GAAG,IAAA,oBAAQ,EACnB,IAAI,EACJ,mBAAmB,EACnB,UAAU,EACV;kBACc,OAAO,CAAC,OAAO;+BACF,UAAU;OAClC,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fixBootstrap = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
function fixBootstrap(
|
|
5
|
+
function fixBootstrap(tree, appRoot, options) {
|
|
6
6
|
const mainFilePath = (0, devkit_1.joinPathFragments)(appRoot, 'src/main.ts');
|
|
7
|
-
const bootstrapCode =
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const bootstrapCode = tree.read(mainFilePath, 'utf-8');
|
|
8
|
+
tree.write((0, devkit_1.joinPathFragments)(appRoot, 'src/bootstrap.ts'), bootstrapCode);
|
|
9
|
+
const bootstrapImportCode = `import('./bootstrap').catch(err => console.error(err))`;
|
|
10
|
+
const fetchMfeManifestCode = `import { setRemoteDefinitions } from '@nrwl/angular/mfe';
|
|
11
|
+
|
|
12
|
+
fetch('/assets/mfe.manifest.json')
|
|
13
|
+
.then((res) => res.json())
|
|
14
|
+
.then(definitions => setRemoteDefinitions(definitions))
|
|
15
|
+
.then(() => ${bootstrapImportCode})`;
|
|
16
|
+
tree.write(mainFilePath, options.mfeType === 'host' && options.federationType === 'dynamic'
|
|
17
|
+
? fetchMfeManifestCode
|
|
18
|
+
: bootstrapImportCode);
|
|
10
19
|
}
|
|
11
20
|
exports.fixBootstrap = fixBootstrap;
|
|
12
21
|
//# sourceMappingURL=fix-bootstrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-bootstrap.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/fix-bootstrap.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fix-bootstrap.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/fix-bootstrap.ts"],"names":[],"mappings":";;;AAGA,yCAAiD;AAEjD,SAAgB,YAAY,CAAC,IAAU,EAAE,OAAe,EAAE,OAAe;IACvE,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC/D,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,IAAI,CAAC,KAAK,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,aAAa,CAAC,CAAC;IAE1E,MAAM,mBAAmB,GAAG,wDAAwD,CAAC;IAErF,MAAM,oBAAoB,GAAG;;;;;gBAKf,mBAAmB,GAAG,CAAC;IAErC,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,OAAO,CAAC,OAAO,KAAK,MAAM,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS;QAChE,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,mBAAmB,CACxB,CAAC;AACJ,CAAC;AApBD,oCAoBC"}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateWebpackConfig = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
function generateWebpackConfig(host, options, appRoot, remotesWithPorts) {
|
|
6
|
-
if (host.exists(`${appRoot}/
|
|
6
|
+
if (host.exists(`${appRoot}/mfe.config.js`) ||
|
|
7
|
+
host.exists(`${appRoot}/webpack.config.js`) ||
|
|
7
8
|
host.exists(`${appRoot}/webpack.prod.config.js`)) {
|
|
8
9
|
devkit_1.logger.warn(`NOTE: We encountered an existing webpack config for the app ${options.appName}. We have overwritten this file with the Module Federation Config.\n
|
|
9
10
|
If this was not the outcome you expected, you can discard the changes we have made, create a backup of your current webpack config, and run the command again.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/generate-config.ts"],"names":[],"mappings":";;;AACA,yCAAwE;AAGxE,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAe,EACf,OAAe,EACf,gBAAwD;IAExD,IACE,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,oBAAoB,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAChD;QACA,eAAM,CAAC,IAAI,CACT,+DAA+D,OAAO,CAAC,OAAO;qKACiF,CAChK,CAAC;KACH;IAED,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,OAAO,EACP;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,OAAO,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,EAAE;QAC/B,WAAW,EAAE,OAAO;KACrB,CACF,CAAC;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/generate-config.ts"],"names":[],"mappings":";;;AACA,yCAAwE;AAGxE,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAe,EACf,OAAe,EACf,gBAAwD;IAExD,IACE,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,gBAAgB,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,oBAAoB,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAChD;QACA,eAAM,CAAC,IAAI,CACT,+DAA+D,OAAO,CAAC,OAAO;qKACiF,CAChK,CAAC;KACH;IAED,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,OAAO,EACP;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,OAAO,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,EAAE;QAC/B,WAAW,EAAE,OAAO;KACrB,CACF,CAAC;AACJ,CAAC;AA7BD,sDA6BC"}
|
|
@@ -10,5 +10,6 @@ tslib_1.__exportStar(require("./fix-bootstrap"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./generate-config"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./get-remotes-with-ports"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./set-tsconfig-target"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./setup-host-if-dynamic"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./setup-serve-target"), exports);
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC;AACzC,6DAAmC;AACnC,8DAAoC;AACpC,+DAAqC;AACrC,gEAAsC;AACtC,0DAAgC;AAChC,4DAAkC;AAClC,mEAAyC;AACzC,gEAAsC;AACtC,+DAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC;AACzC,6DAAmC;AACnC,8DAAoC;AACpC,+DAAqC;AACrC,gEAAsC;AACtC,0DAAgC;AAChC,4DAAkC;AAClC,mEAAyC;AACzC,gEAAsC;AACtC,kEAAwC;AACxC,+DAAqC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupHostIfDynamic = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function setupHostIfDynamic(tree, options) {
|
|
6
|
+
if (options.federationType === 'static' || options.mfeType === 'remote') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const pathToMfeManifest = (0, devkit_1.joinPathFragments)((0, devkit_1.readProjectConfiguration)(tree, options.appName).sourceRoot, 'assets/mfe.manifest.json');
|
|
10
|
+
if (!tree.exists(pathToMfeManifest)) {
|
|
11
|
+
tree.write(pathToMfeManifest, '{}');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.setupHostIfDynamic = setupHostIfDynamic;
|
|
15
|
+
//# sourceMappingURL=setup-host-if-dynamic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-host-if-dynamic.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/setup-host-if-dynamic.ts"],"names":[],"mappings":";;;AAGA,yCAA2E;AAE3E,SAAgB,kBAAkB,CAAC,IAAU,EAAE,OAAe;IAC5D,IAAI,OAAO,CAAC,cAAc,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE;QACvE,OAAO;KACR;IAED,MAAM,iBAAiB,GAAG,IAAA,0BAAiB,EACzC,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,UAAU,EAC1D,0BAA0B,CAC3B,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE;QACnC,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;KACrC;AACH,CAAC;AAbD,gDAaC"}
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"description": "Type of application to generate the Module Federation configuration for.",
|
|
22
22
|
"default": "remote"
|
|
23
23
|
},
|
|
24
|
+
"federationType": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["static", "dynamic"],
|
|
27
|
+
"description": "Use either Static or Dynamic Module Federation pattern for the application.",
|
|
28
|
+
"default": "static"
|
|
29
|
+
},
|
|
24
30
|
"port": {
|
|
25
31
|
"type": "number",
|
|
26
32
|
"description": "The port at which the remote application should be served."
|
|
@@ -48,7 +54,7 @@
|
|
|
48
54
|
},
|
|
49
55
|
"e2eProjectName": {
|
|
50
56
|
"type": "string",
|
|
51
|
-
"description": "The project name of the associated
|
|
57
|
+
"description": "The project name of the associated E2E project for the application. This is only required for Cypress E2E projects that do not follow the naming convention `<appName>-e2e`."
|
|
52
58
|
}
|
|
53
59
|
},
|
|
54
60
|
"required": ["appName", "mfeType"],
|
|
@@ -4,22 +4,25 @@ exports.setupMfe = 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
|
-
function setupMfe(
|
|
7
|
+
function setupMfe(tree, options) {
|
|
8
|
+
var _a;
|
|
8
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(
|
|
10
|
-
|
|
11
|
-
(0, lib_1.
|
|
12
|
-
(0, lib_1.
|
|
13
|
-
(0, lib_1.
|
|
14
|
-
(0, lib_1.
|
|
15
|
-
(0, lib_1.
|
|
16
|
-
(0, lib_1.
|
|
17
|
-
(0, lib_1.
|
|
18
|
-
(0, lib_1.
|
|
19
|
-
(0, lib_1.
|
|
10
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.appName);
|
|
11
|
+
options.federationType = (_a = options.federationType) !== null && _a !== void 0 ? _a : 'static';
|
|
12
|
+
(0, lib_1.setupHostIfDynamic)(tree, options);
|
|
13
|
+
const remotesWithPorts = (0, lib_1.getRemotesWithPorts)(tree, options);
|
|
14
|
+
(0, lib_1.addRemoteToHost)(tree, options);
|
|
15
|
+
(0, lib_1.generateWebpackConfig)(tree, options, projectConfig.root, remotesWithPorts);
|
|
16
|
+
(0, lib_1.addEntryModule)(tree, options, projectConfig.root);
|
|
17
|
+
(0, lib_1.addImplicitDeps)(tree, options);
|
|
18
|
+
(0, lib_1.changeBuildTarget)(tree, options);
|
|
19
|
+
(0, lib_1.updateTsConfigTarget)(tree, options);
|
|
20
|
+
(0, lib_1.setupServeTarget)(tree, options);
|
|
21
|
+
(0, lib_1.fixBootstrap)(tree, projectConfig.root, options);
|
|
22
|
+
(0, lib_1.addCypressOnErrorWorkaround)(tree, options);
|
|
20
23
|
// format files
|
|
21
24
|
if (!options.skipFormat) {
|
|
22
|
-
yield (0, devkit_1.formatFiles)(
|
|
25
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
23
26
|
}
|
|
24
27
|
});
|
|
25
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-mfe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/setup-mfe/setup-mfe.ts"],"names":[],"mappings":";;;;AAGA,yCAAqE;AAErE,+
|
|
1
|
+
{"version":3,"file":"setup-mfe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/setup-mfe/setup-mfe.ts"],"names":[],"mappings":";;;;AAGA,yCAAqE;AAErE,+BAYe;AAEf,SAAsB,QAAQ,CAAC,IAAU,EAAE,OAAe;;;QACxD,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtE,OAAO,CAAC,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,QAAQ,CAAC;QAE5D,IAAA,wBAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAElC,MAAM,gBAAgB,GAAG,IAAA,yBAAmB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAA,qBAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE/B,IAAA,2BAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAE3E,IAAA,oBAAc,EAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QAClD,IAAA,qBAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/B,IAAA,uBAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAA,0BAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpC,IAAA,sBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEhC,IAAA,kBAAY,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEhD,IAAA,iCAA2B,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,eAAe;QACf,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;;CACF;AA1BD,4BA0BC;AAED,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxAngularStorybookStoriesGenerator",
|
|
4
|
+
"title": "Create Storybook stories/specs",
|
|
5
|
+
"description": "Creates Storybook stories/specs for all components declared in a project.",
|
|
4
6
|
"cli": "nx",
|
|
5
7
|
"type": "object",
|
|
6
8
|
"properties": {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxAngularStorybookConfigurationGenerator",
|
|
4
|
+
"title": "Adds Storybook configuration to a project.",
|
|
5
|
+
"description": "Adds Storybook configuration to a project to be able to use and create stories.",
|
|
4
6
|
"cli": "nx",
|
|
5
7
|
"type": "object",
|
|
6
8
|
"properties": {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxStorybookMigrateDefaults5To6Generator",
|
|
4
|
+
"title": "Storybook migrate default 5 to 6",
|
|
5
|
+
"description": "Generates default Storybook configuration files using Storybook version `>=6.x` specs, for projects that already have Storybook instances and configurations of versions `<6.x.`",
|
|
4
6
|
"cli": "nx",
|
|
5
7
|
"type": "object",
|
|
6
8
|
"properties": {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxAngularStorybookMigrateStoriesTo62Generator",
|
|
4
|
+
"title": "Storybook migrate stories to 6.2",
|
|
5
|
+
"description": "Migrates stories to match the new syntax in `v6.2` where the component declaration should be in the default export.",
|
|
4
6
|
"type": "object",
|
|
5
7
|
"cli": "nx",
|
|
6
8
|
"properties": {},
|
|
@@ -21,7 +21,7 @@ function default_1(tree) {
|
|
|
21
21
|
This workspace uses Storybook ${storybookVersion} which does not support Webpack 5.
|
|
22
22
|
Storybook 6.2+ is required to support Webpack 5.
|
|
23
23
|
See our documentation on migrating to Storybook 6:
|
|
24
|
-
https://nx.dev/
|
|
24
|
+
https://nx.dev/storybook/overview-angular#upgrading-to-storybook-6-using-the-nx-migration-generator
|
|
25
25
|
`);
|
|
26
26
|
throw new Error('Could not migrate to Angular 12');
|
|
27
27
|
}
|
|
@@ -99,7 +99,10 @@ function mapRemotes(remotes) {
|
|
|
99
99
|
const mappedRemotes = {};
|
|
100
100
|
for (const remote of remotes) {
|
|
101
101
|
if (Array.isArray(remote)) {
|
|
102
|
-
|
|
102
|
+
const remoteLocation = remote[1].match(/remoteEntry\.(js|mjs)/)
|
|
103
|
+
? remote[1]
|
|
104
|
+
: `${remote[1].endsWith('/') ? remote[1].slice(0, -1) : remote[1]}/remoteEntry.mjs`;
|
|
105
|
+
mappedRemotes[remote[0]] = remoteLocation;
|
|
103
106
|
}
|
|
104
107
|
else if (typeof remote === 'string') {
|
|
105
108
|
mappedRemotes[remote] = determineRemoteUrl(remote);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/utils/mfe/with-module-federation.ts"],"names":[],"mappings":";;;;AAAA,+CAIuB;AACvB,yCAMsB;AACtB,yEAGkD;AAElD,uDAA2D;AAC3D,uFAAwF;AAcxF,SAAS,qCAAqC,CAC5C,YAA+B,EAC/B,MAAc,EACd,cAA2B,IAAI,GAAG,EAAE;;IAEpC,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC3B,OAAO,EAAE,CAAC;KACX;IACD,IAAI,YAAY,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAExB,MAAM,qBAAqB,GAAG,CAC5B,MAAA,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,EAAE,CACxC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE;QACpC,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE;YACvC,YAAY,GAAG;gBACb,GAAG,YAAY;gBACf,GAAG,qCAAqC,CACtC,YAAY,EACZ,GAAG,CAAC,MAAM,EACV,WAAW,CACZ;aACF,CAAC;SACH;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,qCAAqC,CAAC,kBAA4B;;IACzE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,mBAAU,CACjC,sBAAa,CACd,CAAC,0BAA0B,EAAE,CAAC;IAE/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O,CAAC,UAAU,CAAC;KAC1E;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,iDAAiD,MAAM;mJACsF,CAC9I,CAAC;KACH;IACD,OAAO,GACL,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UACvD,kBAAkB,CAAC;AACrB,CAAC;AAED,SAAS,UAAU,CAAC,OAAmB;IACrC,MAAM,aAAa,GAAG,EAAE,CAAC;IAEzB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzB,
|
|
1
|
+
{"version":3,"file":"with-module-federation.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/utils/mfe/with-module-federation.ts"],"names":[],"mappings":";;;;AAAA,+CAIuB;AACvB,yCAMsB;AACtB,yEAGkD;AAElD,uDAA2D;AAC3D,uFAAwF;AAcxF,SAAS,qCAAqC,CAC5C,YAA+B,EAC/B,MAAc,EACd,cAA2B,IAAI,GAAG,EAAE;;IAEpC,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC3B,OAAO,EAAE,CAAC;KACX;IACD,IAAI,YAAY,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAExB,MAAM,qBAAqB,GAAG,CAC5B,MAAA,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,EAAE,CACxC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE;QACpC,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE;YACvC,YAAY,GAAG;g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EAAE;;YAAC,OAAA,iCACd,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,KACjB,MAAM,kCACD,CAAC,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE,CAAC,KACxB,UAAU,EAAE,OAAO,CAAC,IAAI,EACxB,UAAU,EAAE,MAAM,KAEpB,YAAY,kCACP,CAAC,MAAA,MAAM,CAAC,YAAY,mCAAI,EAAE,CAAC,KAC9B,YAAY,EAAE,KAAK,KAErB,OAAO,kCACF,CAAC,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC,KACzB,KAAK,kCACA,CAAC,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,mCAAI,EAAE,CAAC,GAC7B,eAAe,CAAC,UAAU,EAAE,MAGnC,WAAW,kCACN,CAAC,MAAA,MAAM,CAAC,WAAW,mCAAI,EAAE,CAAC,KAC7B,YAAY,EAAE,IAAI,KAEpB,OAAO,EAAE;oBACP,GAAG,CAAC,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC;oBACzB,IAAI,sBAAsB,CAAC;wBACzB,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,QAAQ,EAAE,iBAAiB;wBAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;wBACxB,OAAO,EAAE,aAAa;wBACtB,MAAM,oBACD,kBAAkB,CACtB;wBACD,OAAO,EAAE;4BACP,IAAI,EAAE,QAAQ;yBACf;qBACF,CAAC;oBACF,eAAe,CAAC,oBAAoB,EAAE;iBACvC,IACD,CAAA;SAAA,CAAC;IACL,CAAC;CAAA;AA7ED,oDA6EC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.autoprefixerVersion = exports.postcssVersion = exports.tailwindVersion = exports.angularEslintVersion = exports.jestPresetAngularVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularJsVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '13.10.0-beta.
|
|
4
|
+
exports.nxVersion = '13.10.0-beta.8';
|
|
5
5
|
exports.angularVersion = '~13.3.0';
|
|
6
6
|
exports.angularDevkitVersion = '~13.3.0';
|
|
7
7
|
exports.angularJsVersion = '1.7.9';
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file decorates the Angular CLI with the Nx CLI to enable features such as computation caching
|
|
3
|
-
* and faster execution of tasks.
|
|
4
|
-
*
|
|
5
|
-
* It does this by:
|
|
6
|
-
*
|
|
7
|
-
* - Patching the Angular CLI to warn you in case you accidentally use the undecorated ng command.
|
|
8
|
-
* - Symlinking the ng to nx command, so all commands run through the Nx CLI
|
|
9
|
-
* - Updating the package.json postinstall script to give you control over this script
|
|
10
|
-
*
|
|
11
|
-
* The Nx CLI decorates the Angular CLI, so the Nx CLI is fully compatible with it.
|
|
12
|
-
* Every command you run should work the same when using the Nx CLI, except faster.
|
|
13
|
-
*
|
|
14
|
-
* Because of symlinking you can still type `ng build/test/lint` in the terminal. The ng command, in this case,
|
|
15
|
-
* will point to nx, which will perform optimizations before invoking ng. So the Angular CLI is always invoked.
|
|
16
|
-
* The Nx CLI simply does some optimizations before invoking the Angular CLI.
|
|
17
|
-
*
|
|
18
|
-
* To opt out of this patch:
|
|
19
|
-
* - Replace occurrences of nx with ng in your package.json
|
|
20
|
-
* - Remove the script from your postinstall script in your package.json
|
|
21
|
-
* - Delete and reinstall your node_modules
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const fs = require('fs');
|
|
25
|
-
const os = require('os');
|
|
26
|
-
const cp = require('child_process');
|
|
27
|
-
const isWindows = os.platform() === 'win32';
|
|
28
|
-
let output;
|
|
29
|
-
try {
|
|
30
|
-
output = require('@nrwl/workspace').output;
|
|
31
|
-
} catch (e) {
|
|
32
|
-
console.warn('Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.');
|
|
33
|
-
process.exit(0);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
|
|
38
|
-
* invoke the Nx CLI and get the benefits of computation caching.
|
|
39
|
-
*/
|
|
40
|
-
function symlinkNgCLItoNxCLI() {
|
|
41
|
-
try {
|
|
42
|
-
const ngPath = './node_modules/.bin/ng';
|
|
43
|
-
const nxPath = './node_modules/.bin/nx';
|
|
44
|
-
if (isWindows) {
|
|
45
|
-
/**
|
|
46
|
-
* This is the most reliable way to create symlink-like behavior on Windows.
|
|
47
|
-
* Such that it works in all shells and works with npx.
|
|
48
|
-
*/
|
|
49
|
-
['', '.cmd', '.ps1'].forEach(ext => {
|
|
50
|
-
if (fs.existsSync(nxPath + ext)) fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
|
|
51
|
-
});
|
|
52
|
-
} else {
|
|
53
|
-
// If unix-based, symlink
|
|
54
|
-
cp.execSync(`ln -sf ./nx ${ngPath}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch(e) {
|
|
58
|
-
output.error({ title: 'Unable to create a symlink from the Angular CLI to the Nx CLI:' + e.message });
|
|
59
|
-
throw e;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
symlinkNgCLItoNxCLI();
|
|
65
|
-
require('nx/src/adapter/decorate-cli').decorateCli();
|
|
66
|
-
output.log({ title: 'Angular CLI has been decorated to enable computation caching.' });
|
|
67
|
-
} catch(e) {
|
|
68
|
-
output.error({ title: 'Decoration of the Angular CLI did not complete successfully' });
|
|
69
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"npmScope": "<%= npmScope %>",
|
|
3
|
-
"affected": {
|
|
4
|
-
"defaultBase": "<%= defaultBase %>"
|
|
5
|
-
},
|
|
6
|
-
"implicitDependencies": {
|
|
7
|
-
"package.json": {
|
|
8
|
-
"dependencies": "*",
|
|
9
|
-
"devDependencies": "*"
|
|
10
|
-
},
|
|
11
|
-
".eslintrc.json": "*"
|
|
12
|
-
},
|
|
13
|
-
"tasksRunnerOptions": {
|
|
14
|
-
"default": {
|
|
15
|
-
"runner": "nx/tasks-runners/default",
|
|
16
|
-
"options": {
|
|
17
|
-
"cacheableOperations": ["build", "lint", "test", "e2e"]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"targetDependencies": {
|
|
22
|
-
"build": [
|
|
23
|
-
{
|
|
24
|
-
"target": "build",
|
|
25
|
-
"projects": "dependencies"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (): import("@angular-devkit/schematics").Rule;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
-
const workspace_1 = require("@nrwl/workspace");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
function default_1() {
|
|
7
|
-
return (0, schematics_1.chain)([
|
|
8
|
-
(0, workspace_1.addUpdateTask)('@angular/core', '10.0.0'),
|
|
9
|
-
(0, workspace_1.addUpdateTask)('@angular/cli', '10.0.0'),
|
|
10
|
-
(0, workspace_1.updatePackagesInPackageJson)((0, path_1.join)(__dirname, '../../../migrations.json'), '10.0.0'),
|
|
11
|
-
(0, workspace_1.formatFiles)(),
|
|
12
|
-
]);
|
|
13
|
-
}
|
|
14
|
-
exports.default = default_1;
|
|
15
|
-
//# sourceMappingURL=update-10-0-0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-10-0-0.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-10-0-0/update-10-0-0.ts"],"names":[],"mappings":";;AAAA,2DAAmD;AACnD,+CAIyB;AACzB,+BAA4B;AAE5B;IACE,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,yBAAa,EAAC,eAAe,EAAE,QAAQ,CAAC;QACxC,IAAA,yBAAa,EAAC,cAAc,EAAE,QAAQ,CAAC;QACvC,IAAA,uCAA2B,EACzB,IAAA,WAAI,EAAC,SAAS,EAAE,0BAA0B,CAAC,EAC3C,QAAQ,CACT;QACD,IAAA,uBAAW,GAAE;KACd,CAAC,CAAC;AACL,CAAC;AAVD,4BAUC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (): import("@angular-devkit/schematics").Rule;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
-
const workspace_1 = require("@nrwl/workspace");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
function default_1() {
|
|
7
|
-
return (0, schematics_1.chain)([
|
|
8
|
-
(0, workspace_1.addUpdateTask)('@ngrx/store', '10.0.0'),
|
|
9
|
-
(0, workspace_1.updatePackagesInPackageJson)((0, path_1.join)(__dirname, '../../../migrations.json'), '10.2.0'),
|
|
10
|
-
(0, workspace_1.formatFiles)(),
|
|
11
|
-
]);
|
|
12
|
-
}
|
|
13
|
-
exports.default = default_1;
|
|
14
|
-
//# sourceMappingURL=update-10-2-0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-10-2-0.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-10-2-0/update-10-2-0.ts"],"names":[],"mappings":";;AAAA,2DAAmD;AACnD,+CAIyB;AACzB,+BAA4B;AAE5B;IACE,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,yBAAa,EAAC,aAAa,EAAE,QAAQ,CAAC;QACtC,IAAA,uCAA2B,EACzB,IAAA,WAAI,EAAC,SAAS,EAAE,0BAA0B,CAAC,EAC3C,QAAQ,CACT;QACD,IAAA,uBAAW,GAAE;KACd,CAAC,CAAC;AACL,CAAC;AATD,4BASC"}
|