@nx/js 24.0.5 → 24.0.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/internal.d.ts +1 -0
- package/dist/internal.js +4 -2
- package/dist/src/generators/library/utils/add-release-config.js +1 -1
- package/dist/src/release/utils/update-lock-file.js +21 -1
- package/dist/src/utils/package-json/runtime-dependencies.d.ts +1 -0
- package/dist/src/utils/package-json/runtime-dependencies.js +14 -0
- package/package.json +11 -11
package/dist/internal.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { walkTsconfigExtendsChain, type RawTsconfigJsonCache, } from './src/util
|
|
|
5
5
|
export { isEsmProject } from './src/utils/module-format/is-esm-project';
|
|
6
6
|
export { PNPM_INSTALL_SETTINGS_INPUTS, PNPM_MAJOR_RUNTIME_INPUT, pnpmInstallSettingsInputsForInferredTarget, shouldIncludePnpmMajorRuntimeInput, } from './src/utils/pnpm-install-settings-inputs';
|
|
7
7
|
export { addPnpmDeployOutputCacheInputs } from './src/utils/pnpm-deploy-output-cache-inputs';
|
|
8
|
+
export { readRuntimeDependencies } from './src/utils/package-json/runtime-dependencies';
|
|
8
9
|
export type { MatchedTargetRef } from './src/utils/target-defaults-matching';
|
|
9
10
|
export { TS_SOLUTION_SETUP_TSCONFIG_INPUT, addProjectToTsSolutionWorkspace, assertNotUsingTsSolutionSetup, findRuntimeTsConfigName, getDefinedCustomConditionName, getProjectSourceRoot, getProjectType, isUsingTsSolutionSetup, shouldConfigureTsSolutionSetup, updateTsconfigFiles, } from './src/utils/typescript/ts-solution-setup';
|
|
10
11
|
export { ensureTypescriptPlugin, registerTypescriptPluginForTypecheck, } from './src/utils/typescript/add-typescript-plugin';
|
package/dist/internal.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// internal consumers and may change without semver protection. Consider it
|
|
6
6
|
// the @nx/js equivalent of `@nx/devkit/internal`.
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
exports.typesNodeVersion = exports.tsLibVersion = exports.swcNodeVersion = exports.swcHelpersVersion = exports.swcCoreVersion = exports.swcCliVersion = exports.prettierVersion = exports.esbuildVersion = exports.nxVersion = exports.releaseTasks = exports.addReleaseConfigForTsSolution = exports.addReleaseConfigForNonTsSolution = exports.addLocalRegistryScripts = exports.stripGlobToBaseDir = exports.getImportPath = exports.createGlobPatternsForDependencies = exports.addLintingToProject = exports.detectLinters = exports.normalizeUnitTestRunnerOption = exports.normalizeLinterOption = exports.selectTypecheckTsConfig = exports.createTypecheckTarget = exports.isValidPackageJsonBuildConfig = exports.addBuildAndWatchDepsTargets = void 0;
|
|
8
|
+
exports.getProjectPackageManagerWorkspaceStateWarningTask = exports.getProjectPackageManagerWorkspaceState = exports.getNpmScope = exports.sortPackageJsonFields = exports.CopyAssetsHandler = exports.addSwcRegisterDependencies = exports.addSwcDependencies = exports.acknowledgeSwcBuildScripts = exports.addSwcTestConfig = exports.addSwcConfig = exports.createTmpTsConfig = exports.computeCompilerOptionsPaths = exports.calculateProjectDependencies = exports.calculateProjectBuildableDependencies = exports.compileTypeScript = exports.getNeededCompilerOptionOverrides = exports.isTypescriptVersionAtLeast = exports.getTsConfigModuleResolution = exports.getRangeMinimum = exports.ensureTypescript = exports.createTreeParseConfigHost = exports.getTsConfigBaseOptions = exports.registerTypescriptPluginForTypecheck = exports.ensureTypescriptPlugin = exports.updateTsconfigFiles = exports.shouldConfigureTsSolutionSetup = exports.isUsingTsSolutionSetup = exports.getProjectType = exports.getProjectSourceRoot = exports.getDefinedCustomConditionName = exports.findRuntimeTsConfigName = exports.assertNotUsingTsSolutionSetup = exports.addProjectToTsSolutionWorkspace = exports.TS_SOLUTION_SETUP_TSCONFIG_INPUT = exports.readRuntimeDependencies = exports.addPnpmDeployOutputCacheInputs = exports.shouldIncludePnpmMajorRuntimeInput = exports.pnpmInstallSettingsInputsForInferredTarget = exports.PNPM_MAJOR_RUNTIME_INPUT = exports.PNPM_INSTALL_SETTINGS_INPUTS = exports.isEsmProject = exports.walkTsconfigExtendsChain = exports.findProjectsNpmDependencies = exports.isBuiltinModuleImport = exports.TargetProjectLocator = exports.requireWithTsconfigFallback = exports.registerTsConfigPaths = exports.registerTsProject = exports.loadTsFile = exports.forceRegisterEsmLoader = void 0;
|
|
9
|
+
exports.typesNodeVersion = exports.tsLibVersion = exports.swcNodeVersion = exports.swcHelpersVersion = exports.swcCoreVersion = exports.swcCliVersion = exports.prettierVersion = exports.esbuildVersion = exports.nxVersion = exports.releaseTasks = exports.addReleaseConfigForTsSolution = exports.addReleaseConfigForNonTsSolution = exports.addLocalRegistryScripts = exports.stripGlobToBaseDir = exports.getImportPath = exports.createGlobPatternsForDependencies = exports.addLintingToProject = exports.detectLinters = exports.normalizeUnitTestRunnerOption = exports.normalizeLinterOption = exports.selectTypecheckTsConfig = exports.createTypecheckTarget = exports.isValidPackageJsonBuildConfig = exports.addBuildAndWatchDepsTargets = exports.findNpmDependencies = void 0;
|
|
10
10
|
// Re-exports of nx-source internals.
|
|
11
11
|
var internal_1 = require("@nx/devkit/internal");
|
|
12
12
|
Object.defineProperty(exports, "forceRegisterEsmLoader", { enumerable: true, get: function () { return internal_1.forceRegisterEsmLoader; } });
|
|
@@ -34,6 +34,8 @@ Object.defineProperty(exports, "pnpmInstallSettingsInputsForInferredTarget", { e
|
|
|
34
34
|
Object.defineProperty(exports, "shouldIncludePnpmMajorRuntimeInput", { enumerable: true, get: function () { return pnpm_install_settings_inputs_1.shouldIncludePnpmMajorRuntimeInput; } });
|
|
35
35
|
var pnpm_deploy_output_cache_inputs_1 = require("./src/utils/pnpm-deploy-output-cache-inputs");
|
|
36
36
|
Object.defineProperty(exports, "addPnpmDeployOutputCacheInputs", { enumerable: true, get: function () { return pnpm_deploy_output_cache_inputs_1.addPnpmDeployOutputCacheInputs; } });
|
|
37
|
+
var runtime_dependencies_1 = require("./src/utils/package-json/runtime-dependencies");
|
|
38
|
+
Object.defineProperty(exports, "readRuntimeDependencies", { enumerable: true, get: function () { return runtime_dependencies_1.readRuntimeDependencies; } });
|
|
37
39
|
// TS solution setup detection
|
|
38
40
|
var ts_solution_setup_1 = require("./src/utils/typescript/ts-solution-setup");
|
|
39
41
|
Object.defineProperty(exports, "TS_SOLUTION_SETUP_TSCONFIG_INPUT", { enumerable: true, get: function () { return ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT; } });
|
|
@@ -17,7 +17,7 @@ async function addReleaseConfigForTsSolution(tree, projectName, projectConfigura
|
|
|
17
17
|
nxJson.release = {
|
|
18
18
|
...nxJson.release,
|
|
19
19
|
version: {
|
|
20
|
-
preVersionCommand: `${pmc.
|
|
20
|
+
preVersionCommand: `${pmc.exec} nx run-many -t build`,
|
|
21
21
|
...nxJson.release?.version,
|
|
22
22
|
},
|
|
23
23
|
};
|
|
@@ -3,6 +3,8 @@ 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 fs_1 = require("fs");
|
|
7
|
+
const path_1 = require("path");
|
|
6
8
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
9
|
const semver_1 = require("semver");
|
|
8
10
|
async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
@@ -22,7 +24,8 @@ async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
|
22
24
|
return [];
|
|
23
25
|
}
|
|
24
26
|
const workspacesEnabled = (0, devkit_1.isWorkspacesEnabled)(packageManager, cwd);
|
|
25
|
-
if (!workspacesEnabled
|
|
27
|
+
if (!workspacesEnabled &&
|
|
28
|
+
!(packageManager === 'npm' && isNpmLockFileRootVersionStale(cwd))) {
|
|
26
29
|
if (verbose) {
|
|
27
30
|
console.log(`\nSkipped lock file update because ${packageManager} workspaces are not enabled.`);
|
|
28
31
|
}
|
|
@@ -94,6 +97,23 @@ async function updateLockFile(cwd, { dryRun, verbose, options, }) {
|
|
|
94
97
|
}
|
|
95
98
|
return newlyChanged;
|
|
96
99
|
}
|
|
100
|
+
function isNpmLockFileRootVersionStale(cwd) {
|
|
101
|
+
try {
|
|
102
|
+
const lockFilePath = (0, path_1.join)(cwd, (0, internal_1.getLockFileName)('npm'));
|
|
103
|
+
if (!(0, fs_1.existsSync)(lockFilePath)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
const { version } = (0, devkit_1.readJsonFile)((0, path_1.join)(cwd, 'package.json'));
|
|
107
|
+
const lockFile = (0, devkit_1.readJsonFile)(lockFilePath);
|
|
108
|
+
const lockFileRootVersion = lockFile.lockfileVersion === 1
|
|
109
|
+
? lockFile.version
|
|
110
|
+
: lockFile.packages?.['']?.version;
|
|
111
|
+
return !!version && lockFileRootVersion !== version;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
97
117
|
/**
|
|
98
118
|
* Returns the set of modified, added, and untracked file paths reported by git.
|
|
99
119
|
* Used to detect all filesystem side-effects of the lock file update command.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readRuntimeDependencies(runtimeDependencies: string[], requirePaths: string[]): Record<string, string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readRuntimeDependencies = readRuntimeDependencies;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
function readRuntimeDependencies(runtimeDependencies, requirePaths) {
|
|
6
|
+
const dependencies = {};
|
|
7
|
+
for (const dependency of runtimeDependencies) {
|
|
8
|
+
const { name, version } = (0, internal_1.readModulePackageJson)(dependency, requirePaths).packageJson;
|
|
9
|
+
// An alias installs `name` in the folder `dependency`, which `require` loads.
|
|
10
|
+
dependencies[dependency] =
|
|
11
|
+
name === dependency ? version : `npm:${name}@${version}`;
|
|
12
|
+
}
|
|
13
|
+
return dependencies;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "24.0.
|
|
3
|
+
"version": "24.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
"@babel/preset-env": "^7.23.2",
|
|
163
163
|
"@babel/preset-typescript": "^7.22.5",
|
|
164
164
|
"@babel/runtime": "^7.22.6",
|
|
165
|
-
"@nx/devkit": "24.0.
|
|
166
|
-
"@nx/workspace": "24.0.
|
|
165
|
+
"@nx/devkit": "24.0.6",
|
|
166
|
+
"@nx/workspace": "24.0.6",
|
|
167
167
|
"@zkochan/js-yaml": "0.0.7",
|
|
168
168
|
"babel-plugin-const-enum": "^1.0.1",
|
|
169
169
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -183,14 +183,14 @@
|
|
|
183
183
|
"tslib": "^2.3.0"
|
|
184
184
|
},
|
|
185
185
|
"devDependencies": {
|
|
186
|
-
"@nx/esbuild": "24.0.
|
|
187
|
-
"@nx/eslint": "24.0.
|
|
188
|
-
"@nx/jest": "24.0.
|
|
189
|
-
"@nx/oxlint": "24.0.
|
|
190
|
-
"@nx/rollup": "24.0.
|
|
191
|
-
"@nx/vite": "24.0.
|
|
192
|
-
"@nx/vitest": "24.0.
|
|
193
|
-
"nx": "24.0.
|
|
186
|
+
"@nx/esbuild": "24.0.6",
|
|
187
|
+
"@nx/eslint": "24.0.6",
|
|
188
|
+
"@nx/jest": "24.0.6",
|
|
189
|
+
"@nx/oxlint": "24.0.6",
|
|
190
|
+
"@nx/rollup": "24.0.6",
|
|
191
|
+
"@nx/vite": "24.0.6",
|
|
192
|
+
"@nx/vitest": "24.0.6",
|
|
193
|
+
"nx": "24.0.6"
|
|
194
194
|
},
|
|
195
195
|
"peerDependencies": {
|
|
196
196
|
"@swc/cli": ">=0.6.0 <0.9.0",
|