@nx/angular 16.8.0-beta.4 → 16.8.0-beta.5
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/mf/mf.js +31 -36
- package/package.json +10 -10
- package/plugins/component-testing.js +48 -40
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +4 -6
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +4 -6
- package/src/builders/utilities/buildable-libs.js +1 -2
- package/src/builders/utilities/module-federation.js +2 -3
- package/src/builders/utilities/webpack.js +16 -21
- package/src/builders/webpack-browser/webpack-browser.impl.js +13 -13
- package/src/builders/webpack-dev-server/lib/normalize-options.js +8 -1
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +24 -18
- package/src/builders/webpack-server/webpack-server.impl.js +5 -7
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +19 -23
- package/src/executors/browser-esbuild/lib/buildable-libs.js +1 -2
- package/src/executors/delegate-build/delegate-build.impl.js +9 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +4 -7
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.js +4 -5
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js +158 -156
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/options.di.js +6 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js +118 -118
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/styles/stylesheet-processor.js +96 -103
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.js +20 -12
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +18 -21
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +6 -9
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +6 -3
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +122 -122
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +96 -103
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.js +21 -13
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +5 -8
- package/src/executors/package/package.impl.js +33 -38
- package/src/executors/utilities/angular-version-utils.js +1 -1
- package/src/executors/utilities/tailwindcss.js +2 -2
- package/src/executors/utilities/typescript.js +23 -28
- package/src/generators/add-linting/add-linting.js +76 -74
- package/src/generators/add-linting/lib/create-eslint-configuration.js +12 -4
- package/src/generators/application/application.js +56 -55
- package/src/generators/application/lib/add-e2e.js +36 -40
- package/src/generators/application/lib/add-linting.js +12 -15
- package/src/generators/application/lib/add-proxy-config.js +4 -1
- package/src/generators/application/lib/add-unit-test-runner.js +15 -18
- package/src/generators/application/lib/create-files.js +44 -47
- package/src/generators/application/lib/enable-strict-type-checking.js +2 -2
- package/src/generators/application/lib/normalize-options.js +37 -25
- package/src/generators/application/lib/set-app-strict-default.js +1 -2
- package/src/generators/application/lib/update-editor-tsconfig.js +1 -2
- package/src/generators/component/component.js +40 -43
- package/src/generators/component/lib/normalize-options.js +15 -5
- package/src/generators/component-cypress-spec/component-cypress-spec.js +25 -28
- package/src/generators/component-story/component-story.js +19 -22
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +19 -22
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +3 -4
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +103 -106
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +59 -62
- package/src/generators/directive/directive.js +21 -24
- package/src/generators/directive/lib/normalize-options.js +11 -5
- package/src/generators/host/host.js +77 -67
- package/src/generators/host/lib/add-ssr.js +32 -35
- package/src/generators/init/init.js +101 -92
- package/src/generators/library/lib/add-standalone-component.js +18 -13
- package/src/generators/library/lib/enable-strict-type-checking.js +17 -5
- package/src/generators/library/lib/normalize-options.js +68 -53
- package/src/generators/library/library.js +89 -92
- package/src/generators/library-secondary-entry-point/lib/add-files.js +5 -1
- package/src/generators/library-secondary-entry-point/lib/normalize-options.js +6 -3
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +1 -2
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +6 -9
- package/src/generators/move/lib/normalize-schema.js +5 -1
- package/src/generators/move/lib/update-module-name.js +1 -1
- package/src/generators/move/lib/update-ng-package.js +1 -2
- package/src/generators/move/lib/update-secondary-entry-points.js +1 -2
- package/src/generators/move/move.js +9 -12
- package/src/generators/ng-add/migrate-from-angular-cli.js +54 -53
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +4 -3
- package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.js +11 -12
- package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +39 -42
- package/src/generators/ng-add/migrators/builders/builder.migrator.js +1 -2
- package/src/generators/ng-add/migrators/migrator.js +7 -11
- package/src/generators/ng-add/migrators/projects/app.migrator.js +39 -43
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +115 -91
- package/src/generators/ng-add/migrators/projects/lib.migrator.js +23 -31
- package/src/generators/ng-add/migrators/projects/project.migrator.js +10 -14
- package/src/generators/ng-add/ng-add.js +5 -8
- package/src/generators/ng-add/utilities/dependencies.js +2 -3
- package/src/generators/ng-add/utilities/format-files-task.js +1 -1
- package/src/generators/ng-add/utilities/projects.js +1 -1
- package/src/generators/ng-add/utilities/workspace.js +25 -36
- package/src/generators/ngrx/lib/add-imports-to-module.js +1 -2
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +1 -3
- package/src/generators/ngrx/lib/generate-files.js +11 -2
- package/src/generators/ngrx/lib/normalize-options.js +9 -4
- package/src/generators/ngrx/lib/validate-options.js +3 -3
- package/src/generators/ngrx/ngrx.js +18 -21
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.actions.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.effects.spec.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.effects.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ +6 -6
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.facade.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.reducer.spec.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.reducer.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.selectors.spec.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.selectors.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +4 -1
- package/src/generators/ngrx-feature-store/lib/add-imports.js +1 -1
- package/src/generators/ngrx-feature-store/lib/add-ngrx-to-package-json.js +1 -3
- package/src/generators/ngrx-feature-store/lib/generate-files.js +20 -4
- package/src/generators/ngrx-feature-store/lib/normalize-options.d.ts +1 -0
- package/src/generators/ngrx-feature-store/lib/normalize-options.js +22 -3
- package/src/generators/ngrx-feature-store/lib/validate-options.js +2 -2
- package/src/generators/ngrx-feature-store/ngrx-feature-store.js +18 -21
- package/src/generators/ngrx-root-store/lib/add-ngrx-to-package-json.js +8 -6
- package/src/generators/ngrx-root-store/lib/normalize-options.js +8 -4
- package/src/generators/ngrx-root-store/lib/validate-options.js +2 -2
- package/src/generators/ngrx-root-store/ngrx-root-store.js +27 -30
- package/src/generators/pipe/lib/normalize-options.js +9 -3
- package/src/generators/pipe/pipe.js +21 -24
- package/src/generators/remote/lib/add-ssr.js +46 -47
- package/src/generators/remote/lib/find-next-available-port.js +1 -2
- package/src/generators/remote/remote.js +52 -49
- package/src/generators/scam/lib/convert-component-to-scam.js +1 -2
- package/src/generators/scam/lib/normalize-options.js +11 -4
- package/src/generators/scam/scam.js +15 -12
- package/src/generators/scam-directive/lib/normalize-options.js +12 -4
- package/src/generators/scam-directive/scam-directive.js +13 -10
- package/src/generators/scam-pipe/lib/normalize-options.js +12 -4
- package/src/generators/scam-pipe/scam-pipe.js +13 -10
- package/src/generators/scam-to-standalone/scam-to-standalone.js +23 -26
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +1 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +4 -1
- package/src/generators/setup-mf/lib/change-build-target.js +10 -4
- package/src/generators/setup-mf/lib/generate-config.js +1 -1
- package/src/generators/setup-mf/lib/get-remotes-with-ports.js +1 -2
- package/src/generators/setup-mf/lib/normalize-options.js +5 -2
- package/src/generators/setup-mf/lib/set-tsconfig-target.js +7 -1
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +1 -2
- package/src/generators/setup-mf/lib/setup-serve-target.js +10 -3
- package/src/generators/setup-mf/setup-mf.js +32 -35
- package/src/generators/setup-ssr/lib/generate-files.js +8 -5
- package/src/generators/setup-ssr/lib/normalize-options.js +9 -10
- package/src/generators/setup-ssr/lib/update-project-config.js +21 -17
- package/src/generators/setup-ssr/setup-ssr.js +26 -27
- package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.js +6 -4
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.js +1 -2
- package/src/generators/setup-tailwind/lib/normalize-options.js +4 -1
- package/src/generators/setup-tailwind/lib/update-application-styles.js +5 -6
- package/src/generators/setup-tailwind/setup-tailwind.js +20 -23
- package/src/generators/stories/lib/get-e2e-project.js +1 -1
- package/src/generators/stories/stories.js +43 -50
- package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.js +1 -1
- package/src/generators/storybook-configuration/lib/generate-stories.js +10 -13
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +12 -15
- package/src/generators/storybook-configuration/storybook-configuration.js +20 -16
- package/src/generators/utils/create-ts-config.js +1 -1
- package/src/generators/utils/entry-point.js +1 -2
- package/src/generators/utils/export-scam.js +1 -1
- package/src/generators/utils/insert-ngmodule-import.js +1 -1
- package/src/generators/utils/path.js +3 -3
- package/src/generators/utils/project.js +2 -3
- package/src/generators/utils/selector.js +1 -1
- package/src/generators/utils/storybook-ast/component-info.js +1 -2
- package/src/generators/utils/storybook-ast/entry-point.js +1 -2
- package/src/generators/utils/storybook-ast/module-info.js +1 -2
- package/src/generators/utils/storybook-ast/tree-utilities.js +1 -1
- package/src/generators/utils/testing.js +141 -139
- package/src/generators/utils/validations.js +1 -1
- package/src/generators/utils/version-utils.js +5 -7
- package/src/generators/web-worker/lib/normalize-options.js +6 -3
- package/src/generators/web-worker/web-worker.js +25 -28
- package/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.js +10 -13
- package/src/migrations/update-14-2-0/update-angular-cli.js +14 -18
- package/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.js +22 -26
- package/src/migrations/update-14-2-0/update-ngcc-target.js +10 -14
- package/src/migrations/update-14-2-0/update-router-initial-navigation.js +31 -39
- package/src/migrations/update-14-2-0/update-tsconfig-target.js +48 -56
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js +14 -17
- package/src/migrations/update-14-5-2/update-angular-cli.js +14 -18
- package/src/migrations/update-14-6-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-0-0/add-karma-inputs.js +27 -32
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +62 -68
- package/src/migrations/update-15-2-0/remove-browserlist-config.js +34 -37
- package/src/migrations/update-15-2-0/remove-platform-server-exports.js +49 -52
- package/src/migrations/update-15-2-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-2-0/update-karma-main-file.js +11 -12
- package/src/migrations/update-15-2-0/update-typescript-target.js +40 -39
- package/src/migrations/update-15-2-0/update-workspace-config.js +16 -19
- package/src/migrations/update-15-5-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-7-0/install-required-packages.js +26 -28
- package/src/migrations/update-15-8-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-9-0/update-file-server-executor.js +31 -35
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js +17 -22
- package/src/migrations/update-16-0-0/remove-karma-defaults.js +15 -18
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +22 -25
- package/src/migrations/update-16-0-0/remove-protractor-defaults.js +15 -18
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +38 -42
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +15 -19
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +49 -52
- package/src/migrations/update-16-1-0/update-angular-cli.js +14 -18
- package/src/migrations/update-16-1-0/update-server-executor-config.js +13 -16
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +25 -29
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +13 -16
- package/src/migrations/update-16-4-0/update-angular-cli.js +14 -18
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +19 -24
- package/src/migrations/update-16-7-0/update-angular-cli.js +14 -18
- package/src/migrations/utils/projects.js +9 -15
- package/src/utils/get-mf-projects.js +1 -2
- package/src/utils/mf/utils.js +43 -44
- package/src/utils/mf/with-module-federation-ssr.js +39 -24
- package/src/utils/mf/with-module-federation.js +40 -21
- package/src/utils/nx-devkit/ast-utils.js +2 -3
- package/src/utils/version-utils.js +2 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.libraryGeneratorInternal = exports.libraryGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const jest_1 = require("@nx/jest");
|
|
7
6
|
const linter_1 = require("@nx/linter");
|
|
@@ -21,87 +20,88 @@ const update_lib_package_npm_scope_1 = require("./lib/update-lib-package-npm-sco
|
|
|
21
20
|
const update_tsconfig_1 = require("./lib/update-tsconfig");
|
|
22
21
|
const create_files_1 = require("./lib/create-files");
|
|
23
22
|
const add_project_1 = require("./lib/add-project");
|
|
24
|
-
function libraryGenerator(tree, schema) {
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
async function libraryGenerator(tree, schema) {
|
|
24
|
+
return await libraryGeneratorInternal(tree, {
|
|
25
|
+
// provide a default projectNameAndRootFormat to avoid breaking changes
|
|
26
|
+
// to external generators invoking this one
|
|
27
|
+
projectNameAndRootFormat: 'derived',
|
|
28
|
+
...schema,
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
exports.libraryGenerator = libraryGenerator;
|
|
33
|
-
function libraryGeneratorInternal(tree, schema) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(0, update_tsconfig_1.updateTsConfig)(tree, libraryOptions);
|
|
56
|
-
yield addUnitTestRunner(tree, libraryOptions);
|
|
57
|
-
updateNpmScopeIfBuildableOrPublishable(tree, libraryOptions);
|
|
58
|
-
if (!libraryOptions.standalone) {
|
|
59
|
-
(0, add_module_1.addModule)(tree, libraryOptions);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
yield (0, add_standalone_component_1.addStandaloneComponent)(tree, options);
|
|
63
|
-
}
|
|
64
|
-
setStrictMode(tree, libraryOptions);
|
|
65
|
-
yield addLinting(tree, libraryOptions);
|
|
66
|
-
if (libraryOptions.addTailwind) {
|
|
67
|
-
yield (0, setup_tailwind_1.default)(tree, {
|
|
68
|
-
project: libraryOptions.name,
|
|
69
|
-
skipFormat: true,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
if (libraryOptions.buildable || libraryOptions.publishable) {
|
|
73
|
-
(0, version_utils_1.addDependenciesToPackageJsonIfDontExist)(tree, {}, {
|
|
74
|
-
'ng-packagr': pkgVersions.ngPackagrVersion,
|
|
75
|
-
});
|
|
76
|
-
(0, dependencies_1.addBuildableLibrariesPostCssDependencies)(tree);
|
|
77
|
-
}
|
|
78
|
-
(0, js_1.addTsConfigPath)(tree, libraryOptions.importPath, [
|
|
79
|
-
(0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, './src', 'index.ts'),
|
|
80
|
-
]);
|
|
81
|
-
if (!libraryOptions.skipFormat) {
|
|
82
|
-
yield (0, devkit_1.formatFiles)(tree);
|
|
83
|
-
}
|
|
84
|
-
return () => {
|
|
85
|
-
(0, devkit_1.installPackagesTask)(tree);
|
|
86
|
-
};
|
|
32
|
+
async function libraryGeneratorInternal(tree, schema) {
|
|
33
|
+
// Do some validation checks
|
|
34
|
+
if (!schema.routing && schema.lazy) {
|
|
35
|
+
throw new Error(`To use "--lazy" option, "--routing" must also be set.`);
|
|
36
|
+
}
|
|
37
|
+
if (schema.publishable === true && !schema.importPath) {
|
|
38
|
+
throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
|
|
39
|
+
}
|
|
40
|
+
if (schema.addTailwind && !schema.buildable && !schema.publishable) {
|
|
41
|
+
throw new Error(`To use "--addTailwind" option, you have to set either "--buildable" or "--publishable".`);
|
|
42
|
+
}
|
|
43
|
+
const userInstalledAngularVersion = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
44
|
+
if ((0, semver_1.lt)(userInstalledAngularVersion.version, '14.1.0') && schema.standalone) {
|
|
45
|
+
throw new Error(`The "--standalone" option is not supported in Angular versions < 14.1.0.`);
|
|
46
|
+
}
|
|
47
|
+
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
48
|
+
const { libraryOptions } = options;
|
|
49
|
+
const pkgVersions = (0, version_utils_1.versions)(tree);
|
|
50
|
+
await (0, init_1.default)(tree, {
|
|
51
|
+
...libraryOptions,
|
|
52
|
+
skipFormat: true,
|
|
53
|
+
e2eTestRunner: test_runners_1.E2eTestRunner.None,
|
|
87
54
|
});
|
|
55
|
+
const project = (0, add_project_1.addProject)(tree, libraryOptions);
|
|
56
|
+
(0, create_files_1.createFiles)(tree, options, project);
|
|
57
|
+
(0, update_tsconfig_1.updateTsConfig)(tree, libraryOptions);
|
|
58
|
+
await addUnitTestRunner(tree, libraryOptions);
|
|
59
|
+
updateNpmScopeIfBuildableOrPublishable(tree, libraryOptions);
|
|
60
|
+
if (!libraryOptions.standalone) {
|
|
61
|
+
(0, add_module_1.addModule)(tree, libraryOptions);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
await (0, add_standalone_component_1.addStandaloneComponent)(tree, options);
|
|
65
|
+
}
|
|
66
|
+
setStrictMode(tree, libraryOptions);
|
|
67
|
+
await addLinting(tree, libraryOptions);
|
|
68
|
+
if (libraryOptions.addTailwind) {
|
|
69
|
+
await (0, setup_tailwind_1.default)(tree, {
|
|
70
|
+
project: libraryOptions.name,
|
|
71
|
+
skipFormat: true,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (libraryOptions.buildable || libraryOptions.publishable) {
|
|
75
|
+
(0, version_utils_1.addDependenciesToPackageJsonIfDontExist)(tree, {}, {
|
|
76
|
+
'ng-packagr': pkgVersions.ngPackagrVersion,
|
|
77
|
+
});
|
|
78
|
+
(0, dependencies_1.addBuildableLibrariesPostCssDependencies)(tree);
|
|
79
|
+
}
|
|
80
|
+
(0, js_1.addTsConfigPath)(tree, libraryOptions.importPath, [
|
|
81
|
+
(0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, './src', 'index.ts'),
|
|
82
|
+
]);
|
|
83
|
+
if (!libraryOptions.skipFormat) {
|
|
84
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
85
|
+
}
|
|
86
|
+
return () => {
|
|
87
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
88
|
+
};
|
|
88
89
|
}
|
|
89
90
|
exports.libraryGeneratorInternal = libraryGeneratorInternal;
|
|
90
|
-
function addUnitTestRunner(host, options) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
host.write(setupFile, `// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
|
91
|
+
async function addUnitTestRunner(host, options) {
|
|
92
|
+
if (options.unitTestRunner === 'jest') {
|
|
93
|
+
await (0, jest_1.configurationGenerator)(host, {
|
|
94
|
+
project: options.name,
|
|
95
|
+
setupFile: 'angular',
|
|
96
|
+
supportTsx: false,
|
|
97
|
+
skipSerializers: false,
|
|
98
|
+
skipFormat: true,
|
|
99
|
+
skipPackageJson: options.skipPackageJson,
|
|
100
|
+
});
|
|
101
|
+
const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', 'test-setup.ts');
|
|
102
|
+
if (options.strict && host.exists(setupFile)) {
|
|
103
|
+
const contents = host.read(setupFile, 'utf-8');
|
|
104
|
+
host.write(setupFile, `// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
|
105
105
|
globalThis.ngJest = {
|
|
106
106
|
testEnvironmentOptions: {
|
|
107
107
|
errorOnUnknownElements: true,
|
|
@@ -109,9 +109,8 @@ globalThis.ngJest = {
|
|
|
109
109
|
},
|
|
110
110
|
};
|
|
111
111
|
${contents}`);
|
|
112
|
-
}
|
|
113
112
|
}
|
|
114
|
-
}
|
|
113
|
+
}
|
|
115
114
|
}
|
|
116
115
|
function updateNpmScopeIfBuildableOrPublishable(host, options) {
|
|
117
116
|
if (options.buildable || options.publishable) {
|
|
@@ -126,20 +125,18 @@ function setStrictMode(host, options) {
|
|
|
126
125
|
(0, enable_strict_type_checking_1.setLibraryStrictDefault)(host, options.strict);
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
|
-
function addLinting(host, options) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
skipPackageJson: options.skipPackageJson,
|
|
142
|
-
});
|
|
128
|
+
async function addLinting(host, options) {
|
|
129
|
+
if (options.linter === linter_1.Linter.None) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
await (0, add_linting_1.default)(host, {
|
|
133
|
+
projectName: options.name,
|
|
134
|
+
projectRoot: options.projectRoot,
|
|
135
|
+
prefix: options.prefix,
|
|
136
|
+
unitTestRunner: options.unitTestRunner,
|
|
137
|
+
setParserOptionsProject: options.setParserOptionsProject,
|
|
138
|
+
skipFormat: true,
|
|
139
|
+
skipPackageJson: options.skipPackageJson,
|
|
143
140
|
});
|
|
144
141
|
}
|
|
145
142
|
exports.default = libraryGenerator;
|
|
@@ -4,7 +4,11 @@ exports.addFiles = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function addFiles(tree, options) {
|
|
6
6
|
const nameVariants = (0, devkit_1.names)(options.name);
|
|
7
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.entryPointDestination,
|
|
7
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.entryPointDestination, {
|
|
8
|
+
...options,
|
|
9
|
+
...nameVariants,
|
|
10
|
+
tmpl: '',
|
|
11
|
+
});
|
|
8
12
|
if (options.skipModule) {
|
|
9
13
|
tree.delete((0, devkit_1.joinPathFragments)(options.entryPointDestination, `src/lib/${nameVariants.fileName}.module.ts`));
|
|
10
14
|
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function normalizeOptions(tree, options) {
|
|
6
|
-
var _a;
|
|
7
6
|
const name = (0, devkit_1.names)(options.name).fileName;
|
|
8
7
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
9
8
|
const libraryProject = projects.get(options.library);
|
|
@@ -19,10 +18,14 @@ function normalizeOptions(tree, options) {
|
|
|
19
18
|
}
|
|
20
19
|
const { name: mainEntryPoint } = (0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(libraryProject.root, 'package.json'));
|
|
21
20
|
const secondaryEntryPoint = `${mainEntryPoint}/${options.name}`;
|
|
22
|
-
return
|
|
21
|
+
return {
|
|
22
|
+
...options,
|
|
23
|
+
entryPointDestination,
|
|
23
24
|
mainEntryPoint,
|
|
24
25
|
name,
|
|
25
26
|
libraryProject,
|
|
26
|
-
secondaryEntryPoint,
|
|
27
|
+
secondaryEntryPoint,
|
|
28
|
+
skipModule: options.skipModule ?? false,
|
|
29
|
+
};
|
|
27
30
|
}
|
|
28
31
|
exports.normalizeOptions = normalizeOptions;
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateLintingFilePatterns = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function updateLintingFilePatterns(tree, options) {
|
|
6
|
-
var _a, _b, _c;
|
|
7
6
|
const { libraryProject } = options;
|
|
8
|
-
if (
|
|
7
|
+
if (libraryProject.targets?.lint?.options?.lintFilePatterns) {
|
|
9
8
|
libraryProject.targets.lint.options.lintFilePatterns.push(...[
|
|
10
9
|
`${libraryProject.root}/${options.name}/**/*.ts`,
|
|
11
10
|
`${libraryProject.root}/${options.name}/**/*.html`,
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.librarySecondaryEntryPointGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const lib_1 = require("./lib");
|
|
7
|
-
function librarySecondaryEntryPointGenerator(tree, rawOptions) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
yield (0, devkit_1.formatFiles)(tree);
|
|
14
|
-
});
|
|
6
|
+
async function librarySecondaryEntryPointGenerator(tree, rawOptions) {
|
|
7
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
8
|
+
(0, lib_1.addFiles)(tree, options);
|
|
9
|
+
(0, lib_1.addPathMapping)(tree, options);
|
|
10
|
+
(0, lib_1.updateLintingFilePatterns)(tree, options);
|
|
11
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
15
12
|
}
|
|
16
13
|
exports.librarySecondaryEntryPointGenerator = librarySecondaryEntryPointGenerator;
|
|
17
14
|
exports.default = librarySecondaryEntryPointGenerator;
|
|
@@ -6,6 +6,10 @@ const get_new_project_name_1 = require("../../utils/get-new-project-name");
|
|
|
6
6
|
function normalizeSchema(tree, schema) {
|
|
7
7
|
const newProjectName = (0, get_new_project_name_1.getNewProjectName)(schema.destination);
|
|
8
8
|
const { root } = (0, devkit_1.readProjectConfiguration)(tree, schema.projectName);
|
|
9
|
-
return
|
|
9
|
+
return {
|
|
10
|
+
...schema,
|
|
11
|
+
newProjectName,
|
|
12
|
+
oldProjectRoot: root,
|
|
13
|
+
};
|
|
10
14
|
}
|
|
11
15
|
exports.normalizeSchema = normalizeSchema;
|
|
@@ -87,7 +87,7 @@ function updateFileContent(tree, replacements, fileName, newFileName) {
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
if (updated) {
|
|
90
|
-
tree.write(newFileName
|
|
90
|
+
tree.write(newFileName ?? fileName, content);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -4,7 +4,6 @@ exports.updateNgPackage = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
function updateNgPackage(tree, schema) {
|
|
7
|
-
var _a;
|
|
8
7
|
const project = (0, devkit_1.readProjectConfiguration)(tree, schema.newProjectName);
|
|
9
8
|
if (project.projectType === 'application') {
|
|
10
9
|
return;
|
|
@@ -28,7 +27,7 @@ function updateNgPackage(tree, schema) {
|
|
|
28
27
|
targets: project.targets,
|
|
29
28
|
},
|
|
30
29
|
});
|
|
31
|
-
const output =
|
|
30
|
+
const output = outputs[0] ?? `dist/${project.root}`;
|
|
32
31
|
(0, devkit_1.updateJson)(tree, ngPackagePath, (json) => {
|
|
33
32
|
json.dest = `${rootOffset}/${output}`;
|
|
34
33
|
return json;
|
|
@@ -12,12 +12,11 @@ const libraryExecutors = [
|
|
|
12
12
|
'@nrwl/angular:package',
|
|
13
13
|
];
|
|
14
14
|
function updateSecondaryEntryPoints(tree, schema) {
|
|
15
|
-
var _a;
|
|
16
15
|
const project = (0, devkit_1.readProjectConfiguration)(tree, schema.newProjectName);
|
|
17
16
|
if (project.projectType !== 'library') {
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
|
-
if (!Object.values(
|
|
19
|
+
if (!Object.values(project.targets ?? {}).some((target) => libraryExecutors.includes(target.executor))) {
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
22
|
(0, devkit_1.visitNotIgnoredFiles)(tree, project.root, (filePath) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularMoveGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const generators_1 = require("@nx/workspace/generators");
|
|
7
6
|
const lib_1 = require("./lib");
|
|
@@ -12,16 +11,14 @@ const lib_1 = require("./lib");
|
|
|
12
11
|
* to the workspace, so it can't use the same tricks as the `@nx/workspace` rules
|
|
13
12
|
* to get the before and after names and paths.
|
|
14
13
|
*/
|
|
15
|
-
function angularMoveGenerator(tree, schema) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
});
|
|
14
|
+
async function angularMoveGenerator(tree, schema) {
|
|
15
|
+
const normalizedSchema = (0, lib_1.normalizeSchema)(tree, schema);
|
|
16
|
+
await (0, generators_1.moveGenerator)(tree, { ...schema, skipFormat: true });
|
|
17
|
+
(0, lib_1.updateModuleName)(tree, normalizedSchema);
|
|
18
|
+
(0, lib_1.updateNgPackage)(tree, normalizedSchema);
|
|
19
|
+
(0, lib_1.updateSecondaryEntryPoints)(tree, normalizedSchema);
|
|
20
|
+
if (!normalizedSchema.skipFormat) {
|
|
21
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
+
}
|
|
26
23
|
}
|
|
27
24
|
exports.angularMoveGenerator = angularMoveGenerator;
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateFromAngularCli = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const migrators_1 = require("./migrators");
|
|
7
6
|
const utilities_1 = require("./utilities");
|
|
8
|
-
function migrateFromAngularCli(tree, options) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
(0, utilities_1.
|
|
52
|
-
(0, utilities_1.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
7
|
+
async function migrateFromAngularCli(tree, options) {
|
|
8
|
+
(0, utilities_1.validateWorkspace)(tree);
|
|
9
|
+
const projects = (0, utilities_1.getAllProjects)(tree);
|
|
10
|
+
const angularJson = (0, devkit_1.readJson)(tree, 'angular.json');
|
|
11
|
+
(0, utilities_1.ensureAngularDevKitPeerDependenciesAreInstalled)(tree);
|
|
12
|
+
const migrators = [
|
|
13
|
+
...projects.apps.map((app) => new migrators_1.AppMigrator(tree, options, app)),
|
|
14
|
+
...projects.libs.map((lib) => new migrators_1.LibMigrator(tree, options, lib)),
|
|
15
|
+
];
|
|
16
|
+
const workspaceRootFileTypesInfo = (0, utilities_1.getWorkspaceRootFileTypesInfo)(tree, migrators);
|
|
17
|
+
/**
|
|
18
|
+
* Keep a copy of the root eslint config to restore it later. We need to
|
|
19
|
+
* do this because the root config can also be the config for the app at
|
|
20
|
+
* the root of the Angular CLI workspace and it will be moved as part of
|
|
21
|
+
* the app migration.
|
|
22
|
+
*/
|
|
23
|
+
let eslintConfig = workspaceRootFileTypesInfo.eslint && tree.exists('.eslintrc.json')
|
|
24
|
+
? (0, devkit_1.readJson)(tree, '.eslintrc.json')
|
|
25
|
+
: undefined;
|
|
26
|
+
// create and update root files and configurations
|
|
27
|
+
(0, devkit_1.updateJson)(tree, 'angular.json', (json) => ({
|
|
28
|
+
...json,
|
|
29
|
+
version: 2,
|
|
30
|
+
$schema: undefined,
|
|
31
|
+
}));
|
|
32
|
+
(0, utilities_1.createNxJson)(tree, options, angularJson.defaultProject);
|
|
33
|
+
(0, utilities_1.updateWorkspaceConfigDefaults)(tree);
|
|
34
|
+
(0, utilities_1.updateRootTsConfig)(tree);
|
|
35
|
+
(0, utilities_1.updatePackageJson)(tree);
|
|
36
|
+
await (0, utilities_1.createWorkspaceFiles)(tree);
|
|
37
|
+
// migrate all projects
|
|
38
|
+
for (const migrator of migrators) {
|
|
39
|
+
await migrator.migrate();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* This needs to be done last because the Angular CLI workspace can have
|
|
43
|
+
* these files in the root for the root application, so we wait until
|
|
44
|
+
* those root config files are moved when the projects are migrated.
|
|
45
|
+
*/
|
|
46
|
+
if (workspaceRootFileTypesInfo.karma) {
|
|
47
|
+
(0, utilities_1.createRootKarmaConfig)(tree);
|
|
48
|
+
}
|
|
49
|
+
if (workspaceRootFileTypesInfo.eslint) {
|
|
50
|
+
(0, utilities_1.updateRootEsLintConfig)(tree, eslintConfig, options.unitTestRunner);
|
|
51
|
+
(0, utilities_1.cleanupEsLintPackages)(tree);
|
|
52
|
+
}
|
|
53
|
+
(0, utilities_1.deleteGitKeepFilesIfNotNeeded)(tree);
|
|
54
|
+
(0, utilities_1.deleteAngularJson)(tree);
|
|
55
|
+
if (!options.skipInstall) {
|
|
56
|
+
return () => {
|
|
57
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
58
|
+
(0, utilities_1.formatFilesTask)(tree);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
60
61
|
}
|
|
61
62
|
exports.migrateFromAngularCli = migrateFromAngularCli;
|
|
@@ -58,11 +58,12 @@ class AngularDevkitKarmaMigrator extends builder_migrator_1.BuilderMigrator {
|
|
|
58
58
|
target.options.scripts =
|
|
59
59
|
target.options.scripts &&
|
|
60
60
|
target.options.scripts.map((script) => this.convertAsset(script));
|
|
61
|
-
(0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name,
|
|
61
|
+
(0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
|
|
62
|
+
...this.projectConfig,
|
|
63
|
+
});
|
|
62
64
|
}
|
|
63
65
|
updateTsConfigFileUsedByTestTarget(targetName, target) {
|
|
64
|
-
|
|
65
|
-
if (!((_a = target.options) === null || _a === void 0 ? void 0 : _a.tsConfig)) {
|
|
66
|
+
if (!target.options?.tsConfig) {
|
|
66
67
|
this.logger.warn(`The "${targetName}" target does not have the "tsConfig" option configured. Skipping updating the tsConfig file.`);
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
@@ -35,21 +35,21 @@ class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
['project', 'tsConfig'].forEach((option) => {
|
|
38
|
-
|
|
39
|
-
if ((_a = target.options) === null || _a === void 0 ? void 0 : _a[option]) {
|
|
38
|
+
if (target.options?.[option]) {
|
|
40
39
|
target.options[option] = (0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(target.options[option]));
|
|
41
40
|
}
|
|
42
|
-
for (const configuration of Object.values(
|
|
41
|
+
for (const configuration of Object.values(target.configurations ?? {})) {
|
|
43
42
|
configuration[option] =
|
|
44
43
|
configuration[option] &&
|
|
45
44
|
(0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(configuration[option]));
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
|
-
(0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name,
|
|
47
|
+
(0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
|
|
48
|
+
...this.projectConfig,
|
|
49
|
+
});
|
|
49
50
|
}
|
|
50
51
|
updateNgPackageJson(targetName, target) {
|
|
51
|
-
|
|
52
|
-
if (!((_a = target.options) === null || _a === void 0 ? void 0 : _a.project)) {
|
|
52
|
+
if (!target.options?.project) {
|
|
53
53
|
this.logger.warn(`The "${targetName}" target does not have the "project" option configured. Skipping updating the ng-packagr project file ("ng-package.json").`);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
@@ -68,16 +68,16 @@ class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
updateTsConfigs(targetName, target) {
|
|
71
|
-
|
|
72
|
-
const tsConfigPath = (_b = (_a = target.options) === null || _a === void 0 ? void 0 : _a.tsConfig) !== null && _b !== void 0 ? _b : (_d = (_c = target.configurations) === null || _c === void 0 ? void 0 : _c.development) === null || _d === void 0 ? void 0 : _d.tsConfig;
|
|
71
|
+
const tsConfigPath = target.options?.tsConfig ?? target.configurations?.development?.tsConfig;
|
|
73
72
|
if (!tsConfigPath) {
|
|
74
73
|
this.logger.warn(`The "${targetName}" target does not have the "tsConfig" option configured. Skipping updating the tsConfig file.`);
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
77
76
|
else if (!this.tree.exists(tsConfigPath)) {
|
|
78
|
-
const originalTsConfigPath =
|
|
77
|
+
const originalTsConfigPath = target.options?.tsConfig
|
|
79
78
|
? this.originalProjectConfig.targets[targetName].options.tsConfig
|
|
80
|
-
:
|
|
79
|
+
: this.originalProjectConfig.targets[targetName].configurations
|
|
80
|
+
?.development?.tsConfig;
|
|
81
81
|
this.logger.warn(`The tsConfig file "${originalTsConfigPath}" specified in the "${targetName}" target could not be found. Skipping updating the tsConfig file.`);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
@@ -85,8 +85,7 @@ class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator
|
|
|
85
85
|
const projectOffsetFromRoot = (0, devkit_1.offsetFromRoot)(this.projectConfig.root);
|
|
86
86
|
this.updateTsConfigFile(tsConfigPath, rootTsConfigFile, projectOffsetFromRoot);
|
|
87
87
|
(0, devkit_1.updateJson)(this.tree, tsConfigPath, (json) => {
|
|
88
|
-
|
|
89
|
-
if (!((_a = json.include) === null || _a === void 0 ? void 0 : _a.length) && !((_b = json.files) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
88
|
+
if (!json.include?.length && !json.files?.length) {
|
|
90
89
|
json.include = ['**/*.ts'];
|
|
91
90
|
}
|
|
92
91
|
return json;
|