@pnpm/resolving.jsr-specifier-parser 1100.0.1 → 1100.0.3
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/CHANGELOG.md +10 -0
- package/lib/index.js +7 -4
- package/package.json +5 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# @pnpm/resolving.jsr-specifier-parser
|
|
2
|
+
|
|
3
|
+
## 1100.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Republished every package: the tarballs published by the v11.13.1 through v11.16.0 releases were missing most of their compiled files due to a packing bug [#13164](https://github.com/pnpm/pnpm/issues/13164).
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @pnpm/error@1100.1.0
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PnpmError } from '@pnpm/error';
|
|
2
|
+
import validateNpmPackageName from 'validate-npm-package-name';
|
|
2
3
|
export function parseJsrSpecifier(rawSpecifier, alias) {
|
|
3
4
|
if (!rawSpecifier.startsWith('jsr:'))
|
|
4
5
|
return null;
|
|
@@ -39,12 +40,14 @@ function jsrToNpmPackageName(jsrPkgName) {
|
|
|
39
40
|
if (jsrPkgName[0] !== '@') {
|
|
40
41
|
throw new PnpmError('MISSING_JSR_PACKAGE_SCOPE', 'Package names from JSR must have a scope');
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
// The returned name is used in registry URLs and metadata cache file paths,
|
|
44
|
+
// so anything that is not a valid npm package name must never make it through.
|
|
45
|
+
if (!validateNpmPackageName(jsrPkgName).validForOldPackages) {
|
|
44
46
|
throw new PnpmError('INVALID_JSR_PACKAGE_NAME', `The package name '${jsrPkgName}' is invalid`);
|
|
45
47
|
}
|
|
46
|
-
const
|
|
48
|
+
const sepIndex = jsrPkgName.indexOf('/');
|
|
49
|
+
const scope = jsrPkgName.substring('@'.length, sepIndex);
|
|
47
50
|
const name = jsrPkgName.substring(sepIndex + '/'.length);
|
|
48
|
-
return `@jsr/${scope
|
|
51
|
+
return `@jsr/${scope}__${name}`;
|
|
49
52
|
}
|
|
50
53
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/resolving.jsr-specifier-parser",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.3",
|
|
4
4
|
"description": "Parser of jsr specifiers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
"!*.map"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@pnpm/error": "1100.0
|
|
31
|
+
"@pnpm/error": "1100.1.0",
|
|
32
|
+
"validate-npm-package-name": "7.0.2"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@jest/globals": "30.4.1",
|
|
35
|
-
"@pnpm/resolving.jsr-specifier-parser": "1100.0.
|
|
36
|
+
"@pnpm/resolving.jsr-specifier-parser": "1100.0.3",
|
|
37
|
+
"@types/validate-npm-package-name": "^4.0.2"
|
|
36
38
|
},
|
|
37
39
|
"engines": {
|
|
38
40
|
"node": ">=22.13"
|