nx 21.0.0-beta.0 → 21.0.0-beta.2
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/.eslintrc.json +5 -1
- package/package.json +12 -12
- package/release/index.d.ts +1 -1
- package/release/index.js +2 -1
- package/schemas/nx-schema.json +186 -35
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +3 -0
- package/src/command-line/add/add.js +6 -16
- package/src/command-line/affected/command-object.js +6 -6
- package/src/command-line/examples.js +0 -4
- package/src/command-line/exec/command-object.js +1 -1
- package/src/command-line/generate/generator-utils.js +8 -3
- package/src/command-line/import/import.js +1 -1
- package/src/command-line/init/command-object.js +18 -6
- package/src/command-line/init/configure-plugins.d.ts +6 -7
- package/src/command-line/init/configure-plugins.js +47 -35
- package/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
- package/src/command-line/init/implementation/add-nx-to-turborepo.js +49 -0
- package/src/command-line/init/implementation/check-compatible-with-plugins.js +7 -1
- package/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
- package/src/command-line/init/implementation/deduce-default-base.js +53 -0
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +6 -4
- package/src/command-line/init/implementation/react/index.d.ts +1 -1
- package/src/command-line/init/implementation/react/index.js +32 -185
- package/src/command-line/init/implementation/react/write-vite-config.js +19 -3
- package/src/command-line/init/implementation/utils.d.ts +4 -1
- package/src/command-line/init/implementation/utils.js +108 -44
- package/src/command-line/init/init-v1.js +1 -1
- package/src/command-line/init/init-v2.d.ts +1 -0
- package/src/command-line/init/init-v2.js +68 -38
- package/src/command-line/migrate/migrate.js +21 -18
- package/src/command-line/nx-commands.js +19 -5
- package/src/command-line/register/command-object.d.ts +6 -0
- package/src/command-line/{activate-powerpack → register}/command-object.js +9 -9
- package/src/command-line/register/register.d.ts +2 -0
- package/src/command-line/register/register.js +9 -0
- package/src/command-line/release/changelog.js +18 -15
- package/src/command-line/release/command-object.d.ts +2 -0
- package/src/command-line/release/command-object.js +9 -0
- package/src/command-line/release/config/config.d.ts +8 -7
- package/src/command-line/release/config/config.js +129 -42
- package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
- package/src/command-line/release/config/use-legacy-versioning.js +9 -0
- package/src/command-line/release/index.d.ts +4 -0
- package/src/command-line/release/index.js +6 -1
- package/src/command-line/release/plan-check.js +6 -3
- package/src/command-line/release/plan.js +7 -3
- package/src/command-line/release/publish.js +7 -3
- package/src/command-line/release/release.js +8 -3
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
- package/src/command-line/release/utils/git.d.ts +3 -2
- package/src/command-line/release/utils/git.js +65 -9
- package/src/command-line/release/utils/github.js +3 -1
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
- package/src/command-line/release/utils/semver.d.ts +8 -0
- package/src/command-line/release/utils/semver.js +8 -0
- package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
- package/src/command-line/release/utils/shared-legacy.js +2 -0
- package/src/command-line/release/utils/shared.d.ts +11 -17
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
- package/src/command-line/release/version/project-logger.d.ts +8 -0
- package/src/command-line/release/version/project-logger.js +45 -0
- package/src/command-line/release/version/release-group-processor.d.ts +251 -0
- package/src/command-line/release/version/release-group-processor.js +1040 -0
- package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
- package/src/command-line/release/version/resolve-current-version.js +241 -0
- package/src/command-line/release/version/test-utils.d.ts +95 -0
- package/src/command-line/release/version/test-utils.js +416 -0
- package/src/command-line/release/version/topological-sort.d.ts +9 -0
- package/src/command-line/release/version/topological-sort.js +41 -0
- package/src/command-line/release/version/version-actions.d.ts +170 -0
- package/src/command-line/release/version/version-actions.js +183 -0
- package/src/command-line/release/version-legacy.d.ts +46 -0
- package/src/command-line/release/version-legacy.js +453 -0
- package/src/command-line/release/version.d.ts +0 -40
- package/src/command-line/release/version.js +80 -262
- package/src/command-line/report/report.d.ts +7 -3
- package/src/command-line/report/report.js +52 -18
- package/src/command-line/run/command-object.js +2 -2
- package/src/command-line/run/run.js +1 -1
- package/src/command-line/run-many/command-object.js +2 -2
- package/src/command-line/yargs-utils/shared-options.d.ts +4 -0
- package/src/command-line/yargs-utils/shared-options.js +20 -0
- package/src/config/nx-json.d.ts +153 -15
- package/src/config/project-graph.d.ts +4 -2
- package/src/config/project-graph.js +8 -0
- package/src/config/workspace-json-project-json.d.ts +2 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/runtime.js +1 -1
- package/src/core/graph/styles.css +2 -2
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +2 -0
- package/src/daemon/client/client.js +15 -0
- package/src/daemon/message-types/glob.d.ts +7 -0
- package/src/daemon/message-types/glob.js +9 -1
- package/src/daemon/message-types/hash-glob.d.ts +6 -0
- package/src/daemon/message-types/hash-glob.js +9 -1
- package/src/daemon/server/handle-glob.d.ts +1 -0
- package/src/daemon/server/handle-glob.js +8 -0
- package/src/daemon/server/handle-hash-glob.d.ts +1 -0
- package/src/daemon/server/handle-hash-glob.js +8 -0
- package/src/daemon/server/logger.js +2 -1
- package/src/daemon/server/server.js +7 -0
- package/src/devkit-internals.d.ts +2 -1
- package/src/devkit-internals.js +4 -1
- package/src/executors/run-commands/run-commands.impl.d.ts +3 -5
- package/src/executors/run-commands/run-commands.impl.js +14 -42
- package/src/executors/run-commands/running-tasks.d.ts +7 -5
- package/src/executors/run-commands/running-tasks.js +64 -27
- package/src/executors/run-script/run-script.impl.js +3 -3
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +8 -0
- package/src/generators/testing-utils/create-tree.js +5 -1
- package/src/native/index.d.ts +93 -19
- package/src/native/native-bindings.js +6 -0
- package/src/native/nx.wasi-browser.js +20 -19
- package/src/native/nx.wasi.cjs +20 -19
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/nx-cloud-tasks-runner-shell.js +3 -3
- package/src/plugins/js/lock-file/lock-file.js +28 -13
- package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
- package/src/plugins/js/lock-file/utils/package-json.js +2 -1
- package/src/plugins/js/lock-file/yarn-parser.js +85 -39
- package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +10 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +59 -6
- package/src/plugins/js/utils/packages.js +22 -3
- package/src/plugins/js/utils/register.js +1 -0
- package/src/plugins/js/utils/typescript.js +3 -3
- package/src/plugins/package-json/create-nodes.js +3 -1
- package/src/project-graph/affected/locators/project-glob-changes.js +2 -2
- package/src/project-graph/error-types.js +32 -2
- package/src/project-graph/nx-deps-cache.js +7 -2
- package/src/project-graph/plugins/get-plugins.js +2 -1
- package/src/project-graph/plugins/in-process-loader.js +1 -1
- package/src/project-graph/plugins/isolation/plugin-worker.js +12 -6
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts +2 -1
- package/src/project-graph/plugins/loaded-nx-plugin.js +3 -7
- package/src/project-graph/plugins/utils.d.ts +2 -2
- package/src/project-graph/plugins/utils.js +2 -2
- package/src/project-graph/project-graph.js +5 -2
- package/src/project-graph/utils/project-configuration-utils.d.ts +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +25 -11
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
- package/src/project-graph/utils/retrieve-workspace-files.js +14 -18
- package/src/tasks-runner/batch/batch-messages.d.ts +2 -0
- package/src/tasks-runner/batch/run-batch.js +2 -3
- package/src/tasks-runner/cache.d.ts +20 -6
- package/src/tasks-runner/cache.js +104 -20
- package/src/tasks-runner/create-task-graph.d.ts +1 -1
- package/src/tasks-runner/create-task-graph.js +12 -11
- package/src/tasks-runner/default-tasks-runner.js +4 -13
- package/src/tasks-runner/forked-process-task-runner.d.ts +6 -3
- package/src/tasks-runner/forked-process-task-runner.js +29 -28
- package/src/tasks-runner/init-tasks-runner.d.ts +15 -1
- package/src/tasks-runner/init-tasks-runner.js +55 -2
- package/src/tasks-runner/is-tui-enabled.d.ts +2 -0
- package/src/tasks-runner/is-tui-enabled.js +58 -0
- package/src/tasks-runner/life-cycle.d.ts +10 -3
- package/src/tasks-runner/life-cycle.js +23 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +7 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +6 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +17 -0
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +221 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +10 -7
- package/src/tasks-runner/pseudo-terminal.js +37 -35
- package/src/tasks-runner/run-command.d.ts +1 -0
- package/src/tasks-runner/run-command.js +180 -23
- package/src/tasks-runner/task-env.d.ts +1 -4
- package/src/tasks-runner/task-env.js +2 -0
- package/src/tasks-runner/task-orchestrator.d.ts +21 -9
- package/src/tasks-runner/task-orchestrator.js +126 -44
- package/src/tasks-runner/utils.d.ts +2 -2
- package/src/tasks-runner/utils.js +15 -11
- package/src/utils/child-process.d.ts +4 -0
- package/src/utils/child-process.js +23 -30
- package/src/utils/command-line-utils.d.ts +1 -1
- package/src/utils/find-matching-projects.js +2 -2
- package/src/utils/handle-errors.js +15 -0
- package/src/utils/is-ci.js +4 -1
- package/src/utils/is-using-prettier.d.ts +3 -0
- package/src/utils/is-using-prettier.js +62 -0
- package/src/utils/nx-key.d.ts +7 -0
- package/src/utils/nx-key.js +52 -0
- package/src/utils/package-manager.js +2 -2
- package/src/utils/path.js +1 -1
- package/src/utils/require-nx-key.d.ts +1 -0
- package/src/utils/require-nx-key.js +22 -0
- package/src/utils/workspace-context.d.ts +2 -0
- package/src/utils/workspace-context.js +16 -0
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +0 -2
- package/src/command-line/activate-powerpack/activate-powerpack.js +0 -34
- package/src/command-line/activate-powerpack/command-object.d.ts +0 -6
- package/src/command-line/init/implementation/react/write-craco-config.d.ts +0 -1
- package/src/command-line/init/implementation/react/write-craco-config.js +0 -61
- package/src/utils/powerpack.d.ts +0 -5
- package/src/utils/powerpack.js +0 -33
@@ -10,8 +10,10 @@ exports.getLockFileDependencies = getLockFileDependencies;
|
|
10
10
|
exports.lockFileExists = lockFileExists;
|
11
11
|
exports.getLockFileName = getLockFileName;
|
12
12
|
exports.createLockFile = createLockFile;
|
13
|
-
const
|
14
|
-
const
|
13
|
+
const node_child_process_1 = require("node:child_process");
|
14
|
+
const node_fs_1 = require("node:fs");
|
15
|
+
const node_path_1 = require("node:path");
|
16
|
+
const semver_1 = require("semver");
|
15
17
|
const package_manager_1 = require("../../../utils/package-manager");
|
16
18
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
17
19
|
const output_1 = require("../../../utils/output");
|
@@ -25,23 +27,26 @@ const YARN_LOCK_FILE = 'yarn.lock';
|
|
25
27
|
const NPM_LOCK_FILE = 'package-lock.json';
|
26
28
|
const PNPM_LOCK_FILE = 'pnpm-lock.yaml';
|
27
29
|
const BUN_LOCK_FILE = 'bun.lockb';
|
30
|
+
const BUN_TEXT_LOCK_FILE = 'bun.lock';
|
28
31
|
exports.LOCKFILES = [
|
29
32
|
YARN_LOCK_FILE,
|
30
33
|
NPM_LOCK_FILE,
|
31
34
|
PNPM_LOCK_FILE,
|
32
35
|
BUN_LOCK_FILE,
|
36
|
+
BUN_TEXT_LOCK_FILE,
|
33
37
|
];
|
34
|
-
const YARN_LOCK_PATH = (0,
|
35
|
-
const NPM_LOCK_PATH = (0,
|
36
|
-
const PNPM_LOCK_PATH = (0,
|
37
|
-
const BUN_LOCK_PATH = (0,
|
38
|
+
const YARN_LOCK_PATH = (0, node_path_1.join)(workspace_root_1.workspaceRoot, YARN_LOCK_FILE);
|
39
|
+
const NPM_LOCK_PATH = (0, node_path_1.join)(workspace_root_1.workspaceRoot, NPM_LOCK_FILE);
|
40
|
+
const PNPM_LOCK_PATH = (0, node_path_1.join)(workspace_root_1.workspaceRoot, PNPM_LOCK_FILE);
|
41
|
+
const BUN_LOCK_PATH = (0, node_path_1.join)(workspace_root_1.workspaceRoot, BUN_LOCK_FILE);
|
42
|
+
const BUN_TEXT_LOCK_PATH = (0, node_path_1.join)(workspace_root_1.workspaceRoot, BUN_TEXT_LOCK_FILE);
|
38
43
|
/**
|
39
44
|
* Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
|
40
45
|
*/
|
41
46
|
function getLockFileNodes(packageManager, contents, lockFileHash, context) {
|
42
47
|
try {
|
43
48
|
if (packageManager === 'yarn') {
|
44
|
-
const packageJson = (0, fileutils_1.readJsonFile)((0,
|
49
|
+
const packageJson = (0, fileutils_1.readJsonFile)((0, node_path_1.join)(context.workspaceRoot, 'package.json'));
|
45
50
|
return (0, yarn_parser_1.getYarnLockfileNodes)(contents, lockFileHash, packageJson);
|
46
51
|
}
|
47
52
|
if (packageManager === 'pnpm') {
|
@@ -99,16 +104,16 @@ function getLockFileDependencies(packageManager, contents, lockFileHash, context
|
|
99
104
|
}
|
100
105
|
function lockFileExists(packageManager) {
|
101
106
|
if (packageManager === 'yarn') {
|
102
|
-
return (0,
|
107
|
+
return (0, node_fs_1.existsSync)(YARN_LOCK_PATH);
|
103
108
|
}
|
104
109
|
if (packageManager === 'pnpm') {
|
105
|
-
return (0,
|
110
|
+
return (0, node_fs_1.existsSync)(PNPM_LOCK_PATH);
|
106
111
|
}
|
107
112
|
if (packageManager === 'npm') {
|
108
|
-
return (0,
|
113
|
+
return (0, node_fs_1.existsSync)(NPM_LOCK_PATH);
|
109
114
|
}
|
110
115
|
if (packageManager === 'bun') {
|
111
|
-
return (0,
|
116
|
+
return (0, node_fs_1.existsSync)(BUN_LOCK_PATH) || (0, node_fs_1.existsSync)(BUN_TEXT_LOCK_PATH);
|
112
117
|
}
|
113
118
|
throw new Error(`Unknown package manager ${packageManager} or lock file missing`);
|
114
119
|
}
|
@@ -143,7 +148,17 @@ function getLockFilePath(packageManager) {
|
|
143
148
|
return NPM_LOCK_PATH;
|
144
149
|
}
|
145
150
|
if (packageManager === 'bun') {
|
146
|
-
|
151
|
+
try {
|
152
|
+
const bunVersion = (0, node_child_process_1.execSync)('bun --version').toString().trim();
|
153
|
+
// In version 1.2.0, bun switched to a text based lockfile format by default
|
154
|
+
if ((0, semver_1.gte)(bunVersion, '1.2.0')) {
|
155
|
+
return BUN_TEXT_LOCK_FILE;
|
156
|
+
}
|
157
|
+
return BUN_LOCK_PATH;
|
158
|
+
}
|
159
|
+
catch {
|
160
|
+
return BUN_LOCK_PATH;
|
161
|
+
}
|
147
162
|
}
|
148
163
|
throw new Error(`Unknown package manager: ${packageManager}`);
|
149
164
|
}
|
@@ -157,7 +172,7 @@ function getLockFilePath(packageManager) {
|
|
157
172
|
*/
|
158
173
|
function createLockFile(packageJson, graph, packageManager = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot)) {
|
159
174
|
const normalizedPackageJson = (0, package_json_1.normalizePackageJson)(packageJson);
|
160
|
-
const content = (0,
|
175
|
+
const content = (0, node_fs_1.readFileSync)(getLockFilePath(packageManager), 'utf8');
|
161
176
|
try {
|
162
177
|
if (packageManager === 'yarn') {
|
163
178
|
const prunedGraph = (0, project_graph_pruning_1.pruneProjectGraph)(graph, packageJson);
|
@@ -3,7 +3,7 @@ import { PackageJson } from '../../../../utils/package-json';
|
|
3
3
|
* Get version of hoisted package if available
|
4
4
|
*/
|
5
5
|
export declare function getHoistedPackageVersion(packageName: string): string;
|
6
|
-
export type NormalizedPackageJson = Pick<PackageJson, 'name' | 'version' | 'license' | 'dependencies' | 'devDependencies' | 'peerDependencies' | 'peerDependenciesMeta' | 'optionalDependencies' | 'packageManager'>;
|
6
|
+
export type NormalizedPackageJson = Pick<PackageJson, 'name' | 'version' | 'license' | 'dependencies' | 'devDependencies' | 'peerDependencies' | 'peerDependenciesMeta' | 'optionalDependencies' | 'packageManager' | 'resolutions'>;
|
7
7
|
/**
|
8
8
|
* Strip off non-pruning related fields from package.json
|
9
9
|
*/
|
@@ -19,7 +19,7 @@ function getHoistedPackageVersion(packageName) {
|
|
19
19
|
* Strip off non-pruning related fields from package.json
|
20
20
|
*/
|
21
21
|
function normalizePackageJson(packageJson) {
|
22
|
-
const { name, version, license, dependencies, devDependencies, peerDependencies, peerDependenciesMeta, optionalDependencies, packageManager, } = packageJson;
|
22
|
+
const { name, version, license, dependencies, devDependencies, peerDependencies, peerDependenciesMeta, optionalDependencies, packageManager, resolutions, } = packageJson;
|
23
23
|
return {
|
24
24
|
name,
|
25
25
|
version,
|
@@ -30,5 +30,6 @@ function normalizePackageJson(packageJson) {
|
|
30
30
|
peerDependenciesMeta,
|
31
31
|
optionalDependencies,
|
32
32
|
packageManager,
|
33
|
+
resolutions,
|
33
34
|
};
|
34
35
|
}
|
@@ -29,14 +29,14 @@ function getYarnLockfileNodes(lockFileContent, lockFileHash, packageJson) {
|
|
29
29
|
const isBerry = !!__metadata;
|
30
30
|
// yarn classic splits keys when parsing so we need to stich them back together
|
31
31
|
const groupedDependencies = groupDependencies(dependencies, isBerry);
|
32
|
-
return getNodes(groupedDependencies, packageJson,
|
32
|
+
return getNodes(groupedDependencies, packageJson, isBerry);
|
33
33
|
}
|
34
34
|
function getYarnLockfileDependencies(lockFileContent, lockFileHash, ctx) {
|
35
35
|
const { __metadata, ...dependencies } = parseLockFile(lockFileContent, lockFileHash);
|
36
36
|
const isBerry = !!__metadata;
|
37
37
|
// yarn classic splits keys when parsing so we need to stich them back together
|
38
38
|
const groupedDependencies = groupDependencies(dependencies, isBerry);
|
39
|
-
return getDependencies(groupedDependencies,
|
39
|
+
return getDependencies(groupedDependencies, ctx);
|
40
40
|
}
|
41
41
|
function getPackageNameKeyPairs(keys) {
|
42
42
|
const result = new Map();
|
@@ -51,7 +51,7 @@ function getPackageNameKeyPairs(keys) {
|
|
51
51
|
});
|
52
52
|
return result;
|
53
53
|
}
|
54
|
-
function getNodes(dependencies, packageJson,
|
54
|
+
function getNodes(dependencies, packageJson, isBerry) {
|
55
55
|
const nodes = new Map();
|
56
56
|
const combinedDeps = {
|
57
57
|
...packageJson.dependencies,
|
@@ -68,7 +68,7 @@ function getNodes(dependencies, packageJson, keyMap, isBerry) {
|
|
68
68
|
nameKeyPairs.forEach((keySet, packageName) => {
|
69
69
|
const keysArray = Array.from(keySet);
|
70
70
|
// use key relevant to the package name
|
71
|
-
const version = findVersion(packageName, keysArray[0], snapshot, isBerry);
|
71
|
+
const [version, isAlias] = findVersion(packageName, keysArray[0], snapshot, isBerry);
|
72
72
|
// use keys linked to the extracted package name
|
73
73
|
keysArray.forEach((key) => {
|
74
74
|
// we don't need to keep duplicates, we can just track the keys
|
@@ -79,7 +79,7 @@ function getNodes(dependencies, packageJson, keyMap, isBerry) {
|
|
79
79
|
}
|
80
80
|
const node = {
|
81
81
|
type: 'npm',
|
82
|
-
name: version
|
82
|
+
name: version && !isAlias
|
83
83
|
? `npm:${packageName}@${version}`
|
84
84
|
: `npm:${packageName}`,
|
85
85
|
data: {
|
@@ -151,7 +151,7 @@ function findVersion(packageName, key, snapshot, isBerry) {
|
|
151
151
|
? snapshot.resolution && !snapshot.resolution.startsWith(`${packageName}@`)
|
152
152
|
: versionRange.startsWith('npm:');
|
153
153
|
if (isAlias) {
|
154
|
-
return versionRange;
|
154
|
+
return [versionRange, true];
|
155
155
|
}
|
156
156
|
// check for berry tarball packages
|
157
157
|
if (isBerry &&
|
@@ -159,13 +159,13 @@ function findVersion(packageName, key, snapshot, isBerry) {
|
|
159
159
|
// different registry would yield suffix following '::' which we don't need
|
160
160
|
snapshot.resolution.split('::')[0] !==
|
161
161
|
`${packageName}@npm:${snapshot.version}`) {
|
162
|
-
return snapshot.resolution.slice(packageName.length + 1);
|
162
|
+
return [snapshot.resolution.slice(packageName.length + 1)];
|
163
163
|
}
|
164
164
|
if (!isBerry && isTarballPackage(versionRange, snapshot)) {
|
165
|
-
return snapshot.resolved;
|
165
|
+
return [snapshot.resolved];
|
166
166
|
}
|
167
167
|
// otherwise it's a standard version
|
168
|
-
return snapshot.version;
|
168
|
+
return [snapshot.version];
|
169
169
|
}
|
170
170
|
// check if snapshot represents tarball package
|
171
171
|
function isTarballPackage(versionRange, snapshot) {
|
@@ -193,7 +193,7 @@ function getHoistedVersion(packageName) {
|
|
193
193
|
return version;
|
194
194
|
}
|
195
195
|
}
|
196
|
-
function getDependencies(dependencies,
|
196
|
+
function getDependencies(dependencies, ctx) {
|
197
197
|
const projectGraphDependencies = [];
|
198
198
|
Object.keys(dependencies).forEach((keys) => {
|
199
199
|
const snapshot = dependencies[keys];
|
@@ -203,8 +203,26 @@ function getDependencies(dependencies, keyMap, ctx) {
|
|
203
203
|
[snapshot.dependencies, snapshot.optionalDependencies].forEach((section) => {
|
204
204
|
if (section) {
|
205
205
|
Object.entries(section).forEach(([name, versionRange]) => {
|
206
|
-
|
206
|
+
let target = keyMap.get(`${name}@npm:${versionRange}`) ||
|
207
207
|
keyMap.get(`${name}@${versionRange}`);
|
208
|
+
if (!target) {
|
209
|
+
const shortRange = versionRange.replace(/^npm:/, '');
|
210
|
+
// for range like 'npm:*' the above will not be a match
|
211
|
+
if (shortRange === '*') {
|
212
|
+
const foundKey = Array.from(keyMap.keys()).find((k) => k.startsWith(`${name}@`));
|
213
|
+
if (foundKey) {
|
214
|
+
target = keyMap.get(foundKey);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
else if (shortRange.includes('||')) {
|
218
|
+
// when range is a union of ranges, we need to treat it as an array
|
219
|
+
const ranges = shortRange.split('||').map((r) => r.trim());
|
220
|
+
target = Object.values(keyMap).find((n) => {
|
221
|
+
return (n.data.packageName === name &&
|
222
|
+
ranges.some((r) => (0, semver_1.satisfies)(n.data.version, r)));
|
223
|
+
})?.[1];
|
224
|
+
}
|
225
|
+
}
|
208
226
|
if (target) {
|
209
227
|
const dep = {
|
210
228
|
source: node.name,
|
@@ -271,11 +289,11 @@ function addPackageVersion(packageName, version, collection, isBerry) {
|
|
271
289
|
collection.set(packageName, new Set());
|
272
290
|
}
|
273
291
|
collection.get(packageName).add(`${packageName}@${version}`);
|
274
|
-
if (isBerry && !version.startsWith('npm:')) {
|
292
|
+
if (isBerry && !version.startsWith('npm:') && !version.startsWith('patch:')) {
|
275
293
|
collection.get(packageName).add(`${packageName}@npm:${version}`);
|
276
294
|
}
|
277
295
|
}
|
278
|
-
function mapSnapshots(
|
296
|
+
function mapSnapshots(rootDependencies, nodes, packageJson, isBerry) {
|
279
297
|
// map snapshot to set of keys (e.g. `eslint@^7.0.0, eslint@npm:^7.0.0`)
|
280
298
|
const snapshotMap = new Map();
|
281
299
|
// track all existing dependencies's keys
|
@@ -286,8 +304,11 @@ function mapSnapshots(dependencies, nodes, packageJson, isBerry) {
|
|
286
304
|
...packageJson.optionalDependencies,
|
287
305
|
...packageJson.peerDependencies,
|
288
306
|
};
|
307
|
+
const resolutions = {
|
308
|
+
...packageJson.resolutions,
|
309
|
+
};
|
289
310
|
// yarn classic splits keys when parsing so we need to stich them back together
|
290
|
-
const groupedDependencies = groupDependencies(
|
311
|
+
const groupedDependencies = groupDependencies(rootDependencies, isBerry);
|
291
312
|
// collect snapshots and their matching keys
|
292
313
|
Object.values(nodes).forEach((node) => {
|
293
314
|
const foundOriginalKeys = findOriginalKeys(groupedDependencies, node);
|
@@ -311,9 +332,19 @@ function mapSnapshots(dependencies, nodes, packageJson, isBerry) {
|
|
311
332
|
snapshotMap.get(snapshot).add(requestedKey);
|
312
333
|
}
|
313
334
|
}
|
335
|
+
const requestedResolutionsVersion = getPackageJsonVersion(resolutions, node);
|
336
|
+
if (requestedResolutionsVersion) {
|
337
|
+
addPackageVersion(node.data.packageName, requestedResolutionsVersion, existingKeys, isBerry);
|
338
|
+
const requestedKey = isBerry
|
339
|
+
? reverseMapBerryKey(node, requestedResolutionsVersion, snapshot)
|
340
|
+
: `${node.data.packageName}@${requestedResolutionsVersion}`;
|
341
|
+
if (!snapshotMap.get(snapshot).has(requestedKey)) {
|
342
|
+
snapshotMap.get(snapshot).add(requestedKey);
|
343
|
+
}
|
344
|
+
}
|
314
345
|
if (isBerry) {
|
315
346
|
// look for patched versions
|
316
|
-
const patch = findPatchedKeys(groupedDependencies, node);
|
347
|
+
const patch = findPatchedKeys(groupedDependencies, node, resolutions[node.data.packageName]);
|
317
348
|
if (patch) {
|
318
349
|
const [matchedKeys, snapshot] = patch;
|
319
350
|
snapshotMap.set(snapshot, new Set(matchedKeys));
|
@@ -321,7 +352,7 @@ function mapSnapshots(dependencies, nodes, packageJson, isBerry) {
|
|
321
352
|
}
|
322
353
|
});
|
323
354
|
// remove keys that match version ranges that have been pruned away
|
324
|
-
snapshotMap.forEach((snapshotValue,
|
355
|
+
snapshotMap.forEach((snapshotValue, snapshot) => {
|
325
356
|
for (const key of snapshotValue.values()) {
|
326
357
|
const packageName = key.slice(0, key.indexOf('@', 1));
|
327
358
|
let normalizedKey = key;
|
@@ -353,8 +384,8 @@ function mapSnapshots(dependencies, nodes, packageJson, isBerry) {
|
|
353
384
|
}
|
354
385
|
function reverseMapBerryKey(node, version, snapshot) {
|
355
386
|
// alias packages already have version
|
356
|
-
if (version.startsWith('npm:')) {
|
357
|
-
`${node.data.packageName}@${version}`;
|
387
|
+
if (version.startsWith('npm:') || version.startsWith('patch:')) {
|
388
|
+
return `${node.data.packageName}@${version}`;
|
358
389
|
}
|
359
390
|
// check for berry tarball packages
|
360
391
|
if (snapshot.resolution &&
|
@@ -363,15 +394,28 @@ function reverseMapBerryKey(node, version, snapshot) {
|
|
363
394
|
}
|
364
395
|
return `${node.data.packageName}@npm:${version}`;
|
365
396
|
}
|
366
|
-
function getPackageJsonVersion(
|
397
|
+
function getPackageJsonVersion(dependencies, node) {
|
367
398
|
const { packageName, version } = node.data;
|
368
|
-
if (
|
369
|
-
|
370
|
-
|
371
|
-
|
399
|
+
if (dependencies[packageName]) {
|
400
|
+
const patchRegex = new RegExp(`^patch:${packageName}@(.*)|#.*$`);
|
401
|
+
// extract the version from the patch or use the full version
|
402
|
+
const versionRange = dependencies[packageName].match(patchRegex)?.[1] ||
|
403
|
+
dependencies[packageName];
|
404
|
+
if (versionRange === version || (0, semver_1.satisfies)(version, versionRange)) {
|
405
|
+
return dependencies[packageName];
|
372
406
|
}
|
373
407
|
}
|
374
408
|
}
|
409
|
+
function isStandardPackage(snapshot, version) {
|
410
|
+
return snapshot.version === version;
|
411
|
+
}
|
412
|
+
function isBerryAlias(snapshot, version) {
|
413
|
+
return snapshot.resolution && `npm:${snapshot.resolution}` === version;
|
414
|
+
}
|
415
|
+
function isClassicAlias(node, keys) {
|
416
|
+
return (node.data.version.startsWith('npm:') &&
|
417
|
+
keys.some((k) => k === `${node.data.packageName}@${node.data.version}`));
|
418
|
+
}
|
375
419
|
function findOriginalKeys(dependencies, node) {
|
376
420
|
for (const keyExpr of Object.keys(dependencies)) {
|
377
421
|
const snapshot = dependencies[keyExpr];
|
@@ -379,18 +423,9 @@ function findOriginalKeys(dependencies, node) {
|
|
379
423
|
if (!keys.some((k) => k.startsWith(`${node.data.packageName}@`))) {
|
380
424
|
continue;
|
381
425
|
}
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
}
|
386
|
-
// berry alias package
|
387
|
-
if (snapshot.resolution &&
|
388
|
-
`npm:${snapshot.resolution}` === node.data.version) {
|
389
|
-
return [keys, snapshot];
|
390
|
-
}
|
391
|
-
// classic alias
|
392
|
-
if (node.data.version.startsWith('npm:') &&
|
393
|
-
keys.some((k) => k === `${node.data.packageName}@${node.data.version}`)) {
|
426
|
+
if (isStandardPackage(snapshot, node.data.version) ||
|
427
|
+
isBerryAlias(snapshot, node.data.version) ||
|
428
|
+
isClassicAlias(node, keys)) {
|
394
429
|
return [keys, snapshot];
|
395
430
|
}
|
396
431
|
// tarball package
|
@@ -400,16 +435,27 @@ function findOriginalKeys(dependencies, node) {
|
|
400
435
|
}
|
401
436
|
}
|
402
437
|
}
|
403
|
-
function findPatchedKeys(dependencies, node) {
|
438
|
+
function findPatchedKeys(dependencies, node, resolutionVersion) {
|
404
439
|
for (const keyExpr of Object.keys(dependencies)) {
|
405
440
|
const snapshot = dependencies[keyExpr];
|
406
441
|
const keys = keyExpr.split(', ');
|
407
442
|
if (!keys[0].startsWith(`${node.data.packageName}@patch:`)) {
|
408
443
|
continue;
|
409
444
|
}
|
410
|
-
|
411
|
-
|
412
|
-
|
445
|
+
if (keyExpr.includes('.yarn/patches')) {
|
446
|
+
if (!resolutionVersion) {
|
447
|
+
continue;
|
448
|
+
}
|
449
|
+
const key = `${node.data.packageName}@${resolutionVersion}`;
|
450
|
+
// local patches can have different location from than the root lock file
|
451
|
+
// use the one from local package.json as the source of truth as long as the rest of the patch matches
|
452
|
+
// this obviously doesn't cover the case of patch over a patch, but that's a super rare case and one can argue one can just join those two patches
|
453
|
+
if (key.split('::locator')[0] !== keyExpr.split('::locator')[0]) {
|
454
|
+
continue;
|
455
|
+
}
|
456
|
+
else {
|
457
|
+
return [[key], { ...snapshot, resolution: key }];
|
458
|
+
}
|
413
459
|
}
|
414
460
|
if (snapshot.version === node.data.version) {
|
415
461
|
return [keys, snapshot];
|
@@ -19,6 +19,7 @@ const getTouchedProjectsFromLockFile = (fileChanges, projectGraphNodes) => {
|
|
19
19
|
'pnpm-lock.yaml',
|
20
20
|
'pnpm-lock.yml',
|
21
21
|
'bun.lockb',
|
22
|
+
'bun.lock',
|
22
23
|
];
|
23
24
|
if (fileChanges.some((f) => lockFiles.includes(f.file))) {
|
24
25
|
return Object.values(projectGraphNodes).map((p) => p.name);
|
@@ -38,7 +38,7 @@ function buildExplicitTypeScriptDependencies(ctx, targetProjectLocator) {
|
|
38
38
|
if (isVuePluginInstalled()) {
|
39
39
|
moduleExtensions.push('.vue');
|
40
40
|
}
|
41
|
-
for (const [project, fileData] of Object.entries(ctx.
|
41
|
+
for (const [project, fileData] of Object.entries(ctx.filesToProcess.projectFileMap)) {
|
42
42
|
filesToProcess[project] ??= [];
|
43
43
|
for (const { file } of fileData) {
|
44
44
|
if (moduleExtensions.some((ext) => file.endsWith(ext))) {
|
@@ -5,6 +5,11 @@ import type { ProjectGraphExternalNode, ProjectGraphProjectNode } from '../../..
|
|
5
5
|
* resolved external node name from the project graph.
|
6
6
|
*/
|
7
7
|
type NpmResolutionCache = Map<string, string | null>;
|
8
|
+
type PathPattern = {
|
9
|
+
pattern: string;
|
10
|
+
prefix: string;
|
11
|
+
suffix: string;
|
12
|
+
};
|
8
13
|
export declare function isBuiltinModuleImport(importExpr: string): boolean;
|
9
14
|
export declare class TargetProjectLocator {
|
10
15
|
private readonly nodes;
|
@@ -14,6 +19,7 @@ export declare class TargetProjectLocator {
|
|
14
19
|
private npmProjects;
|
15
20
|
private tsConfig;
|
16
21
|
private paths;
|
22
|
+
private parsedPathPatterns;
|
17
23
|
private typescriptResolutionCache;
|
18
24
|
private packagesMetadata;
|
19
25
|
constructor(nodes: Record<string, ProjectGraphProjectNode>, externalNodes?: Record<string, ProjectGraphExternalNode>, npmResolutionCache?: NpmResolutionCache);
|
@@ -36,11 +42,14 @@ export declare class TargetProjectLocator {
|
|
36
42
|
/**
|
37
43
|
* Return file paths matching the import relative to the repo root
|
38
44
|
* @param normalizedImportExpr
|
39
|
-
* @
|
45
|
+
* @deprecated Use `findMatchingPaths` instead. It will be removed in Nx v22.
|
40
46
|
*/
|
41
47
|
findPaths(normalizedImportExpr: string): string[] | undefined;
|
48
|
+
findMatchingPaths(importExpr: string): [pattern: string | PathPattern, paths: string[]] | undefined;
|
42
49
|
findImportInWorkspaceProjects(importPath: string): string | null;
|
43
50
|
findDependencyInWorkspaceProjects(dep: string): string | null;
|
51
|
+
private isPatternMatch;
|
52
|
+
private parsePaths;
|
44
53
|
private resolveImportWithTypescript;
|
45
54
|
private resolveImportWithRequire;
|
46
55
|
private findProjectOfResolvedModule;
|
@@ -49,6 +49,9 @@ class TargetProjectLocator {
|
|
49
49
|
}
|
50
50
|
return acc;
|
51
51
|
}, {});
|
52
|
+
if (this.tsConfig.config?.compilerOptions?.paths) {
|
53
|
+
this.parsePaths(this.tsConfig.config.compilerOptions.paths);
|
54
|
+
}
|
52
55
|
}
|
53
56
|
/**
|
54
57
|
* Resolve any workspace or external project that matches the given import expression,
|
@@ -63,14 +66,15 @@ class TargetProjectLocator {
|
|
63
66
|
return this.findProjectOfResolvedModule(resolvedModule);
|
64
67
|
}
|
65
68
|
// find project using tsconfig paths
|
66
|
-
const results = this.
|
69
|
+
const results = this.findMatchingPaths(importExpr);
|
67
70
|
if (results) {
|
68
71
|
const [path, paths] = results;
|
72
|
+
const matchedStar = typeof path === 'string'
|
73
|
+
? undefined
|
74
|
+
: importExpr.substring(path.prefix.length, importExpr.length - path.suffix.length);
|
69
75
|
for (let p of paths) {
|
70
|
-
const
|
71
|
-
|
72
|
-
: p;
|
73
|
-
const maybeResolvedProject = this.findProjectOfResolvedModule(r);
|
76
|
+
const path = matchedStar ? p.replace('*', matchedStar) : p;
|
77
|
+
const maybeResolvedProject = this.findProjectOfResolvedModule(path);
|
74
78
|
if (maybeResolvedProject) {
|
75
79
|
return maybeResolvedProject;
|
76
80
|
}
|
@@ -172,7 +176,7 @@ class TargetProjectLocator {
|
|
172
176
|
/**
|
173
177
|
* Return file paths matching the import relative to the repo root
|
174
178
|
* @param normalizedImportExpr
|
175
|
-
* @
|
179
|
+
* @deprecated Use `findMatchingPaths` instead. It will be removed in Nx v22.
|
176
180
|
*/
|
177
181
|
findPaths(normalizedImportExpr) {
|
178
182
|
if (!this.paths) {
|
@@ -189,6 +193,29 @@ class TargetProjectLocator {
|
|
189
193
|
}
|
190
194
|
return undefined;
|
191
195
|
}
|
196
|
+
findMatchingPaths(importExpr) {
|
197
|
+
if (!this.parsedPathPatterns) {
|
198
|
+
return undefined;
|
199
|
+
}
|
200
|
+
const { matchableStrings, patterns } = this.parsedPathPatterns;
|
201
|
+
if (matchableStrings.has(importExpr)) {
|
202
|
+
return [importExpr, this.paths[importExpr]];
|
203
|
+
}
|
204
|
+
// https://github.com/microsoft/TypeScript/blob/29e6d6689dfb422e4f1395546c1917d07e1f664d/src/compiler/core.ts#L2410
|
205
|
+
let matchedValue;
|
206
|
+
let longestMatchPrefixLength = -1;
|
207
|
+
for (let i = 0; i < patterns.length; i++) {
|
208
|
+
const pattern = patterns[i];
|
209
|
+
if (pattern.prefix.length > longestMatchPrefixLength &&
|
210
|
+
this.isPatternMatch(pattern, importExpr)) {
|
211
|
+
longestMatchPrefixLength = pattern.prefix.length;
|
212
|
+
matchedValue = pattern;
|
213
|
+
}
|
214
|
+
}
|
215
|
+
return matchedValue
|
216
|
+
? [matchedValue, this.paths[matchedValue.pattern]]
|
217
|
+
: undefined;
|
218
|
+
}
|
192
219
|
findImportInWorkspaceProjects(importPath) {
|
193
220
|
this.packagesMetadata ??= (0, packages_1.getWorkspacePackagesMetadata)(this.nodes);
|
194
221
|
if (this.packagesMetadata.entryPointsToProjectMap[importPath]) {
|
@@ -201,6 +228,32 @@ class TargetProjectLocator {
|
|
201
228
|
this.packagesMetadata ??= (0, packages_1.getWorkspacePackagesMetadata)(this.nodes);
|
202
229
|
return this.packagesMetadata.packageToProjectMap[dep]?.name;
|
203
230
|
}
|
231
|
+
isPatternMatch({ prefix, suffix }, candidate) {
|
232
|
+
return (candidate.length >= prefix.length + suffix.length &&
|
233
|
+
candidate.startsWith(prefix) &&
|
234
|
+
candidate.endsWith(suffix));
|
235
|
+
}
|
236
|
+
parsePaths(paths) {
|
237
|
+
this.parsedPathPatterns = {
|
238
|
+
matchableStrings: new Set(),
|
239
|
+
patterns: [],
|
240
|
+
};
|
241
|
+
for (const key of Object.keys(paths)) {
|
242
|
+
const parts = key.split('*');
|
243
|
+
if (parts.length > 2) {
|
244
|
+
continue;
|
245
|
+
}
|
246
|
+
if (parts.length === 1) {
|
247
|
+
this.parsedPathPatterns.matchableStrings.add(key);
|
248
|
+
continue;
|
249
|
+
}
|
250
|
+
this.parsedPathPatterns.patterns.push({
|
251
|
+
pattern: key,
|
252
|
+
prefix: parts[0],
|
253
|
+
suffix: parts[1],
|
254
|
+
});
|
255
|
+
}
|
256
|
+
}
|
204
257
|
resolveImportWithTypescript(normalizedImportExpr, filePath) {
|
205
258
|
let resolvedModule;
|
206
259
|
if (this.typescriptResolutionCache.has(normalizedImportExpr)) {
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getWorkspacePackagesMetadata = getWorkspacePackagesMetadata;
|
4
4
|
exports.matchImportToWildcardEntryPointsToProjectMap = matchImportToWildcardEntryPointsToProjectMap;
|
5
|
-
const minimatch_1 = require("minimatch");
|
6
5
|
const posix_1 = require("node:path/posix");
|
7
6
|
function getWorkspacePackagesMetadata(projects) {
|
8
7
|
const entryPointsToProjectMap = {};
|
@@ -63,10 +62,30 @@ function getWorkspacePackagesMetadata(projects) {
|
|
63
62
|
packageToProjectMap,
|
64
63
|
};
|
65
64
|
}
|
65
|
+
// adapted from PACKAGE_IMPORTS_EXPORTS_RESOLVE at
|
66
|
+
// https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification
|
66
67
|
function matchImportToWildcardEntryPointsToProjectMap(wildcardEntryPointsToProjectMap, importPath) {
|
67
68
|
if (!Object.keys(wildcardEntryPointsToProjectMap).length) {
|
68
69
|
return null;
|
69
70
|
}
|
70
|
-
const
|
71
|
-
|
71
|
+
const entryPoint = Object.keys(wildcardEntryPointsToProjectMap).find((key) => {
|
72
|
+
const segments = key.split('*');
|
73
|
+
if (segments.length > 2) {
|
74
|
+
return false;
|
75
|
+
}
|
76
|
+
const patternBase = segments[0];
|
77
|
+
if (patternBase === importPath) {
|
78
|
+
return false;
|
79
|
+
}
|
80
|
+
if (!importPath.startsWith(patternBase)) {
|
81
|
+
return false;
|
82
|
+
}
|
83
|
+
const patternTrailer = segments[1];
|
84
|
+
if (patternTrailer?.length > 0 &&
|
85
|
+
(!importPath.endsWith(patternTrailer) || importPath.length < key.length)) {
|
86
|
+
return false;
|
87
|
+
}
|
88
|
+
return true;
|
89
|
+
});
|
90
|
+
return entryPoint ? wildcardEntryPointsToProjectMap[entryPoint] : null;
|
72
91
|
}
|
@@ -161,6 +161,7 @@ function getTranspiler(compilerOptions, tsConfigRaw) {
|
|
161
161
|
// use NodeJs module resolution until support for TS 4.x is dropped and then
|
162
162
|
// we can switch to Node10
|
163
163
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
164
|
+
compilerOptions.customConditions = null;
|
164
165
|
compilerOptions.target = ts.ScriptTarget.ES2021;
|
165
166
|
compilerOptions.inlineSourceMap = true;
|
166
167
|
compilerOptions.skipLibCheck = true;
|
@@ -23,11 +23,11 @@ function readTsConfigOptions(tsConfigPath) {
|
|
23
23
|
tsModule = require('typescript');
|
24
24
|
}
|
25
25
|
const readResult = tsModule.readConfigFile(tsConfigPath, tsModule.sys.readFile);
|
26
|
-
// we don't need to scan
|
26
|
+
// We only care about options, so we don't need to scan source files, and thus
|
27
|
+
// `readDirectory` is stubbed for performance.
|
27
28
|
const host = {
|
29
|
+
...tsModule.sys,
|
28
30
|
readDirectory: () => [],
|
29
|
-
readFile: () => '',
|
30
|
-
fileExists: tsModule.sys.fileExists,
|
31
31
|
};
|
32
32
|
return tsModule.parseJsonConfigFileContent(readResult.config, host, (0, path_1.dirname)(tsConfigPath)).options;
|
33
33
|
}
|
@@ -86,6 +86,9 @@ function createNodeFromPackageJson(pkgJsonPath, workspaceRoot, cache, isInPackag
|
|
86
86
|
...json,
|
87
87
|
root: projectRoot,
|
88
88
|
isInPackageManagerWorkspaces,
|
89
|
+
// change this to bust the cache when making changes that result in different
|
90
|
+
// results for the same hash
|
91
|
+
bust: 1,
|
89
92
|
});
|
90
93
|
const cached = cache[hash];
|
91
94
|
if (cached) {
|
@@ -126,7 +129,6 @@ function buildProjectConfigurationFromPackageJson(packageJson, workspaceRoot, pa
|
|
126
129
|
let name = packageJson.name ?? (0, to_project_name_1.toProjectName)(normalizedPath);
|
127
130
|
const projectConfiguration = {
|
128
131
|
root: projectRoot,
|
129
|
-
sourceRoot: projectRoot,
|
130
132
|
name,
|
131
133
|
...packageJson.nx,
|
132
134
|
targets: (0, package_json_1.readTargetsFromPackageJson)(packageJson, nxJson),
|
@@ -20,8 +20,8 @@ const getTouchedProjectsFromProjectGlobChanges = async (touchedFiles, projectGra
|
|
20
20
|
'package.json',
|
21
21
|
]);
|
22
22
|
}
|
23
|
-
const plugins = await (0, get_plugins_1.getPlugins)();
|
24
|
-
return (0, globs_1.combineGlobPatterns)((0, retrieve_workspace_files_1.
|
23
|
+
const plugins = (await (0, get_plugins_1.getPlugins)()).filter((p) => !!p.createNodes);
|
24
|
+
return (0, globs_1.combineGlobPatterns)((0, retrieve_workspace_files_1.getGlobPatternsOfPlugins)(plugins));
|
25
25
|
})();
|
26
26
|
const touchedProjects = new Set();
|
27
27
|
for (const touchedFile of touchedFiles) {
|