@nx/workspace 19.5.0-beta.0 → 19.5.0-beta.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/migrations.json +13 -0
- package/package.json +4 -4
- package/src/executors/counter/counter.impl.js +2 -3
- package/src/generators/ci-workflow/ci-workflow.js +3 -2
- package/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +8 -3
- package/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ +14 -6
- package/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ +7 -3
- package/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +7 -3
- package/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ +7 -3
- package/src/generators/convert-to-monorepo/convert-to-monorepo.js +1 -2
- package/src/generators/convert-to-nx-project/convert-to-nx-project.js +2 -3
- package/src/generators/move/lib/check-destination.js +1 -2
- package/src/generators/move/lib/create-project-configuration-in-new-destination.js +1 -2
- package/src/generators/move/lib/extract-base-configs.js +3 -4
- package/src/generators/move/lib/move-project-files.js +1 -2
- package/src/generators/move/lib/normalize-schema.js +1 -2
- package/src/generators/move/lib/run-angular-plugin.js +1 -2
- package/src/generators/move/lib/update-build-targets.js +1 -2
- package/src/generators/move/lib/update-cypress-config.js +1 -2
- package/src/generators/move/lib/update-default-project.js +1 -2
- package/src/generators/move/lib/update-eslint-config.js +1 -2
- package/src/generators/move/lib/update-implicit-dependencies.js +1 -2
- package/src/generators/move/lib/update-imports.js +1 -2
- package/src/generators/move/lib/update-jest-config.js +1 -2
- package/src/generators/move/lib/update-package-json.js +1 -2
- package/src/generators/move/lib/update-project-root-files.js +3 -4
- package/src/generators/move/lib/update-readme.js +1 -2
- package/src/generators/move/lib/update-storybook-config.js +1 -2
- package/src/generators/move/lib/utils.js +3 -4
- package/src/generators/move/move.js +2 -3
- package/src/generators/new/generate-preset.js +2 -3
- package/src/generators/new/generate-workspace-files.js +1 -2
- package/src/generators/new/new.js +1 -2
- package/src/generators/npm-package/npm-package.js +2 -3
- package/src/generators/preset/preset.js +1 -2
- package/src/generators/remove/lib/check-dependencies.js +1 -2
- package/src/generators/remove/lib/check-project-is-safe-to-remove.js +1 -2
- package/src/generators/remove/lib/check-targets.js +1 -2
- package/src/generators/remove/lib/remove-project-references-in-config.js +1 -2
- package/src/generators/remove/lib/remove-project.js +1 -2
- package/src/generators/remove/lib/update-jest-config.js +1 -2
- package/src/generators/remove/lib/update-tsconfig.js +1 -2
- package/src/generators/remove/remove.js +1 -2
- package/src/generators/run-commands/run-commands.js +1 -2
- package/src/generators/utils/get-npm-package-version.js +1 -2
- package/src/generators/utils/insert-import.js +1 -2
- package/src/generators/utils/insert-statement.js +1 -2
- package/src/generators/utils/jest-config.js +1 -2
- package/src/migrations/update-16-0-0/fix-invalid-babelrc.js +1 -1
- package/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.js +1 -1
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +1 -1
- package/src/utilities/default-base.js +1 -2
- package/src/utilities/fileutils.js +4 -4
- package/src/utilities/get-import-path.js +2 -3
- package/src/utilities/ts-config.js +5 -6
- package/src/utilities/typescript/compilation.js +2 -3
- package/src/utilities/typescript/get-source-nodes.js +1 -2
- package/src/utilities/typescript.js +3 -3
- package/src/utils/cli-config-utils.js +4 -5
- package/src/utils/project-type.js +2 -2
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
package/migrations.json
CHANGED
|
@@ -80,6 +80,19 @@
|
|
|
80
80
|
"alwaysAddToPackageJson": false
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
},
|
|
84
|
+
"19.5.1": {
|
|
85
|
+
"version": "19.5.0-beta.1",
|
|
86
|
+
"x-prompt": "Do you want to update to TypeScript v5.5?",
|
|
87
|
+
"requires": {
|
|
88
|
+
"typescript": ">=5.4.0 <5.5.0"
|
|
89
|
+
},
|
|
90
|
+
"packages": {
|
|
91
|
+
"typescript": {
|
|
92
|
+
"version": "~5.5.2",
|
|
93
|
+
"alwaysAddToPackageJson": false
|
|
94
|
+
}
|
|
95
|
+
}
|
|
83
96
|
}
|
|
84
97
|
}
|
|
85
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "19.5.0-beta.
|
|
3
|
+
"version": "19.5.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
|
|
6
6
|
"repository": {
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@nx/devkit": "19.5.0-beta.
|
|
64
|
+
"@nx/devkit": "19.5.0-beta.1",
|
|
65
65
|
"chalk": "^4.1.0",
|
|
66
66
|
"enquirer": "~2.3.6",
|
|
67
67
|
"tslib": "^2.3.0",
|
|
68
68
|
"yargs-parser": "21.1.1",
|
|
69
|
-
"nx": "19.5.0-beta.
|
|
70
|
-
"@nrwl/workspace": "19.5.0-beta.
|
|
69
|
+
"nx": "19.5.0-beta.1",
|
|
70
|
+
"@nrwl/workspace": "19.5.0-beta.1"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.default = counter;
|
|
4
|
+
exports.batchCounter = batchCounter;
|
|
4
5
|
const os_1 = require("os");
|
|
5
6
|
async function wait() {
|
|
6
7
|
return new Promise((res) => {
|
|
@@ -15,7 +16,6 @@ async function* counter(opts) {
|
|
|
15
16
|
}
|
|
16
17
|
yield { success: opts.result };
|
|
17
18
|
}
|
|
18
|
-
exports.default = counter;
|
|
19
19
|
async function batchCounter(taskGraph, inputs) {
|
|
20
20
|
const result = {};
|
|
21
21
|
const results = await Promise.all(taskGraph.roots
|
|
@@ -37,4 +37,3 @@ async function batchCounter(taskGraph, inputs) {
|
|
|
37
37
|
}
|
|
38
38
|
return result;
|
|
39
39
|
}
|
|
40
|
-
exports.batchCounter = batchCounter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ciWorkflowGenerator =
|
|
3
|
+
exports.ciWorkflowGenerator = ciWorkflowGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const default_base_1 = require("../../utilities/default-base");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -15,7 +15,6 @@ async function ciWorkflowGenerator(tree, schema) {
|
|
|
15
15
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', ci), '', options);
|
|
16
16
|
await (0, devkit_1.formatFiles)(tree);
|
|
17
17
|
}
|
|
18
|
-
exports.ciWorkflowGenerator = ciWorkflowGenerator;
|
|
19
18
|
function normalizeOptions(options, tree) {
|
|
20
19
|
const { name: workflowName, fileName: workflowFileName } = (0, devkit_1.names)(options.name);
|
|
21
20
|
const packageManager = (0, devkit_1.detectPackageManager)();
|
|
@@ -32,6 +31,7 @@ function normalizeOptions(options, tree) {
|
|
|
32
31
|
...packageJson.devDependencies,
|
|
33
32
|
};
|
|
34
33
|
const hasE2E = allDependencies['@nx/cypress'] || allDependencies['@nx/playwright'];
|
|
34
|
+
const connectedToCloud = (0, nx_cloud_utils_1.isNxCloudUsed)((0, devkit_1.readJson)(tree, 'nx.json'));
|
|
35
35
|
return {
|
|
36
36
|
workflowName,
|
|
37
37
|
workflowFileName,
|
|
@@ -43,6 +43,7 @@ function normalizeOptions(options, tree) {
|
|
|
43
43
|
hasE2E,
|
|
44
44
|
nxCloudHost,
|
|
45
45
|
tmpl: '',
|
|
46
|
+
connectedToCloud,
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
function defaultBranchNeedsOriginPrefix(nxJson) {
|
|
@@ -51,15 +51,20 @@ jobs:
|
|
|
51
51
|
displayName: Install Bun
|
|
52
52
|
|
|
53
53
|
<% } %>
|
|
54
|
-
|
|
55
|
-
#
|
|
54
|
+
|
|
55
|
+
# This enables task distribution via Nx Cloud
|
|
56
|
+
# Run this command as early as possible, before dependencies are installed
|
|
57
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
|
|
58
|
+
<% if (connectedToCloud) { %>- script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
59
|
+
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
56
60
|
# - script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
57
|
-
|
|
61
|
+
<% } %>
|
|
58
62
|
- script: <%= packageManagerInstall %>
|
|
59
63
|
- script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
|
|
60
64
|
condition: eq(variables['Build.Reason'], 'PullRequest')
|
|
61
65
|
|
|
62
66
|
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
63
67
|
# - script: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
68
|
+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
|
|
64
69
|
- script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build<% if(hasE2E){ %>
|
|
65
70
|
- script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --parallel 1 e2e-ci<% } %>
|
package/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__
CHANGED
|
@@ -19,13 +19,17 @@ pipelines:
|
|
|
19
19
|
- npm install --prefix=$HOME/.local -g bun
|
|
20
20
|
|
|
21
21
|
<% } %>
|
|
22
|
-
#
|
|
23
|
-
#
|
|
22
|
+
# This enables task distribution via Nx Cloud
|
|
23
|
+
# Run this command as early as possible, before dependencies are installed
|
|
24
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
|
|
25
|
+
<% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
26
|
+
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
24
27
|
# - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
25
|
-
|
|
28
|
+
<% } %>
|
|
26
29
|
- <%= packageManagerInstall %>
|
|
27
30
|
|
|
28
31
|
- <%= packageManagerPrefix %> nx-cloud record -- nx format:check
|
|
32
|
+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
|
|
29
33
|
- <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> -t lint test build<% if(hasE2E){ %>
|
|
30
34
|
- <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> --parallel 1 -t e2e-ci<% } %>
|
|
31
35
|
|
|
@@ -35,10 +39,13 @@ pipelines:
|
|
|
35
39
|
name: 'Build and test affected apps on "<%= mainBranch %>" branch changes'
|
|
36
40
|
script:
|
|
37
41
|
- export NX_BRANCH=$BITBUCKET_BRANCH
|
|
38
|
-
#
|
|
39
|
-
#
|
|
42
|
+
# This enables task distribution via Nx Cloud
|
|
43
|
+
# Run this command as early as possible, before dependencies are installed
|
|
44
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
|
|
45
|
+
<% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
46
|
+
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
40
47
|
# - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
41
|
-
|
|
48
|
+
<% } %>
|
|
42
49
|
<% if(packageManager == 'pnpm'){ %>
|
|
43
50
|
- npm install --prefix=$HOME/.local -g pnpm@8
|
|
44
51
|
<% } %>
|
|
@@ -49,4 +56,5 @@ pipelines:
|
|
|
49
56
|
|
|
50
57
|
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
51
58
|
# - <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
59
|
+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
|
|
52
60
|
- <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> --base=HEAD~1
|
|
@@ -21,16 +21,20 @@ jobs:
|
|
|
21
21
|
<% } %>
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
#
|
|
24
|
+
# This enables task distribution via Nx Cloud
|
|
25
|
+
# Run this command as early as possible, before dependencies are installed
|
|
26
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
|
|
27
|
+
<% if (connectedToCloud) { %>- run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
28
|
+
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
26
29
|
# - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
27
|
-
|
|
30
|
+
<% } %>
|
|
28
31
|
- run: <%= packageManagerInstall %>
|
|
29
32
|
- nx/set-shas:
|
|
30
33
|
main-branch-name: '<%= mainBranch %>'
|
|
31
34
|
|
|
32
35
|
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
33
36
|
# - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
37
|
+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
|
|
34
38
|
- run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %>
|
|
35
39
|
- run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD --parallel 1 -t e2e-ci<% } %>
|
|
36
40
|
|
package/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__
CHANGED
|
@@ -28,10 +28,13 @@ jobs:
|
|
|
28
28
|
bun-version: latest
|
|
29
29
|
<% } %>
|
|
30
30
|
|
|
31
|
-
#
|
|
32
|
-
#
|
|
31
|
+
# This enables task distribution via Nx Cloud
|
|
32
|
+
# Run this command as early as possible, before dependencies are installed
|
|
33
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
|
|
34
|
+
<% if (connectedToCloud) { %>- run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
35
|
+
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
33
36
|
# - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
34
|
-
|
|
37
|
+
<% } %>
|
|
35
38
|
<% if(packageManager != 'bun'){ %>
|
|
36
39
|
# Cache node_modules
|
|
37
40
|
- uses: actions/setup-node@v3
|
|
@@ -44,5 +47,6 @@ jobs:
|
|
|
44
47
|
|
|
45
48
|
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
46
49
|
# - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
50
|
+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
|
|
47
51
|
- run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %>
|
|
48
52
|
- run: <%= packageManagerPrefix %> nx affected --parallel 1 -t e2e-ci<% } %>
|
|
@@ -15,15 +15,19 @@ variables:
|
|
|
15
15
|
<% if(packageManager == 'bun'){ %>
|
|
16
16
|
- npm install --prefix=$HOME/.local -g bun
|
|
17
17
|
<% } %>
|
|
18
|
-
#
|
|
19
|
-
#
|
|
18
|
+
# This enables task distribution via Nx Cloud
|
|
19
|
+
# Run this command as early as possible, before dependencies are installed
|
|
20
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
|
|
21
|
+
<% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
22
|
+
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
20
23
|
# - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
|
|
21
|
-
|
|
24
|
+
<% } %>
|
|
22
25
|
- <%= packageManagerInstall %>
|
|
23
26
|
- NX_HEAD=$CI_COMMIT_SHA
|
|
24
27
|
- NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
|
|
25
28
|
|
|
26
29
|
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
27
30
|
# - <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
31
|
+
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
|
|
28
32
|
- <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %>
|
|
29
33
|
- <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD --parallel 1 -t e2e-ci<% } %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.monorepoGenerator =
|
|
3
|
+
exports.monorepoGenerator = monorepoGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const move_1 = require("../move/move");
|
|
6
6
|
async function monorepoGenerator(tree, options) {
|
|
@@ -49,5 +49,4 @@ async function monorepoGenerator(tree, options) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
exports.monorepoGenerator = monorepoGenerator;
|
|
53
52
|
exports.default = monorepoGenerator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateSchema = validateSchema;
|
|
4
|
+
exports.convertToNxProjectGenerator = convertToNxProjectGenerator;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const path_1 = require("path");
|
|
6
7
|
const angular_json_1 = require("nx/src/adapter/angular-json");
|
|
@@ -23,7 +24,6 @@ async function validateSchema(schema, configName) {
|
|
|
23
24
|
schema.all = true;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
exports.validateSchema = validateSchema;
|
|
27
27
|
async function convertToNxProjectGenerator(host, schema) {
|
|
28
28
|
const configName = host.exists('angular.json')
|
|
29
29
|
? 'angular.json'
|
|
@@ -75,5 +75,4 @@ async function convertToNxProjectGenerator(host, schema) {
|
|
|
75
75
|
],
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
exports.convertToNxProjectGenerator = convertToNxProjectGenerator;
|
|
79
78
|
exports.default = convertToNxProjectGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkDestination =
|
|
3
|
+
exports.checkDestination = checkDestination;
|
|
4
4
|
/**
|
|
5
5
|
* Checks whether the destination folder is valid
|
|
6
6
|
*
|
|
@@ -18,4 +18,3 @@ function checkDestination(tree, schema, providedDestination) {
|
|
|
18
18
|
throw new Error(`${INVALID_DESTINATION} - Path is not empty.`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
exports.checkDestination = checkDestination;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createProjectConfigurationInNewDestination =
|
|
3
|
+
exports.createProjectConfigurationInNewDestination = createProjectConfigurationInNewDestination;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function createProjectConfigurationInNewDestination(tree, schema, projectConfig) {
|
|
6
6
|
projectConfig.name = schema.newProjectName;
|
|
@@ -51,4 +51,3 @@ function createProjectConfigurationInNewDestination(tree, schema, projectConfig)
|
|
|
51
51
|
// Create a new project with the root replaced
|
|
52
52
|
(0, devkit_1.addProjectConfiguration)(tree, schema.newProjectName, newProject);
|
|
53
53
|
}
|
|
54
|
-
exports.createProjectConfigurationInNewDestination = createProjectConfigurationInNewDestination;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.maybeExtractTsConfigBase = maybeExtractTsConfigBase;
|
|
4
|
+
exports.maybeExtractJestConfigBase = maybeExtractJestConfigBase;
|
|
5
|
+
exports.maybeMigrateEslintConfigIfRootProject = maybeMigrateEslintConfigIfRootProject;
|
|
4
6
|
const devkit_1 = require("@nx/devkit");
|
|
5
7
|
function maybeExtractTsConfigBase(tree) {
|
|
6
8
|
let extractTsConfigBase;
|
|
@@ -13,7 +15,6 @@ function maybeExtractTsConfigBase(tree) {
|
|
|
13
15
|
}
|
|
14
16
|
extractTsConfigBase(tree);
|
|
15
17
|
}
|
|
16
|
-
exports.maybeExtractTsConfigBase = maybeExtractTsConfigBase;
|
|
17
18
|
async function maybeExtractJestConfigBase(tree) {
|
|
18
19
|
let jestInitGenerator;
|
|
19
20
|
try {
|
|
@@ -25,7 +26,6 @@ async function maybeExtractJestConfigBase(tree) {
|
|
|
25
26
|
}
|
|
26
27
|
await jestInitGenerator(tree, {});
|
|
27
28
|
}
|
|
28
|
-
exports.maybeExtractJestConfigBase = maybeExtractJestConfigBase;
|
|
29
29
|
function maybeMigrateEslintConfigIfRootProject(tree, rootProject) {
|
|
30
30
|
let migrateConfigToMonorepoStyle;
|
|
31
31
|
try {
|
|
@@ -40,4 +40,3 @@ function maybeMigrateEslintConfigIfRootProject(tree, rootProject) {
|
|
|
40
40
|
? 'jest'
|
|
41
41
|
: 'none');
|
|
42
42
|
}
|
|
43
|
-
exports.maybeMigrateEslintConfigIfRootProject = maybeMigrateEslintConfigIfRootProject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.moveProjectFiles =
|
|
3
|
+
exports.moveProjectFiles = moveProjectFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
/**
|
|
@@ -54,4 +54,3 @@ function moveProjectFiles(tree, schema, project) {
|
|
|
54
54
|
tree.delete(file);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
exports.moveProjectFiles = moveProjectFiles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeSchema =
|
|
3
|
+
exports.normalizeSchema = normalizeSchema;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const enquirer_1 = require("enquirer");
|
|
6
6
|
const get_import_path_1 = require("../../../utilities/get-import-path");
|
|
@@ -15,7 +15,6 @@ async function normalizeSchema(tree, schema, projectConfiguration) {
|
|
|
15
15
|
relativeToRootDestination: destination,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
exports.normalizeSchema = normalizeSchema;
|
|
19
18
|
async function determineProjectNameAndRootOptions(tree, options, projectConfiguration) {
|
|
20
19
|
if (!options.projectNameAndRootFormat &&
|
|
21
20
|
(process.env.NX_INTERACTIVE !== 'true' || !isTTY())) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runAngularPlugin =
|
|
3
|
+
exports.runAngularPlugin = runAngularPlugin;
|
|
4
4
|
async function runAngularPlugin(tree, schema) {
|
|
5
5
|
let move;
|
|
6
6
|
try {
|
|
@@ -16,4 +16,3 @@ async function runAngularPlugin(tree, schema) {
|
|
|
16
16
|
newProjectName: schema.newProjectName,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
exports.runAngularPlugin = runAngularPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateBuildTargets =
|
|
3
|
+
exports.updateBuildTargets = updateBuildTargets;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* Update other references to the source project's targets
|
|
@@ -24,7 +24,6 @@ function updateBuildTargets(tree, schema) {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
exports.updateBuildTargets = updateBuildTargets;
|
|
28
27
|
function updateJsonValue(config, callback) {
|
|
29
28
|
function recur(obj, key, value) {
|
|
30
29
|
let changed = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCypressConfig =
|
|
3
|
+
exports.updateCypressConfig = updateCypressConfig;
|
|
4
4
|
const path = require("path");
|
|
5
5
|
/**
|
|
6
6
|
* Updates the videos and screenshots folders in the cypress.json/cypress.config.ts if it exists (i.e. we're moving an e2e project)
|
|
@@ -37,4 +37,3 @@ function updateCypressConfig(tree, schema, project) {
|
|
|
37
37
|
tree.write(cypressConfigPath, newContent);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
exports.updateCypressConfig = updateCypressConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateDefaultProject =
|
|
3
|
+
exports.updateDefaultProject = updateDefaultProject;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* Updates the project in the workspace file
|
|
@@ -17,4 +17,3 @@ function updateDefaultProject(tree, schema) {
|
|
|
17
17
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
exports.updateDefaultProject = updateDefaultProject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateEslintConfig =
|
|
3
|
+
exports.updateEslintConfig = updateEslintConfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* Update the .eslintrc file of the project if it exists.
|
|
@@ -30,4 +30,3 @@ function updateEslintConfig(tree, schema, project) {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
exports.updateEslintConfig = updateEslintConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateImplicitDependencies =
|
|
3
|
+
exports.updateImplicitDependencies = updateImplicitDependencies;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* @param schema The options provided to the schematic
|
|
@@ -16,4 +16,3 @@ function updateImplicitDependencies(tree, schema) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
exports.updateImplicitDependencies = updateImplicitDependencies;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateImports =
|
|
3
|
+
exports.updateImports = updateImports;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const get_import_path_1 = require("../../../utilities/get-import-path");
|
|
@@ -105,7 +105,6 @@ function updateImports(tree, schema, project) {
|
|
|
105
105
|
(0, devkit_1.writeJson)(tree, tsConfigPath, tsConfig);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
exports.updateImports = updateImports;
|
|
109
108
|
function ensureTrailingSlash(path) {
|
|
110
109
|
return path.endsWith('/') ? path : `${path}/`;
|
|
111
110
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateJestConfig =
|
|
3
|
+
exports.updateJestConfig = updateJestConfig;
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const jest_config_1 = require("../../utils/jest-config");
|
|
6
6
|
/**
|
|
@@ -46,4 +46,3 @@ function updateJestConfig(tree, schema, project) {
|
|
|
46
46
|
const newRootJestConfigContent = oldRootJestConfigContent.replace(findProject, usingJestProjects ? `` : `'<rootDir>/${schema.relativeToRootDestination}'`);
|
|
47
47
|
tree.write(rootJestConfigPath, newRootJestConfigContent);
|
|
48
48
|
}
|
|
49
|
-
exports.updateJestConfig = updateJestConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updatePackageJson =
|
|
3
|
+
exports.updatePackageJson = updatePackageJson;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
/**
|
|
@@ -21,4 +21,3 @@ function updatePackageJson(tree, schema) {
|
|
|
21
21
|
packageJson.name = schema.importPath;
|
|
22
22
|
tree.write(packageJsonPath, JSON.stringify(packageJson));
|
|
23
23
|
}
|
|
24
|
-
exports.updatePackageJson = updatePackageJson;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.updateProjectRootFiles = updateProjectRootFiles;
|
|
4
|
+
exports.updateFilesForRootProjects = updateFilesForRootProjects;
|
|
5
|
+
exports.updateFilesForNonRootProjects = updateFilesForNonRootProjects;
|
|
4
6
|
const devkit_1 = require("@nx/devkit");
|
|
5
7
|
const path = require("path");
|
|
6
8
|
const path_1 = require("path");
|
|
@@ -22,7 +24,6 @@ function updateProjectRootFiles(tree, schema, project) {
|
|
|
22
24
|
updateFilesForNonRootProjects(tree, schema, project);
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
exports.updateProjectRootFiles = updateProjectRootFiles;
|
|
26
27
|
function updateFilesForRootProjects(tree, schema, project) {
|
|
27
28
|
// Skip updating "path" and "extends" for tsconfig files since they are mostly
|
|
28
29
|
// relative to the project root. The only exception is tsconfig.json that
|
|
@@ -52,7 +53,6 @@ function updateFilesForRootProjects(tree, schema, project) {
|
|
|
52
53
|
tree.write((0, path_1.join)(schema.relativeToRootDestination, file), newContent);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
exports.updateFilesForRootProjects = updateFilesForRootProjects;
|
|
56
56
|
function updateFilesForNonRootProjects(tree, schema, project) {
|
|
57
57
|
const newRelativeRoot = path
|
|
58
58
|
.relative(path.join(devkit_1.workspaceRoot, schema.relativeToRootDestination), devkit_1.workspaceRoot)
|
|
@@ -84,4 +84,3 @@ function updateFilesForNonRootProjects(tree, schema, project) {
|
|
|
84
84
|
tree.write((0, path_1.join)(schema.relativeToRootDestination, file), newContent);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
exports.updateFilesForNonRootProjects = updateFilesForNonRootProjects;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateReadme =
|
|
3
|
+
exports.updateReadme = updateReadme;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
/**
|
|
6
6
|
* Update the README.md file of the project if it exists.
|
|
@@ -18,4 +18,3 @@ function updateReadme(tree, schema) {
|
|
|
18
18
|
const newContent = oldContent.replace(findName, schema.newProjectName);
|
|
19
19
|
tree.write(readmePath, newContent);
|
|
20
20
|
}
|
|
21
|
-
exports.updateReadme = updateReadme;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateStorybookConfig =
|
|
3
|
+
exports.updateStorybookConfig = updateStorybookConfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -27,7 +27,6 @@ function updateStorybookConfig(tree, schema, project) {
|
|
|
27
27
|
// Replace relative import path to root storybook folder for each file under project storybook
|
|
28
28
|
updateRecursively(tree, storybookDir, oldRelativeRoot, newRelativeRoot);
|
|
29
29
|
}
|
|
30
|
-
exports.updateStorybookConfig = updateStorybookConfig;
|
|
31
30
|
function updateRecursively(tree, dir, oldRoot, newRoot) {
|
|
32
31
|
for (const child of tree.children(dir)) {
|
|
33
32
|
const childPath = (0, path_1.join)(dir, child);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getDestination = getDestination;
|
|
4
|
+
exports.getNewProjectName = getNewProjectName;
|
|
5
|
+
exports.normalizePathSlashes = normalizePathSlashes;
|
|
4
6
|
const devkit_1 = require("@nx/devkit");
|
|
5
7
|
/**
|
|
6
8
|
* This helper function ensures that we don't move libs or apps
|
|
@@ -18,7 +20,6 @@ function getDestination(host, schema, project) {
|
|
|
18
20
|
}
|
|
19
21
|
return (0, devkit_1.joinPathFragments)(rootFolder, schema.destination);
|
|
20
22
|
}
|
|
21
|
-
exports.getDestination = getDestination;
|
|
22
23
|
/**
|
|
23
24
|
* Joins path segments replacing slashes with dashes
|
|
24
25
|
*
|
|
@@ -32,7 +33,6 @@ function getNewProjectName(path) {
|
|
|
32
33
|
.filter((x) => !!x)
|
|
33
34
|
.join('-');
|
|
34
35
|
}
|
|
35
|
-
exports.getNewProjectName = getNewProjectName;
|
|
36
36
|
/**
|
|
37
37
|
* Normalizes slashes (removes duplicates)
|
|
38
38
|
*
|
|
@@ -46,4 +46,3 @@ function normalizePathSlashes(input) {
|
|
|
46
46
|
.filter((x) => !!x)
|
|
47
47
|
.join('/'));
|
|
48
48
|
}
|
|
49
|
-
exports.normalizePathSlashes = normalizePathSlashes;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.moveGenerator = moveGenerator;
|
|
4
|
+
exports.moveGeneratorInternal = moveGeneratorInternal;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const check_destination_1 = require("./lib/check-destination");
|
|
6
7
|
const create_project_configuration_in_new_destination_1 = require("./lib/create-project-configuration-in-new-destination");
|
|
@@ -25,7 +26,6 @@ async function moveGenerator(tree, rawSchema) {
|
|
|
25
26
|
...rawSchema,
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
exports.moveGenerator = moveGenerator;
|
|
29
29
|
async function moveGeneratorInternal(tree, rawSchema) {
|
|
30
30
|
let projectConfig = (0, devkit_1.readProjectConfiguration)(tree, rawSchema.projectName);
|
|
31
31
|
const schema = await (0, normalize_schema_1.normalizeSchema)(tree, rawSchema, projectConfig);
|
|
@@ -59,5 +59,4 @@ async function moveGeneratorInternal(tree, rawSchema) {
|
|
|
59
59
|
await (0, devkit_1.formatFiles)(tree);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
exports.moveGeneratorInternal = moveGeneratorInternal;
|
|
63
62
|
exports.default = moveGenerator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addPresetDependencies = addPresetDependencies;
|
|
4
|
+
exports.generatePreset = generatePreset;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const presets_1 = require("../utils/presets");
|
|
6
7
|
const versions_1 = require("../../utils/versions");
|
|
@@ -12,7 +13,6 @@ function addPresetDependencies(host, options) {
|
|
|
12
13
|
const { dependencies, dev } = getPresetDependencies(options);
|
|
13
14
|
return (0, devkit_1.addDependenciesToPackageJson)(host, dependencies, dev, (0, path_1.join)(options.directory, 'package.json'));
|
|
14
15
|
}
|
|
15
|
-
exports.addPresetDependencies = addPresetDependencies;
|
|
16
16
|
function generatePreset(host, opts) {
|
|
17
17
|
const parsedArgs = yargsParser(process.argv, {
|
|
18
18
|
boolean: ['interactive'],
|
|
@@ -71,7 +71,6 @@ function generatePreset(host, opts) {
|
|
|
71
71
|
].filter((e) => !!e);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
exports.generatePreset = generatePreset;
|
|
75
74
|
function getPresetDependencies({ preset, presetVersion, bundler, e2eTestRunner, }) {
|
|
76
75
|
switch (preset) {
|
|
77
76
|
case presets_1.Preset.Apps:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateWorkspaceFiles =
|
|
3
|
+
exports.generateWorkspaceFiles = generateWorkspaceFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("../../utils/versions");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -33,7 +33,6 @@ async function generateWorkspaceFiles(tree, options) {
|
|
|
33
33
|
setUpWorkspacesInPackageJson(tree, options);
|
|
34
34
|
await (0, devkit_1.formatFiles)(tree);
|
|
35
35
|
}
|
|
36
|
-
exports.generateWorkspaceFiles = generateWorkspaceFiles;
|
|
37
36
|
function setPresetProperty(tree, options) {
|
|
38
37
|
(0, devkit_1.updateJson)(tree, (0, path_1.join)(options.directory, 'nx.json'), (json) => {
|
|
39
38
|
if (options.preset === presets_1.Preset.NPM) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newGenerator =
|
|
3
|
+
exports.newGenerator = newGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const presets_1 = require("../utils/presets");
|
|
@@ -29,7 +29,6 @@ async function newGenerator(tree, opts) {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
exports.newGenerator = newGenerator;
|
|
33
32
|
exports.default = newGenerator;
|
|
34
33
|
function validateOptions(options, host) {
|
|
35
34
|
if (options.skipInstall &&
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.npmPackageGenerator = npmPackageGenerator;
|
|
4
|
+
exports.npmPackageGeneratorInternal = npmPackageGeneratorInternal;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
6
7
|
const path_1 = require("path");
|
|
@@ -36,7 +37,6 @@ async function npmPackageGenerator(tree, options) {
|
|
|
36
37
|
...options,
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
exports.npmPackageGenerator = npmPackageGenerator;
|
|
40
40
|
async function npmPackageGeneratorInternal(tree, _options) {
|
|
41
41
|
const options = await normalizeOptions(tree, _options);
|
|
42
42
|
(0, devkit_1.addProjectConfiguration)(tree, options.name, {
|
|
@@ -50,4 +50,3 @@ async function npmPackageGeneratorInternal(tree, _options) {
|
|
|
50
50
|
}
|
|
51
51
|
await (0, devkit_1.formatFiles)(tree);
|
|
52
52
|
}
|
|
53
|
-
exports.npmPackageGeneratorInternal = npmPackageGeneratorInternal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.presetGenerator =
|
|
3
|
+
exports.presetGenerator = presetGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const presets_1 = require("../utils/presets");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -12,7 +12,6 @@ async function presetGenerator(tree, options) {
|
|
|
12
12
|
await presetTask();
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
exports.presetGenerator = presetGenerator;
|
|
16
15
|
exports.default = presetGenerator;
|
|
17
16
|
async function createPreset(tree, options) {
|
|
18
17
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkDependencies =
|
|
3
|
+
exports.checkDependencies = checkDependencies;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* Check whether the project to be removed is depended on by another project
|
|
@@ -20,4 +20,3 @@ async function checkDependencies(_, schema) {
|
|
|
20
20
|
.join('\n')}`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
exports.checkDependencies = checkDependencies;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkProjectIsSafeToRemove =
|
|
3
|
+
exports.checkProjectIsSafeToRemove = checkProjectIsSafeToRemove;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
function checkProjectIsSafeToRemove(tree, schema, project) {
|
|
@@ -22,4 +22,3 @@ function checkProjectIsSafeToRemove(tree, schema, project) {
|
|
|
22
22
|
throw new Error(`"${schema.projectName}" is a project that has nested projects within it. Removing this project would remove the following projects as well:\n - ${containedProjects.join('\n - ')}\nPass --forceRemove to remove all of the above projects`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.checkProjectIsSafeToRemove = checkProjectIsSafeToRemove;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkTargets =
|
|
3
|
+
exports.checkTargets = checkTargets;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* Check whether the project to be removed has builders targetted by another project
|
|
@@ -47,7 +47,6 @@ async function checkTargets(tree, schema) {
|
|
|
47
47
|
throw new Error(message);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
exports.checkTargets = checkTargets;
|
|
51
50
|
function checkIfProjectIsUsed(config, callback) {
|
|
52
51
|
function recur(obj, key, value) {
|
|
53
52
|
if (typeof value === 'string') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeProjectReferencesInConfig =
|
|
3
|
+
exports.removeProjectReferencesInConfig = removeProjectReferencesInConfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function removeProjectReferencesInConfig(tree, schema) {
|
|
6
6
|
// Unset default project if deleting the default project
|
|
@@ -18,4 +18,3 @@ function removeProjectReferencesInConfig(tree, schema) {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
exports.removeProjectReferencesInConfig = removeProjectReferencesInConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeProject =
|
|
3
|
+
exports.removeProject = removeProject;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
/**
|
|
6
6
|
* Removes (deletes) a project's files from the folder tree
|
|
@@ -11,4 +11,3 @@ function removeProject(tree, project) {
|
|
|
11
11
|
});
|
|
12
12
|
tree.delete(project.root);
|
|
13
13
|
}
|
|
14
|
-
exports.removeProject = removeProject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateJestConfig =
|
|
3
|
+
exports.updateJestConfig = updateJestConfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const get_source_nodes_1 = require("../../../utilities/typescript/get-source-nodes");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -73,4 +73,3 @@ function updateJestConfig(tree, schema, projectConfig) {
|
|
|
73
73
|
},
|
|
74
74
|
]));
|
|
75
75
|
}
|
|
76
|
-
exports.updateJestConfig = updateJestConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTsconfig =
|
|
3
|
+
exports.updateTsconfig = updateTsconfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const ts_config_1 = require("../../../utilities/ts-config");
|
|
6
6
|
const find_project_for_path_1 = require("nx/src/project-graph/utils/find-project-for-path");
|
|
@@ -28,4 +28,3 @@ async function updateTsconfig(tree, schema) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.updateTsconfig = updateTsconfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeGenerator =
|
|
3
|
+
exports.removeGenerator = removeGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const check_project_is_safe_to_remove_1 = require("./lib/check-project-is-safe-to-remove");
|
|
6
6
|
const check_dependencies_1 = require("./lib/check-dependencies");
|
|
@@ -22,5 +22,4 @@ async function removeGenerator(tree, schema) {
|
|
|
22
22
|
await (0, devkit_1.formatFiles)(tree);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.removeGenerator = removeGenerator;
|
|
26
25
|
exports.default = removeGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runCommandsGenerator =
|
|
3
|
+
exports.runCommandsGenerator = runCommandsGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
async function runCommandsGenerator(host, schema) {
|
|
6
6
|
const project = (0, devkit_1.readProjectConfiguration)(host, schema.project);
|
|
@@ -21,5 +21,4 @@ async function runCommandsGenerator(host, schema) {
|
|
|
21
21
|
(0, devkit_1.updateProjectConfiguration)(host, schema.project, project);
|
|
22
22
|
await (0, devkit_1.formatFiles)(host);
|
|
23
23
|
}
|
|
24
|
-
exports.runCommandsGenerator = runCommandsGenerator;
|
|
25
24
|
exports.default = runCommandsGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNpmPackageVersion =
|
|
3
|
+
exports.getNpmPackageVersion = getNpmPackageVersion;
|
|
4
4
|
function getNpmPackageVersion(packageName, packageVersion) {
|
|
5
5
|
try {
|
|
6
6
|
const version = require('child_process').execSync(`npm view ${packageName}${packageVersion ? '@' + packageVersion : ''} version --json`, { stdio: ['pipe', 'pipe', 'ignore'] });
|
|
@@ -18,4 +18,3 @@ function getNpmPackageVersion(packageName, packageVersion) {
|
|
|
18
18
|
catch (err) { }
|
|
19
19
|
return packageVersion ?? null;
|
|
20
20
|
}
|
|
21
|
-
exports.getNpmPackageVersion = getNpmPackageVersion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertImport =
|
|
3
|
+
exports.insertImport = insertImport;
|
|
4
4
|
const insert_statement_1 = require("./insert-statement");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const typescript_1 = require("../../utilities/typescript");
|
|
@@ -44,4 +44,3 @@ function insertImport(tree, path, name, modulePath) {
|
|
|
44
44
|
]);
|
|
45
45
|
tree.write(path, newContents);
|
|
46
46
|
}
|
|
47
|
-
exports.insertImport = insertImport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertStatement =
|
|
3
|
+
exports.insertStatement = insertStatement;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const typescript_1 = require("../../utilities/typescript");
|
|
6
6
|
let tsModule;
|
|
@@ -30,4 +30,3 @@ function insertStatement(tree, path, statement) {
|
|
|
30
30
|
]);
|
|
31
31
|
tree.write(path, newContents);
|
|
32
32
|
}
|
|
33
|
-
exports.insertStatement = insertStatement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findRootJestConfig =
|
|
3
|
+
exports.findRootJestConfig = findRootJestConfig;
|
|
4
4
|
function findRootJestConfig(tree) {
|
|
5
5
|
if (tree.exists('jest.config.js')) {
|
|
6
6
|
return 'jest.config.js';
|
|
@@ -10,4 +10,3 @@ function findRootJestConfig(tree) {
|
|
|
10
10
|
}
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
exports.findRootJestConfig = findRootJestConfig;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
3
4
|
const devkit_1 = require("@nx/devkit");
|
|
4
5
|
function update(tree) {
|
|
5
6
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
@@ -38,4 +39,3 @@ function update(tree) {
|
|
|
38
39
|
(0, devkit_1.writeJson)(tree, babelRcPath, babelRc);
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
exports.default = update;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
3
4
|
const devkit_1 = require("@nx/devkit");
|
|
4
5
|
// nx-ignore-next-line
|
|
5
6
|
const path = require("path");
|
|
@@ -25,7 +26,6 @@ async function default_1(tree) {
|
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
|
-
exports.default = default_1;
|
|
29
29
|
async function moveWorkspaceGeneratorsToLocalPlugin(tree) {
|
|
30
30
|
const tasks = [];
|
|
31
31
|
let project = (0, devkit_1.getProjects)(tree).get(PROJECT_NAME);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = replacePackage;
|
|
3
4
|
const devkit_1 = require("@nx/devkit");
|
|
4
5
|
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
5
6
|
async function replacePackage(tree) {
|
|
6
7
|
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/workspace', '@nx/workspace');
|
|
7
8
|
await (0, devkit_1.formatFiles)(tree);
|
|
8
9
|
}
|
|
9
|
-
exports.default = replacePackage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deduceDefaultBase =
|
|
3
|
+
exports.deduceDefaultBase = deduceDefaultBase;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
function deduceDefaultBase() {
|
|
6
6
|
const nxDefaultBase = 'main';
|
|
@@ -12,4 +12,3 @@ function deduceDefaultBase() {
|
|
|
12
12
|
return nxDefaultBase;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
exports.deduceDefaultBase = deduceDefaultBase;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createDirectory = exports.isRelativePath = exports.directoryExists = exports.fileExists = void 0;
|
|
4
|
+
exports.updateJsonFile = updateJsonFile;
|
|
5
|
+
exports.copyFile = copyFile;
|
|
6
|
+
exports.renameSync = renameSync;
|
|
4
7
|
const fs_1 = require("fs");
|
|
5
8
|
const path_1 = require("path");
|
|
6
9
|
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
@@ -21,7 +24,6 @@ function updateJsonFile(path, callback) {
|
|
|
21
24
|
callback(json);
|
|
22
25
|
(0, fileutils_1.writeJsonFile)(path, json);
|
|
23
26
|
}
|
|
24
|
-
exports.updateJsonFile = updateJsonFile;
|
|
25
27
|
function copyFile(file, target) {
|
|
26
28
|
const f = (0, path_1.basename)(file);
|
|
27
29
|
const source = (0, fs_1.createReadStream)(file);
|
|
@@ -29,7 +31,6 @@ function copyFile(file, target) {
|
|
|
29
31
|
source.pipe(dest);
|
|
30
32
|
source.on('error', (e) => console.error(e));
|
|
31
33
|
}
|
|
32
|
-
exports.copyFile = copyFile;
|
|
33
34
|
function renameSync(from, to, cb) {
|
|
34
35
|
try {
|
|
35
36
|
if (!(0, fs_1.existsSync)(from)) {
|
|
@@ -48,4 +49,3 @@ function renameSync(from, to, cb) {
|
|
|
48
49
|
cb(e);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
exports.renameSync = renameSync;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getImportPath = getImportPath;
|
|
4
|
+
exports.getNpmScope = getNpmScope;
|
|
4
5
|
const json_1 = require("nx/src/generators/utils/json");
|
|
5
6
|
function getImportPath(tree, projectDirectory) {
|
|
6
7
|
const npmScope = getNpmScope(tree);
|
|
@@ -8,7 +9,6 @@ function getImportPath(tree, projectDirectory) {
|
|
|
8
9
|
? `${npmScope === '@' ? '' : '@'}${npmScope}/${projectDirectory}`
|
|
9
10
|
: projectDirectory;
|
|
10
11
|
}
|
|
11
|
-
exports.getImportPath = getImportPath;
|
|
12
12
|
function getNpmScope(tree) {
|
|
13
13
|
const { name } = tree.exists('package.json')
|
|
14
14
|
? (0, json_1.readJson)(tree, 'package.json')
|
|
@@ -17,4 +17,3 @@ function getNpmScope(tree) {
|
|
|
17
17
|
return name.split('/')[0].substring(1);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
exports.getNpmScope = getNpmScope;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.readTsConfig = readTsConfig;
|
|
4
|
+
exports.getRootTsConfigPathInTree = getRootTsConfigPathInTree;
|
|
5
|
+
exports.getRelativePathToRootTsConfig = getRelativePathToRootTsConfig;
|
|
6
|
+
exports.getRootTsConfigFileName = getRootTsConfigFileName;
|
|
7
|
+
exports.findNodes = findNodes;
|
|
4
8
|
const devkit_1 = require("@nx/devkit");
|
|
5
9
|
const fs_1 = require("fs");
|
|
6
10
|
const path_1 = require("path");
|
|
@@ -13,7 +17,6 @@ function readTsConfig(tsConfigPath) {
|
|
|
13
17
|
const readResult = tsModule.readConfigFile(tsConfigPath, tsModule.sys.readFile);
|
|
14
18
|
return tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, (0, path_1.dirname)(tsConfigPath));
|
|
15
19
|
}
|
|
16
|
-
exports.readTsConfig = readTsConfig;
|
|
17
20
|
function getRootTsConfigPathInTree(tree) {
|
|
18
21
|
for (const path of ['tsconfig.base.json', 'tsconfig.json']) {
|
|
19
22
|
if (tree.exists(path)) {
|
|
@@ -22,11 +25,9 @@ function getRootTsConfigPathInTree(tree) {
|
|
|
22
25
|
}
|
|
23
26
|
return 'tsconfig.base.json';
|
|
24
27
|
}
|
|
25
|
-
exports.getRootTsConfigPathInTree = getRootTsConfigPathInTree;
|
|
26
28
|
function getRelativePathToRootTsConfig(tree, targetPath) {
|
|
27
29
|
return (0, devkit_1.offsetFromRoot)(targetPath) + getRootTsConfigPathInTree(tree);
|
|
28
30
|
}
|
|
29
|
-
exports.getRelativePathToRootTsConfig = getRelativePathToRootTsConfig;
|
|
30
31
|
function getRootTsConfigFileName() {
|
|
31
32
|
for (const tsConfigName of ['tsconfig.base.json', 'tsconfig.json']) {
|
|
32
33
|
const tsConfigPath = (0, path_1.join)(devkit_1.workspaceRoot, tsConfigName);
|
|
@@ -36,7 +37,6 @@ function getRootTsConfigFileName() {
|
|
|
36
37
|
}
|
|
37
38
|
return null;
|
|
38
39
|
}
|
|
39
|
-
exports.getRootTsConfigFileName = getRootTsConfigFileName;
|
|
40
40
|
function findNodes(node, kind, max = Infinity) {
|
|
41
41
|
if (!node || max == 0) {
|
|
42
42
|
return [];
|
|
@@ -64,4 +64,3 @@ function findNodes(node, kind, max = Infinity) {
|
|
|
64
64
|
}
|
|
65
65
|
return arr;
|
|
66
66
|
}
|
|
67
|
-
exports.findNodes = findNodes;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.compileTypeScript = compileTypeScript;
|
|
4
|
+
exports.compileTypeScriptWatcher = compileTypeScriptWatcher;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
const ts_config_1 = require("../ts-config");
|
|
@@ -14,7 +15,6 @@ function compileTypeScript(options) {
|
|
|
14
15
|
}
|
|
15
16
|
return createProgram(tsConfig, normalizedOptions);
|
|
16
17
|
}
|
|
17
|
-
exports.compileTypeScript = compileTypeScript;
|
|
18
18
|
function compileTypeScriptWatcher(options, callback) {
|
|
19
19
|
if (!tsModule) {
|
|
20
20
|
tsModule = (0, typescript_1.ensureTypescript)();
|
|
@@ -43,7 +43,6 @@ function compileTypeScriptWatcher(options, callback) {
|
|
|
43
43
|
};
|
|
44
44
|
return tsModule.createWatchProgram(host);
|
|
45
45
|
}
|
|
46
|
-
exports.compileTypeScriptWatcher = compileTypeScriptWatcher;
|
|
47
46
|
function mergeCustomTransformers(originalCustomTransformers, consumerCustomTransformers) {
|
|
48
47
|
if (!consumerCustomTransformers)
|
|
49
48
|
return originalCustomTransformers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSourceNodes =
|
|
3
|
+
exports.getSourceNodes = getSourceNodes;
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This function will be removed from @nx/workspace in version 17. Prefer importing from @nx/js.
|
|
6
6
|
*/
|
|
@@ -18,4 +18,3 @@ function getSourceNodes(sourceFile) {
|
|
|
18
18
|
}
|
|
19
19
|
return result;
|
|
20
20
|
}
|
|
21
|
-
exports.getSourceNodes = getSourceNodes;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSourceNodes = exports.compileTypeScript = void 0;
|
|
4
|
+
exports.resolveModuleByImport = resolveModuleByImport;
|
|
5
|
+
exports.ensureTypescript = ensureTypescript;
|
|
4
6
|
const devkit_1 = require("@nx/devkit");
|
|
5
7
|
const path_1 = require("path");
|
|
6
8
|
const versions_1 = require("../utils/versions");
|
|
@@ -42,7 +44,6 @@ function resolveModuleByImport(importExpr, filePath, tsConfigPath) {
|
|
|
42
44
|
return resolvedModule.resolvedFileName.replace(`${normalizedAppRoot}/`, '');
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
exports.resolveModuleByImport = resolveModuleByImport;
|
|
46
47
|
function getCompilerHost(tsConfigPath) {
|
|
47
48
|
const options = readTsConfigOptions(tsConfigPath);
|
|
48
49
|
const host = tsModule.createCompilerHost(options, true);
|
|
@@ -52,4 +53,3 @@ function getCompilerHost(tsConfigPath) {
|
|
|
52
53
|
function ensureTypescript() {
|
|
53
54
|
return (0, devkit_1.ensurePackage)('typescript', versions_1.typescriptVersion);
|
|
54
55
|
}
|
|
55
|
-
exports.ensureTypescript = ensureTypescript;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getWorkspacePath = getWorkspacePath;
|
|
4
|
+
exports.parseTarget = parseTarget;
|
|
5
|
+
exports.editTarget = editTarget;
|
|
6
|
+
exports.serializeTarget = serializeTarget;
|
|
4
7
|
/**
|
|
5
8
|
* @deprecated Nx no longer supports workspace.json
|
|
6
9
|
*/
|
|
@@ -8,7 +11,6 @@ function getWorkspacePath(host) {
|
|
|
8
11
|
const possibleFiles = ['/angular.json', '/workspace.json'];
|
|
9
12
|
return possibleFiles.filter((path) => host.exists(path))[0];
|
|
10
13
|
}
|
|
11
|
-
exports.getWorkspacePath = getWorkspacePath;
|
|
12
14
|
function parseTarget(targetString) {
|
|
13
15
|
const [project, target, config] = targetString.split(':');
|
|
14
16
|
return {
|
|
@@ -17,16 +19,13 @@ function parseTarget(targetString) {
|
|
|
17
19
|
config,
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
|
-
exports.parseTarget = parseTarget;
|
|
21
22
|
function editTarget(targetString, callback) {
|
|
22
23
|
const parsedTarget = parseTarget(targetString);
|
|
23
24
|
return serializeTarget(callback(parsedTarget));
|
|
24
25
|
}
|
|
25
|
-
exports.editTarget = editTarget;
|
|
26
26
|
/**
|
|
27
27
|
* @deprecated use the utility from nx/src/utils instead
|
|
28
28
|
*/
|
|
29
29
|
function serializeTarget({ project, target, config }) {
|
|
30
30
|
return [project, target, config].filter((part) => !!part).join(':');
|
|
31
31
|
}
|
|
32
|
-
exports.serializeTarget = serializeTarget;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProjectType = void 0;
|
|
4
|
+
exports.projectRootDir = projectRootDir;
|
|
4
5
|
var ProjectType;
|
|
5
6
|
(function (ProjectType) {
|
|
6
7
|
ProjectType["Application"] = "application";
|
|
@@ -14,4 +15,3 @@ function projectRootDir(projectType) {
|
|
|
14
15
|
return 'libs';
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
exports.projectRootDir = projectRootDir;
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const typescriptVersion = "~5.
|
|
3
|
-
export declare const angularCliVersion = "~18.
|
|
2
|
+
export declare const typescriptVersion = "~5.5.2";
|
|
3
|
+
export declare const angularCliVersion = "~18.1.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularCliVersion = exports.typescriptVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.typescriptVersion = '~5.
|
|
5
|
+
exports.typescriptVersion = '~5.5.2';
|
|
6
6
|
// TODO: remove when preset generation is reworked and
|
|
7
7
|
// deps are not installed from workspace
|
|
8
|
-
exports.angularCliVersion = '~18.
|
|
8
|
+
exports.angularCliVersion = '~18.1.0';
|