@nx/workspace 23.2.0-beta.4 → 23.2.0-beta.6
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/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/src/core/file-utils.d.ts +2 -1
- package/dist/src/core/file-utils.js +12 -2
- package/dist/src/core/project-graph.d.ts +2 -1
- package/dist/src/core/project-graph.js +11 -2
- package/dist/src/generators/ci-workflow/ci-workflow.js +4 -3
- package/dist/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +3 -2
- package/dist/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ +7 -5
- package/dist/src/generators/ci-workflow/files/ci-config/.nx/ci-config.yaml__tmpl__ +9 -0
- package/dist/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ +3 -2
- package/dist/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +3 -2
- package/dist/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ +3 -2
- package/dist/src/generators/convert-to-nx-project/convert-to-nx-project.js +3 -3
- package/dist/src/generators/infer-targets/infer-targets.js +2 -4
- package/dist/src/generators/new/generate-preset.js +2 -2
- package/dist/src/generators/new/generate-workspace-files.js +5 -6
- package/dist/src/generators/new/new.d.ts +1 -1
- package/dist/src/generators/remove/lib/update-tsconfig.js +3 -3
- package/dist/src/tasks-runner/cache.d.ts +1 -1
- package/dist/src/tasks-runner/cache.js +2 -2
- package/dist/src/tasks-runner/default-tasks-runner.d.ts +2 -1
- package/dist/src/tasks-runner/default-tasks-runner.js +5 -2
- package/dist/src/tasks-runner/life-cycle.d.ts +2 -1
- package/dist/src/tasks-runner/life-cycle.js +2 -2
- package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts +1 -1
- package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +3 -2
- package/dist/src/tasks-runner/tasks-runner.d.ts +1 -1
- package/dist/src/tasks-runner/tasks-runner.js +0 -2
- package/dist/src/tasks-runner/utils.d.ts +2 -1
- package/dist/src/tasks-runner/utils.js +30 -2
- package/dist/src/utilities/app-root.d.ts +2 -1
- package/dist/src/utilities/app-root.js +6 -2
- package/dist/src/utilities/fileutils.d.ts +1 -1
- package/dist/src/utilities/fileutils.js +9 -8
- package/dist/src/utilities/get-import-path.d.ts +1 -1
- package/dist/src/utilities/get-import-path.js +2 -2
- package/dist/src/utilities/output.d.ts +2 -1
- package/dist/src/utilities/output.js +5 -2
- package/dist/src/utilities/package-manager-workspaces.js +2 -2
- package/dist/src/utilities/typescript/ts-solution-setup.js +2 -2
- package/dist/src/utils/versions.d.ts +1 -1
- package/dist/src/utils/versions.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { ProjectType, projectRootDir } from './src/utils/project-type';
|
|
|
3
3
|
export { renameSync, updateJsonFile, copyFile, createDirectory, } from './src/utilities/fileutils';
|
|
4
4
|
export { names } from '@nx/devkit';
|
|
5
5
|
export { output } from './src/utilities/output';
|
|
6
|
-
export { readPackageJson } from 'nx/
|
|
6
|
+
export { readPackageJson } from '@nx/devkit/internal';
|
|
7
7
|
export { getWorkspacePath, editTarget, parseTarget, serializeTarget, } from './src/utils/cli-config-utils';
|
|
8
8
|
export { Linter } from './src/utils/lint';
|
|
9
9
|
export { moveGenerator } from './src/generators/move/move';
|
package/dist/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var devkit_1 = require("@nx/devkit");
|
|
|
15
15
|
Object.defineProperty(exports, "names", { enumerable: true, get: function () { return devkit_1.names; } });
|
|
16
16
|
var output_1 = require("./src/utilities/output");
|
|
17
17
|
Object.defineProperty(exports, "output", { enumerable: true, get: function () { return output_1.output; } });
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "readPackageJson", { enumerable: true, get: function () { return
|
|
18
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
19
|
+
Object.defineProperty(exports, "readPackageJson", { enumerable: true, get: function () { return internal_1.readPackageJson; } });
|
|
20
20
|
var cli_config_utils_1 = require("./src/utils/cli-config-utils");
|
|
21
21
|
Object.defineProperty(exports, "getWorkspacePath", { enumerable: true, get: function () { return cli_config_utils_1.getWorkspacePath; } });
|
|
22
22
|
Object.defineProperty(exports, "editTarget", { enumerable: true, get: function () { return cli_config_utils_1.editTarget; } });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { FileData } from '@nx/devkit';
|
|
2
|
+
export { Change, DeletedFileChange, FileChange, LockFileChange, TEN_MEGABYTES, WholeFileChange, calculateFileChanges, defaultFileRead, isDeletedFileChange, isLockFileChange, isWholeFileChange, readPackageJson, } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.readPackageJson = exports.isWholeFileChange = exports.isLockFileChange = exports.isDeletedFileChange = exports.defaultFileRead = exports.calculateFileChanges = exports.WholeFileChange = exports.TEN_MEGABYTES = exports.LockFileChange = exports.DeletedFileChange = void 0;
|
|
4
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
Object.defineProperty(exports, "DeletedFileChange", { enumerable: true, get: function () { return internal_1.DeletedFileChange; } });
|
|
6
|
+
Object.defineProperty(exports, "LockFileChange", { enumerable: true, get: function () { return internal_1.LockFileChange; } });
|
|
7
|
+
Object.defineProperty(exports, "TEN_MEGABYTES", { enumerable: true, get: function () { return internal_1.TEN_MEGABYTES; } });
|
|
8
|
+
Object.defineProperty(exports, "WholeFileChange", { enumerable: true, get: function () { return internal_1.WholeFileChange; } });
|
|
9
|
+
Object.defineProperty(exports, "calculateFileChanges", { enumerable: true, get: function () { return internal_1.calculateFileChanges; } });
|
|
10
|
+
Object.defineProperty(exports, "defaultFileRead", { enumerable: true, get: function () { return internal_1.defaultFileRead; } });
|
|
11
|
+
Object.defineProperty(exports, "isDeletedFileChange", { enumerable: true, get: function () { return internal_1.isDeletedFileChange; } });
|
|
12
|
+
Object.defineProperty(exports, "isLockFileChange", { enumerable: true, get: function () { return internal_1.isLockFileChange; } });
|
|
13
|
+
Object.defineProperty(exports, "isWholeFileChange", { enumerable: true, get: function () { return internal_1.isWholeFileChange; } });
|
|
14
|
+
Object.defineProperty(exports, "readPackageJson", { enumerable: true, get: function () { return internal_1.readPackageJson; } });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { createProjectGraphAsync, readCachedProjectGraph, readProjectsConfigurationFromProjectGraph, } from '@nx/devkit';
|
|
2
|
+
export { buildProjectGraphAndSourceMapsWithoutDaemon, createProjectGraphAndSourceMapsAsync, handleProjectGraphError, preventRecursionInGraphConstruction, readCachedProjectConfiguration, } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.readCachedProjectConfiguration = exports.preventRecursionInGraphConstruction = exports.handleProjectGraphError = exports.createProjectGraphAndSourceMapsAsync = exports.buildProjectGraphAndSourceMapsWithoutDaemon = exports.readProjectsConfigurationFromProjectGraph = exports.readCachedProjectGraph = exports.createProjectGraphAsync = void 0;
|
|
4
|
+
var devkit_1 = require("@nx/devkit");
|
|
5
|
+
Object.defineProperty(exports, "createProjectGraphAsync", { enumerable: true, get: function () { return devkit_1.createProjectGraphAsync; } });
|
|
6
|
+
Object.defineProperty(exports, "readCachedProjectGraph", { enumerable: true, get: function () { return devkit_1.readCachedProjectGraph; } });
|
|
7
|
+
Object.defineProperty(exports, "readProjectsConfigurationFromProjectGraph", { enumerable: true, get: function () { return devkit_1.readProjectsConfigurationFromProjectGraph; } });
|
|
8
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
9
|
+
Object.defineProperty(exports, "buildProjectGraphAndSourceMapsWithoutDaemon", { enumerable: true, get: function () { return internal_1.buildProjectGraphAndSourceMapsWithoutDaemon; } });
|
|
10
|
+
Object.defineProperty(exports, "createProjectGraphAndSourceMapsAsync", { enumerable: true, get: function () { return internal_1.createProjectGraphAndSourceMapsAsync; } });
|
|
11
|
+
Object.defineProperty(exports, "handleProjectGraphError", { enumerable: true, get: function () { return internal_1.handleProjectGraphError; } });
|
|
12
|
+
Object.defineProperty(exports, "preventRecursionInGraphConstruction", { enumerable: true, get: function () { return internal_1.preventRecursionInGraphConstruction; } });
|
|
13
|
+
Object.defineProperty(exports, "readCachedProjectConfiguration", { enumerable: true, get: function () { return internal_1.readCachedProjectConfiguration; } });
|
|
@@ -4,8 +4,8 @@ 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");
|
|
7
|
-
const nx_cloud_utils_1 = require("nx/src/utils/nx-cloud-utils");
|
|
8
7
|
const ts_solution_setup_1 = require("../../utilities/typescript/ts-solution-setup");
|
|
8
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
9
9
|
function getNxCloudRecordCommand(ci, packageManagerPrefix) {
|
|
10
10
|
const baseCommand = `${packageManagerPrefix} nx record -- echo Hello World`;
|
|
11
11
|
const prefix = getCiPrefix(ci);
|
|
@@ -100,6 +100,7 @@ async function ciWorkflowGenerator(tree, schema) {
|
|
|
100
100
|
appendOriginPrefix(nxJson);
|
|
101
101
|
}
|
|
102
102
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', ci), '', options);
|
|
103
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', 'ci-config'), '', options);
|
|
103
104
|
addWorkflowFileToSharedGlobals(nxJson, schema.ci, options.workflowFileName);
|
|
104
105
|
(0, devkit_1.writeJson)(tree, 'nx.json', nxJson);
|
|
105
106
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -110,7 +111,7 @@ function normalizeOptions(options, tree) {
|
|
|
110
111
|
const { exec: packageManagerPrefix, ciInstall: packageManagerInstall, dlx: packageManagerPreInstallPrefix, } = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
111
112
|
let nxCloudHost = 'nx.app';
|
|
112
113
|
try {
|
|
113
|
-
const nxCloudUrl = (0,
|
|
114
|
+
const nxCloudUrl = (0, internal_1.getNxCloudUrl)((0, devkit_1.readJson)(tree, 'nx.json'));
|
|
114
115
|
nxCloudHost = new URL(nxCloudUrl).host;
|
|
115
116
|
}
|
|
116
117
|
catch { }
|
|
@@ -123,7 +124,7 @@ function normalizeOptions(options, tree) {
|
|
|
123
124
|
const hasPlaywright = allDependencies['@nx/playwright'];
|
|
124
125
|
const hasE2E = hasCypress || hasPlaywright;
|
|
125
126
|
const hasTypecheck = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
|
126
|
-
const connectedToCloud = (0,
|
|
127
|
+
const connectedToCloud = (0, internal_1.isNxCloudUsed)((0, devkit_1.readJson)(tree, 'nx.json'));
|
|
127
128
|
const mainBranch = (0, default_base_1.deduceDefaultBase)();
|
|
128
129
|
const commands = getCiCommands(options.ci, packageManagerPrefix, mainBranch, hasTypecheck, hasE2E, options.useRunMany ?? false);
|
|
129
130
|
const branchCommands = options.ci === 'bitbucket-pipelines'
|
|
@@ -55,9 +55,10 @@ jobs:
|
|
|
55
55
|
|
|
56
56
|
# This enables task distribution via Nx Cloud
|
|
57
57
|
# Run this command as early as possible, before dependencies are installed
|
|
58
|
-
#
|
|
58
|
+
# Configure Nx Agents and task distribution in .nx/ci-config.yaml
|
|
59
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
59
60
|
<% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %>
|
|
60
|
-
# - script: <%= packageManagerPreInstallPrefix %> nx start-
|
|
61
|
+
# - script: <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
61
62
|
|
|
62
63
|
- script: <%= packageManagerInstall %><% if(hasCypress){ %>
|
|
63
64
|
- script: <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %>
|
package/dist/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__
CHANGED
|
@@ -21,9 +21,10 @@ pipelines:
|
|
|
21
21
|
<% } %>
|
|
22
22
|
# This enables task distribution via Nx Cloud
|
|
23
23
|
# Run this command as early as possible, before dependencies are installed
|
|
24
|
-
#
|
|
24
|
+
# Configure Nx Agents and task distribution in .nx/ci-config.yaml
|
|
25
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
25
26
|
<% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %>
|
|
26
|
-
# - <%= packageManagerPreInstallPrefix %> nx start-
|
|
27
|
+
# - <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
27
28
|
|
|
28
29
|
- <%= packageManagerInstall %><% if(hasCypress){ %>
|
|
29
30
|
- <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %>
|
|
@@ -48,10 +49,11 @@ pipelines:
|
|
|
48
49
|
- export NX_BRANCH=$BITBUCKET_BRANCH
|
|
49
50
|
# This enables task distribution via Nx Cloud
|
|
50
51
|
# Run this command as early as possible, before dependencies are installed
|
|
51
|
-
#
|
|
52
|
-
|
|
52
|
+
# Configure Nx Agents and task distribution in .nx/ci-config.yaml
|
|
53
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
54
|
+
<% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
53
55
|
<% } else { %># Connect your workspace by running "nx connect" and uncomment this
|
|
54
|
-
# - <%= packageManagerPreInstallPrefix %> nx start-
|
|
56
|
+
# - <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
55
57
|
<% } %>
|
|
56
58
|
<% if(packageManager == 'pnpm'){ %>
|
|
57
59
|
- npm install --prefix=$HOME/.local -g pnpm@11
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Nx Cloud reads this file to configure your CI Pipeline Executions.
|
|
2
|
+
# Uncomment the "nx start-nx-agents" line in your CI workflow to distribute tasks across agents.
|
|
3
|
+
# Learn how to start Nx Agents at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
4
|
+
# Learn how to configure this file at https://nx.dev/ci/reference/nx-cloud/ci-config
|
|
5
|
+
dte:
|
|
6
|
+
distribute-on: 3 linux-medium-js
|
|
7
|
+
lifecycle:
|
|
8
|
+
stop-after:
|
|
9
|
+
- <% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>
|
|
@@ -23,9 +23,10 @@ jobs:
|
|
|
23
23
|
|
|
24
24
|
# This enables task distribution via Nx Cloud
|
|
25
25
|
# Run this command as early as possible, before dependencies are installed
|
|
26
|
-
#
|
|
26
|
+
# Configure Nx Agents and task distribution in .nx/ci-config.yaml
|
|
27
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
27
28
|
<% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %>
|
|
28
|
-
# - run: <%= packageManagerPreInstallPrefix %> nx start-
|
|
29
|
+
# - run: <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
29
30
|
|
|
30
31
|
- run: <%= packageManagerInstall %><% if(hasCypress){ %>
|
|
31
32
|
- run: <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %>
|
|
@@ -34,9 +34,10 @@ jobs:
|
|
|
34
34
|
<% } %>
|
|
35
35
|
# This enables task distribution via Nx Cloud
|
|
36
36
|
# Run this command as early as possible, before dependencies are installed
|
|
37
|
-
#
|
|
37
|
+
# Configure Nx Agents and task distribution in .nx/ci-config.yaml
|
|
38
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
38
39
|
<% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %>
|
|
39
|
-
# - run: <%= packageManagerPreInstallPrefix %> nx start-
|
|
40
|
+
# - run: <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
40
41
|
|
|
41
42
|
<% if(packageManager !== 'bun'){ %>
|
|
42
43
|
# Cache node_modules
|
|
@@ -18,9 +18,10 @@ variables:
|
|
|
18
18
|
<% } %>
|
|
19
19
|
# This enables task distribution via Nx Cloud
|
|
20
20
|
# Run this command as early as possible, before dependencies are installed
|
|
21
|
-
#
|
|
21
|
+
# Configure Nx Agents and task distribution in .nx/ci-config.yaml
|
|
22
|
+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#nx-cloud-start-nx-agents
|
|
22
23
|
<% if (connectedToCloud) { %># Uncomment this line to enable task distribution<% } else { %># Connect your workspace by running "nx connect" and uncomment this line to enable task distribution<% } %>
|
|
23
|
-
# - <%= packageManagerPreInstallPrefix %> nx start-
|
|
24
|
+
# - <%= packageManagerPreInstallPrefix %> nx start-nx-agents
|
|
24
25
|
|
|
25
26
|
- <%= packageManagerInstall %><% if(hasCypress){ %>
|
|
26
27
|
- <%= packageManagerPrefix %> cypress install<% } %><% if(hasPlaywright){ %>
|
|
@@ -4,8 +4,8 @@ exports.validateSchema = validateSchema;
|
|
|
4
4
|
exports.convertToNxProjectGenerator = convertToNxProjectGenerator;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
-
const angular_json_1 = require("nx/src/adapter/angular-json");
|
|
8
7
|
const output_1 = require("../../utils/output");
|
|
8
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
9
9
|
async function validateSchema(schema, configName) {
|
|
10
10
|
if (schema.project && schema.all) {
|
|
11
11
|
throw new Error('--project and --all are mutually exclusive');
|
|
@@ -31,7 +31,7 @@ async function convertToNxProjectGenerator(host, schema) {
|
|
|
31
31
|
if (!host.exists(configName))
|
|
32
32
|
return;
|
|
33
33
|
await validateSchema(schema, configName);
|
|
34
|
-
const projects = (0,
|
|
34
|
+
const projects = (0, internal_1.toNewFormat)((0, devkit_1.readJson)(host, configName)).projects;
|
|
35
35
|
const leftOverProjects = {};
|
|
36
36
|
for (const projectName of Object.keys(projects)) {
|
|
37
37
|
const config = projects[projectName];
|
|
@@ -60,7 +60,7 @@ async function convertToNxProjectGenerator(host, schema) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
if (Object.keys(leftOverProjects).length > 0) {
|
|
63
|
-
(0, devkit_1.writeJson)(host, 'angular.json', (0,
|
|
63
|
+
(0, devkit_1.writeJson)(host, 'angular.json', (0, internal_1.toOldFormat)({ version: 1, projects: leftOverProjects }));
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
66
66
|
host.delete(configName);
|
|
@@ -4,8 +4,6 @@ exports.convertToInferredGenerator = convertToInferredGenerator;
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const enquirer_1 = require("enquirer");
|
|
7
|
-
const generator_utils_1 = require("nx/src/command-line/generate/generator-utils");
|
|
8
|
-
const installed_plugins_1 = require("nx/src/utils/plugins/installed-plugins");
|
|
9
7
|
async function convertToInferredGenerator(tree, options) {
|
|
10
8
|
const generatorCollectionChoices = await getPossibleConvertToInferredGenerators();
|
|
11
9
|
if (generatorCollectionChoices.size === 0) {
|
|
@@ -85,13 +83,13 @@ async function convertToInferredGenerator(tree, options) {
|
|
|
85
83
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
86
84
|
}
|
|
87
85
|
async function getPossibleConvertToInferredGenerators() {
|
|
88
|
-
const installedCollections = Array.from(new Set((0,
|
|
86
|
+
const installedCollections = Array.from(new Set((0, internal_1.findInstalledPlugins)().map((x) => x.name)));
|
|
89
87
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
90
88
|
const projectsConfigurations = (0, devkit_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
|
91
89
|
const choices = new Map();
|
|
92
90
|
for (const collectionName of installedCollections) {
|
|
93
91
|
try {
|
|
94
|
-
const generator = (0,
|
|
92
|
+
const generator = (0, internal_1.getGeneratorInformation)(collectionName, 'convert-to-inferred', devkit_1.workspaceRoot, projectsConfigurations.projects);
|
|
95
93
|
if (generator.generatorConfiguration.hidden ||
|
|
96
94
|
generator.generatorConfiguration['x-deprecated']) {
|
|
97
95
|
continue;
|
|
@@ -10,7 +10,7 @@ const get_npm_package_version_1 = require("../utils/get-npm-package-version");
|
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const yargs_parser_1 = tslib_1.__importDefault(require("yargs-parser"));
|
|
12
12
|
const child_process_1 = require("child_process");
|
|
13
|
-
const
|
|
13
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
14
14
|
function addPresetDependencies(host, options) {
|
|
15
15
|
const { dependencies, dev } = getPresetDependencies(options);
|
|
16
16
|
return (0, devkit_1.addDependenciesToPackageJson)(host, dependencies, dev, (0, path_1.join)(options.directory, 'package.json'), true);
|
|
@@ -28,7 +28,7 @@ function generatePreset(host, opts) {
|
|
|
28
28
|
cwd: newWorkspaceRoot,
|
|
29
29
|
};
|
|
30
30
|
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
31
|
-
const nxInstallationPaths = (0,
|
|
31
|
+
const nxInstallationPaths = (0, internal_1.getNxRequirePaths)(newWorkspaceRoot);
|
|
32
32
|
const nxBinForNewWorkspaceRoot = require.resolve('nx/bin/nx', {
|
|
33
33
|
paths: nxInstallationPaths,
|
|
34
34
|
});
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateWorkspaceFiles = generateWorkspaceFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const url_shorten_1 = require("nx/src/nx-cloud/utilities/url-shorten");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
6
|
const path_1 = require("path");
|
|
8
7
|
const semver_1 = require("semver");
|
|
9
8
|
const default_base_1 = require("../../utilities/default-base");
|
|
10
9
|
const versions_1 = require("../../utils/versions");
|
|
11
10
|
const presets_1 = require("../utils/presets");
|
|
12
|
-
const
|
|
11
|
+
const internal_2 = require("@nx/devkit/internal");
|
|
13
12
|
// map from the preset to the name of the plugin s.t. the README can have a more
|
|
14
13
|
// meaningful generator command.
|
|
15
14
|
const presetToPluginMap = {
|
|
@@ -127,7 +126,7 @@ async function generateWorkspaceFiles(tree, options) {
|
|
|
127
126
|
createFiles(tree, options);
|
|
128
127
|
const nxJson = createNxJson(tree, options);
|
|
129
128
|
const token = options.nxCloud !== 'skip'
|
|
130
|
-
? await (0,
|
|
129
|
+
? await (0, internal_1.connectToNxCloud)(tree, {
|
|
131
130
|
installationSource: 'create-nx-workspace',
|
|
132
131
|
directory: options.directory,
|
|
133
132
|
github: options.useGitHub,
|
|
@@ -136,7 +135,7 @@ async function generateWorkspaceFiles(tree, options) {
|
|
|
136
135
|
await createReadme(tree, options, token);
|
|
137
136
|
let aiAgentsCallback = undefined;
|
|
138
137
|
if (options.aiAgents && options.aiAgents.length > 0) {
|
|
139
|
-
aiAgentsCallback = await (0,
|
|
138
|
+
aiAgentsCallback = await (0, internal_2.setupAiAgentsGenerator)(tree, {
|
|
140
139
|
directory: options.directory,
|
|
141
140
|
writeNxCloudRules: options.nxCloud !== 'skip',
|
|
142
141
|
packageVersion: 'latest',
|
|
@@ -239,7 +238,7 @@ async function createReadme(tree, { name, appName, directory, preset, nxCloud, w
|
|
|
239
238
|
generateLibCmd: null,
|
|
240
239
|
};
|
|
241
240
|
const nxCloudOnboardingUrl = nxCloudToken
|
|
242
|
-
? await (0,
|
|
241
|
+
? await (0, internal_1.createNxCloudOnboardingURL)('readme', nxCloudToken, undefined, false)
|
|
243
242
|
: null;
|
|
244
243
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files-readme'), directory, {
|
|
245
244
|
formattedNames,
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateTsconfig = updateTsconfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const ts_config_1 = require("../../../utilities/ts-config");
|
|
6
|
-
const find_project_for_path_1 = require("nx/src/project-graph/utils/find-project-for-path");
|
|
7
6
|
const ts_solution_setup_1 = require("../../../utilities/typescript/ts-solution-setup");
|
|
8
7
|
const path_1 = require("path");
|
|
8
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
9
9
|
/**
|
|
10
10
|
* Updates the tsconfig paths to remove the project.
|
|
11
11
|
*
|
|
@@ -18,7 +18,7 @@ async function updateTsconfig(tree, schema) {
|
|
|
18
18
|
: (0, ts_config_1.getRootTsConfigPathInTree)(tree);
|
|
19
19
|
if (tree.exists(tsConfigPath)) {
|
|
20
20
|
const graph = await (0, devkit_1.createProjectGraphAsync)();
|
|
21
|
-
const projectMapping = (0,
|
|
21
|
+
const projectMapping = (0, internal_1.createProjectRootMappings)(graph.nodes);
|
|
22
22
|
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
23
23
|
if (isUsingTsSolution) {
|
|
24
24
|
const projectConfigs = (0, devkit_1.readProjectsConfigurationFromProjectGraph)(graph);
|
|
@@ -32,7 +32,7 @@ async function updateTsconfig(tree, schema) {
|
|
|
32
32
|
for (const importPath in json.compilerOptions.paths) {
|
|
33
33
|
for (const path of json.compilerOptions.paths[importPath]) {
|
|
34
34
|
const normalized = (0, devkit_1.normalizePath)(path).replace(/^\.\//, '');
|
|
35
|
-
const project = (0,
|
|
35
|
+
const project = (0, internal_1.findProjectForPath)(normalized, projectMapping);
|
|
36
36
|
if (project === schema.projectName) {
|
|
37
37
|
delete json.compilerOptions.paths[importPath];
|
|
38
38
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CachedResult, TaskWithCachedResult, Cache
|
|
1
|
+
export { CachedResult, TaskWithCachedResult, Cache } from '@nx/devkit/internal';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Cache = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return
|
|
4
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return internal_1.Cache; } });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { DefaultTasksRunnerOptions, RemoteCache, defaultTasksRunner, } from '@nx/devkit';
|
|
2
|
+
export { RemoteCacheV2 } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.RemoteCacheV2 = exports.defaultTasksRunner = void 0;
|
|
4
|
+
var devkit_1 = require("@nx/devkit");
|
|
5
|
+
Object.defineProperty(exports, "defaultTasksRunner", { enumerable: true, get: function () { return devkit_1.defaultTasksRunner; } });
|
|
6
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
Object.defineProperty(exports, "RemoteCacheV2", { enumerable: true, get: function () { return internal_1.RemoteCacheV2; } });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { CompositeLifeCycle, TaskMetadata,
|
|
1
|
+
export { CompositeLifeCycle, TaskMetadata, LifeCycle, } from '@nx/devkit/internal';
|
|
2
|
+
export { TaskResult } from '@nx/devkit';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CompositeLifeCycle = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "CompositeLifeCycle", { enumerable: true, get: function () { return
|
|
4
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
Object.defineProperty(exports, "CompositeLifeCycle", { enumerable: true, get: function () { return internal_1.CompositeLifeCycle; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { createRunManyDynamicOutputRenderer } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.createRunManyDynamicOutputRenderer = void 0;
|
|
4
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
Object.defineProperty(exports, "createRunManyDynamicOutputRenderer", { enumerable: true, get: function () { return internal_1.createRunManyDynamicOutputRenderer; } });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { TaskStatus, TasksRunner } from '@nx/devkit/internal';
|
|
2
2
|
export { Task } from '@nx/devkit';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { getOutputsForTargetAndConfiguration } from '@nx/devkit';
|
|
2
|
+
export { DependsOnEntryLocation, NormalizedTargetDependencyConfig, calculateReverseDeps, createTaskId, expandDependencyConfigSyntaxSugar, expandInitiatingTasksThroughNoop, expandWildcardTargetConfiguration, getCliPath, getCustomHasher, getDependencyConfigs, getExecutorForTask, getExecutorNameForTask, getOutputs, getPrintableCommandArgsForTask, getSerializedArgsForTask, getTargetConfigurationForTask, getUnparsedOverrideArgs, interpolate, isCacheableTask, normalizeDependencyConfigDefinition, normalizeDependencyConfigProjects, normalizeTargetDependencyWithStringProjects, readProjectAndTargetFromTargetString, removeTasksFromTaskGraph, shouldStreamOutput, transformLegacyOutputs, unparse, validateOutputs, } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.validateOutputs = exports.unparse = exports.transformLegacyOutputs = exports.shouldStreamOutput = exports.removeTasksFromTaskGraph = exports.readProjectAndTargetFromTargetString = exports.normalizeTargetDependencyWithStringProjects = exports.normalizeDependencyConfigProjects = exports.normalizeDependencyConfigDefinition = exports.isCacheableTask = exports.interpolate = exports.getUnparsedOverrideArgs = exports.getTargetConfigurationForTask = exports.getSerializedArgsForTask = exports.getPrintableCommandArgsForTask = exports.getOutputs = exports.getExecutorNameForTask = exports.getExecutorForTask = exports.getDependencyConfigs = exports.getCustomHasher = exports.getCliPath = exports.expandWildcardTargetConfiguration = exports.expandInitiatingTasksThroughNoop = exports.expandDependencyConfigSyntaxSugar = exports.createTaskId = exports.calculateReverseDeps = exports.getOutputsForTargetAndConfiguration = void 0;
|
|
4
|
+
var devkit_1 = require("@nx/devkit");
|
|
5
|
+
Object.defineProperty(exports, "getOutputsForTargetAndConfiguration", { enumerable: true, get: function () { return devkit_1.getOutputsForTargetAndConfiguration; } });
|
|
6
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
Object.defineProperty(exports, "calculateReverseDeps", { enumerable: true, get: function () { return internal_1.calculateReverseDeps; } });
|
|
8
|
+
Object.defineProperty(exports, "createTaskId", { enumerable: true, get: function () { return internal_1.createTaskId; } });
|
|
9
|
+
Object.defineProperty(exports, "expandDependencyConfigSyntaxSugar", { enumerable: true, get: function () { return internal_1.expandDependencyConfigSyntaxSugar; } });
|
|
10
|
+
Object.defineProperty(exports, "expandInitiatingTasksThroughNoop", { enumerable: true, get: function () { return internal_1.expandInitiatingTasksThroughNoop; } });
|
|
11
|
+
Object.defineProperty(exports, "expandWildcardTargetConfiguration", { enumerable: true, get: function () { return internal_1.expandWildcardTargetConfiguration; } });
|
|
12
|
+
Object.defineProperty(exports, "getCliPath", { enumerable: true, get: function () { return internal_1.getCliPath; } });
|
|
13
|
+
Object.defineProperty(exports, "getCustomHasher", { enumerable: true, get: function () { return internal_1.getCustomHasher; } });
|
|
14
|
+
Object.defineProperty(exports, "getDependencyConfigs", { enumerable: true, get: function () { return internal_1.getDependencyConfigs; } });
|
|
15
|
+
Object.defineProperty(exports, "getExecutorForTask", { enumerable: true, get: function () { return internal_1.getExecutorForTask; } });
|
|
16
|
+
Object.defineProperty(exports, "getExecutorNameForTask", { enumerable: true, get: function () { return internal_1.getExecutorNameForTask; } });
|
|
17
|
+
Object.defineProperty(exports, "getOutputs", { enumerable: true, get: function () { return internal_1.getOutputs; } });
|
|
18
|
+
Object.defineProperty(exports, "getPrintableCommandArgsForTask", { enumerable: true, get: function () { return internal_1.getPrintableCommandArgsForTask; } });
|
|
19
|
+
Object.defineProperty(exports, "getSerializedArgsForTask", { enumerable: true, get: function () { return internal_1.getSerializedArgsForTask; } });
|
|
20
|
+
Object.defineProperty(exports, "getTargetConfigurationForTask", { enumerable: true, get: function () { return internal_1.getTargetConfigurationForTask; } });
|
|
21
|
+
Object.defineProperty(exports, "getUnparsedOverrideArgs", { enumerable: true, get: function () { return internal_1.getUnparsedOverrideArgs; } });
|
|
22
|
+
Object.defineProperty(exports, "interpolate", { enumerable: true, get: function () { return internal_1.interpolate; } });
|
|
23
|
+
Object.defineProperty(exports, "isCacheableTask", { enumerable: true, get: function () { return internal_1.isCacheableTask; } });
|
|
24
|
+
Object.defineProperty(exports, "normalizeDependencyConfigDefinition", { enumerable: true, get: function () { return internal_1.normalizeDependencyConfigDefinition; } });
|
|
25
|
+
Object.defineProperty(exports, "normalizeDependencyConfigProjects", { enumerable: true, get: function () { return internal_1.normalizeDependencyConfigProjects; } });
|
|
26
|
+
Object.defineProperty(exports, "normalizeTargetDependencyWithStringProjects", { enumerable: true, get: function () { return internal_1.normalizeTargetDependencyWithStringProjects; } });
|
|
27
|
+
Object.defineProperty(exports, "readProjectAndTargetFromTargetString", { enumerable: true, get: function () { return internal_1.readProjectAndTargetFromTargetString; } });
|
|
28
|
+
Object.defineProperty(exports, "removeTasksFromTaskGraph", { enumerable: true, get: function () { return internal_1.removeTasksFromTaskGraph; } });
|
|
29
|
+
Object.defineProperty(exports, "shouldStreamOutput", { enumerable: true, get: function () { return internal_1.shouldStreamOutput; } });
|
|
30
|
+
Object.defineProperty(exports, "transformLegacyOutputs", { enumerable: true, get: function () { return internal_1.transformLegacyOutputs; } });
|
|
31
|
+
Object.defineProperty(exports, "unparse", { enumerable: true, get: function () { return internal_1.unparse; } });
|
|
32
|
+
Object.defineProperty(exports, "validateOutputs", { enumerable: true, get: function () { return internal_1.validateOutputs; } });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { workspaceRoot } from '@nx/devkit';
|
|
2
|
+
export { setWorkspaceRoot, workspaceRootInner } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.workspaceRootInner = exports.setWorkspaceRoot = exports.workspaceRoot = void 0;
|
|
4
|
+
var devkit_1 = require("@nx/devkit");
|
|
5
|
+
Object.defineProperty(exports, "workspaceRoot", { enumerable: true, get: function () { return devkit_1.workspaceRoot; } });
|
|
6
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
Object.defineProperty(exports, "setWorkspaceRoot", { enumerable: true, get: function () { return internal_1.setWorkspaceRoot; } });
|
|
8
|
+
Object.defineProperty(exports, "workspaceRootInner", { enumerable: true, get: function () { return internal_1.workspaceRootInner; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fileExists, directoryExists, isRelativePath, createDirectory } from 'nx/
|
|
1
|
+
import { fileExists, directoryExists, isRelativePath, createDirectory } from '@nx/devkit/internal';
|
|
2
2
|
export { fileExists, directoryExists, isRelativePath, createDirectory };
|
|
3
3
|
/**
|
|
4
4
|
* This method is specifically for updating a JSON file using the filesystem
|
|
@@ -6,11 +6,12 @@ exports.copyFile = copyFile;
|
|
|
6
6
|
exports.renameSync = renameSync;
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "
|
|
12
|
-
Object.defineProperty(exports, "
|
|
13
|
-
Object.defineProperty(exports, "
|
|
9
|
+
const devkit_1 = require("@nx/devkit");
|
|
10
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
11
|
+
Object.defineProperty(exports, "fileExists", { enumerable: true, get: function () { return internal_1.fileExists; } });
|
|
12
|
+
Object.defineProperty(exports, "directoryExists", { enumerable: true, get: function () { return internal_1.directoryExists; } });
|
|
13
|
+
Object.defineProperty(exports, "isRelativePath", { enumerable: true, get: function () { return internal_1.isRelativePath; } });
|
|
14
|
+
Object.defineProperty(exports, "createDirectory", { enumerable: true, get: function () { return internal_1.createDirectory; } });
|
|
14
15
|
/**
|
|
15
16
|
* This method is specifically for updating a JSON file using the filesystem
|
|
16
17
|
*
|
|
@@ -20,9 +21,9 @@ Object.defineProperty(exports, "createDirectory", { enumerable: true, get: funct
|
|
|
20
21
|
* @param callback Manipulation of the JSON data
|
|
21
22
|
*/
|
|
22
23
|
function updateJsonFile(path, callback) {
|
|
23
|
-
const json = (0,
|
|
24
|
+
const json = (0, devkit_1.readJsonFile)(path);
|
|
24
25
|
callback(json);
|
|
25
|
-
(0,
|
|
26
|
+
(0, devkit_1.writeJsonFile)(path, json);
|
|
26
27
|
}
|
|
27
28
|
function copyFile(file, target) {
|
|
28
29
|
const f = (0, path_1.basename)(file);
|
|
@@ -41,7 +42,7 @@ function renameSync(from, to, cb) {
|
|
|
41
42
|
}
|
|
42
43
|
// Make sure parent path exists
|
|
43
44
|
const parentPath = (0, path_1.resolve)(to, '..');
|
|
44
|
-
(0,
|
|
45
|
+
(0, internal_1.createDirectory)(parentPath);
|
|
45
46
|
(0, fs_1.renameSync)(from, to);
|
|
46
47
|
cb(null);
|
|
47
48
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getImportPath = getImportPath;
|
|
4
4
|
exports.getNpmScope = getNpmScope;
|
|
5
|
-
const
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
function getImportPath(tree, projectDirectory) {
|
|
7
7
|
const npmScope = getNpmScope(tree);
|
|
8
8
|
return npmScope
|
|
@@ -11,7 +11,7 @@ function getImportPath(tree, projectDirectory) {
|
|
|
11
11
|
}
|
|
12
12
|
function getNpmScope(tree) {
|
|
13
13
|
const { name } = tree.exists('package.json')
|
|
14
|
-
? (0,
|
|
14
|
+
? (0, devkit_1.readJson)(tree, 'package.json')
|
|
15
15
|
: { name: null };
|
|
16
16
|
if (name?.startsWith('@')) {
|
|
17
17
|
return name.split('/')[0].substring(1);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { output } from '@nx/devkit';
|
|
2
|
+
export { CLIErrorMessageConfig, CLINoteMessageConfig, CLISuccessMessageConfig, CLIWarnMessageConfig, orange, } from '@nx/devkit/internal';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.orange = exports.output = void 0;
|
|
4
|
+
var devkit_1 = require("@nx/devkit");
|
|
5
|
+
Object.defineProperty(exports, "output", { enumerable: true, get: function () { return devkit_1.output; } });
|
|
6
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
Object.defineProperty(exports, "orange", { enumerable: true, get: function () { return internal_1.orange; } });
|
|
@@ -6,7 +6,7 @@ exports.isUsingPackageManagerWorkspaces = isUsingPackageManagerWorkspaces;
|
|
|
6
6
|
exports.isWorkspacesEnabled = isWorkspacesEnabled;
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const posix_1 = require("node:path/posix");
|
|
9
|
-
const
|
|
9
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
10
10
|
const picomatch = require("picomatch");
|
|
11
11
|
function isProjectIncludedInPackageManagerWorkspaces(tree, projectRoot) {
|
|
12
12
|
if (!isUsingPackageManagerWorkspaces(tree)) {
|
|
@@ -16,7 +16,7 @@ function isProjectIncludedInPackageManagerWorkspaces(tree, projectRoot) {
|
|
|
16
16
|
return patterns.some((p) => picomatch(p)((0, posix_1.join)(projectRoot, 'package.json')));
|
|
17
17
|
}
|
|
18
18
|
function getPackageManagerWorkspacesPatterns(tree) {
|
|
19
|
-
return (0,
|
|
19
|
+
return (0, internal_1.getGlobPatternsFromPackageManagerWorkspaces)(tree.root, (path) => (0, devkit_1.readJson)(tree, path, { expectComments: true }), (path) => {
|
|
20
20
|
const content = tree.read(path, 'utf-8');
|
|
21
21
|
const { load } = require('@zkochan/js-yaml');
|
|
22
22
|
return load(content, { filename: path });
|
|
@@ -4,8 +4,8 @@ exports.isUsingTsSolutionSetup = isUsingTsSolutionSetup;
|
|
|
4
4
|
exports.addProjectToTsSolutionWorkspace = addProjectToTsSolutionWorkspace;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const posix_1 = require("node:path/posix");
|
|
7
|
-
const tree_1 = require("nx/src/generators/tree");
|
|
8
7
|
const package_manager_workspaces_1 = require("../package-manager-workspaces");
|
|
8
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
9
9
|
/**
|
|
10
10
|
* The TS solution setup requires:
|
|
11
11
|
* - `tsconfig.base.json`: TS config with common compiler options needed by the
|
|
@@ -51,7 +51,7 @@ function isWorkspaceSetupWithTsSolution(tree) {
|
|
|
51
51
|
return true;
|
|
52
52
|
}
|
|
53
53
|
function isUsingTsSolutionSetup(tree) {
|
|
54
|
-
tree ??= new
|
|
54
|
+
tree ??= new internal_1.FsTree(devkit_1.workspaceRoot, false);
|
|
55
55
|
return ((0, package_manager_workspaces_1.isUsingPackageManagerWorkspaces)(tree) &&
|
|
56
56
|
isWorkspaceSetupWithTsSolution(tree));
|
|
57
57
|
}
|
|
@@ -9,4 +9,4 @@ exports.nxVersion = require((0, path_1.join)('@nx/workspace', 'package.json')).v
|
|
|
9
9
|
exports.typescriptVersion = '~6.0.3';
|
|
10
10
|
// TODO: remove when preset generation is reworked and
|
|
11
11
|
// deps are not installed from workspace
|
|
12
|
-
exports.angularCliVersion = '~22.
|
|
12
|
+
exports.angularCliVersion = '~22.1.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"semver": "^7.6.3",
|
|
86
86
|
"tslib": "^2.3.0",
|
|
87
87
|
"yargs-parser": "21.1.1",
|
|
88
|
-
"nx": "23.2.0-beta.
|
|
89
|
-
"@nx/devkit": "23.2.0-beta.
|
|
88
|
+
"nx": "23.2.0-beta.6",
|
|
89
|
+
"@nx/devkit": "23.2.0-beta.6"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"nx": "23.2.0-beta.
|
|
92
|
+
"nx": "23.2.0-beta.6"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"access": "public"
|