@nx/js 23.1.0 → 23.1.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/dist/babel.js +11 -0
- package/dist/internal.d.ts +4 -3
- package/dist/internal.js +16 -17
- package/dist/src/executors/copy-workspace-modules/copy-workspace-modules.js +4 -6
- package/dist/src/executors/node/lib/output-file.js +4 -4
- package/dist/src/executors/node/node.impl.js +9 -10
- package/dist/src/executors/prune-lockfile/prune-lockfile.d.ts +1 -1
- package/dist/src/executors/prune-lockfile/prune-lockfile.js +4 -9
- package/dist/src/executors/release-publish/extract-npm-publish-json-data.js +92 -52
- package/dist/src/executors/release-publish/log-tar.js +6 -2
- package/dist/src/executors/release-publish/release-publish.impl.js +15 -0
- package/dist/src/executors/tsc/lib/batch/watch.js +3 -3
- package/dist/src/executors/tsc/tsc.batch-impl.d.ts +1 -1
- package/dist/src/executors/tsc/tsc.batch-impl.js +2 -2
- package/dist/src/executors/verdaccio/verdaccio.impl.js +8 -1
- package/dist/src/generators/library/library.d.ts +1 -1
- package/dist/src/generators/library/library.js +4 -4
- package/dist/src/generators/library/schema.d.ts +4 -0
- package/dist/src/generators/library/schema.json +8 -2
- package/dist/src/generators/library/utils/add-release-config.js +2 -2
- package/dist/src/generators/setup-build/generator.js +2 -7
- package/dist/src/generators/typescript-sync/typescript-sync.d.ts +1 -1
- package/dist/src/generators/typescript-sync/typescript-sync.js +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +5 -7
- package/dist/src/migrations/update-23-1-0/add-ignore-deprecations-for-ts6.d.ts +3 -2
- package/dist/src/migrations/update-23-1-0/add-ignore-deprecations-for-ts6.js +17 -11
- package/dist/src/plugins/jest/start-local-registry.js +6 -1
- package/dist/src/plugins/typescript/plugin.js +9 -14
- package/dist/src/plugins/typescript/util.d.ts +1 -1
- package/dist/src/release/utils/update-lock-file.js +5 -7
- package/dist/src/release/version-actions.d.ts +12 -3
- package/dist/src/release/version-actions.js +232 -74
- package/dist/src/utils/assets/copy-assets-handler.d.ts +1 -1
- package/dist/src/utils/assets/copy-assets-handler.js +2 -2
- package/dist/src/utils/buildable-libs-utils.js +10 -13
- package/dist/src/utils/find-npm-dependencies.js +7 -10
- package/dist/src/utils/generate-globs.js +11 -14
- package/dist/src/utils/get-main-file-dir.js +2 -2
- package/dist/src/utils/npm-config.d.ts +1 -1
- package/dist/src/utils/package-json/update-package-json.d.ts +1 -1
- package/dist/src/utils/package-json/update-package-json.js +6 -11
- package/dist/src/utils/package-manager-workspaces.js +2 -2
- package/dist/src/utils/swc/add-swc-dependencies.js +6 -0
- package/dist/src/utils/typescript/configuration.js +3 -5
- package/dist/src/utils/typescript/create-ts-config.d.ts +1 -1
- package/dist/src/utils/typescript/create-ts-config.js +5 -5
- package/dist/src/utils/typescript/plugin.js +2 -2
- package/dist/src/utils/typescript/run-type-check.js +2 -2
- package/dist/src/utils/typescript/ts-config.d.ts +51 -1
- package/dist/src/utils/typescript/ts-config.js +114 -0
- package/dist/src/utils/typescript/ts-solution-setup.d.ts +1 -1
- package/dist/src/utils/typescript/ts-solution-setup.js +3 -3
- package/dist/src/utils/watch-for-single-file-changes.js +2 -2
- package/migrations.json +1 -1
- package/package.json +8 -5
|
@@ -99,11 +99,17 @@
|
|
|
99
99
|
"description": "Generate a buildable library.",
|
|
100
100
|
"x-deprecated": "Use the `bundler` option for greater control (swc, tsc, rollup, vite, esbuild, none)."
|
|
101
101
|
},
|
|
102
|
-
"
|
|
102
|
+
"enableTypedLinting": {
|
|
103
103
|
"type": "boolean",
|
|
104
|
-
"description": "Whether
|
|
104
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
105
105
|
"default": false
|
|
106
106
|
},
|
|
107
|
+
"setParserOptionsProject": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
110
|
+
"default": false,
|
|
111
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
112
|
+
},
|
|
107
113
|
"config": {
|
|
108
114
|
"type": "string",
|
|
109
115
|
"enum": ["workspace", "project", "npm-scripts"],
|
|
@@ -5,8 +5,8 @@ exports.addReleaseConfigForNonTsSolution = addReleaseConfigForNonTsSolution;
|
|
|
5
5
|
exports.releaseTasks = releaseTasks;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const find_matching_projects_1 = require("nx/src/utils/find-matching-projects");
|
|
9
8
|
const generator_1 = tslib_1.__importDefault(require("../../setup-verdaccio/generator"));
|
|
9
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
10
10
|
/**
|
|
11
11
|
* Adds release option in nx.json to build the project before versioning
|
|
12
12
|
*/
|
|
@@ -122,7 +122,7 @@ function projectsConfigMatchesProject(projectsConfig, project) {
|
|
|
122
122
|
const graph = {
|
|
123
123
|
[project.name]: project,
|
|
124
124
|
};
|
|
125
|
-
const matchingProjects = (0,
|
|
125
|
+
const matchingProjects = (0, internal_1.findMatchingProjects)(projectsConfig, graph);
|
|
126
126
|
return matchingProjects.includes(project.name);
|
|
127
127
|
}
|
|
128
128
|
async function releaseTasks(tree) {
|
|
@@ -4,7 +4,6 @@ exports.setupBuildGenerator = setupBuildGenerator;
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const posix_1 = require("node:path/posix");
|
|
7
|
-
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
8
7
|
const assert_supported_typescript_version_1 = require("../../utils/assert-supported-typescript-version");
|
|
9
8
|
const get_import_path_1 = require("../../utils/get-import-path");
|
|
10
9
|
const update_package_json_1 = require("../../utils/package-json/update-package-json");
|
|
@@ -181,11 +180,7 @@ function updatePackageJsonForTsc(tree, options, project) {
|
|
|
181
180
|
if (!ts) {
|
|
182
181
|
ts = (0, ensure_typescript_1.ensureTypescript)();
|
|
183
182
|
}
|
|
184
|
-
const tsconfig = (0, ts_config_1.readTsConfig)(options.tsConfig,
|
|
185
|
-
...ts.sys,
|
|
186
|
-
readFile: (p) => tree.read(p, 'utf-8'),
|
|
187
|
-
fileExists: (p) => tree.exists(p),
|
|
188
|
-
});
|
|
183
|
+
const tsconfig = (0, ts_config_1.readTsConfig)(options.tsConfig, (0, ts_config_1.createTreeParseConfigHost)(tree));
|
|
189
184
|
let main;
|
|
190
185
|
let rootDir;
|
|
191
186
|
let outputPath;
|
|
@@ -249,5 +244,5 @@ function updatePackageJson(tree, projectName, projectRoot, main, outputPath, roo
|
|
|
249
244
|
function mergeTargetDefaults(tree, project, buildTarget) {
|
|
250
245
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
251
246
|
const projectTarget = project.targets[buildTarget];
|
|
252
|
-
return (0,
|
|
247
|
+
return (0, internal_1.mergeTargetConfigurations)(projectTarget, (0, internal_1.readTargetDefaultsForTarget)(buildTarget, nxJson.targetDefaults, projectTarget.executor));
|
|
253
248
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
|
-
import { type SyncGeneratorResult } from 'nx/
|
|
2
|
+
import { type SyncGeneratorResult } from '@nx/devkit/internal';
|
|
3
3
|
export declare function syncGenerator(tree: Tree): Promise<SyncGeneratorResult>;
|
|
4
4
|
export default syncGenerator;
|
|
@@ -6,9 +6,9 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const ignore_1 = tslib_1.__importDefault(require("ignore"));
|
|
7
7
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
8
8
|
const posix_1 = require("node:path/posix");
|
|
9
|
-
const sync_generators_1 = require("nx/src/utils/sync-generators");
|
|
10
9
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
11
10
|
const assert_supported_typescript_version_1 = require("../../utils/assert-supported-typescript-version");
|
|
11
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
12
12
|
const COMMON_RUNTIME_TS_CONFIG_FILE_NAMES = [
|
|
13
13
|
'tsconfig.app.json',
|
|
14
14
|
'tsconfig.lib.json',
|
|
@@ -29,7 +29,7 @@ async function syncGenerator(tree) {
|
|
|
29
29
|
// Root tsconfig containing project references for the whole workspace
|
|
30
30
|
const rootTsconfigPath = 'tsconfig.json';
|
|
31
31
|
if (!tsconfigExists(tree, tsconfigInfoCaches, rootTsconfigPath)) {
|
|
32
|
-
throw new
|
|
32
|
+
throw new internal_1.SyncError('Missing root "tsconfig.json"', [
|
|
33
33
|
`A "tsconfig.json" file must exist in the workspace root in order to sync the project graph information to the TypeScript configuration files.`,
|
|
34
34
|
]);
|
|
35
35
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export { initGenerator } from './generators/init/init';
|
|
|
16
16
|
export { setupPrettierGenerator } from './generators/setup-prettier/generator';
|
|
17
17
|
export { setupVerdaccio } from './generators/setup-verdaccio/generator';
|
|
18
18
|
export { isValidVariable } from './utils/is-valid-variable';
|
|
19
|
-
export { createLockFile, getLockFileName
|
|
20
|
-
export { createPackageJson } from 'nx/
|
|
19
|
+
export { createLockFile, getLockFileName } from '@nx/devkit/internal';
|
|
20
|
+
export { createPackageJson } from '@nx/devkit/internal';
|
package/dist/src/index.js
CHANGED
|
@@ -25,10 +25,8 @@ var generator_2 = require("./generators/setup-verdaccio/generator");
|
|
|
25
25
|
Object.defineProperty(exports, "setupVerdaccio", { enumerable: true, get: function () { return generator_2.setupVerdaccio; } });
|
|
26
26
|
var is_valid_variable_1 = require("./utils/is-valid-variable");
|
|
27
27
|
Object.defineProperty(exports, "isValidVariable", { enumerable: true, get: function () { return is_valid_variable_1.isValidVariable; } });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var create_package_json_1 = require("nx/src/plugins/js/package-json/create-package-json");
|
|
34
|
-
Object.defineProperty(exports, "createPackageJson", { enumerable: true, get: function () { return create_package_json_1.createPackageJson; } });
|
|
28
|
+
var internal_1 = require("@nx/devkit/internal");
|
|
29
|
+
Object.defineProperty(exports, "createLockFile", { enumerable: true, get: function () { return internal_1.createLockFile; } });
|
|
30
|
+
Object.defineProperty(exports, "getLockFileName", { enumerable: true, get: function () { return internal_1.getLockFileName; } });
|
|
31
|
+
var internal_2 = require("@nx/devkit/internal");
|
|
32
|
+
Object.defineProperty(exports, "createPackageJson", { enumerable: true, get: function () { return internal_2.createPackageJson; } });
|
|
@@ -21,8 +21,9 @@ import { type Tree } from '@nx/devkit';
|
|
|
21
21
|
* the pre-TS6 behavior. It is itself deprecated (removed in TS7), so pass
|
|
22
22
|
* 2 silences it, deferring the interop change to the eventual TS7 work.
|
|
23
23
|
* - Config-load flag: set `ignoreDeprecations: "6.0"` on every file named
|
|
24
|
-
* exactly `tsconfig.json`, the name
|
|
25
|
-
*
|
|
24
|
+
* exactly `tsconfig.json`, the name ts-node auto-resolves when jest compiles
|
|
25
|
+
* a config file like jest.config.ts (walking up from the working directory,
|
|
26
|
+
* not the config file's own directory). ts-node injects a
|
|
26
27
|
* `target: es5` when the config leaves it unset, and es5 is a TS6-deprecated
|
|
27
28
|
* value (TS5107); the flag (which ts-node passes through) keeps that load
|
|
28
29
|
* silent. Set unconditionally, since any `tsconfig.json` is a potential
|
|
@@ -5,6 +5,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
7
7
|
const ensure_typescript_1 = require("../../utils/typescript/ensure-typescript");
|
|
8
|
+
const ts_config_1 = require("../../utils/typescript/ts-config");
|
|
8
9
|
const FORMATTING_OPTIONS = {
|
|
9
10
|
formattingOptions: { keepLines: true, insertSpaces: true, tabSize: 2 },
|
|
10
11
|
};
|
|
@@ -31,8 +32,9 @@ let tsModule;
|
|
|
31
32
|
* the pre-TS6 behavior. It is itself deprecated (removed in TS7), so pass
|
|
32
33
|
* 2 silences it, deferring the interop change to the eventual TS7 work.
|
|
33
34
|
* - Config-load flag: set `ignoreDeprecations: "6.0"` on every file named
|
|
34
|
-
* exactly `tsconfig.json`, the name
|
|
35
|
-
*
|
|
35
|
+
* exactly `tsconfig.json`, the name ts-node auto-resolves when jest compiles
|
|
36
|
+
* a config file like jest.config.ts (walking up from the working directory,
|
|
37
|
+
* not the config file's own directory). ts-node injects a
|
|
36
38
|
* `target: es5` when the config leaves it unset, and es5 is a TS6-deprecated
|
|
37
39
|
* value (TS5107); the flag (which ts-node passes through) keeps that load
|
|
38
40
|
* silent. Set unconditionally, since any `tsconfig.json` is a potential
|
|
@@ -53,14 +55,11 @@ let tsModule;
|
|
|
53
55
|
async function default_1(tree) {
|
|
54
56
|
tsModule ??= (0, ensure_typescript_1.ensureTypescript)();
|
|
55
57
|
const ts = tsModule;
|
|
56
|
-
// Tree-
|
|
57
|
-
// writes
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
readFile: (filePath) => tree.read(filePath, 'utf-8') ?? undefined,
|
|
62
|
-
readDirectory: () => [],
|
|
63
|
-
};
|
|
58
|
+
// Tree-faithful host so TypeScript resolves `extends` against pass 1's pending
|
|
59
|
+
// writes and against package-provided bases (a naive `tree.read` host misses
|
|
60
|
+
// the latter). The host's `readDirectory` no-op skips the source-file scan,
|
|
61
|
+
// since only the merged compiler options matter here, not the file list.
|
|
62
|
+
const parseHost = (0, ts_config_1.createTreeParseConfigHost)(tree);
|
|
64
63
|
const tsconfigPaths = await (0, devkit_1.globAsync)(tree, ['**/tsconfig*.json']);
|
|
65
64
|
// Pass 1: pins and config-load flags, so pass 2's inheritance check sees them.
|
|
66
65
|
let defaultsPinCount = 0;
|
|
@@ -178,7 +177,14 @@ function silenceDeprecations(tree, ts, parseHost, tsconfigPath) {
|
|
|
178
177
|
// The `extends`-merged main options, normalized by TypeScript. Passing the
|
|
179
178
|
// config object (not the path) keeps TypeScript from re-reading this file; it
|
|
180
179
|
// reads only the ancestors.
|
|
181
|
-
const
|
|
180
|
+
const mainParsed = ts.parseJsonConfigFileContent({ extends: own.extends, compilerOptions: mainIsObject ? mainBlock : {} }, parseHost, (0, node_path_1.dirname)(tsconfigPath));
|
|
181
|
+
// A base that neither the tree nor `tsc` can read leaves the merged options
|
|
182
|
+
// incomplete, so a value it deprecates would be missed. The config does not
|
|
183
|
+
// compile in that state anyway; surface it rather than silently guessing.
|
|
184
|
+
if ((0, ts_config_1.extendsResolutionFailed)(mainParsed.errors)) {
|
|
185
|
+
devkit_1.logger.warn(`Could not resolve the "extends" chain of "${tsconfigPath}"; a TypeScript 6 deprecated option inherited from the unresolved base may have been missed. Make sure the config compiles.`);
|
|
186
|
+
}
|
|
187
|
+
const mainOptions = mainParsed.options;
|
|
182
188
|
const mainDeprecated = hasDeprecatedOption(ts, mainOptions);
|
|
183
189
|
let contents = original;
|
|
184
190
|
let changed = false;
|
|
@@ -36,6 +36,11 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
|
|
|
36
36
|
(0, child_process_1.execSync)(`npm config set //${listenAddress}:${port}/:_authToken "${authToken}" --ws=false`, {
|
|
37
37
|
windowsHide: true,
|
|
38
38
|
});
|
|
39
|
+
// pnpm 11 reads pnpm_config_* env vars instead of npm_config_*, and
|
|
40
|
+
// they take precedence over any registry configured in ~/.npmrc
|
|
41
|
+
process.env.pnpm_config_registry = registry;
|
|
42
|
+
process.env[`pnpm_config_//${listenAddress}:${port}/:_authToken`] =
|
|
43
|
+
authToken;
|
|
39
44
|
// bun
|
|
40
45
|
process.env.BUN_CONFIG_REGISTRY = registry;
|
|
41
46
|
process.env.BUN_CONFIG_TOKEN = authToken;
|
|
@@ -44,7 +49,7 @@ function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorag
|
|
|
44
49
|
// yarnv2
|
|
45
50
|
process.env.YARN_NPM_REGISTRY_SERVER = registry;
|
|
46
51
|
process.env.YARN_UNSAFE_HTTP_WHITELIST = listenAddress;
|
|
47
|
-
console.log('Set npm, bun, and yarn config registry to ' + registry);
|
|
52
|
+
console.log('Set npm, pnpm, bun, and yarn config registry to ' + registry);
|
|
48
53
|
resolve(() => {
|
|
49
54
|
childProcess.kill();
|
|
50
55
|
(0, child_process_1.execSync)(`npm config delete //${listenAddress}:${port}/:_authToken --ws=false`, {
|
|
@@ -5,12 +5,7 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const node_fs_1 = require("node:fs");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
|
-
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
9
8
|
const picomatch = require("picomatch");
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
11
|
-
const lock_file_1 = require("nx/src/plugins/js/lock-file/lock-file");
|
|
12
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
13
|
-
const installation_directory_1 = require("nx/src/utils/installation-directory");
|
|
14
9
|
const util_1 = require("./util");
|
|
15
10
|
let ts;
|
|
16
11
|
const resolvedTypescriptPaths = {};
|
|
@@ -20,12 +15,12 @@ function resolveTypescriptPath(projectRoot, workspaceRoot) {
|
|
|
20
15
|
// path is outside the workspace tree (e.g. pnpm's enableGlobalVirtualStore),
|
|
21
16
|
// since typescript is not a declared dep.
|
|
22
17
|
resolvedTypescriptPaths[projectRoot] ??= require.resolve('typescript', {
|
|
23
|
-
paths: [projectRoot, ...(0,
|
|
18
|
+
paths: [projectRoot, ...(0, internal_1.getNxRequirePaths)(workspaceRoot), __dirname],
|
|
24
19
|
});
|
|
25
20
|
return resolvedTypescriptPaths[projectRoot];
|
|
26
21
|
}
|
|
27
22
|
const TSCONFIG_CACHE_VERSION = 2;
|
|
28
|
-
const TS_CONFIG_CACHE_PATH = (0, node_path_1.join)(
|
|
23
|
+
const TS_CONFIG_CACHE_PATH = (0, node_path_1.join)(internal_1.workspaceDataDirectory, 'tsconfig-files.hash');
|
|
29
24
|
// Module-level cache store — each invocation gets a unique Symbol key
|
|
30
25
|
const cacheStore = new Map();
|
|
31
26
|
// Shared tsconfig cache — initialized once per batch, persisted to disk
|
|
@@ -117,8 +112,8 @@ const tsConfigGlob = '**/tsconfig*.json';
|
|
|
117
112
|
exports.createNodesV2 = [
|
|
118
113
|
tsConfigGlob,
|
|
119
114
|
async (configFilePaths, options, context) => {
|
|
120
|
-
const optionsHash = (0,
|
|
121
|
-
const targetsCachePath = (0, node_path_1.join)(
|
|
115
|
+
const optionsHash = (0, internal_1.hashObject)(options);
|
|
116
|
+
const targetsCachePath = (0, node_path_1.join)(internal_1.workspaceDataDirectory, `tsc-${optionsHash}.hash`);
|
|
122
117
|
const targetsCache = readFromCache(targetsCachePath);
|
|
123
118
|
// Each invocation gets a unique Symbol key — guaranteed no collisions
|
|
124
119
|
const cacheKey = Symbol('tsc-invocation');
|
|
@@ -136,7 +131,7 @@ exports.createNodesV2 = [
|
|
|
136
131
|
const normalizedOptions = normalizePluginOptions(options);
|
|
137
132
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
138
133
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
139
|
-
const lockFileName = (0,
|
|
134
|
+
const lockFileName = (0, internal_1.getLockFileName)(packageManager);
|
|
140
135
|
const { configFilePaths: validConfigFilePaths, hashes, projectRoots, } = await resolveValidConfigFilesAndHashes(configFilePaths, normalizedOptions, optionsHash, context, cache, lockFileName);
|
|
141
136
|
try {
|
|
142
137
|
return await (0, devkit_1.createNodesFromFiles)((configFilePath, options, context, idx) => {
|
|
@@ -171,7 +166,7 @@ exports.createNodesV2 = [
|
|
|
171
166
|
];
|
|
172
167
|
exports.createNodes = exports.createNodesV2;
|
|
173
168
|
async function resolveValidConfigFilesAndHashes(configFilePaths, options, optionsHash, context, cache, lockFileName) {
|
|
174
|
-
const lockFileHash = (0,
|
|
169
|
+
const lockFileHash = (0, internal_1.hashFile)((0, node_path_1.join)(context.workspaceRoot, lockFileName)) ?? '';
|
|
175
170
|
const validConfigFilePaths = [];
|
|
176
171
|
const hashes = [];
|
|
177
172
|
const projectRoots = [];
|
|
@@ -218,7 +213,7 @@ async function getConfigFileHash(configFilePath, workspaceRoot, project, options
|
|
|
218
213
|
packageJson = (0, devkit_1.readJsonFile)((0, node_path_1.join)(workspaceRoot, project.root, 'package.json'));
|
|
219
214
|
}
|
|
220
215
|
catch { }
|
|
221
|
-
return (0,
|
|
216
|
+
return (0, devkit_1.hashArray)([
|
|
222
217
|
...[
|
|
223
218
|
fullConfigPath,
|
|
224
219
|
...extendedConfigFiles.files.sort(),
|
|
@@ -228,7 +223,7 @@ async function getConfigFileHash(configFilePath, workspaceRoot, project, options
|
|
|
228
223
|
...extendedConfigFiles.packages.sort(),
|
|
229
224
|
lockFileHash,
|
|
230
225
|
optionsHash,
|
|
231
|
-
...(packageJson ? [(0,
|
|
226
|
+
...(packageJson ? [(0, internal_1.hashObject)(packageJson)] : []),
|
|
232
227
|
]);
|
|
233
228
|
}
|
|
234
229
|
function checkIfConfigFileShouldBeProject(config, cache) {
|
|
@@ -956,7 +951,7 @@ function getFileHash(filePath, workspaceRoot, cache) {
|
|
|
956
951
|
const relativePath = posixRelative(workspaceRoot, filePath);
|
|
957
952
|
if (!cache.fileHashes[relativePath]) {
|
|
958
953
|
const content = readFile(filePath, workspaceRoot, cache);
|
|
959
|
-
cache.fileHashes[relativePath] = (0,
|
|
954
|
+
cache.fileHashes[relativePath] = (0, devkit_1.hashArray)([content]);
|
|
960
955
|
}
|
|
961
956
|
return cache.fileHashes[relativePath];
|
|
962
957
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TargetConfiguration } from '@nx/devkit';
|
|
2
|
-
import { type PackageManagerCommands } from 'nx/src/utils/package-manager';
|
|
3
2
|
import { type ParsedCommandLine } from 'typescript';
|
|
3
|
+
import { type PackageManagerCommands } from '@nx/devkit/internal';
|
|
4
4
|
export type ExtendedConfigFile = {
|
|
5
5
|
filePath: string;
|
|
6
6
|
externalPackage?: string;
|
|
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateLockFile = updateLockFile;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
-
const
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
8
|
-
const lock_file_1 = require("nx/src/plugins/js/lock-file/lock-file");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
9
7
|
const semver_1 = require("semver");
|
|
10
8
|
async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
11
9
|
if (options?.skipLockFileUpdate) {
|
|
@@ -30,10 +28,10 @@ async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
|
30
28
|
}
|
|
31
29
|
return [];
|
|
32
30
|
}
|
|
33
|
-
const isDaemonEnabled =
|
|
31
|
+
const isDaemonEnabled = internal_1.daemonClient.enabled();
|
|
34
32
|
if (!dryRun && isDaemonEnabled) {
|
|
35
33
|
// if not in dry-run temporarily stop the daemon, as it will error if the lock file is updated
|
|
36
|
-
await
|
|
34
|
+
await internal_1.daemonClient.stop();
|
|
37
35
|
}
|
|
38
36
|
const packageManagerCommands = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
39
37
|
let installArgs = options?.installArgs || '';
|
|
@@ -48,7 +46,7 @@ async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
|
48
46
|
installArgs = `${installArgs} --ignore-scripts`.trim();
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
|
-
const lockFile = (0,
|
|
49
|
+
const lockFile = (0, internal_1.getLockFileName)(packageManager);
|
|
52
50
|
const command = `${packageManagerCommands.updateLockFile} ${installArgs}`.trim();
|
|
53
51
|
if (verbose) {
|
|
54
52
|
if (dryRun) {
|
|
@@ -65,7 +63,7 @@ async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
|
65
63
|
execLockFileUpdate(command, cwd, env);
|
|
66
64
|
if (isDaemonEnabled) {
|
|
67
65
|
try {
|
|
68
|
-
await
|
|
66
|
+
await internal_1.daemonClient.startInBackground();
|
|
69
67
|
}
|
|
70
68
|
catch (e) {
|
|
71
69
|
// If the daemon fails to start, we don't want to prevent the user from continuing, so we just log the error and move on
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ProjectGraph, Tree } from '@nx/devkit';
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
2
|
+
import { VersionActions } from 'nx/release';
|
|
3
|
+
import type { ResolveVersionForDependency } from 'nx/release';
|
|
4
|
+
import type { AfterAllProjectsVersioned, NxReleaseVersionConfiguration } from '@nx/devkit/internal';
|
|
4
5
|
export declare const afterAllProjectsVersioned: AfterAllProjectsVersioned;
|
|
5
6
|
export default class JsVersionActions extends VersionActions {
|
|
6
7
|
validManifestFilenames: string[];
|
|
8
|
+
excludeManifestsFromFormatting: boolean;
|
|
7
9
|
readCurrentVersionFromSourceManifest(tree: Tree): Promise<{
|
|
8
10
|
currentVersion: string;
|
|
9
11
|
manifestPath: string;
|
|
@@ -17,6 +19,13 @@ export default class JsVersionActions extends VersionActions {
|
|
|
17
19
|
dependencyCollection: string | null;
|
|
18
20
|
}>;
|
|
19
21
|
updateProjectVersion(tree: Tree, newVersion: string): Promise<string[]>;
|
|
20
|
-
updateProjectDependencies(tree: Tree, projectGraph: ProjectGraph, dependenciesToUpdate: Record<string, string
|
|
22
|
+
updateProjectDependencies(tree: Tree, projectGraph: ProjectGraph, dependenciesToUpdate: Record<string, string>, resolveVersionForDependency?: ResolveVersionForDependency): Promise<string[]>;
|
|
23
|
+
private getLocalDependencyProjectLookup;
|
|
24
|
+
private resolveLocalDependencySpecifier;
|
|
25
|
+
private applyVersionPrefix;
|
|
26
|
+
private updateManifestValues;
|
|
27
|
+
private readAndValidateManifest;
|
|
28
|
+
private validateManifestUpdates;
|
|
29
|
+
private detectFormattingOptions;
|
|
21
30
|
private isLocalDependencyProtocol;
|
|
22
31
|
}
|