mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-04-03 02:00:14 +08:00
Merge 7ab4b27c6c3e658a53289cf930cf2093d3c61eaf into 54cb141c5c91e2fdc396be3155a391f28e1822eb
This commit is contained in:
commit
b1f480176d
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"semi": true,
|
||||
"quoteProps": "preserve"
|
||||
}
|
3
.vscode/extensions.json
vendored
Normal file
3
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["esbenp.prettier-vscode", "github.vscode-github-actions"]
|
||||
}
|
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"search.exclude": {
|
||||
"dist/**": true
|
||||
},
|
||||
// Lock changes to these files
|
||||
"files.readonlyInclude": {
|
||||
"dist/**": true,
|
||||
"bun.lock": true,
|
||||
"package-lock.json": true
|
||||
},
|
||||
}
|
6
bun.lock
Executable file → Normal file
6
bun.lock
Executable file → Normal file
@ -1,5 +1,5 @@
|
||||
{
|
||||
"lockfileVersion": 0,
|
||||
"lockfileVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
@ -13,7 +13,7 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^4.9.5",
|
||||
},
|
||||
},
|
||||
@ -139,7 +139,7 @@
|
||||
|
||||
"node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],
|
||||
|
||||
"prettier": ["prettier@2.8.8", "", { "bin": { "prettier": "bin-prettier.js" } }, "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q=="],
|
||||
"prettier": ["prettier@3.4.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ=="],
|
||||
|
||||
"process": ["process@0.11.10", "", {}, "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="],
|
||||
|
||||
|
10
package-lock.json
generated
10
package-lock.json
generated
@ -19,7 +19,7 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
},
|
||||
@ -473,14 +473,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.8.8",
|
||||
"version": "3.4.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
|
||||
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
|
@ -32,10 +32,7 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"prettier": {
|
||||
"quoteProps": "preserve"
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ export default async (options: Input): Promise<Output> => {
|
||||
info(`Using a cached version of Bun: ${revision}`);
|
||||
} else {
|
||||
warning(
|
||||
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`
|
||||
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -98,7 +98,7 @@ export default async (options: Input): Promise<Output> => {
|
||||
|
||||
if (!revision) {
|
||||
throw new Error(
|
||||
"Downloaded a new version of Bun, but failed to check its version? Try again."
|
||||
"Downloaded a new version of Bun, but failed to check its version? Try again.",
|
||||
);
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ export default async (options: Input): Promise<Output> => {
|
||||
|
||||
async function downloadBun(
|
||||
url: string,
|
||||
bunPath: string
|
||||
bunPath: string,
|
||||
): Promise<string | undefined> {
|
||||
// Workaround for https://github.com/oven-sh/setup-bun/issues/79 and https://github.com/actions/toolkit/issues/1179
|
||||
const zipPath = addExtension(await downloadTool(url), ".zip");
|
||||
@ -168,7 +168,7 @@ function getDownloadUrl(options: Input): string {
|
||||
const eprofile = encodeURIComponent(profile ?? false);
|
||||
const { href } = new URL(
|
||||
`${eversion}/${eos}/${earch}?avx2=${eavx2}&profile=${eprofile}`,
|
||||
"https://bun.sh/download/"
|
||||
"https://bun.sh/download/",
|
||||
);
|
||||
return href;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ import { saveCache } from "@actions/cache";
|
||||
import { getState, warning } from "@actions/core";
|
||||
import { CacheState } from "./action";
|
||||
import { createHash } from "node:crypto";
|
||||
|
||||
(async () => {
|
||||
const state: CacheState = JSON.parse(getState("cache"));
|
||||
if (state.cacheEnabled && !state.cacheHit) {
|
||||
|
@ -6,14 +6,14 @@ import { resolve, basename } from "node:path";
|
||||
export function retry<T>(
|
||||
fn: () => Promise<T>,
|
||||
retries: number,
|
||||
timeout = 10000
|
||||
timeout = 10000,
|
||||
): Promise<T> {
|
||||
return fn().catch((err) => {
|
||||
if (retries <= 0) {
|
||||
throw err;
|
||||
}
|
||||
return new Promise((resolve) => setTimeout(resolve, timeout)).then(() =>
|
||||
retry(fn, retries - 1, timeout)
|
||||
retry(fn, retries - 1, timeout),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user