@nrwl/angular 13.4.0-beta.2 → 13.4.1
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/package.json +6 -6
- package/src/generators/setup-mfe/files/entry-module-files/entry.module.ts__tmpl__ +2 -2
- package/src/generators/setup-mfe/files/webpack/webpack.config.js__tmpl__ +4 -4
- package/src/generators/setup-mfe/lib/generate-config.js +1 -0
- package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
- package/src/generators/utils/insert-ngmodule-import.d.ts +3 -0
- package/src/generators/utils/insert-ngmodule-import.js +18 -14
- package/src/generators/utils/insert-ngmodule-import.js.map +1 -1
- package/src/utils/versions.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.1",
|
|
4
4
|
"description": "Angular Plugin for Nx",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@angular-devkit/schematics": "~13.1.0",
|
|
58
|
-
"@nrwl/cypress": "13.4.
|
|
59
|
-
"@nrwl/devkit": "13.4.
|
|
60
|
-
"@nrwl/jest": "13.4.
|
|
61
|
-
"@nrwl/linter": "13.4.
|
|
62
|
-
"@nrwl/storybook": "13.4.
|
|
58
|
+
"@nrwl/cypress": "13.4.1",
|
|
59
|
+
"@nrwl/devkit": "13.4.1",
|
|
60
|
+
"@nrwl/jest": "13.4.1",
|
|
61
|
+
"@nrwl/linter": "13.4.1",
|
|
62
|
+
"@nrwl/storybook": "13.4.1",
|
|
63
63
|
"@schematics/angular": "~13.1.0",
|
|
64
64
|
"@phenomnomnominal/tsquery": "4.1.1",
|
|
65
65
|
"ignore": "^5.0.4",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
3
|
<% if(routing) { %>import { RouterModule } from '@angular/router';<% } %>
|
|
4
4
|
|
|
5
5
|
import { RemoteEntryComponent } from './entry.component';
|
|
@@ -7,7 +7,7 @@ import { RemoteEntryComponent } from './entry.component';
|
|
|
7
7
|
@NgModule({
|
|
8
8
|
declarations: [RemoteEntryComponent],
|
|
9
9
|
imports: [
|
|
10
|
-
|
|
10
|
+
CommonModule,
|
|
11
11
|
<% if(routing) { %>RouterModule.forChild([
|
|
12
12
|
{
|
|
13
13
|
path: '',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
|
|
2
2
|
const mf = require("@angular-architects/module-federation/webpack");
|
|
3
3
|
const path = require("path");
|
|
4
|
-
|
|
4
|
+
const share = mf.share;
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser
|
|
@@ -46,10 +46,10 @@ module.exports = {
|
|
|
46
46
|
remotes: {
|
|
47
47
|
<% remotes.forEach(function(remote) { %>"<%= remote.remoteName %>": "http://localhost:<%= remote.port %>/remoteEntry.js",<% }); %>
|
|
48
48
|
},<% } %>
|
|
49
|
-
shared: {<% sharedLibraries.forEach(function (lib) { %>
|
|
50
|
-
"<%= lib %>": { singleton: true, strictVersion: true },<% }); %>
|
|
49
|
+
shared: share({<% sharedLibraries.forEach(function (lib) { %>
|
|
50
|
+
"<%= lib %>": { singleton: true, strictVersion: true, requiredVersion: 'auto', includeSecondaries: true },<% }); %>
|
|
51
51
|
...sharedMappings.getDescriptors(),
|
|
52
|
-
},
|
|
52
|
+
}),
|
|
53
53
|
library: {
|
|
54
54
|
type: 'module'
|
|
55
55
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/generate-config.ts"],"names":[],"mappings":";;;AAEA,yCAKsB;AAEtB,MAAM,0BAA0B,GAAG;IACjC,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,iBAAiB;
|
|
1
|
+
{"version":3,"file":"generate-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/generate-config.ts"],"names":[],"mappings":";;;AAEA,yCAKsB;AAEtB,MAAM,0BAA0B,GAAG;IACjC,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,iBAAiB;IACjB,MAAM;CACP,CAAC;AAEF,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;IACD,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,UAAU,EAAE,OAAO;QACnB,eAAe,EAAE,0BAA0B;QAC3C,cAAc,EAAE,IAAA,uBAAc,EAAC,OAAO,CAAC;KACxC,CACF,CAAC;AACJ,CAAC;AA7BD,sDA6BC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nrwl/devkit';
|
|
2
|
+
declare type ngModuleDecoratorProperty = 'imports' | 'providers' | 'declarations' | 'exports';
|
|
3
|
+
export declare function insertNgModuleProperty(tree: Tree, modulePath: string, name: string, property: ngModuleDecoratorProperty): void;
|
|
2
4
|
export declare function insertNgModuleImport(tree: Tree, modulePath: string, importName: string): void;
|
|
5
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertNgModuleImport = void 0;
|
|
3
|
+
exports.insertNgModuleImport = exports.insertNgModuleProperty = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
const typescript_1 = require("typescript");
|
|
6
|
-
function
|
|
6
|
+
function insertNgModuleProperty(tree, modulePath, name, property) {
|
|
7
7
|
const contents = tree.read(modulePath).toString('utf-8');
|
|
8
8
|
const sourceFile = (0, typescript_1.createSourceFile)(modulePath, contents, typescript_1.ScriptTarget.ESNext);
|
|
9
9
|
const coreImport = findImport(sourceFile, '@angular/core');
|
|
@@ -22,7 +22,7 @@ function insertNgModuleImport(tree, modulePath, importName) {
|
|
|
22
22
|
{
|
|
23
23
|
type: devkit_1.ChangeType.Insert,
|
|
24
24
|
index: ngModuleCall.getEnd() - 1,
|
|
25
|
-
text: `{
|
|
25
|
+
text: `{ ${property}: [${name}]}`,
|
|
26
26
|
},
|
|
27
27
|
]);
|
|
28
28
|
tree.write(modulePath, newContents);
|
|
@@ -33,9 +33,9 @@ function insertNgModuleImport(tree, modulePath, importName) {
|
|
|
33
33
|
}
|
|
34
34
|
const ngModuleOptions = ngModuleCall
|
|
35
35
|
.arguments[0];
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
38
|
-
let text =
|
|
36
|
+
const typeProperty = findPropertyAssignment(ngModuleOptions, property);
|
|
37
|
+
if (!typeProperty) {
|
|
38
|
+
let text = `${property}: [${name}]`;
|
|
39
39
|
if (ngModuleOptions.properties.hasTrailingComma) {
|
|
40
40
|
text = `${text},`;
|
|
41
41
|
}
|
|
@@ -52,20 +52,20 @@ function insertNgModuleImport(tree, modulePath, importName) {
|
|
|
52
52
|
tree.write(modulePath, newContents);
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
if (!(0, typescript_1.isArrayLiteralExpression)(
|
|
56
|
-
throw new Error(`The NgModule
|
|
55
|
+
if (!(0, typescript_1.isArrayLiteralExpression)(typeProperty.initializer)) {
|
|
56
|
+
throw new Error(`The NgModule ${property} for ${ngModuleClassDeclaration.name.escapedText} in ${modulePath} is not an array literal`);
|
|
57
57
|
}
|
|
58
58
|
let text;
|
|
59
|
-
if (
|
|
60
|
-
text = `${
|
|
59
|
+
if (typeProperty.initializer.elements.hasTrailingComma) {
|
|
60
|
+
text = `${name},`;
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
|
-
text = `, ${
|
|
63
|
+
text = `, ${name}`;
|
|
64
64
|
}
|
|
65
65
|
const newContents = (0, devkit_1.applyChangesToString)(contents, [
|
|
66
66
|
{
|
|
67
67
|
type: devkit_1.ChangeType.Insert,
|
|
68
|
-
index:
|
|
68
|
+
index: typeProperty.initializer.getEnd() - 1,
|
|
69
69
|
text,
|
|
70
70
|
},
|
|
71
71
|
]);
|
|
@@ -73,6 +73,10 @@ function insertNgModuleImport(tree, modulePath, importName) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
exports.insertNgModuleProperty = insertNgModuleProperty;
|
|
77
|
+
function insertNgModuleImport(tree, modulePath, importName) {
|
|
78
|
+
insertNgModuleProperty(tree, modulePath, importName, 'imports');
|
|
79
|
+
}
|
|
76
80
|
exports.insertNgModuleImport = insertNgModuleImport;
|
|
77
81
|
function findImport(sourceFile, importPath) {
|
|
78
82
|
const importStatements = sourceFile.statements.filter(typescript_1.isImportDeclaration);
|
|
@@ -98,9 +102,9 @@ function findDecoratedClass(sourceFile, ngModuleName) {
|
|
|
98
102
|
(0, typescript_1.isIdentifier)(decorator.expression.expression) &&
|
|
99
103
|
decorator.expression.expression.escapedText === ngModuleName));
|
|
100
104
|
}
|
|
101
|
-
function findPropertyAssignment(ngModuleOptions) {
|
|
105
|
+
function findPropertyAssignment(ngModuleOptions, propertyName) {
|
|
102
106
|
return ngModuleOptions.properties.find((property) => (0, typescript_1.isPropertyAssignment)(property) &&
|
|
103
107
|
(0, typescript_1.isIdentifier)(property.name) &&
|
|
104
|
-
property.name.escapedText ===
|
|
108
|
+
property.name.escapedText === propertyName);
|
|
105
109
|
}
|
|
106
110
|
//# sourceMappingURL=insert-ngmodule-import.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-ngmodule-import.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/insert-ngmodule-import.ts"],"names":[],"mappings":";;;AAAA,yCAAsE;AACtE,2CAiBoB;
|
|
1
|
+
{"version":3,"file":"insert-ngmodule-import.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/insert-ngmodule-import.ts"],"names":[],"mappings":";;;AAAA,yCAAsE;AACtE,2CAiBoB;AAQpB,SAAgB,sBAAsB,CACpC,IAAU,EACV,UAAkB,EAClB,IAAY,EACZ,QAAmC;IAEnC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEzD,MAAM,UAAU,GAAG,IAAA,6BAAgB,EACjC,UAAU,EACV,QAAQ,EACR,yBAAY,CAAC,MAAM,CACpB,CAAC;IAEF,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAE3D,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CACb,gDAAgD,UAAU,GAAG,CAC9D,CAAC;KACH;IAED,MAAM,mBAAmB,GAAG,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC;IAE1D,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAE9E,MAAM,iBAAiB,GAAG,wBAA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AW,KAAK,YAAY,CAC/D,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAC7B,eAAwC,EACxC,YAAuC;IAEvC,OAAO,eAAe,CAAC,UAAU,CAAC,IAAI,CACpC,CAAC,QAAQ,EAAE,EAAE,CACX,IAAA,iCAAoB,EAAC,QAAQ,CAAC;QAC9B,IAAA,yBAAY,EAAC,QAAQ,CAAC,IAAI,CAAC;QAC3B,QAAQ,CAAC,IAAI,CAAC,WAAW,KAAK,YAAY,CACvB,CAAC;AAC1B,CAAC"}
|
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.angularArchitectsModuleFederationPluginVersion = exports.angularEslintVersion = exports.jestPresetAngularVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularJsVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '13.4.
|
|
4
|
+
exports.nxVersion = '13.4.1';
|
|
5
5
|
exports.angularVersion = '~13.1.0';
|
|
6
6
|
exports.angularDevkitVersion = '~13.1.0';
|
|
7
7
|
exports.angularJsVersion = '1.7.9';
|