@vltpkg/cli-js 1.1.1 → 1.3.0
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/{access-YYMAAPHV.js → access-HIVJOWXZ.js} +10 -10
- package/{bugs-RK5JBPSC.js → bugs-2KFUYMPS.js} +19 -19
- package/{build-DVJSYCNF.js → build-CX6YZ4LS.js} +12 -12
- package/{cache-JKQNGZ7L.js → cache-I6L5ZRGD.js} +145 -16
- package/cache-unzip-src-unzip.js +2953 -164
- package/{src-MOKZQTH2.js → chunk-263MHLR3.js} +299 -43
- package/{chunk-3LUM7NX5.js → chunk-2HXJ4ZSF.js} +3 -3
- package/{chunk-GDJ7JT2R.js → chunk-33HBY5CF.js} +1 -1
- package/{chunk-MZA6N2TA.js → chunk-C6LK7C3L.js} +4 -4
- package/{chunk-34TE4HZS.js → chunk-CU752KW7.js} +2 -2
- package/{chunk-2PWSMJD7.js → chunk-D2LEK7VS.js} +1 -1
- package/{chunk-CEHPRPGQ.js → chunk-ENSGPOLR.js} +46 -0
- package/{chunk-V4YCZZHY.js → chunk-EP7AVBIO.js} +16 -8
- package/{chunk-DS7YMIHP.js → chunk-FHMIECHI.js} +158 -59
- package/chunk-GDV5LSQ2.js +75 -0
- package/{chunk-BWEH7DHQ.js → chunk-HCZOVC3Y.js} +1 -1
- package/{chunk-CBASIDQH.js → chunk-I6QGYSB4.js} +1 -1
- package/{chunk-KDF7PEBY.js → chunk-ILRJWH6A.js} +5 -5
- package/{chunk-JZJWASXL.js → chunk-J2WL3A3C.js} +134 -68
- package/{chunk-YOE3VZFX.js → chunk-J3R4XWB3.js} +2 -2
- package/{chunk-DF5K4CYR.js → chunk-JFHEXCG5.js} +5 -5
- package/{chunk-LR42WTKN.js → chunk-MJWUULO6.js} +14 -12
- package/{chunk-QQYTPGIL.js → chunk-N4RCKCHY.js} +1 -1
- package/{chunk-X2AWQGYG.js → chunk-P4LLYWCG.js} +112 -23
- package/{chunk-BHJT53TP.js → chunk-PDWPFR5T.js} +1 -1
- package/{chunk-XIF734VO.js → chunk-QETVMIIT.js} +4 -4
- package/{chunk-WE2TQN32.js → chunk-QWJDHBV7.js} +4 -3
- package/{chunk-VFBCWAOC.js → chunk-RH2Y7MPW.js} +29 -0
- package/{chunk-LN2A74PF.js → chunk-SVMH3NDM.js} +277 -50
- package/{chunk-DR4Z63B6.js → chunk-TYLYZKVA.js} +14 -11
- package/{chunk-XKVU23NC.js → chunk-V7EQZOO5.js} +1 -1
- package/{chunk-YBVTY6ZW.js → chunk-VBADA6QU.js} +1 -1
- package/{chunk-GDT6KI4I.js → chunk-W6UMN2YJ.js} +4 -4
- package/{chunk-VE6CCH33.js → chunk-Y5PA7DVK.js} +1 -0
- package/{chunk-6FT6K5YN.js → chunk-YZWFWSY7.js} +25 -7
- package/{chunk-SNOBGFNM.js → chunk-ZNUXDX6R.js} +50 -8
- package/{ci-WVYVR4XK.js → ci-BX54SEU3.js} +12 -12
- package/cli-package.json +3 -2
- package/{config-VYOTYBGS.js → config-HFF6XDCV.js} +9 -9
- package/{config-2MFZVP2N.js → config-WBVJX42R.js} +12 -12
- package/{create-OJPLHBRR.js → create-W67HRHWZ.js} +20 -20
- package/{deprecate-V4PKGFF7.js → deprecate-5T6JTGJ3.js} +14 -14
- package/{devtools-UEMPW5GG.js → devtools-UMJUK42W.js} +2 -2
- package/{dist-tag-DNLV4VDE.js → dist-tag-YIZTS7GF.js} +10 -10
- package/{docs-LXHDCGL5.js → docs-G7CKMPCL.js} +19 -19
- package/{exec-P32YSP44.js → exec-YYCAZZ6Z.js} +20 -20
- package/{exec-cache-JZ5PDTOY.js → exec-cache-6ENHAGC6.js} +18 -18
- package/{exec-local-HHA464H4.js → exec-local-OXG3PSLF.js} +17 -17
- package/{help-GVTTOYUL.js → help-RMOIAILM.js} +4 -4
- package/{init-RENGG74N.js → init-UPEQXC4D.js} +12 -12
- package/{install-V6VXOBH2.js → install-U7LLEQU6.js} +18 -18
- package/{list-7N7Y5OXB.js → list-N6CKPXTK.js} +20 -20
- package/{login-D2QSAUJC.js → login-MCO4ZLVF.js} +14 -14
- package/{logout-QPOYBQNF.js → logout-BJ4QRZYG.js} +10 -10
- package/{pack-4YYGXP3A.js → pack-U6PYRFZ6.js} +13 -13
- package/package.json +1 -1
- package/{ping-QYRIZONU.js → ping-VFB6SCMH.js} +10 -10
- package/{pkg-WQTNABKT.js → pkg-ZNK5SCF4.js} +13 -13
- package/{profile-PRI7WXK7.js → profile-TW32HLYA.js} +10 -10
- package/{publish-PSBYJQS7.js → publish-AHOITWZQ.js} +36 -21
- package/{query-UFYLQW4N.js → query-KKP5PNSQ.js} +20 -20
- package/{registry-YTJZ3AQD.js → registry-VHB65BWD.js} +5 -5
- package/registry-client-src-revalidate.js +5936 -5801
- package/{repo-4S6ETFXX.js → repo-BHTVK5KE.js} +19 -19
- package/{reporter-GLWYHI2Y.js → reporter-VQU7HYKM.js} +77 -77
- package/{run-OU7NUB7A.js → run-UD32OTUJ.js} +17 -17
- package/{run-exec-QPBY7ULE.js → run-exec-NOCIUNGL.js} +17 -17
- package/security-archive-src-update-expired.js +1 -1
- package/{setup-23QXG473.js → setup-PBCWOSTV.js} +18 -18
- package/{src-575IYJOL.js → src-LRKPUV4J.js} +16 -16
- package/src-T5FBZFMV.js +222 -0
- package/{src-3GN7TDNH.js → src-Z44JKVWS.js} +9 -7
- package/{token-FCIA3RGD.js → token-PCPB6NOL.js} +10 -10
- package/{uninstall-BQVZVKB5.js → uninstall-LOGSQXFS.js} +14 -14
- package/{unpublish-YGJ5HEYF.js → unpublish-O3UFCTEJ.js} +10 -10
- package/{update-WCGV66JK.js → update-WBCLWGLN.js} +17 -17
- package/{version-7EA3UQG7.js → version-S3LCB2TQ.js} +13 -13
- package/{view-5FWIENVE.js → view-LMPENVAJ.js} +12 -12
- package/vlr.js +1 -1
- package/vlrx.js +1 -1
- package/vlt.js +1 -1
- package/vlx.js +1 -1
- package/vlxl.js +1 -1
- package/{whoami-O4ZTBIC4.js → whoami-LYMG7R3P.js} +10 -10
- package/chunk-WD74RJXW.js +0 -75
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
graphRun,
|
|
14
14
|
graphRunSync,
|
|
15
15
|
joinDepIDTuple
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-J3R4XWB3.js";
|
|
17
17
|
import {
|
|
18
18
|
Spec
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-V7EQZOO5.js";
|
|
20
20
|
import {
|
|
21
21
|
load,
|
|
22
22
|
parse as parse2,
|
|
@@ -28,6 +28,10 @@ import {
|
|
|
28
28
|
promiseSpawn,
|
|
29
29
|
whichSync
|
|
30
30
|
} from "./chunk-U7TEQCBN.js";
|
|
31
|
+
import {
|
|
32
|
+
ot,
|
|
33
|
+
ts
|
|
34
|
+
} from "./chunk-Y5PA7DVK.js";
|
|
31
35
|
import {
|
|
32
36
|
Range,
|
|
33
37
|
Version,
|
|
@@ -37,11 +41,9 @@ import {
|
|
|
37
41
|
longDependencyTypes,
|
|
38
42
|
normalizeManifest,
|
|
39
43
|
parse,
|
|
44
|
+
parseRange,
|
|
40
45
|
satisfies
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
ts
|
|
44
|
-
} from "./chunk-VE6CCH33.js";
|
|
46
|
+
} from "./chunk-RH2Y7MPW.js";
|
|
45
47
|
import {
|
|
46
48
|
error
|
|
47
49
|
} from "./chunk-WZWDS3W4.js";
|
|
@@ -5771,6 +5773,59 @@ var assertWSConfig = (conf, path2) => {
|
|
|
5771
5773
|
wanted: "string | string[] | { [group: string]: string | string[] }"
|
|
5772
5774
|
});
|
|
5773
5775
|
};
|
|
5776
|
+
var manifestWSIgnoredKeys = /* @__PURE__ */ new Set(["nohoist"]);
|
|
5777
|
+
var asManifestWSConfig = (conf, path2) => {
|
|
5778
|
+
if (conf && typeof conf === "object" && !Array.isArray(conf)) {
|
|
5779
|
+
const groups = Object.keys(conf).filter(
|
|
5780
|
+
(k) => k !== "packages" && !manifestWSIgnoredKeys.has(k)
|
|
5781
|
+
);
|
|
5782
|
+
if (groups.length) {
|
|
5783
|
+
throw error(
|
|
5784
|
+
'Named workspace groups are not supported in package.json. Move them to the "workspaces" field of vlt.json to use them.',
|
|
5785
|
+
{
|
|
5786
|
+
path: path2,
|
|
5787
|
+
found: groups,
|
|
5788
|
+
wanted: "string | string[] | { packages: string[] }"
|
|
5789
|
+
}
|
|
5790
|
+
);
|
|
5791
|
+
}
|
|
5792
|
+
const { packages } = conf;
|
|
5793
|
+
if (packages === void 0) return {};
|
|
5794
|
+
return asWSConfig({ packages }, path2);
|
|
5795
|
+
}
|
|
5796
|
+
return asWSConfig(conf, path2);
|
|
5797
|
+
};
|
|
5798
|
+
var resolveWSConfig = (projectRoot, packageJson = new PackageJson()) => {
|
|
5799
|
+
const fromVltJson = load("workspaces", assertWSConfig);
|
|
5800
|
+
if (fromVltJson !== void 0) {
|
|
5801
|
+
return { config: asWSConfig(fromVltJson), source: "vlt.json" };
|
|
5802
|
+
}
|
|
5803
|
+
const workspaces = packageJson.maybeRead(projectRoot)?.workspaces;
|
|
5804
|
+
if (workspaces === void 0) return { config: {} };
|
|
5805
|
+
return {
|
|
5806
|
+
config: asManifestWSConfig(
|
|
5807
|
+
workspaces,
|
|
5808
|
+
resolve4(projectRoot, "package.json")
|
|
5809
|
+
),
|
|
5810
|
+
source: "package.json"
|
|
5811
|
+
};
|
|
5812
|
+
};
|
|
5813
|
+
var splitNegatedPatterns = (all) => {
|
|
5814
|
+
const patterns = [];
|
|
5815
|
+
let ignore = [];
|
|
5816
|
+
for (const orig of all) {
|
|
5817
|
+
const excl = /^!+/.exec(orig);
|
|
5818
|
+
const stripped = excl ? orig.slice(excl[0].length) : orig;
|
|
5819
|
+
const pattern = stripped.replace(/^\.?\/+/, "");
|
|
5820
|
+
if (excl && excl[0].length % 2 === 1) {
|
|
5821
|
+
ignore.push(pattern);
|
|
5822
|
+
continue;
|
|
5823
|
+
}
|
|
5824
|
+
ignore = ignore.filter((ign) => !minimatch(pattern, ign));
|
|
5825
|
+
patterns.push(pattern);
|
|
5826
|
+
}
|
|
5827
|
+
return { patterns, ignore };
|
|
5828
|
+
};
|
|
5774
5829
|
var Monorepo = class _Monorepo {
|
|
5775
5830
|
/** The project root where vlt.json is found */
|
|
5776
5831
|
projectRoot;
|
|
@@ -5795,9 +5850,9 @@ var Monorepo = class _Monorepo {
|
|
|
5795
5850
|
if (options.load) this.load(options.load);
|
|
5796
5851
|
}
|
|
5797
5852
|
/**
|
|
5798
|
-
* Load the workspace definitions from vlt.json,
|
|
5799
|
-
*
|
|
5800
|
-
* form.
|
|
5853
|
+
* Load the workspace definitions from vlt.json, or from the root
|
|
5854
|
+
* package.json when vlt.json declares none, canonicalizing the result
|
|
5855
|
+
* into the effective `{[group:string]:string[]}` form.
|
|
5801
5856
|
*
|
|
5802
5857
|
* Eg:
|
|
5803
5858
|
* - `"src/*"` => `{packages:["src/*"]}`
|
|
@@ -5805,9 +5860,10 @@ var Monorepo = class _Monorepo {
|
|
|
5805
5860
|
*/
|
|
5806
5861
|
get config() {
|
|
5807
5862
|
if (this.#config) return this.#config;
|
|
5808
|
-
this.#config =
|
|
5809
|
-
|
|
5810
|
-
|
|
5863
|
+
this.#config = resolveWSConfig(
|
|
5864
|
+
this.projectRoot,
|
|
5865
|
+
this.packageJson
|
|
5866
|
+
).config;
|
|
5811
5867
|
return this.#config;
|
|
5812
5868
|
}
|
|
5813
5869
|
/**
|
|
@@ -5902,7 +5958,7 @@ var Monorepo = class _Monorepo {
|
|
|
5902
5958
|
}
|
|
5903
5959
|
// can't be cached, because it's dependent on the matches set
|
|
5904
5960
|
// but still worthwhile to have it defined in one place
|
|
5905
|
-
#globOptions(matches, parseErrors) {
|
|
5961
|
+
#globOptions(matches, ignore, parseErrors) {
|
|
5906
5962
|
const inMatches = (p) => {
|
|
5907
5963
|
return !!p?.relativePosix() && (matches.has(p.relativePosix()) || inMatches(p.parent));
|
|
5908
5964
|
};
|
|
@@ -5913,12 +5969,15 @@ var Monorepo = class _Monorepo {
|
|
|
5913
5969
|
scurry: this.scurry,
|
|
5914
5970
|
withFileTypes: false,
|
|
5915
5971
|
ignore: {
|
|
5916
|
-
childrenIgnored: (p) => basename2(p.relativePosix()) === "node_modules" ||
|
|
5972
|
+
childrenIgnored: (p) => basename2(p.relativePosix()) === "node_modules" || // only prunes the subtree for a `!foo/**` style negation,
|
|
5973
|
+
// matching npm -- a bare `!foo` still gets walked into
|
|
5974
|
+
!!ignore?.childrenIgnored(p) || inMatches(p),
|
|
5917
5975
|
// ignore if fails to load package.json
|
|
5918
5976
|
ignored: (p) => {
|
|
5919
5977
|
p.lstatSync();
|
|
5920
5978
|
const rel = p.relativePosix();
|
|
5921
5979
|
if (!rel) return true;
|
|
5980
|
+
if (ignore?.ignored(p)) return true;
|
|
5922
5981
|
const maybeDelete = [];
|
|
5923
5982
|
for (const m of matches) {
|
|
5924
5983
|
if (rel.startsWith(m + "/")) return true;
|
|
@@ -5946,10 +6005,21 @@ var Monorepo = class _Monorepo {
|
|
|
5946
6005
|
}
|
|
5947
6006
|
};
|
|
5948
6007
|
}
|
|
6008
|
+
// patterns are always an array: asWSConfig normalizes every
|
|
6009
|
+
// WorkspaceConfig shape to string[], and the path filter is a Set
|
|
5949
6010
|
#glob(pattern) {
|
|
6011
|
+
const { patterns, ignore } = splitNegatedPatterns(pattern);
|
|
5950
6012
|
const matches = /* @__PURE__ */ new Set();
|
|
6013
|
+
if (!patterns.length) return matches;
|
|
5951
6014
|
const parseErrors = /* @__PURE__ */ new Map();
|
|
5952
|
-
ts(
|
|
6015
|
+
ts(
|
|
6016
|
+
patterns,
|
|
6017
|
+
this.#globOptions(
|
|
6018
|
+
matches,
|
|
6019
|
+
ignore.length ? new ot(ignore, {}) : void 0,
|
|
6020
|
+
parseErrors
|
|
6021
|
+
)
|
|
6022
|
+
);
|
|
5953
6023
|
for (const [rel, err] of parseErrors) {
|
|
5954
6024
|
let isNested = false;
|
|
5955
6025
|
for (const m of matches) {
|
|
@@ -5978,6 +6048,12 @@ var Monorepo = class _Monorepo {
|
|
|
5978
6048
|
* This does *not* get the full set of dependencies, or expand any
|
|
5979
6049
|
* `workspace:` dependencies that are not loaded.
|
|
5980
6050
|
*
|
|
6051
|
+
* Bare semver specs are matched by name, and linked only when the
|
|
6052
|
+
* local workspace version satisfies the range -- the same test
|
|
6053
|
+
* `@vltpkg/satisfies` applies at resolution time, so the two agree on
|
|
6054
|
+
* which deps are local. Specs that aren't parseable ranges, such as
|
|
6055
|
+
* dist-tags, still match by name alone.
|
|
6056
|
+
*
|
|
5981
6057
|
* Call with the `forceLoad` param set to `true` to attempt a full
|
|
5982
6058
|
* load if any deps are not currently loaded.
|
|
5983
6059
|
*/
|
|
@@ -5994,15 +6070,20 @@ var Monorepo = class _Monorepo {
|
|
|
5994
6070
|
const deps = manifest[depType];
|
|
5995
6071
|
if (!deps) continue;
|
|
5996
6072
|
for (const [dep, spec] of Object.entries(deps)) {
|
|
5997
|
-
if (spec.startsWith("workspace:")) {
|
|
6073
|
+
if (spec.startsWith("workspace:") || !spec.includes(":")) {
|
|
5998
6074
|
let depWS = this.#workspaces.get(dep);
|
|
6075
|
+
if (depWS && depWS.name !== dep) depWS = void 0;
|
|
5999
6076
|
if (!depWS) {
|
|
6000
6077
|
if (!forceLoad) continue;
|
|
6001
6078
|
if (didForceLoad) continue;
|
|
6002
6079
|
didForceLoad = true;
|
|
6003
6080
|
this.load();
|
|
6004
6081
|
depWS = this.#workspaces.get(dep);
|
|
6005
|
-
if (
|
|
6082
|
+
if (depWS?.name !== dep) continue;
|
|
6083
|
+
}
|
|
6084
|
+
const range2 = spec.includes(":") ? void 0 : parseRange(spec);
|
|
6085
|
+
if (range2 && !satisfies(depWS.manifest.version ?? "", range2)) {
|
|
6086
|
+
continue;
|
|
6006
6087
|
}
|
|
6007
6088
|
depWorkspaces.push(depWS);
|
|
6008
6089
|
}
|
|
@@ -6142,13 +6223,20 @@ var Monorepo = class _Monorepo {
|
|
|
6142
6223
|
}
|
|
6143
6224
|
/**
|
|
6144
6225
|
* Convenience method to instantiate and load in one call.
|
|
6145
|
-
* Returns undefined if the project is not a monorepo workspaces
|
|
6146
|
-
*
|
|
6226
|
+
* Returns undefined if the project is not a monorepo workspaces root,
|
|
6227
|
+
* meaning neither `vlt.json` nor the root `package.json` declares any
|
|
6228
|
+
* workspaces. Otherwise returns the loaded Monorepo.
|
|
6147
6229
|
*/
|
|
6148
6230
|
static maybeLoad(projectRoot, options = { load: {} }) {
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6231
|
+
if (options.config) {
|
|
6232
|
+
return new _Monorepo(projectRoot, { load: {}, ...options });
|
|
6233
|
+
}
|
|
6234
|
+
const { config, source } = resolveWSConfig(
|
|
6235
|
+
projectRoot,
|
|
6236
|
+
options.packageJson
|
|
6237
|
+
);
|
|
6238
|
+
if (!source) return;
|
|
6239
|
+
return new _Monorepo(projectRoot, { load: {}, ...options, config });
|
|
6152
6240
|
}
|
|
6153
6241
|
/**
|
|
6154
6242
|
* Convenience method to instantiate and load in one call.
|
|
@@ -6198,7 +6286,8 @@ export {
|
|
|
6198
6286
|
PackageJson,
|
|
6199
6287
|
minimatch,
|
|
6200
6288
|
PathScurry,
|
|
6201
|
-
asWSConfig,
|
|
6202
6289
|
assertWSConfig,
|
|
6290
|
+
resolveWSConfig,
|
|
6291
|
+
splitNegatedPatterns,
|
|
6203
6292
|
Monorepo
|
|
6204
6293
|
};
|
|
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
Ze,
|
|
14
14
|
ts
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Y5PA7DVK.js";
|
|
16
16
|
|
|
17
17
|
// ../../node_modules/.vlt/~npm~rimraf@6.1.3/node_modules/rimraf/dist/esm/opt-arg.js
|
|
18
18
|
var typeOrUndef = (val, t) => typeof val === "undefined" || typeof val === t;
|
|
@@ -11,18 +11,18 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
asUnknownSpecPrefix
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-D2LEK7VS.js";
|
|
15
15
|
import {
|
|
16
16
|
addKey,
|
|
17
17
|
asDependency
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-J2WL3A3C.js";
|
|
19
19
|
import {
|
|
20
20
|
joinDepIDTuple,
|
|
21
21
|
splitDepID
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-J3R4XWB3.js";
|
|
23
23
|
import {
|
|
24
24
|
Spec
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-V7EQZOO5.js";
|
|
26
26
|
|
|
27
27
|
// ../../src/cli-sdk/src/parse-add-remove-args.ts
|
|
28
28
|
import { isAbsolute, relative, resolve } from "node:path";
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-ZWKI5OSF.js";
|
|
17
17
|
import {
|
|
18
18
|
minimatch
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-P4LLYWCG.js";
|
|
20
20
|
import {
|
|
21
21
|
Spec
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-V7EQZOO5.js";
|
|
23
23
|
import {
|
|
24
24
|
parse,
|
|
25
25
|
stringify
|
|
@@ -770,7 +770,8 @@ var packTarball = async (manifest, dir, config) => {
|
|
|
770
770
|
files,
|
|
771
771
|
integrity,
|
|
772
772
|
shasum,
|
|
773
|
-
resolvedManifest: processedManifest
|
|
773
|
+
resolvedManifest: processedManifest,
|
|
774
|
+
packDir
|
|
774
775
|
};
|
|
775
776
|
} finally {
|
|
776
777
|
config.options.packageJson.write(packDir, manifest);
|
|
@@ -1946,6 +1946,28 @@ var normalizeBinPaths = (manifest) => {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
};
|
|
1948
1948
|
var isBoolean = (value) => typeof value === "boolean";
|
|
1949
|
+
var integrityRE = /^sha512-[a-zA-Z0-9/+]{86}==$/;
|
|
1950
|
+
var isIntegrity = (i) => typeof i === "string" && integrityRE.test(i);
|
|
1951
|
+
var integrityHex = (i) => isIntegrity(i) ? Buffer.from(i.slice(7), "base64").toString("hex") : void 0;
|
|
1952
|
+
var BROTLI_TARBALL_EXT = ".tar.br";
|
|
1953
|
+
var tarballFormat = (url) => {
|
|
1954
|
+
const end = /[?#]/.exec(url)?.index ?? url.length;
|
|
1955
|
+
return url.endsWith(BROTLI_TARBALL_EXT, end) ? "brotli" : void 0;
|
|
1956
|
+
};
|
|
1957
|
+
var brotliTarballName = (tgz) => tgz.replace(/\.tgz$/, BROTLI_TARBALL_EXT);
|
|
1958
|
+
var brotliTarballUrl = (tarball, alternates) => {
|
|
1959
|
+
if (!tarball) return void 0;
|
|
1960
|
+
const entry = alternates?.find(
|
|
1961
|
+
(a) => a.kind === "tar.br" && !!a.tarball
|
|
1962
|
+
);
|
|
1963
|
+
if (!entry) return void 0;
|
|
1964
|
+
try {
|
|
1965
|
+
const href = new URL(entry.tarball, tarball).href;
|
|
1966
|
+
return href === new URL(brotliTarballName(tarball)).href ? href : void 0;
|
|
1967
|
+
} catch {
|
|
1968
|
+
return void 0;
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1949
1971
|
var asError = (er, fallbackMessage = "Unknown error") => er instanceof Error ? er : new Error(String(er) || fallbackMessage);
|
|
1950
1972
|
var isError = (er) => er instanceof Error;
|
|
1951
1973
|
var isErrorWithCause = (er) => isError(er) && "cause" in er;
|
|
@@ -2508,6 +2530,12 @@ export {
|
|
|
2508
2530
|
isSpec,
|
|
2509
2531
|
currentDefaultRegistryName,
|
|
2510
2532
|
Spec,
|
|
2533
|
+
normalizeBinPaths,
|
|
2534
|
+
integrityRE,
|
|
2535
|
+
integrityHex,
|
|
2536
|
+
tarballFormat,
|
|
2537
|
+
brotliTarballName,
|
|
2538
|
+
brotliTarballUrl,
|
|
2511
2539
|
asError,
|
|
2512
2540
|
isError,
|
|
2513
2541
|
isErrorWithCause,
|
|
@@ -2515,6 +2543,7 @@ export {
|
|
|
2515
2543
|
isRecordStringString,
|
|
2516
2544
|
assertRecordStringString,
|
|
2517
2545
|
assertRecordStringT,
|
|
2546
|
+
isManifest,
|
|
2518
2547
|
asManifest,
|
|
2519
2548
|
normalizeManifest,
|
|
2520
2549
|
asNormalizedManifest,
|