@nrwl/angular 14.7.18 → 15.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/esm2020/index.mjs +2 -3
- package/esm2020/src/runtime/nx/data-persistence.mjs +2 -59
- package/esm2020/testing/index.mjs +1 -18
- package/fesm2015/nrwl-angular-testing.mjs +1 -19
- package/fesm2015/nrwl-angular-testing.mjs.map +1 -1
- package/fesm2015/nrwl-angular.mjs +2 -79
- package/fesm2015/nrwl-angular.mjs.map +1 -1
- package/fesm2020/nrwl-angular-testing.mjs +1 -19
- package/fesm2020/nrwl-angular-testing.mjs.map +1 -1
- package/fesm2020/nrwl-angular.mjs +2 -79
- package/fesm2020/nrwl-angular.mjs.map +1 -1
- package/index.d.ts +1 -2
- package/index.js +1 -4
- package/index.js.map +1 -1
- package/migrations.json +6 -0
- package/ng-package.json +0 -1
- package/package.json +9 -10
- package/src/generators/application/application.js +0 -3
- package/src/generators/application/application.js.map +1 -1
- package/src/generators/application/files/src/app/app.routes.ts__tpl__ +3 -0
- package/src/generators/application/lib/convert-to-standalone-app.js +1 -0
- package/src/generators/application/lib/convert-to-standalone-app.js.map +1 -1
- package/src/generators/application/lib/create-files.d.ts +1 -1
- package/src/generators/application/lib/create-files.js +5 -2
- package/src/generators/application/lib/create-files.js.map +1 -1
- package/src/generators/application/lib/index.d.ts +0 -1
- package/src/generators/application/lib/index.js +0 -1
- package/src/generators/application/lib/index.js.map +1 -1
- package/src/generators/application/lib/normalized-schema.d.ts +3 -2
- package/src/generators/application/lib/root-router-config.js +2 -1
- package/src/generators/application/lib/root-router-config.js.map +1 -1
- package/src/generators/application/schema.d.ts +1 -23
- package/src/generators/application/schema.json +0 -30
- package/src/generators/host/host.js +4 -16
- package/src/generators/host/host.js.map +1 -1
- package/src/generators/host/schema.d.ts +1 -3
- package/src/generators/init/schema.d.ts +1 -1
- package/src/generators/library/lib/add-children.js +9 -14
- package/src/generators/library/lib/add-children.js.map +1 -1
- package/src/generators/library/lib/add-lazy-loaded-router-configuration.d.ts +1 -1
- package/src/generators/library/lib/add-lazy-loaded-router-configuration.js +17 -8
- package/src/generators/library/lib/add-lazy-loaded-router-configuration.js.map +1 -1
- package/src/generators/library/lib/add-load-children.js +7 -13
- package/src/generators/library/lib/add-load-children.js.map +1 -1
- package/src/generators/library/lib/add-module.js +2 -2
- package/src/generators/library/lib/add-module.js.map +1 -1
- package/src/generators/library/lib/add-router-configuration.d.ts +1 -1
- package/src/generators/library/lib/add-router-configuration.js +13 -5
- package/src/generators/library/lib/add-router-configuration.js.map +1 -1
- package/src/generators/library/lib/add-standalone-component.js +4 -4
- package/src/generators/library/lib/add-standalone-component.js.map +1 -1
- package/src/generators/library/lib/normalized-schema.d.ts +3 -3
- package/src/generators/library/schema.d.ts +2 -4
- package/src/generators/library/schema.json +2 -3
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +2 -6
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.ts__tmpl__ +5 -17
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -2
- package/src/generators/ngrx/lib/add-imports-to-module.js +0 -6
- package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
- package/src/generators/ngrx/schema.d.ts +0 -5
- package/src/generators/ngrx/schema.json +0 -6
- package/src/generators/remote/schema.d.ts +1 -3
- package/src/generators/setup-mf/files/entry-module-files/entry.module.ts__tmpl__ +3 -7
- package/src/generators/setup-mf/files/{standalone-entry-component-files/routes.ts__tmpl__ → entry-module-files/entry.routes.ts__tmpl__} +1 -1
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +4 -0
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js +8 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js.map +1 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +9 -23
- package/src/generators/setup-mf/lib/add-remote-to-host.js.map +1 -1
- package/src/generators/setup-mf/lib/fix-bootstrap.js +2 -2
- package/src/generators/storybook-configuration/schema.d.ts +1 -1
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.d.ts +2 -0
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +94 -0
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js.map +1 -0
- package/src/runtime/nx/data-persistence.d.ts +4 -46
- package/src/runtime/nx/data-persistence.js +1 -57
- package/src/runtime/nx/data-persistence.js.map +1 -1
- package/src/utils/nx-devkit/ast-utils.d.ts +1 -1
- package/src/utils/nx-devkit/ast-utils.js +3 -3
- package/src/utils/nx-devkit/ast-utils.js.map +1 -1
- package/src/utils/nx-devkit/route-utils.d.ts +2 -0
- package/src/utils/nx-devkit/route-utils.js +39 -0
- package/src/utils/nx-devkit/route-utils.js.map +1 -0
- package/src/utils/versions.d.ts +1 -0
- package/src/utils/versions.js +2 -1
- package/src/utils/versions.js.map +1 -1
- package/testing/index.d.ts +0 -17
- package/testing/index.js +1 -18
- package/testing/index.js.map +1 -1
- package/esm2020/src/runtime/nx/nx.module.mjs +0 -23
- package/src/generators/application/lib/add-mf.d.ts +0 -3
- package/src/generators/application/lib/add-mf.js +0 -24
- package/src/generators/application/lib/add-mf.js.map +0 -1
- package/src/runtime/nx/nx.module.d.ts +0 -15
- package/src/runtime/nx/nx.module.js +0 -24
- package/src/runtime/nx/nx.module.js.map +0 -1
- package/src/utils/nx-devkit/standalone-utils.d.ts +0 -2
- package/src/utils/nx-devkit/standalone-utils.js +0 -37
- package/src/utils/nx-devkit/standalone-utils.js.map +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addStandaloneRoute = void 0;
|
|
4
|
-
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
5
|
-
const ts = require("typescript");
|
|
6
|
-
const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
|
|
7
|
-
function addStandaloneRoute(tree, parentPath, route, lazy = true, routesConst, importPath) {
|
|
8
|
-
if (!tree.exists(parentPath)) {
|
|
9
|
-
throw new Error(`Path to parent routing declaration (${parentPath}) does not exist. Please ensure path is correct.`);
|
|
10
|
-
}
|
|
11
|
-
let parentContents = tree.read(parentPath, 'utf-8');
|
|
12
|
-
if (!lazy) {
|
|
13
|
-
let parentSourceFile = ts.createSourceFile(parentPath, parentContents, ts.ScriptTarget.Latest, true);
|
|
14
|
-
parentSourceFile = (0, ast_utils_1.insertImport)(tree, parentSourceFile, parentPath, routesConst, importPath);
|
|
15
|
-
parentContents = tree.read(parentPath, 'utf-8');
|
|
16
|
-
}
|
|
17
|
-
const ast = tsquery_1.tsquery.ast(parentContents);
|
|
18
|
-
const IMPORT_PROVIDERS_FROM_ROUTER_MODULE_SELECTOR = 'CallExpression:has(Identifier[name=importProvidersFrom]) CallExpression:has(PropertyAccessExpression:has(Identifier[name=RouterModule])) > ArrayLiteralExpression';
|
|
19
|
-
const ROUTES_ARRAY_SELECTOR = 'VariableDeclaration:has(ArrayType > TypeReference > Identifier[name=Route]) > ArrayLiteralExpression';
|
|
20
|
-
const routerModuleNodes = (0, tsquery_1.tsquery)(ast, IMPORT_PROVIDERS_FROM_ROUTER_MODULE_SELECTOR, { visitAllChildren: true });
|
|
21
|
-
const isImportProvidersFromRouterSetup = routerModuleNodes.length > 0;
|
|
22
|
-
const routesArrayNodes = (0, tsquery_1.tsquery)(ast, ROUTES_ARRAY_SELECTOR, {
|
|
23
|
-
visitAllChildren: true,
|
|
24
|
-
});
|
|
25
|
-
const isRoutesArray = routesArrayNodes.length > 0;
|
|
26
|
-
if (!isImportProvidersFromRouterSetup && !isRoutesArray) {
|
|
27
|
-
throw new Error('Parent routing declaration does not contain a routing configuration. Please ensure the parent contains a routing configuration.');
|
|
28
|
-
}
|
|
29
|
-
const nodes = isImportProvidersFromRouterSetup
|
|
30
|
-
? routerModuleNodes
|
|
31
|
-
: routesArrayNodes;
|
|
32
|
-
const newParentContents = `${parentContents.slice(0, nodes[0].getStart() + 1)}
|
|
33
|
-
${route},${parentContents.slice(nodes[0].getStart() + 1, -1)}`;
|
|
34
|
-
tree.write(parentPath, newParentContents);
|
|
35
|
-
}
|
|
36
|
-
exports.addStandaloneRoute = addStandaloneRoute;
|
|
37
|
-
//# sourceMappingURL=standalone-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standalone-utils.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/utils/nx-devkit/standalone-utils.ts"],"names":[],"mappings":";;;AACA,uDAAoD;AACpD,iCAAiC;AACjC,uEAAuE;AAEvE,SAAgB,kBAAkB,CAChC,IAAU,EACV,UAAkB,EAClB,KAAa,EACb,OAAgB,IAAI,EACpB,WAAoB,EACpB,UAAmB;IAEnB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CACb,uCAAuC,UAAU,kDAAkD,CACpG,CAAC;KACH;IAED,IAAI,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEpD,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,gBAAgB,GAAG,EAAE,CAAC,gBAAgB,CACxC,UAAU,EACV,cAAc,EACd,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;QAEF,gBAAgB,GAAG,IAAA,wBAAY,EAC7B,IAAI,EACJ,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,UAAU,CACX,CAAC;QAEF,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KACjD;IAED,MAAM,GAAG,GAAG,iBAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAExC,MAAM,4CAA4C,GAChD,mKAAmK,CAAC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