@nx/angular 23.0.0-beta.12 → 23.0.0-beta.13
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 +8 -8
- package/plugins/component-testing.js +2 -2
- package/src/builders/utilities/buildable-libs.d.ts +1 -1
- package/src/builders/utilities/buildable-libs.d.ts.map +1 -1
- package/src/builders/utilities/buildable-libs.js +3 -3
- package/src/builders/utilities/module-federation.d.ts.map +1 -1
- package/src/builders/utilities/module-federation.js +2 -3
- package/src/builders/utilities/webpack.js +1 -1
- package/src/executors/delegate-build/delegate-build.impl.js +3 -3
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +2 -2
- package/src/executors/package/package.impl.d.ts +1 -1
- package/src/executors/package/package.impl.d.ts.map +1 -1
- package/src/executors/package/package.impl.js +3 -3
- package/src/executors/utilities/buildable-libs.d.ts +1 -1
- package/src/executors/utilities/buildable-libs.d.ts.map +1 -1
- package/src/executors/utilities/buildable-libs.js +3 -3
- package/src/executors/utilities/esbuild-extensions.js +1 -1
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +4 -6
- package/src/generators/application/lib/update-tsconfig-files.js +3 -3
- package/src/generators/component/lib/component.js +2 -2
- package/src/generators/convert-to-with-mf/lib/check-name-matches.js +2 -2
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +2 -2
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +4 -4
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +2 -2
- package/src/generators/federate-module/lib/add-path-to-exposes.js +6 -6
- package/src/generators/host/lib/update-ssr-setup.js +2 -2
- package/src/generators/library/lib/add-children.js +2 -2
- package/src/generators/library/lib/add-load-children.js +2 -2
- package/src/generators/library/lib/add-project.js +2 -2
- package/src/generators/library/lib/create-files.js +2 -2
- package/src/generators/library/lib/update-tsconfig-files.js +3 -3
- package/src/generators/library/library.js +2 -2
- package/src/generators/move/lib/update-module-name.js +2 -2
- package/src/generators/ng-add/migrators/migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/migrator.js +10 -5
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +6 -6
- package/src/generators/ng-add/utilities/workspace.js +6 -6
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +2 -2
- package/src/generators/ngrx-feature-store/lib/add-imports.js +2 -2
- package/src/generators/ngrx-root-store/lib/add-imports.js +2 -2
- package/src/generators/ngrx-root-store/lib/normalize-options.js +2 -2
- package/src/generators/remote/lib/update-ssr-setup.js +2 -2
- package/src/generators/remote/remote.js +2 -2
- package/src/generators/scam/lib/convert-component-to-scam.js +2 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +2 -2
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +2 -2
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +2 -2
- package/src/generators/setup-mf/lib/add-remote-to-host.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +5 -6
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +2 -2
- package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-hydration.js +3 -4
- package/src/generators/setup-ssr/lib/add-server-file.js +2 -2
- package/src/generators/setup-ssr/lib/generate-files.js +2 -2
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +2 -2
- package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +19 -7
- package/src/generators/utils/add-mf-env-to-inputs.d.ts.map +1 -1
- package/src/generators/utils/add-mf-env-to-inputs.js +16 -9
- package/src/generators/utils/add-vitest.d.ts.map +1 -1
- package/src/generators/utils/add-vitest.js +16 -9
- package/src/generators/utils/app-components-info.js +2 -2
- package/src/generators/utils/find-module.js +2 -2
- package/src/generators/utils/insert-ngmodule-import.js +6 -6
- package/src/generators/utils/storybook-ast/component-info.js +5 -5
- package/src/generators/utils/storybook-ast/module-info.js +9 -9
- package/src/generators/utils/storybook-ast/storybook-inputs.js +4 -4
- package/src/generators/utils/testing.js +2 -2
- package/src/generators/utils/tsconfig-utils.js +2 -2
- package/src/generators/utils/validations.js +2 -2
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.d.ts.map +1 -1
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.js +25 -18
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.js +43 -10
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +2 -2
- package/src/migrations/update-21-5-0/utils/karma-config-analyzer.js +2 -2
- package/src/migrations/update-22-3-0/update-module-resolution.js +2 -2
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +2 -2
- package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
- package/src/utils/nx-devkit/ast-utils.js +17 -18
- package/src/utils/nx-devkit/route-utils.js +3 -3
- package/tailwind.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/migrators/migrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,IAAI,EACL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"migrator.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/migrators/migrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,IAAI,EACL,MAAM,YAAY,CAAC;AASpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,8BAAsB,QAAQ;IAK1B,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI;IAC7B,SAAS,CAAC,aAAa,EAAE,oBAAoB;IAC7C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IANnC,SAAS,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACxC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;gBAG1C,IAAI,EAAE,IAAI,EACnB,aAAa,EAAE,oBAAoB,EAC1B,MAAM,EAAE,MAAM;IAOnC,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAExC,QAAQ,CAAC,QAAQ,IAAI,gBAAgB;IAErC,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG;IAQzD,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IASvD,SAAS,CAAC,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAS7D,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAc,GAAG,IAAI;IAgB5E,SAAS,CAAC,oCAAoC,CAC5C,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,EAAE;IASnB,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,IAAI;IAYxE,SAAS,CAAC,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;IAmBhE,SAAS,CAAC,kBAAkB,CAC1B,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,EACxB,qBAAqB,EAAE,MAAM,GAC5B,IAAI;IASP,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,iBAAiB;CAoB1B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Migrator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const path_1 = require("path");
|
|
6
7
|
class Migrator {
|
|
7
8
|
constructor(tree, projectConfig, logger) {
|
|
@@ -66,11 +67,15 @@ class Migrator {
|
|
|
66
67
|
if (!targetNames.length) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
|
-
const nxJson = (0, devkit_1.readNxJson)(this.tree);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
const nxJson = (0, devkit_1.readNxJson)(this.tree) ?? {};
|
|
71
|
+
for (const name of targetNames) {
|
|
72
|
+
const existing = (0, internal_1.findTargetDefault)(nxJson.targetDefaults, {
|
|
73
|
+
target: name,
|
|
74
|
+
});
|
|
75
|
+
(0, internal_1.upsertTargetDefault)(this.tree, nxJson, {
|
|
76
|
+
target: name,
|
|
77
|
+
cache: existing?.cache ?? true,
|
|
78
|
+
});
|
|
74
79
|
}
|
|
75
80
|
(0, devkit_1.updateNxJson)(this.tree, nxJson);
|
|
76
81
|
}
|
|
@@ -4,7 +4,7 @@ exports.E2eMigrator = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const eslint_1 = require("@nx/eslint");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const file_change_recorder_1 = require("../../../../utils/file-change-recorder");
|
|
10
10
|
const versions_1 = require("../../../../utils/versions");
|
|
@@ -317,7 +317,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
317
317
|
: undefined;
|
|
318
318
|
}
|
|
319
319
|
updateCypressConfigFile(configFilePath) {
|
|
320
|
-
const { isPropertyAssignment } = (0,
|
|
320
|
+
const { isPropertyAssignment } = (0, internal_1.ensureTypescript)();
|
|
321
321
|
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
322
322
|
const { nxE2EPreset } = require('@nx/cypress/plugins/cypress-preset');
|
|
323
323
|
this.cypressPreset = nxE2EPreset(configFilePath);
|
|
@@ -353,7 +353,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
353
353
|
if (!componentNode) {
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
|
-
const { isObjectLiteralExpression, isPropertyAssignment } = (0,
|
|
356
|
+
const { isObjectLiteralExpression, isPropertyAssignment } = (0, internal_1.ensureTypescript)();
|
|
357
357
|
if (!isObjectLiteralExpression(componentNode.initializer)) {
|
|
358
358
|
this.logger.warn('The automatic migration only supports having an object literal in the "component" option of the Cypress configuration. ' +
|
|
359
359
|
`The configuration won't be updated. Please make sure to update any paths you may have in the "component" option ` +
|
|
@@ -367,7 +367,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
369
|
updateCypressE2EConfig(configFilePath, defineConfigNode, e2eNode, recorder, { ...globalConfig }) {
|
|
370
|
-
(0,
|
|
370
|
+
(0, internal_1.ensureTypescript)();
|
|
371
371
|
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
372
372
|
const e2eConfig = {};
|
|
373
373
|
const presetSpreadAssignment = `...nxE2EPreset(__dirname),`;
|
|
@@ -384,7 +384,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
384
384
|
recorder.insertRight(defineConfigNode.getStart() + 1, e2eAssignment);
|
|
385
385
|
}
|
|
386
386
|
else {
|
|
387
|
-
const { isObjectLiteralExpression, isPropertyAssignment } = (0,
|
|
387
|
+
const { isObjectLiteralExpression, isPropertyAssignment } = (0, internal_1.ensureTypescript)();
|
|
388
388
|
if (!isObjectLiteralExpression(e2eNode.initializer)) {
|
|
389
389
|
this.logger.warn('The automatic migration only supports having an object literal in the "e2e" option of the Cypress configuration. ' +
|
|
390
390
|
`The configuration won't be updated. Please make sure to update any paths you might have in the "e2e" option ` +
|
|
@@ -472,7 +472,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
isValidPathLikePropertyWithStringLiteralValue(node, properties) {
|
|
475
|
-
const { isPropertyAssignment, isStringLiteralLike, isTemplateExpression, SyntaxKind, } = (0,
|
|
475
|
+
const { isPropertyAssignment, isStringLiteralLike, isTemplateExpression, SyntaxKind, } = (0, internal_1.ensureTypescript)();
|
|
476
476
|
if (!isPropertyAssignment(node)) {
|
|
477
477
|
// TODO(leo): handle more scenarios (spread assignments, etc)
|
|
478
478
|
return false;
|
|
@@ -18,9 +18,9 @@ const eslint_1 = require("@nx/eslint");
|
|
|
18
18
|
const setup_root_eslint_1 = require("@nx/eslint/src/generators/lint-project/setup-root-eslint");
|
|
19
19
|
const js_1 = require("@nx/js");
|
|
20
20
|
const default_base_1 = require("nx/src/utils/default-base");
|
|
21
|
-
const
|
|
21
|
+
const internal_1 = require("@nx/js/internal");
|
|
22
22
|
const angular_json_1 = require("nx/src/adapter/angular-json");
|
|
23
|
-
const
|
|
23
|
+
const versions_1 = require("../../../utils/versions");
|
|
24
24
|
const path_1 = require("path");
|
|
25
25
|
function validateWorkspace(tree) {
|
|
26
26
|
const errors = [];
|
|
@@ -141,17 +141,17 @@ function updatePackageJson(tree) {
|
|
|
141
141
|
packageJson.devDependencies = packageJson.devDependencies ?? {};
|
|
142
142
|
packageJson.dependencies = packageJson.dependencies ?? {};
|
|
143
143
|
if (!packageJson.devDependencies['@angular/cli']) {
|
|
144
|
-
packageJson.devDependencies['@angular/cli'] =
|
|
144
|
+
packageJson.devDependencies['@angular/cli'] = versions_1.angularDevkitVersion;
|
|
145
145
|
}
|
|
146
146
|
if (!packageJson.devDependencies['@nx/workspace'] &&
|
|
147
147
|
!packageJson.devDependencies['@nrwl/workspace']) {
|
|
148
|
-
packageJson.devDependencies['@nx/workspace'] =
|
|
148
|
+
packageJson.devDependencies['@nx/workspace'] = versions_1.nxVersion;
|
|
149
149
|
}
|
|
150
150
|
if (!packageJson.devDependencies['nx']) {
|
|
151
|
-
packageJson.devDependencies['nx'] =
|
|
151
|
+
packageJson.devDependencies['nx'] = versions_1.nxVersion;
|
|
152
152
|
}
|
|
153
153
|
if (!packageJson.devDependencies['prettier']) {
|
|
154
|
-
packageJson.devDependencies['prettier'] =
|
|
154
|
+
packageJson.devDependencies['prettier'] = internal_1.prettierVersion;
|
|
155
155
|
}
|
|
156
156
|
return packageJson;
|
|
157
157
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addExportsToBarrel = addExportsToBarrel;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
let tsModule;
|
|
8
8
|
function addExportsToBarrel(tree, options) {
|
|
@@ -11,7 +11,7 @@ function addExportsToBarrel(tree, options) {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
if (!tsModule) {
|
|
14
|
-
tsModule = (0,
|
|
14
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
15
15
|
}
|
|
16
16
|
const indexSourceText = tree.read(indexFilePath, 'utf-8');
|
|
17
17
|
let sourceFile = tsModule.createSourceFile(indexFilePath, indexSourceText, tsModule.ScriptTarget.Latest, true);
|
|
@@ -4,7 +4,7 @@ exports.addImportsToModule = addImportsToModule;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
6
6
|
const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const js_1 = require("@nx/js");
|
|
9
9
|
let tsModule;
|
|
10
10
|
function addStoreForFeatureImport(tree, isParentStandalone, route, sourceFile, parentPath, provideStoreForFeature, storeForFeature) {
|
|
@@ -45,7 +45,7 @@ function addEffectsForFeatureImport(tree, isParentStandalone, route, sourceFile,
|
|
|
45
45
|
}
|
|
46
46
|
function addImportsToModule(tree, options) {
|
|
47
47
|
if (!tsModule) {
|
|
48
|
-
tsModule = (0,
|
|
48
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
49
49
|
}
|
|
50
50
|
const parentPath = options.parent;
|
|
51
51
|
const sourceText = tree.read(parentPath, 'utf-8');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addImportsToModule = addImportsToModule;
|
|
4
4
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
let tsModule;
|
|
8
8
|
function addRootStoreImport(tree, isParentStandalone, sourceFile, parentPath, provideRootStore, storeForRoot) {
|
|
@@ -58,7 +58,7 @@ function addStoreDevTools(tree, sourceFile, parentPath, isParentStandalone, addI
|
|
|
58
58
|
}
|
|
59
59
|
function addImportsToModule(tree, options) {
|
|
60
60
|
if (!tsModule) {
|
|
61
|
-
tsModule = (0,
|
|
61
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
62
62
|
}
|
|
63
63
|
const parentPath = options.parent;
|
|
64
64
|
const sourceText = tree.read(parentPath, 'utf-8');
|
|
@@ -5,7 +5,7 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
7
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
8
|
-
const
|
|
8
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
9
|
function normalizeOptions(tree, options) {
|
|
10
10
|
let rxjsVersion;
|
|
11
11
|
try {
|
|
@@ -17,7 +17,7 @@ function normalizeOptions(tree, options) {
|
|
|
17
17
|
}
|
|
18
18
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
19
19
|
const isStandalone = (0, ast_utils_1.isNgStandaloneApp)(tree, options.project);
|
|
20
|
-
const sourceRoot = (0,
|
|
20
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(project, tree);
|
|
21
21
|
const appConfigPath = (0, devkit_1.joinPathFragments)(sourceRoot, 'app/app.config.ts');
|
|
22
22
|
let appMainPath = project.targets.build.options.main ?? project.targets.build.options.browser;
|
|
23
23
|
if (!appMainPath) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateSsrSetup = updateSsrSetup;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const versions_1 = require("../../../utils/versions");
|
|
@@ -11,7 +11,7 @@ const version_utils_1 = require("../../utils/version-utils");
|
|
|
11
11
|
async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfiguration, zoneless, skipPackageJson, }) {
|
|
12
12
|
const { major: angularMajorVersion, version: angularVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
13
13
|
let project = (0, devkit_1.readProjectConfiguration)(tree, appName);
|
|
14
|
-
const sourceRoot = (0,
|
|
14
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
|
|
15
15
|
tree.rename((0, devkit_1.joinPathFragments)(sourceRoot, 'main.server.ts'), (0, devkit_1.joinPathFragments)(sourceRoot, 'bootstrap.server.ts'));
|
|
16
16
|
const pathToServerEntry = (0, devkit_1.joinPathFragments)(sourceRoot, 'server.ts');
|
|
17
17
|
tree.write(pathToServerEntry, `import('./main.server');`);
|
|
@@ -4,7 +4,7 @@ exports.remote = remote;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
9
9
|
const test_runners_1 = require("../../utils/test-runners");
|
|
10
10
|
const application_1 = require("../application/application");
|
|
@@ -73,7 +73,7 @@ async function remote(tree, schema) {
|
|
|
73
73
|
const installTasks = [appInstallTask];
|
|
74
74
|
if (!options.skipPackageJson) {
|
|
75
75
|
const installSwcHelpersTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
76
|
-
'@swc/helpers':
|
|
76
|
+
'@swc/helpers': internal_2.swcHelpersVersion,
|
|
77
77
|
});
|
|
78
78
|
installTasks.push(installSwcHelpersTask);
|
|
79
79
|
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertComponentToScam = convertComponentToScam;
|
|
4
4
|
const js_1 = require("@nx/js");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
let tsModule;
|
|
7
7
|
function convertComponentToScam(tree, options) {
|
|
8
8
|
if (!tree.exists(options.filePath)) {
|
|
9
9
|
throw new Error(`Couldn't find component at path ${options.filePath} to add SCAM setup.`);
|
|
10
10
|
}
|
|
11
11
|
if (!tsModule) {
|
|
12
|
-
tsModule = (0,
|
|
12
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
13
13
|
}
|
|
14
14
|
if (options.inlineScam) {
|
|
15
15
|
const currentComponentContents = tree.read(options.filePath, 'utf-8');
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertDirectiveToScam = convertDirectiveToScam;
|
|
4
4
|
const js_1 = require("@nx/js");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
let tsModule;
|
|
7
7
|
function convertDirectiveToScam(tree, options) {
|
|
8
8
|
if (!tree.exists(options.filePath)) {
|
|
9
9
|
throw new Error(`Couldn't find directive at path ${options.filePath} to add SCAM setup.`);
|
|
10
10
|
}
|
|
11
11
|
if (!tsModule) {
|
|
12
|
-
tsModule = (0,
|
|
12
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
13
13
|
}
|
|
14
14
|
if (options.inlineScam) {
|
|
15
15
|
const currentDirectiveContents = tree.read(options.filePath, 'utf-8');
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertPipeToScam = convertPipeToScam;
|
|
4
4
|
const js_1 = require("@nx/js");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
let tsModule;
|
|
7
7
|
function convertPipeToScam(tree, options) {
|
|
8
8
|
if (!tree.exists(options.filePath)) {
|
|
9
9
|
throw new Error(`Couldn't find pipe at path ${options.filePath} to add SCAM setup.`);
|
|
10
10
|
}
|
|
11
11
|
if (!tsModule) {
|
|
12
|
-
tsModule = (0,
|
|
12
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
13
13
|
}
|
|
14
14
|
if (options.inlineScam) {
|
|
15
15
|
const currentPipeContents = tree.read(options.filePath, 'utf-8');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.addCypressOnErrorWorkaround = addCypressOnErrorWorkaround;
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
function addCypressOnErrorWorkaround(tree, schema) {
|
|
10
10
|
if (!schema.e2eProjectName) {
|
|
11
11
|
return;
|
|
@@ -44,7 +44,7 @@ function addCypressOnErrorWorkaround(tree, schema) {
|
|
|
44
44
|
}
|
|
45
45
|
return true;
|
|
46
46
|
});`;
|
|
47
|
-
const pathToCommandsFile = (0, devkit_1.joinPathFragments)((0,
|
|
47
|
+
const pathToCommandsFile = (0, devkit_1.joinPathFragments)((0, internal_1.getProjectSourceRoot)(e2eProject, tree), 'support/e2e.ts');
|
|
48
48
|
const commandsContent = tree.exists(pathToCommandsFile)
|
|
49
49
|
? tree.read(pathToCommandsFile, 'utf-8')
|
|
50
50
|
: '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-remote-to-host.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAEL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add-remote-to-host.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mf/lib/add-remote-to-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAEL,MAAM,YAAY,CAAC;AAQpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,WAOtD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QA4BpE"}
|
|
@@ -4,8 +4,7 @@ exports.checkIsCommaNeeded = checkIsCommaNeeded;
|
|
|
4
4
|
exports.addRemoteToHost = addRemoteToHost;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
8
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
8
|
const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
|
|
10
9
|
let tsModule;
|
|
11
10
|
function checkIsCommaNeeded(mfRemoteText) {
|
|
@@ -26,7 +25,7 @@ function addRemoteToHost(tree, options) {
|
|
|
26
25
|
addRemoteToStaticHost(tree, options, hostProject, isHostUsingTypescriptConfig);
|
|
27
26
|
}
|
|
28
27
|
else if (hostFederationType === 'dynamic') {
|
|
29
|
-
addRemoteToDynamicHost(tree, options, pathToMFManifest, (0,
|
|
28
|
+
addRemoteToDynamicHost(tree, options, pathToMFManifest, (0, internal_1.getProjectSourceRoot)(hostProject, tree));
|
|
30
29
|
}
|
|
31
30
|
addLazyLoadedRouteToHostAppModule(tree, options, hostFederationType);
|
|
32
31
|
}
|
|
@@ -40,7 +39,7 @@ function getDynamicManifestFile(tree, project) {
|
|
|
40
39
|
// at the old path.
|
|
41
40
|
return [
|
|
42
41
|
(0, devkit_1.joinPathFragments)(project.root, 'public/module-federation.manifest.json'),
|
|
43
|
-
(0, devkit_1.joinPathFragments)((0,
|
|
42
|
+
(0, devkit_1.joinPathFragments)((0, internal_1.getProjectSourceRoot)(project, tree), 'assets/module-federation.manifest.json'),
|
|
44
43
|
].find((path) => tree.exists(path));
|
|
45
44
|
}
|
|
46
45
|
function addRemoteToStaticHost(tree, options, hostProject, isHostUsingTypescript) {
|
|
@@ -73,10 +72,10 @@ function addRemoteToDynamicHost(tree, options, pathToMfManifest, hostSourceRoot)
|
|
|
73
72
|
}
|
|
74
73
|
function addLazyLoadedRouteToHostAppModule(tree, options, hostFederationType) {
|
|
75
74
|
if (!tsModule) {
|
|
76
|
-
tsModule = (0,
|
|
75
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
77
76
|
}
|
|
78
77
|
const hostAppConfig = (0, devkit_1.readProjectConfiguration)(tree, options.host);
|
|
79
|
-
const sourceRoot = (0,
|
|
78
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(hostAppConfig, tree);
|
|
80
79
|
const pathToHostRootRouting = `${sourceRoot}/app/app.routes.ts`;
|
|
81
80
|
if (!tree.exists(pathToHostRootRouting)) {
|
|
82
81
|
return;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeDeadCodeFromRemote = removeDeadCodeFromRemote;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
function removeDeadCodeFromRemote(tree, options) {
|
|
7
7
|
const projectName = options.appName;
|
|
8
8
|
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
9
|
-
const sourceRoot = (0,
|
|
9
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
|
|
10
10
|
const { appComponentInfo, nxWelcomeComponentInfo, entryModuleFileName } = options;
|
|
11
11
|
['css', 'less', 'scss', 'sass'].forEach((style) => {
|
|
12
12
|
const pathToComponentStyle = (0, devkit_1.joinPathFragments)(sourceRoot, `app/${appComponentInfo.extensionlessFileName}.${style}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-hydration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-ssr/lib/add-hydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add-hydration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-ssr/lib/add-hydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAQpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAK5D,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,0BAA0B,QA0E3E"}
|
|
@@ -3,16 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addHydration = addHydration;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
|
-
const
|
|
7
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
7
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
9
8
|
let tsModule;
|
|
10
9
|
let tsquery;
|
|
11
10
|
function addHydration(tree, options) {
|
|
12
11
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
13
|
-
const sourceRoot = (0,
|
|
12
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(projectConfig, tree);
|
|
14
13
|
if (!tsModule) {
|
|
15
|
-
tsModule = (0,
|
|
14
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
16
15
|
tsquery = require('@phenomnomnominal/tsquery').tsquery;
|
|
17
16
|
}
|
|
18
17
|
let pathToClientConfigFile;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addServerFile = addServerFile;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const zoneless_1 = require("../../../utils/zoneless");
|
|
8
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
@@ -27,7 +27,7 @@ function addServerFile(tree, options) {
|
|
|
27
27
|
(options.serverRouting ? '' : '-common-engine')
|
|
28
28
|
: 'server-builder', 'server');
|
|
29
29
|
}
|
|
30
|
-
const sourceRoot = (0,
|
|
30
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
|
|
31
31
|
const zoneless = (0, zoneless_1.isZonelessApp)(project);
|
|
32
32
|
(0, devkit_1.generateFiles)(tree, pathToFiles, sourceRoot, {
|
|
33
33
|
...options,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateSSRFiles = generateSSRFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const app_components_info_1 = require("../../utils/app-components-info");
|
|
@@ -29,7 +29,7 @@ function generateSSRFiles(tree, options) {
|
|
|
29
29
|
? 'application-builder'
|
|
30
30
|
: 'server-builder', options.standalone ? 'standalone-src' : 'ngmodule-src');
|
|
31
31
|
}
|
|
32
|
-
const sourceRoot = (0,
|
|
32
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
|
|
33
33
|
const ssrVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, '@angular/ssr');
|
|
34
34
|
const cleanedSsrVersion = ssrVersion
|
|
35
35
|
? ((0, semver_1.clean)(ssrVersion) ?? (0, semver_1.coerce)(ssrVersion).version)
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.setServerTsConfigOptionsForApplicationBuilder = setServerTsConfigOptionsForApplicationBuilder;
|
|
4
4
|
exports.generateTsConfigServerJsonForBrowserBuilder = generateTsConfigServerJsonForBrowserBuilder;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const tsconfig_utils_1 = require("../../utils/tsconfig-utils");
|
|
9
9
|
const version_utils_1 = require("../../utils/version-utils");
|
|
@@ -75,7 +75,7 @@ function generateTsConfigServerJsonForBrowserBuilder(tree, options) {
|
|
|
75
75
|
});
|
|
76
76
|
// read the parsed compiler options from tsconfig.server.json
|
|
77
77
|
const compilerOptions = (0, tsconfig_utils_1.readCompilerOptionsFromTsConfig)(tree, tsconfigServerPath);
|
|
78
|
-
const ts = (0,
|
|
78
|
+
const ts = (0, internal_1.ensureTypescript)();
|
|
79
79
|
if (compilerOptions.module === ts.ModuleKind.Preserve &&
|
|
80
80
|
compilerOptions.moduleResolution === ts.ModuleResolutionKind.Bundler) {
|
|
81
81
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-project-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-ssr/lib/update-project-config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"update-project-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-ssr/lib/update-project-config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,IAAI,EACL,MAAM,YAAY,CAAC;AAWpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAO5D,wBAAgB,wCAAwC,CACtD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,0BAA0B,GAClC,IAAI,CAmDN;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,0BAA0B,QAoFpC"}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateProjectConfigForApplicationBuilder = updateProjectConfigForApplicationBuilder;
|
|
4
4
|
exports.updateProjectConfigForBrowserBuilder = updateProjectConfigForBrowserBuilder;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
8
|
const constants_1 = require("./constants");
|
|
8
9
|
function updateProjectConfigForApplicationBuilder(tree, options) {
|
|
9
10
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
@@ -28,7 +29,7 @@ function updateProjectConfigForApplicationBuilder(tree, options) {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
const sourceRoot = (0,
|
|
32
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(project, tree);
|
|
32
33
|
buildTarget.options ??= {};
|
|
33
34
|
buildTarget.options.outputPath = outputPath;
|
|
34
35
|
buildTarget.options.server = (0, devkit_1.joinPathFragments)(sourceRoot, options.main);
|
|
@@ -55,7 +56,7 @@ function updateProjectConfigForBrowserBuilder(tree, options) {
|
|
|
55
56
|
configurations[key] = getServerOptions(options);
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
const sourceRoot = (0,
|
|
59
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(projectConfig, tree);
|
|
59
60
|
projectConfig.targets.server = {
|
|
60
61
|
dependsOn: ['build'],
|
|
61
62
|
executor: buildTarget.executor.startsWith('@angular-devkit/build-angular:')
|
|
@@ -103,16 +104,27 @@ function updateProjectConfigForBrowserBuilder(tree, options) {
|
|
|
103
104
|
defaultConfiguration: 'production',
|
|
104
105
|
};
|
|
105
106
|
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
|
106
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
107
|
+
const nxJson = (0, devkit_1.readNxJson)(tree) ?? {};
|
|
107
108
|
if (nxJson.tasksRunnerOptions?.default?.options?.cacheableOperations &&
|
|
108
109
|
!nxJson.tasksRunnerOptions.default.options.cacheableOperations.includes('server')) {
|
|
109
110
|
nxJson.tasksRunnerOptions.default.options.cacheableOperations.push('server');
|
|
110
111
|
}
|
|
111
|
-
nxJson.targetDefaults
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const existing = findServerDefault(nxJson.targetDefaults);
|
|
113
|
+
if (!existing || existing.cache === undefined) {
|
|
114
|
+
(0, internal_1.upsertTargetDefault)(tree, nxJson, { target: 'server', cache: true });
|
|
115
|
+
}
|
|
114
116
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
115
117
|
}
|
|
118
|
+
function findServerDefault(td) {
|
|
119
|
+
if (!td)
|
|
120
|
+
return undefined;
|
|
121
|
+
if (Array.isArray(td)) {
|
|
122
|
+
return td.find((e) => e.target === 'server' &&
|
|
123
|
+
e.projects === undefined &&
|
|
124
|
+
e.plugin === undefined);
|
|
125
|
+
}
|
|
126
|
+
return td['server'];
|
|
127
|
+
}
|
|
116
128
|
function getServerOptions(options = {}) {
|
|
117
129
|
return {
|
|
118
130
|
buildOptimizer: options?.buildOptimizer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-mf-env-to-inputs.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/add-mf-env-to-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAA4B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add-mf-env-to-inputs.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/add-mf-env-to-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAA4B,MAAM,YAAY,CAAC;AAMjE,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,QAsCvD"}
|
|
@@ -2,29 +2,36 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addMfEnvToTargetDefaultInputs = addMfEnvToTargetDefaultInputs;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
function addMfEnvToTargetDefaultInputs(tree) {
|
|
6
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
7
|
+
const nxJson = (0, devkit_1.readNxJson)(tree) ?? {};
|
|
7
8
|
const webpackExecutor = '@nx/angular:webpack-browser';
|
|
8
9
|
const mfEnvVar = 'NX_MF_DEV_REMOTES';
|
|
9
|
-
const
|
|
10
|
+
const defaultInputs = [
|
|
10
11
|
...(nxJson.namedInputs && 'production' in nxJson.namedInputs
|
|
11
12
|
? ['production', '^production']
|
|
12
13
|
: ['default', '^default']),
|
|
13
14
|
];
|
|
14
|
-
nxJson.targetDefaults
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const existing = (0, internal_1.normalizeTargetDefaults)(nxJson.targetDefaults).find((e) => e.executor === webpackExecutor &&
|
|
16
|
+
e.target === undefined &&
|
|
17
|
+
e.projects === undefined &&
|
|
18
|
+
e.plugin === undefined);
|
|
19
|
+
const inputs = [...(existing?.inputs ?? defaultInputs)];
|
|
18
20
|
let mfEnvVarExists = false;
|
|
19
|
-
for (const input of
|
|
21
|
+
for (const input of inputs) {
|
|
20
22
|
if (typeof input === 'object' && input['env'] === mfEnvVar) {
|
|
21
23
|
mfEnvVarExists = true;
|
|
22
24
|
break;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
if (!mfEnvVarExists) {
|
|
26
|
-
|
|
28
|
+
inputs.push({ env: mfEnvVar });
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
(0, internal_1.upsertTargetDefault)(tree, nxJson, {
|
|
31
|
+
executor: webpackExecutor,
|
|
32
|
+
cache: true,
|
|
33
|
+
inputs,
|
|
34
|
+
dependsOn: existing?.dependsOn ?? ['^build'],
|
|
35
|
+
});
|
|
29
36
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
30
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-vitest.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/add-vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EAKV,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"add-vitest.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/add-vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EAKV,MAAM,YAAY,CAAC;AAcpB,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAsCf"}
|