@vltpkg/spec 1.0.0-rc.27 → 1.0.0-rc.29
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/browser.js +10 -6
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/browser.js
CHANGED
|
@@ -47,7 +47,7 @@ export const getOptions = (options) => ({
|
|
|
47
47
|
...defaultJsrRegistries,
|
|
48
48
|
},
|
|
49
49
|
registry: options?.registry ?? defaultRegistry,
|
|
50
|
-
'
|
|
50
|
+
'scoped-registries': options?.['scoped-registries'] ?? {},
|
|
51
51
|
'git-hosts': options?.['git-hosts'] ?
|
|
52
52
|
{
|
|
53
53
|
...defaultGitHosts,
|
|
@@ -500,7 +500,7 @@ export class Spec {
|
|
|
500
500
|
this.distTag = this.bareSpec;
|
|
501
501
|
}
|
|
502
502
|
this.registrySpec = this.bareSpec;
|
|
503
|
-
const { '
|
|
503
|
+
const { 'scoped-registries': scopeRegs, registry } = this.options;
|
|
504
504
|
const scopeReg = this.scope && scopeRegs[this.scope];
|
|
505
505
|
this.registry = scopeReg ?? registry;
|
|
506
506
|
// no guessing the tarball for JSR registries
|
|
@@ -517,7 +517,7 @@ export class Spec {
|
|
|
517
517
|
if (s > 1 && s < name.length - 1) {
|
|
518
518
|
const scope = name.substring(0, s);
|
|
519
519
|
this.registry = this.scopeRegistry =
|
|
520
|
-
this.options['
|
|
520
|
+
this.options['scoped-registries'][scope];
|
|
521
521
|
this.scope = scope;
|
|
522
522
|
}
|
|
523
523
|
}
|
|
@@ -571,7 +571,11 @@ export class Spec {
|
|
|
571
571
|
if (!registry || !range?.isSingle)
|
|
572
572
|
return;
|
|
573
573
|
const stripScope = /^@[^/]+\//;
|
|
574
|
-
|
|
574
|
+
// resolve relative to the registry URL so that any path component
|
|
575
|
+
// (e.g. https://registry.example.com/npm/) is preserved. Using a
|
|
576
|
+
// leading `/` would make the path absolute and discard that prefix.
|
|
577
|
+
const base = registry.endsWith('/') ? registry : registry + '/';
|
|
578
|
+
this.conventionalRegistryTarball = String(new URL(`${name}/-/${name.replace(stripScope, '')}-${range}.tgz`, base));
|
|
575
579
|
}
|
|
576
580
|
#parseRegistrySpec(s, url) {
|
|
577
581
|
// note: this takes priority over the scoped registry, if set
|
|
@@ -592,8 +596,8 @@ export class Spec {
|
|
|
592
596
|
const name = s.startsWith('@jsr/') ? s : (`@jsr/${s.replace(/^@/, '').replace(/\//, '__')}`);
|
|
593
597
|
this.subspec = this.constructor.parse(name, {
|
|
594
598
|
...this.options,
|
|
595
|
-
'
|
|
596
|
-
...this.options['
|
|
599
|
+
'scoped-registries': {
|
|
600
|
+
...this.options['scoped-registries'],
|
|
597
601
|
'@jsr': url,
|
|
598
602
|
},
|
|
599
603
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type SpecOptionsFilled = {
|
|
|
13
13
|
/** tarball hosting services for hosts listed in git-hosts */
|
|
14
14
|
'git-host-archives': Record<string, string>;
|
|
15
15
|
/** registries mapped to a `@scope` */
|
|
16
|
-
'
|
|
16
|
+
'scoped-registries': Record<Scope, string>;
|
|
17
17
|
/** registries that work like https://npm.jsr.io */
|
|
18
18
|
'jsr-registries': Record<string, string>;
|
|
19
19
|
catalog: Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/spec",
|
|
3
3
|
"description": "Package specifier library",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.29",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"url": "http://vlt.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vltpkg/error-cause": "1.0.0-rc.
|
|
17
|
-
"@vltpkg/semver": "1.0.0-rc.
|
|
16
|
+
"@vltpkg/error-cause": "1.0.0-rc.29",
|
|
17
|
+
"@vltpkg/semver": "1.0.0-rc.29"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@eslint/js": "^9.39.1",
|