@pnpm/engine.runtime.bun-resolver 1102.0.1 → 1102.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/lib/index.js +6 -2
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export async function resolveBunRuntime(ctx, wantedDependency, opts) {
|
|
|
12
12
|
resolvedVia: 'github.com/oven-sh/bun',
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
const versionSpec = wantedDependency.bareSpecifier.substring('runtime:'.length);
|
|
15
|
+
const versionSpec = normalizeRuntimeSpec(wantedDependency.bareSpecifier.substring('runtime:'.length));
|
|
16
16
|
// We use the npm registry for version resolution as it is easier than using the GitHub API for releases,
|
|
17
17
|
// which uses pagination (e.g. https://api.github.com/repos/oven-sh/bun/releases?per_page=100).
|
|
18
18
|
const npmResolution = await ctx.resolveFromNpm({ ...wantedDependency, bareSpecifier: versionSpec }, {});
|
|
@@ -41,7 +41,7 @@ export async function resolveLatestBunRuntime(ctx, query, opts) {
|
|
|
41
41
|
const manifestSpec = query.wantedDependency.bareSpecifier;
|
|
42
42
|
if (query.wantedDependency.alias !== 'bun' || !manifestSpec?.startsWith('runtime:'))
|
|
43
43
|
return undefined;
|
|
44
|
-
const versionSpec = query.compatible ? manifestSpec.substring('runtime:'.length) : 'latest';
|
|
44
|
+
const versionSpec = query.compatible ? normalizeRuntimeSpec(manifestSpec.substring('runtime:'.length)) : 'latest';
|
|
45
45
|
try {
|
|
46
46
|
const npmResolution = await ctx.resolveFromNpm({ alias: 'bun', bareSpecifier: versionSpec }, query.compatible ? opts : { ...opts, update: 'latest' });
|
|
47
47
|
if (npmResolution?.policyViolation?.code === MINIMUM_RELEASE_AGE_VIOLATION_CODE)
|
|
@@ -57,6 +57,10 @@ export async function resolveLatestBunRuntime(ctx, query, opts) {
|
|
|
57
57
|
throw err;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
function normalizeRuntimeSpec(versionSpec) {
|
|
61
|
+
versionSpec = versionSpec.trim();
|
|
62
|
+
return versionSpec === '' ? 'latest' : versionSpec;
|
|
63
|
+
}
|
|
60
64
|
async function readBunAssets(fetch, version) {
|
|
61
65
|
const integritiesFileUrl = `https://github.com/oven-sh/bun/releases/download/bun-v${version}/SHASUMS256.txt`;
|
|
62
66
|
const shasumsFileItems = await fetchShasumsFile(fetch, integritiesFileUrl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/engine.runtime.bun-resolver",
|
|
3
|
-
"version": "1102.0.
|
|
3
|
+
"version": "1102.0.3",
|
|
4
4
|
"description": "Resolves the Bun runtime",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"funding": "https://opencollective.com/pnpm",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/pnpm/pnpm/tree/main/engine/runtime/bun-resolver"
|
|
15
|
+
"url": "https://github.com/pnpm/pnpm/tree/main/pnpm11/engine/runtime/bun-resolver"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://github.com/pnpm/pnpm/tree/main/engine/runtime/bun-resolver#readme",
|
|
17
|
+
"homepage": "https://github.com/pnpm/pnpm/tree/main/pnpm11/engine/runtime/bun-resolver#readme",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
20
20
|
},
|
|
@@ -31,21 +31,21 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@pnpm/util.lex-comparator": "^4.0.1",
|
|
33
33
|
"semver": "^7.8.4",
|
|
34
|
-
"@pnpm/
|
|
35
|
-
"@pnpm/
|
|
36
|
-
"@pnpm/fetching.binary-fetcher": "1102.0.0",
|
|
34
|
+
"@pnpm/crypto.shasums-file": "1100.1.3",
|
|
35
|
+
"@pnpm/error": "1100.0.1",
|
|
37
36
|
"@pnpm/fetching.types": "1100.0.2",
|
|
38
|
-
"@pnpm/
|
|
39
|
-
"@pnpm/resolving.
|
|
40
|
-
"@pnpm/
|
|
41
|
-
"@pnpm/fetching.fetcher-base": "1100.1
|
|
37
|
+
"@pnpm/resolving.npm-resolver": "1102.1.1",
|
|
38
|
+
"@pnpm/resolving.resolver-base": "1100.5.1",
|
|
39
|
+
"@pnpm/fetching.binary-fetcher": "1102.0.2",
|
|
40
|
+
"@pnpm/fetching.fetcher-base": "1100.2.1",
|
|
41
|
+
"@pnpm/types": "1101.3.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@pnpm/worker": "^1100.2.
|
|
44
|
+
"@pnpm/worker": "^1100.2.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/semver": "7.7.1",
|
|
48
|
-
"@pnpm/engine.runtime.bun-resolver": "1102.0.
|
|
48
|
+
"@pnpm/engine.runtime.bun-resolver": "1102.0.3"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=22.13"
|