@nx/workspace 22.4.4 → 22.4.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "22.4.
|
|
3
|
+
"version": "22.4.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@nx/devkit": "22.4.
|
|
41
|
+
"@nx/devkit": "22.4.5",
|
|
42
42
|
"@zkochan/js-yaml": "0.0.7",
|
|
43
43
|
"chalk": "^4.1.0",
|
|
44
44
|
"enquirer": "~2.3.6",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"semver": "^7.6.3",
|
|
47
47
|
"tslib": "^2.3.0",
|
|
48
48
|
"yargs-parser": "21.1.1",
|
|
49
|
-
"nx": "22.4.
|
|
49
|
+
"nx": "22.4.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"nx": "22.4.
|
|
52
|
+
"nx": "22.4.5"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-npm-package-version.d.ts","sourceRoot":"","sources":["../../../../../../packages/workspace/src/generators/utils/get-npm-package-version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-npm-package-version.d.ts","sourceRoot":"","sources":["../../../../../../packages/workspace/src/generators/utils/get-npm-package-version.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,GAAG,IAAI,CAmCf"}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNpmPackageVersion = getNpmPackageVersion;
|
|
4
|
+
// Valid npm package names: optional @scope/ prefix, then URL-safe chars (A-Za-z0-9 . - _ ~)
|
|
5
|
+
// Must not start with . or _ per npm rules. Uppercase allowed for legacy packages.
|
|
6
|
+
const validNpmPackageNameRegex = /^(@[a-zA-Z0-9~-][a-zA-Z0-9._~-]*\/)?[a-zA-Z0-9~-][a-zA-Z0-9._~-]*$/;
|
|
4
7
|
function getNpmPackageVersion(packageName, packageVersion) {
|
|
8
|
+
if (!validNpmPackageNameRegex.test(packageName)) {
|
|
9
|
+
throw new Error(`Invalid npm package name: "${packageName}". Package names can only contain URL-safe characters (letters, digits, hyphens, dots, underscores, and tildes).`);
|
|
10
|
+
}
|
|
5
11
|
try {
|
|
6
|
-
const
|
|
12
|
+
const packageSpec = packageVersion
|
|
13
|
+
? `${packageName}@${packageVersion}`
|
|
14
|
+
: packageName;
|
|
15
|
+
// Use npm.cmd on Windows since execFileSync without a shell can't run .cmd files
|
|
16
|
+
const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
17
|
+
const version = require('child_process').execFileSync(npmBin, ['view', packageSpec, 'version', '--json'], {
|
|
7
18
|
stdio: ['pipe', 'pipe', 'ignore'],
|
|
8
19
|
windowsHide: false,
|
|
9
20
|
});
|