Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d267786b1 | ||
|
|
db6bcf6eb8 | ||
|
|
4a638a4fad | ||
|
|
563911925f | ||
|
|
b02f8a8a6e | ||
|
|
8c296f9cb7 | ||
|
|
b7a1c7ccf2 | ||
|
|
ad1208bf19 | ||
|
|
bc6f04ce3b | ||
|
|
1dbab0699e | ||
|
|
635640504f | ||
|
|
22457c87c1 | ||
|
|
237a6a77d8 | ||
|
|
53e6487b6e | ||
|
|
68643ea879 | ||
|
|
56169ab7b0 | ||
|
|
34f777aec1 | ||
|
|
7c641390eb | ||
|
|
735343b667 | ||
|
|
27ecfffdee | ||
|
|
fcc30ed971 | ||
|
|
56408e9a3f | ||
|
|
85cb7f6e7e | ||
|
|
54cb141c5c | ||
|
|
6fb6603cc1 | ||
|
|
9bdeab4320 | ||
|
|
f09eb1edd0 | ||
|
|
8f1bc2eeb3 | ||
|
|
a8913c42f4 | ||
|
|
b9d34de66d | ||
|
|
1e54087d4f | ||
|
|
4bc047ad25 | ||
|
|
f43b443c1c | ||
|
|
339e277e69 | ||
|
|
e20a54d1da | ||
|
|
3fcae870de | ||
|
|
123c6c4e2f | ||
|
|
ef00e4ac8e | ||
|
|
43b2dc9ae8 | ||
|
|
45d2c09359 | ||
|
|
6ef34ab578 | ||
|
|
f4d14e03ff | ||
|
|
8f24390df0 | ||
|
|
932c3b236c | ||
|
|
9e6479509b | ||
|
|
194c60efc3 | ||
|
|
d3603274ac | ||
|
|
0f37bd8169 | ||
|
|
12944059f7 | ||
|
|
8642d99a51 | ||
|
|
40646b1808 | ||
|
|
94177e527c |
86
.github/actions/compare-bun-version/action.yml
vendored
Normal file
86
.github/actions/compare-bun-version/action.yml
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
name: ⚖️ Compare Bun Version
|
||||
description: Compare the installed Bun version against a version specification.
|
||||
|
||||
inputs:
|
||||
bun-version:
|
||||
description: The version spec to compare against (e.g., '1.1.0', 'canary', '>1.2.0', '1.x').
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 🛠️ Get installed Bun version and revision
|
||||
id: bun
|
||||
shell: bash
|
||||
run: |
|
||||
echo "version=$(bun --version | tr -d '\r\n')" >> $GITHUB_OUTPUT
|
||||
echo "revision=$(bun --revision 2>/dev/null || true)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: ⚖️ Compare versions
|
||||
shell: bash
|
||||
env:
|
||||
REQUESTED_SPEC: ${{ inputs.bun-version }}
|
||||
ACTUAL_VERSION: ${{ steps.bun.outputs.version }}
|
||||
ACTUAL_REVISION: ${{ steps.bun.outputs.revision }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Function to compare two semantic versions (e.g., version_compare 1.2.3 1.10.0)
|
||||
# Returns: 0 if v1 == v2, 1 if v1 > v2, 2 if v1 < v2
|
||||
version_compare() {
|
||||
if [[ "$1" == "$2" ]]; then return 0; fi
|
||||
local lowest=$(printf '%s\n' "$1" "$2" | sort -V | head -n1)
|
||||
if [[ "$1" == "$lowest" ]]; then return 2; else return 1; fi
|
||||
}
|
||||
|
||||
echo "Requested spec: ${REQUESTED_SPEC}"
|
||||
echo "Actual version: ${ACTUAL_VERSION}"
|
||||
|
||||
# Case 1: 'latest' - always passes
|
||||
if [[ "${REQUESTED_SPEC}" == "latest" ]]; then
|
||||
echo "OK: Skipping explicit version check for 'latest'."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Case 2: 'canary' - check for 'canary' in revision or version string
|
||||
if [[ "${REQUESTED_SPEC}" == "canary" ]]; then
|
||||
if [[ "${ACTUAL_REVISION}" == *canary* ]] || [[ "${ACTUAL_VERSION}" == *canary* ]]; then
|
||||
echo "OK: Detected canary build (version: ${ACTUAL_VERSION}, revision: ${ACTUAL_REVISION:-n/a})."
|
||||
exit 0
|
||||
else
|
||||
echo "Error: Expected a canary build, but got ${ACTUAL_VERSION} (revision: ${ACTUAL_REVISION:-n/a})."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Case 3: Semver ranges (e.g., >1.0.0, <2, 1.x, 1.1.0)
|
||||
op_part=$(echo "${REQUESTED_SPEC}" | sed -E 's/^([><=]*).*/\1/')
|
||||
version_part=$(echo "${REQUESTED_SPEC}" | sed -E 's/^[><= ]*//')
|
||||
|
||||
op="${op_part:-==}"
|
||||
version_base="${version_part//.x/}"
|
||||
|
||||
# Handle wildcards like '1.x' or '1'
|
||||
if [[ "${version_part}" == *.x* ]] || { [[ ! "${version_part}" == *.* ]] && [[ "${op}" == "==" ]]; }; then
|
||||
if [[ "${ACTUAL_VERSION}" == "${version_base}" || "${ACTUAL_VERSION}" == "${version_base}".* ]]; then
|
||||
echo "OK: Version ${ACTUAL_VERSION} matches wildcard spec '${REQUESTED_SPEC}'."
|
||||
exit 0
|
||||
else
|
||||
echo "Error: Version ${ACTUAL_VERSION} does not match wildcard spec '${REQUESTED_SPEC}'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Perform comparison for >, <, >=, <=, ==
|
||||
version_compare "${ACTUAL_VERSION}" "${version_part}" && result=0 || result=$?
|
||||
|
||||
case "${op}" in
|
||||
'==') if [[ ${result} -ne 0 ]]; then echo "Error: Expected version ${version_part}, but got ${ACTUAL_VERSION}." && exit 1; fi ;;
|
||||
'>') if [[ ${result} -ne 1 ]]; then echo "Error: Expected version > ${version_part}, but got ${ACTUAL_VERSION}." && exit 1; fi ;;
|
||||
'<') if [[ ${result} -ne 2 ]]; then echo "Error: Expected version < ${version_part}, but got ${ACTUAL_VERSION}." && exit 1; fi ;;
|
||||
'>=') if [[ ${result} -eq 2 ]]; then echo "Error: Expected version >= ${version_part}, but got ${ACTUAL_VERSION}." && exit 1; fi ;;
|
||||
'<=') if [[ ${result} -eq 1 ]]; then echo "Error: Expected version <= ${version_part}, but got ${ACTUAL_VERSION}." && exit 1; fi ;;
|
||||
*) echo "Error: Unsupported operator '${op}' in spec '${REQUESTED_SPEC}'." && exit 1 ;;
|
||||
esac
|
||||
|
||||
echo "OK: Version ${ACTUAL_VERSION} satisfies spec '${REQUESTED_SPEC}'."
|
||||
28
.github/workflows/format.yml
vendored
28
.github/workflows/format.yml
vendored
@@ -14,17 +14,19 @@ jobs:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
- name: Format
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: bun install
|
||||
|
||||
- name: 🧹 Format
|
||||
run: |
|
||||
npm run format
|
||||
npm run build
|
||||
- name: Commit
|
||||
uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc
|
||||
bun run format
|
||||
bun run build
|
||||
|
||||
- name: 💾 Commit
|
||||
uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
|
||||
|
||||
27
.github/workflows/release.yml
vendored
Normal file
27
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: 🚀 Release new action version
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
TAG_NAME:
|
||||
description: Tag name that the major tag will point to
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update_tag:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- uses: actions/publish-action@f784495ce78a41bac4ed7e34a73f0034015764bb # v0.3.0
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
||||
with:
|
||||
source-tag: ${{ env.TAG_NAME }}
|
||||
265
.github/workflows/test.yml
vendored
265
.github/workflows/test.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Test
|
||||
name: 🧪 Test
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -8,71 +8,276 @@ on:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
remove-cache:
|
||||
runs-on: ubuntu-latest
|
||||
permissions: write-all
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 🗑️ Remove cache
|
||||
run: gh cache delete --all || true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
tests:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: ./
|
||||
with:
|
||||
no-cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Run tests
|
||||
run: bun test --coverage
|
||||
|
||||
setup-bun:
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
needs: [remove-cache, tests]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
bun-version: canary
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
- windows-11-arm
|
||||
bun-version:
|
||||
- latest
|
||||
- canary
|
||||
- "0.8.1" # last version before 1.0
|
||||
- "0.x"
|
||||
- "1.0.0"
|
||||
- "1.1.0"
|
||||
- "1.x"
|
||||
- "1"
|
||||
- "> 1.0.0"
|
||||
- "< 2"
|
||||
# https://github.com/oven-sh/setup-bun/issues/37
|
||||
# - "1.x"
|
||||
# - "1"
|
||||
# - "> 1.0.0"
|
||||
# - "< 2"
|
||||
# Disable <sha> support for now. This is because Github Artifacts
|
||||
# expire after 90 days, and we don't have another source of truth yet.
|
||||
# - "822a00c4d508b54f650933a73ca5f4a3af9a7983" # 1.0.0 commit
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Bun
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
id: setup_bun
|
||||
with:
|
||||
bun-version: ${{ matrix.bun-version }}
|
||||
- name: Run Bun
|
||||
no-cache: true
|
||||
|
||||
- name: ▶️ Run Bun
|
||||
id: run_bun
|
||||
run: |
|
||||
bun --version
|
||||
setup-bun-from-package-json-version:
|
||||
|
||||
- name: ⚖️ Verify Bun version
|
||||
uses: ./.github/actions/compare-bun-version
|
||||
with:
|
||||
bun-version: ${{ matrix.bun-version }}
|
||||
|
||||
setup-bun-from-file:
|
||||
name: setup-bun from (${{ matrix.os }}, ${{ matrix.file.name }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
needs: [remove-cache, tests]
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
packageManager:
|
||||
- bun@1.0.0
|
||||
- yarn@bun@1.0.0
|
||||
- windows-latest
|
||||
- windows-11-arm
|
||||
|
||||
file:
|
||||
- name: package.json (packageManager bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: foo/package.json (packageManager bun@1.1.0)
|
||||
file: foo/package.json
|
||||
run: |
|
||||
mkdir -p foo
|
||||
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > foo/package.json
|
||||
|
||||
- name: package.json (packageManager yarn@bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "yarn@bun@1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: package.json (engines bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '.engines = {"bun": "1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: .tool-versions (bun 1.1.0)
|
||||
file: .tool-versions
|
||||
run: echo "bun 1.1.0" > .tool-versions
|
||||
|
||||
- name: .tool-versions (bun1.1.0)
|
||||
file: .tool-versions
|
||||
run: echo "bun1.1.0" > .tool-versions
|
||||
|
||||
- name: .tool-versions (bun 1.1.0)
|
||||
file: .tool-versions
|
||||
run: echo "bun 1.1.0" > .tool-versions
|
||||
|
||||
- name: .bumrc (1.1.0)
|
||||
file: .bumrc
|
||||
run: echo "1.1.0" > .bumrc
|
||||
|
||||
- name: .bun-version (1.1.0)
|
||||
file: .bun-version
|
||||
run: echo "1.1.0" > .bun-version
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "${{ matrix.packageManager }}"}' package.json)" > package.json
|
||||
- name: Setup Bun
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 📄 Setup file
|
||||
run: ${{ matrix.file.run }}
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
- name: Run Bun
|
||||
id: bun
|
||||
with:
|
||||
bun-version-file: ${{ matrix.file.file }}
|
||||
no-cache: true
|
||||
|
||||
- name: ⚖️ Compare versions
|
||||
uses: ./.github/actions/compare-bun-version
|
||||
with:
|
||||
bun-version: "1.1.0"
|
||||
|
||||
setup-bun-from-package-json-without-specified-field:
|
||||
name: setup-bun from (${{ matrix.os }}, ${{ matrix.file.name }}) without specified field
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
needs: [remove-cache, tests]
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
- windows-11-arm
|
||||
|
||||
file:
|
||||
- name: package.json (packageManager bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: package.json (packageManager yarn@bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '. += {"packageManager": "yarn@bun@1.1.0"}' package.json)" > package.json
|
||||
|
||||
- name: package.json (engines bun@1.1.0)
|
||||
file: package.json
|
||||
run: |
|
||||
echo "$(jq '.engines = {"bun": "1.1.0"}' package.json)" > package.json
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 📄 Setup file
|
||||
run: ${{ matrix.file.run }}
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
with:
|
||||
no-cache: true
|
||||
|
||||
- name: ⚖️ Compare versions
|
||||
uses: ./.github/actions/compare-bun-version
|
||||
with:
|
||||
bun-version: "1.1.0"
|
||||
|
||||
setup-bun-download-url:
|
||||
name: setup-bun from (${{ matrix.os }}, download url)
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
needs: [remove-cache, tests]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
id: setup_bun
|
||||
with:
|
||||
bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'aarch64' }}.zip"
|
||||
|
||||
- name: ▶️ Run Bun
|
||||
id: run_bun
|
||||
run: |
|
||||
bun --version
|
||||
echo "version=$(bun --version)" >> $GITHUB_OUTPUT
|
||||
- name: Check version
|
||||
|
||||
test-custom-registries:
|
||||
name: test installing deps from custom registries (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
needs: [remove-cache, tests]
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
|
||||
|
||||
- name: 🛠️ Setup Bun
|
||||
uses: ./
|
||||
id: setup_bun
|
||||
with:
|
||||
registries: |
|
||||
https://registry.npmjs.org
|
||||
@types:https://registry.yarnpkg.com
|
||||
|
||||
- name: ▶️ Install from default registry
|
||||
run: |
|
||||
if [[ "${{ steps.bun.outputs.version }}" == "1.0.0" ]]; then
|
||||
echo "Version is 1.0.0"
|
||||
output=$(bun add is-odd --verbose --force 2>&1)
|
||||
|
||||
if echo "$output" | grep -q "HTTP/1.1 GET https://registry.npmjs.org/is-odd"; then
|
||||
echo "Successfully installed from default registry"
|
||||
else
|
||||
echo "Expected version to be 1.0.0, got ${{ steps.bun.outputs.version }}"
|
||||
echo "Failed to install from default registry"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: ▶️ Install from @types registry
|
||||
run: |
|
||||
output=$(bun add @types/bun --verbose --force 2>&1)
|
||||
|
||||
if echo "$output" | grep -q "HTTP/1.1 GET https://registry.yarnpkg.com/@types%2fbun"; then
|
||||
echo "Successfully installed from @types registry"
|
||||
else
|
||||
echo "Failed to install from @types registry"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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
|
||||
},
|
||||
}
|
||||
90
README.md
90
README.md
@@ -5,41 +5,95 @@ Download, install, and setup [Bun](https://bun.sh) in GitHub Actions.
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
```
|
||||
|
||||
By default, if no version is specified, the action will:
|
||||
|
||||
1. Check `package.json` for the `packageManager` field (e.g., `"packageManager": "bun@1.0.25"`)
|
||||
2. If `packageManager` doesn't exist, check `package.json` for `engines.bun`
|
||||
3. If neither exists or `package.json` is not found, use `latest`
|
||||
|
||||
You can also explicitly specify a version:
|
||||
|
||||
```yaml
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
```
|
||||
|
||||
### Using a custom NPM registry
|
||||
## Using version file
|
||||
|
||||
```yaml
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
registry-url: "https://npm.pkg.github.com/"
|
||||
scope: "@foo"
|
||||
bun-version-file: ".bun-version"
|
||||
```
|
||||
|
||||
If you need to authenticate with a private registry, you can set the `BUN_AUTH_TOKEN` environment variable.
|
||||
## Using custom registries
|
||||
|
||||
You can configure multiple package registries using the `registries` input. This supports both default and scoped registries with various authentication methods.
|
||||
|
||||
### Registry configuration
|
||||
|
||||
```yaml
|
||||
- name: Install Dependencies
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
registries: |
|
||||
https://registry.npmjs.org/
|
||||
@myorg:https://npm.pkg.github.com/|$GITHUB_TOKEN
|
||||
@internal:https://username:$INTERNAL_PASSWORD@registry.internal.com/
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
INTERNAL_PASSWORD: ${{ secrets.INTERNAL_PASSWORD }}
|
||||
run: bun install
|
||||
```
|
||||
|
||||
#### Registry format options
|
||||
|
||||
| Type | Format |
|
||||
| ------------------------------------ | --------------------------------------------------------- |
|
||||
| Default registry | `https://registry.example.com/` |
|
||||
| Default registry with token | `https://registry.example.com/\|$TOKEN` |
|
||||
| Scoped registry | `@scope:https://registry.example.com/` |
|
||||
| Scoped registry with token | `@scope:https://registry.example.com/\|$TOKEN` |
|
||||
| Scoped registry with URL credentials | `@scope:https://username:$PASSWORD@registry.example.com/` |
|
||||
|
||||
> [!IMPORTANT]
|
||||
> When using authentication, make sure to set the corresponding environment variables in your workflow steps that need access to the registries.
|
||||
|
||||
For more information about configuring registries in Bun, see the [official documentation](https://bun.sh/docs/install/registries).
|
||||
|
||||
### Override download url
|
||||
|
||||
If you need to override the download URL, you can use the `bun-download-url` input.
|
||||
|
||||
```yaml
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip"
|
||||
```
|
||||
|
||||
## Inputs
|
||||
|
||||
| Name | Description | Default | Examples |
|
||||
| -------------- | -------------------------------------------------- | ----------- | ------------------------------- |
|
||||
| `bun-version` | The version of Bun to download and install. | `latest` | `canary`, `1.0.0`, `1.0.x` |
|
||||
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
|
||||
| `scope` | Scope for private pacakages. | `undefined` | `"@foo"`, `"@orgname"` |
|
||||
| Name | Description | Default | Examples |
|
||||
| ------------------ | --------------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------ |
|
||||
| `bun-version` | The version of Bun to download and install. | Version from `package.json`, or `latest` | `canary`, `1.0.0`, `1.0.x` |
|
||||
| `bun-version-file` | The version of Bun to download and install from file. | `undefined` | `package.json`, `.bun-version`, `.tool-versions` |
|
||||
| `bun-download-url` | URL to download .zip file for Bun release | | |
|
||||
| `registry-url` | Registry URL where some private package is stored. | `undefined` | `"https://npm.pkg.github.com/"` |
|
||||
| `scope` | Scope for private packages. | `undefined` | `"@foo"`, `"@orgname"` |
|
||||
| `no-cache` | Disable caching of the downloaded executable. | `false` | `true`, `false` |
|
||||
| `token` | Personal access token (PAT) used to fetch tags from the `oven-sh/bun` repository. | `${{ github.token }}` | `${{ secrets.GITHUB_TOKEN }}` |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description | Example |
|
||||
| -------------- | ------------------------------------------ | ---------------- |
|
||||
| `cache-hit` | If the Bun executable was read from cache. | `true` |
|
||||
| `bun-version` | The output from `bun --version`. | `1.0.0` |
|
||||
| `bun-revision` | The output from `bun --revision`. | `1.0.0+822a00c4` |
|
||||
| Name | Description | Example |
|
||||
| ------------------ | ------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `bun-version` | The output from `bun --version`. | `1.0.0` |
|
||||
| `bun-revision` | The output from `bun --revision`. | `1.0.0+822a00c4` |
|
||||
| `bun-path` | The path to the Bun executable. | `/path/to/bun` |
|
||||
| `bun-download-url` | The URL from which Bun was downloaded. | `https://bun.sh/download/latest/linux/x64?avx2=true&profile=false` |
|
||||
| `cache-hit` | If the Bun executable was read from cache. | `true` |
|
||||
|
||||
45
action.yml
45
action.yml
@@ -1,26 +1,63 @@
|
||||
name: Setup Bun
|
||||
description: Download, install, and setup Bun to your path.
|
||||
author: robobun
|
||||
|
||||
branding:
|
||||
icon: play-circle
|
||||
color: white
|
||||
|
||||
inputs:
|
||||
bun-version:
|
||||
description: 'The version of Bun to install. (e.g. "latest", "canary", "1.0.0", "1.0.x", <sha>)'
|
||||
description: The version of Bun to install. (e.g. "latest", "canary", "1.0.0", "1.0.x", <sha>)
|
||||
required: false
|
||||
bun-version-file:
|
||||
description: The version of Bun to install from file. (e.g. "package.json", ".bun-version", ".tool-versions")
|
||||
default: null
|
||||
required: false
|
||||
bun-download-url:
|
||||
description: Override the URL to download Bun from. This skips version resolution and verifying AVX2 support.
|
||||
required: false
|
||||
registries:
|
||||
description: |
|
||||
List of package registries with authentication support. Format:
|
||||
- Default registry: https://registry.npmjs.org/
|
||||
- Default with token: https://registry.npmjs.org/|token
|
||||
- Scoped registry: @scope:https://registry.example.com/
|
||||
- Scoped with token: @scope:https://registry.example.com/|token
|
||||
- Scoped with credentials: @scope:https://user:pass@registry.example.com/
|
||||
required: false
|
||||
registry-url:
|
||||
required: false
|
||||
description: "The URL of the package registry to use for installing Bun. Set the $BUN_AUTH_TOKEN environment variable to authenticate with the registry."
|
||||
description: The URL of the package registry to use for installing Bun. Set the $BUN_AUTH_TOKEN environment variable to authenticate with the registry.
|
||||
deprecationMessage: "Use 'registries' input instead."
|
||||
scope:
|
||||
required: false
|
||||
description: "The scope for authenticating with the package registry."
|
||||
deprecationMessage: "Use 'registries' input instead."
|
||||
no-cache:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: Disable caching of bun executable.
|
||||
token:
|
||||
required: false
|
||||
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
||||
description: Personal access token (PAT) used to fetch tags from oven-sh/bun repository. Recommended for resolving wildcard/range versions to avoid GitHub API rate limiting. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
|
||||
|
||||
outputs:
|
||||
bun-version:
|
||||
description: The version of Bun that was installed.
|
||||
bun-revision:
|
||||
description: The revision of Bun that was installed.
|
||||
bun-path:
|
||||
description: The path to the Bun executable.
|
||||
bun-download-url:
|
||||
description: The URL from which Bun was downloaded.
|
||||
cache-hit:
|
||||
description: If the version of Bun was cached.
|
||||
|
||||
runs:
|
||||
using: node20
|
||||
main: dist/index.js
|
||||
using: "node20"
|
||||
main: "dist/setup/index.js"
|
||||
post: "dist/cache-save/index.js"
|
||||
post-if: success()
|
||||
|
||||
239
bun.lock
Normal file
239
bun.lock
Normal file
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 0,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "setup-bun",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.0",
|
||||
"@actions/core": "^1.11.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"compare-versions": "^6.1.1",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.1.13",
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^4.9.5",
|
||||
},
|
||||
},
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"compare-versions@6.1.1": "patches/compare-versions@6.1.1.patch",
|
||||
},
|
||||
"overrides": {
|
||||
"form-data": "^4.0.4",
|
||||
},
|
||||
"packages": {
|
||||
"@actions/cache": ["@actions/cache@4.0.3", "", { "dependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.0.1", "@actions/glob": "^0.1.0", "@actions/http-client": "^2.1.1", "@actions/io": "^1.0.1", "@azure/abort-controller": "^1.1.0", "@azure/ms-rest-js": "^2.6.0", "@azure/storage-blob": "^12.13.0", "@protobuf-ts/plugin": "^2.9.4", "semver": "^6.3.1" } }, "sha512-SvrqFtYJ7I48A/uXNkoJrnukx5weQv1fGquhs3+4nkByZThBH109KTIqj5x/cGV7JGNvb8dLPVywUOqX1fjiXg=="],
|
||||
|
||||
"@actions/core": ["@actions/core@1.11.1", "", { "dependencies": { "@actions/exec": "^1.1.1", "@actions/http-client": "^2.0.1" } }, "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A=="],
|
||||
|
||||
"@actions/exec": ["@actions/exec@1.1.1", "", { "dependencies": { "@actions/io": "^1.0.1" } }, ""],
|
||||
|
||||
"@actions/glob": ["@actions/glob@0.4.0", "", { "dependencies": { "@actions/core": "^1.9.1", "minimatch": "^3.0.4" } }, ""],
|
||||
|
||||
"@actions/http-client": ["@actions/http-client@2.1.1", "", { "dependencies": { "tunnel": "^0.0.6" } }, ""],
|
||||
|
||||
"@actions/io": ["@actions/io@1.1.3", "", {}, ""],
|
||||
|
||||
"@actions/tool-cache": ["@actions/tool-cache@2.0.1", "", { "dependencies": { "@actions/core": "^1.2.6", "@actions/exec": "^1.0.0", "@actions/http-client": "^2.0.1", "@actions/io": "^1.1.1", "semver": "^6.1.0", "uuid": "^3.3.2" } }, ""],
|
||||
|
||||
"@azure/abort-controller": ["@azure/abort-controller@1.1.0", "", { "dependencies": { "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/core-auth": ["@azure/core-auth@1.5.0", "", { "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-util": "^1.1.0", "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/core-http": ["@azure/core-http@3.0.3", "", { "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.3.0", "@azure/core-tracing": "1.0.0-preview.13", "@azure/core-util": "^1.1.1", "@azure/logger": "^1.0.0", "@types/node-fetch": "^2.5.0", "@types/tunnel": "^0.0.3", "form-data": "^4.0.0", "node-fetch": "^2.6.7", "process": "^0.11.10", "tslib": "^2.2.0", "tunnel": "^0.0.6", "uuid": "^8.3.0", "xml2js": "^0.5.0" } }, ""],
|
||||
|
||||
"@azure/core-lro": ["@azure/core-lro@2.5.4", "", { "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-util": "^1.2.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/core-paging": ["@azure/core-paging@1.5.0", "", { "dependencies": { "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/core-tracing": ["@azure/core-tracing@1.0.0-preview.13", "", { "dependencies": { "@opentelemetry/api": "^1.0.1", "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/core-util": ["@azure/core-util@1.4.0", "", { "dependencies": { "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/logger": ["@azure/logger@1.0.4", "", { "dependencies": { "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@azure/ms-rest-js": ["@azure/ms-rest-js@2.7.0", "", { "dependencies": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", "form-data": "^2.5.0", "node-fetch": "^2.6.7", "tslib": "^1.10.0", "tunnel": "0.0.6", "uuid": "^8.3.2", "xml2js": "^0.5.0" } }, ""],
|
||||
|
||||
"@azure/storage-blob": ["@azure/storage-blob@12.15.0", "", { "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^3.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "events": "^3.0.0", "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.19.2", "", { "os": "android", "cpu": "arm" }, "sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.19.2", "", { "os": "android", "cpu": "arm64" }, "sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.19.2", "", { "os": "android", "cpu": "x64" }, "sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.19.2", "", { "os": "darwin", "cpu": "arm64" }, ""],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.19.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.19.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.19.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.19.2", "", { "os": "linux", "cpu": "arm" }, "sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.19.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.19.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.19.2", "", { "os": "linux", "cpu": "none" }, "sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.19.2", "", { "os": "linux", "cpu": "none" }, "sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.19.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.19.2", "", { "os": "linux", "cpu": "none" }, "sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.19.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.19.2", "", { "os": "linux", "cpu": "x64" }, "sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.19.2", "", { "os": "none", "cpu": "x64" }, "sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.19.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.19.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.19.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.19.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.19.2", "", { "os": "win32", "cpu": "x64" }, "sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw=="],
|
||||
|
||||
"@iarna/toml": ["@iarna/toml@2.2.5", "", {}, "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg=="],
|
||||
|
||||
"@opentelemetry/api": ["@opentelemetry/api@1.5.0", "", {}, ""],
|
||||
|
||||
"@protobuf-ts/plugin": ["@protobuf-ts/plugin@2.9.6", "", { "dependencies": { "@protobuf-ts/plugin-framework": "^2.9.6", "@protobuf-ts/protoc": "^2.9.6", "@protobuf-ts/runtime": "^2.9.6", "@protobuf-ts/runtime-rpc": "^2.9.6", "typescript": "^3.9" }, "bin": { "protoc-gen-dump": "bin/protoc-gen-dump", "protoc-gen-ts": "bin/protoc-gen-ts" } }, "sha512-Wpv5rkXeu6E5Y4r0TjWE0bzRGddiTYl/RM+tLgVlS0r8CqOBqNAmlWv+s8ltf/F75rVrahUal0cpyhFwha9GRA=="],
|
||||
|
||||
"@protobuf-ts/plugin-framework": ["@protobuf-ts/plugin-framework@2.9.6", "", { "dependencies": { "@protobuf-ts/runtime": "^2.9.6", "typescript": "^3.9" } }, "sha512-w7A1RXrDCiVzcaRE6YJP7FCARuAFe/Vc4SNQnHAi4CF0V6mEtyjAYEIC5BNYgIRaJEqB26zzsBQjIem3R02SCA=="],
|
||||
|
||||
"@protobuf-ts/protoc": ["@protobuf-ts/protoc@2.9.6", "", { "bin": { "protoc": "protoc.js" } }, "sha512-c0XvAPDIBAovH9HxV8gBv8gzOTreQIqibcusrB1+DxvFiSvy+2V1tjbUmG5gJEbjk3aAOaoj0a3+QuE+P28xUw=="],
|
||||
|
||||
"@protobuf-ts/runtime": ["@protobuf-ts/runtime@2.9.6", "", {}, "sha512-C0CfpKx4n4LBbUrajOdRj2BTbd3qBoK0SiKWLq7RgCoU6xiN4wesBMFHUOBp3fFzKeZwgU8Q2KtzaqzIvPLRXg=="],
|
||||
|
||||
"@protobuf-ts/runtime-rpc": ["@protobuf-ts/runtime-rpc@2.9.6", "", { "dependencies": { "@protobuf-ts/runtime": "^2.9.6" } }, "sha512-0UeqDRzNxgsh08lY5eWzFJNfD3gZ8Xf+WG1HzbIAbVAigzigwjwsYNNhTeas5H3gco1U5owTzCg177aambKOOw=="],
|
||||
|
||||
"@types/bun": ["@types/bun@1.2.18", "", { "dependencies": { "bun-types": "1.2.18" } }, "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ=="],
|
||||
|
||||
"@types/node": ["@types/node@20.9.1", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA=="],
|
||||
|
||||
"@types/node-fetch": ["@types/node-fetch@2.6.4", "", { "dependencies": { "@types/node": "*", "form-data": "^3.0.0" } }, ""],
|
||||
|
||||
"@types/react": ["@types/react@19.1.8", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g=="],
|
||||
|
||||
"@types/tunnel": ["@types/tunnel@0.0.3", "", { "dependencies": { "@types/node": "*" } }, ""],
|
||||
|
||||
"abort-controller": ["abort-controller@3.0.0", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, ""],
|
||||
|
||||
"asynckit": ["asynckit@0.4.0", "", {}, ""],
|
||||
|
||||
"balanced-match": ["balanced-match@1.0.2", "", {}, ""],
|
||||
|
||||
"brace-expansion": ["brace-expansion@1.1.11", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, ""],
|
||||
|
||||
"bun-types": ["bun-types@1.2.18", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw=="],
|
||||
|
||||
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
||||
|
||||
"combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, ""],
|
||||
|
||||
"compare-versions": ["compare-versions@6.1.1", "", {}, "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg=="],
|
||||
|
||||
"concat-map": ["concat-map@0.0.1", "", {}, ""],
|
||||
|
||||
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
|
||||
|
||||
"delayed-stream": ["delayed-stream@1.0.0", "", {}, ""],
|
||||
|
||||
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
||||
|
||||
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
||||
|
||||
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
|
||||
|
||||
"es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="],
|
||||
|
||||
"esbuild": ["esbuild@0.19.2", "", { "optionalDependencies": { "@esbuild/android-arm": "0.19.2", "@esbuild/android-arm64": "0.19.2", "@esbuild/android-x64": "0.19.2", "@esbuild/darwin-arm64": "0.19.2", "@esbuild/darwin-x64": "0.19.2", "@esbuild/freebsd-arm64": "0.19.2", "@esbuild/freebsd-x64": "0.19.2", "@esbuild/linux-arm": "0.19.2", "@esbuild/linux-arm64": "0.19.2", "@esbuild/linux-ia32": "0.19.2", "@esbuild/linux-loong64": "0.19.2", "@esbuild/linux-mips64el": "0.19.2", "@esbuild/linux-ppc64": "0.19.2", "@esbuild/linux-riscv64": "0.19.2", "@esbuild/linux-s390x": "0.19.2", "@esbuild/linux-x64": "0.19.2", "@esbuild/netbsd-x64": "0.19.2", "@esbuild/openbsd-x64": "0.19.2", "@esbuild/sunos-x64": "0.19.2", "@esbuild/win32-arm64": "0.19.2", "@esbuild/win32-ia32": "0.19.2", "@esbuild/win32-x64": "0.19.2" }, "bin": "bin/esbuild" }, ""],
|
||||
|
||||
"event-target-shim": ["event-target-shim@5.0.1", "", {}, ""],
|
||||
|
||||
"events": ["events@3.3.0", "", {}, ""],
|
||||
|
||||
"form-data": ["form-data@4.0.5", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w=="],
|
||||
|
||||
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
|
||||
|
||||
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
||||
|
||||
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
|
||||
"has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
|
||||
|
||||
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
|
||||
|
||||
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
|
||||
|
||||
"mime-db": ["mime-db@1.52.0", "", {}, ""],
|
||||
|
||||
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, ""],
|
||||
|
||||
"minimatch": ["minimatch@3.0.8", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, ""],
|
||||
|
||||
"node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, ""],
|
||||
|
||||
"prettier": ["prettier@3.4.2", "", { "bin": "bin/prettier.cjs" }, "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ=="],
|
||||
|
||||
"process": ["process@0.11.10", "", {}, ""],
|
||||
|
||||
"sax": ["sax@1.2.4", "", {}, ""],
|
||||
|
||||
"semver": ["semver@6.3.1", "", { "bin": "bin/semver.js" }, ""],
|
||||
|
||||
"tr46": ["tr46@0.0.3", "", {}, ""],
|
||||
|
||||
"tslib": ["tslib@2.6.2", "", {}, ""],
|
||||
|
||||
"tunnel": ["tunnel@0.0.6", "", {}, ""],
|
||||
|
||||
"typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, ""],
|
||||
|
||||
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
||||
|
||||
"uuid": ["uuid@3.4.0", "", { "bin": "bin/uuid" }, ""],
|
||||
|
||||
"webidl-conversions": ["webidl-conversions@3.0.1", "", {}, ""],
|
||||
|
||||
"whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, ""],
|
||||
|
||||
"xml2js": ["xml2js@0.5.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, ""],
|
||||
|
||||
"xmlbuilder": ["xmlbuilder@11.0.1", "", {}, ""],
|
||||
|
||||
"@actions/cache/@actions/glob": ["@actions/glob@0.1.2", "", { "dependencies": { "@actions/core": "^1.2.6", "minimatch": "^3.0.4" } }, ""],
|
||||
|
||||
"@azure/core-http/uuid": ["uuid@8.3.2", "", { "bin": "dist/bin/uuid" }, ""],
|
||||
|
||||
"@azure/ms-rest-js/tslib": ["tslib@1.14.1", "", {}, ""],
|
||||
|
||||
"@azure/ms-rest-js/uuid": ["uuid@8.3.2", "", { "bin": "dist/bin/uuid" }, ""],
|
||||
|
||||
"@protobuf-ts/plugin/typescript": ["typescript@3.9.10", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],
|
||||
|
||||
"@protobuf-ts/plugin-framework/typescript": ["typescript@3.9.10", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],
|
||||
}
|
||||
}
|
||||
2
bunfig.toml
Normal file
2
bunfig.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[install]
|
||||
saveTextLockfile = true
|
||||
73
dist/cache-save/index.js
generated
vendored
Normal file
73
dist/cache-save/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
69
dist/index.js
generated
vendored
69
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
93
dist/setup/index.js
generated
vendored
Normal file
93
dist/setup/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
733
package-lock.json
generated
733
package-lock.json
generated
@@ -1,33 +1,37 @@
|
||||
{
|
||||
"name": "setup-bun",
|
||||
"version": "1.1.1",
|
||||
"version": "2.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "setup-bun",
|
||||
"version": "1.1.1",
|
||||
"version": "2.1.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.1.4",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/cache": "^4.0.0",
|
||||
"@actions/core": "^1.11.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/tool-cache": "^2.0.1"
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.1.13",
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "3.2.2",
|
||||
"license": "MIT",
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.3.tgz",
|
||||
"integrity": "sha512-SvrqFtYJ7I48A/uXNkoJrnukx5weQv1fGquhs3+4nkByZThBH109KTIqj5x/cGV7JGNvb8dLPVywUOqX1fjiXg==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.0.1",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@actions/http-client": "^2.1.1",
|
||||
@@ -35,8 +39,8 @@
|
||||
"@azure/abort-controller": "^1.1.0",
|
||||
"@azure/ms-rest-js": "^2.6.0",
|
||||
"@azure/storage-blob": "^12.13.0",
|
||||
"semver": "^6.1.0",
|
||||
"uuid": "^3.3.3"
|
||||
"@protobuf-ts/plugin": "^2.9.4",
|
||||
"semver": "^6.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache/node_modules/@actions/glob": {
|
||||
@@ -48,18 +52,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
"version": "1.10.1",
|
||||
"license": "MIT",
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
||||
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
||||
"dependencies": {
|
||||
"@actions/http-client": "^2.0.1",
|
||||
"uuid": "^8.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core/node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/http-client": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/exec": {
|
||||
@@ -145,18 +143,6 @@
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/core-http/node_modules/form-data": {
|
||||
"version": "4.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/core-http/node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"license": "MIT",
|
||||
@@ -261,6 +247,57 @@
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.2.tgz",
|
||||
"integrity": "sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.2.tgz",
|
||||
"integrity": "sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.19.2",
|
||||
"cpu": [
|
||||
@@ -276,6 +313,318 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.2.tgz",
|
||||
"integrity": "sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.2.tgz",
|
||||
"integrity": "sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.2.tgz",
|
||||
"integrity": "sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.2.tgz",
|
||||
"integrity": "sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.2.tgz",
|
||||
"integrity": "sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.2.tgz",
|
||||
"integrity": "sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.2.tgz",
|
||||
"integrity": "sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.2.tgz",
|
||||
"integrity": "sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.2.tgz",
|
||||
"integrity": "sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.2.tgz",
|
||||
"integrity": "sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.2.tgz",
|
||||
"integrity": "sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.2.tgz",
|
||||
"integrity": "sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@iarna/toml": {
|
||||
"version": "2.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz",
|
||||
"integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@opentelemetry/api": {
|
||||
"version": "1.5.0",
|
||||
"license": "Apache-2.0",
|
||||
@@ -283,6 +632,86 @@
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/plugin": {
|
||||
"version": "2.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.6.tgz",
|
||||
"integrity": "sha512-Wpv5rkXeu6E5Y4r0TjWE0bzRGddiTYl/RM+tLgVlS0r8CqOBqNAmlWv+s8ltf/F75rVrahUal0cpyhFwha9GRA==",
|
||||
"dependencies": {
|
||||
"@protobuf-ts/plugin-framework": "^2.9.6",
|
||||
"@protobuf-ts/protoc": "^2.9.6",
|
||||
"@protobuf-ts/runtime": "^2.9.6",
|
||||
"@protobuf-ts/runtime-rpc": "^2.9.6",
|
||||
"typescript": "^3.9"
|
||||
},
|
||||
"bin": {
|
||||
"protoc-gen-dump": "bin/protoc-gen-dump",
|
||||
"protoc-gen-ts": "bin/protoc-gen-ts"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/plugin-framework": {
|
||||
"version": "2.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.6.tgz",
|
||||
"integrity": "sha512-w7A1RXrDCiVzcaRE6YJP7FCARuAFe/Vc4SNQnHAi4CF0V6mEtyjAYEIC5BNYgIRaJEqB26zzsBQjIem3R02SCA==",
|
||||
"dependencies": {
|
||||
"@protobuf-ts/runtime": "^2.9.6",
|
||||
"typescript": "^3.9"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/plugin-framework/node_modules/typescript": {
|
||||
"version": "3.9.10",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
|
||||
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/plugin/node_modules/typescript": {
|
||||
"version": "3.9.10",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
|
||||
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/protoc": {
|
||||
"version": "2.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.6.tgz",
|
||||
"integrity": "sha512-c0XvAPDIBAovH9HxV8gBv8gzOTreQIqibcusrB1+DxvFiSvy+2V1tjbUmG5gJEbjk3aAOaoj0a3+QuE+P28xUw==",
|
||||
"bin": {
|
||||
"protoc": "protoc.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/runtime": {
|
||||
"version": "2.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.6.tgz",
|
||||
"integrity": "sha512-C0CfpKx4n4LBbUrajOdRj2BTbd3qBoK0SiKWLq7RgCoU6xiN4wesBMFHUOBp3fFzKeZwgU8Q2KtzaqzIvPLRXg=="
|
||||
},
|
||||
"node_modules/@protobuf-ts/runtime-rpc": {
|
||||
"version": "2.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.6.tgz",
|
||||
"integrity": "sha512-0UeqDRzNxgsh08lY5eWzFJNfD3gZ8Xf+WG1HzbIAbVAigzigwjwsYNNhTeas5H3gco1U5owTzCg177aambKOOw==",
|
||||
"dependencies": {
|
||||
"@protobuf-ts/runtime": "^2.9.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/bun": {
|
||||
"version": "1.2.18",
|
||||
"resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.2.18.tgz",
|
||||
"integrity": "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bun-types": "1.2.18"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.1.tgz",
|
||||
@@ -299,16 +728,15 @@
|
||||
"form-data": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node-fetch/node_modules/form-data": {
|
||||
"version": "3.0.1",
|
||||
"node_modules/@types/react": {
|
||||
"version": "19.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.8.tgz",
|
||||
"integrity": "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/tunnel": {
|
||||
@@ -344,6 +772,32 @@
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/bun-types": {
|
||||
"version": "1.2.18",
|
||||
"resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.18.tgz",
|
||||
"integrity": "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"license": "MIT",
|
||||
@@ -354,10 +808,22 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/compare-versions": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz",
|
||||
"integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg=="
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/csstype": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
|
||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
@@ -365,6 +831,65 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
||||
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.6",
|
||||
"has-tostringtag": "^1.0.2",
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.19.2",
|
||||
"dev": true,
|
||||
@@ -416,15 +941,125 @@
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "2.5.1",
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
||||
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.6",
|
||||
"combined-stream": "^1.0.8",
|
||||
"es-set-tostringtag": "^2.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.12"
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-tostringtag": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
@@ -473,14 +1108,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"
|
||||
|
||||
24
package.json
24
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "setup-bun",
|
||||
"version": "1.1.1",
|
||||
"version": "2.1.0",
|
||||
"description": "Setup Bun on GitHub Actions.",
|
||||
"keywords": [
|
||||
"bun",
|
||||
@@ -18,24 +18,30 @@
|
||||
"author": "xHyroM",
|
||||
"scripts": {
|
||||
"format": "prettier --write src *.yml *.json *.md",
|
||||
"build": "esbuild --target=node20 --outdir=dist --bundle --minify --platform=node --format=cjs src/index.ts",
|
||||
"start": "npm run build && node dist/index.js"
|
||||
"build": "esbuild --target=node20 --outfile=dist/setup/index.js --bundle --keep-names --minify --platform=node --format=cjs src/index.ts && esbuild --target=node20 --outfile=dist/cache-save/index.js --bundle --keep-names --minify --platform=node --format=cjs src/cache-save.ts",
|
||||
"start": "npm run build && node dist/setup/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.1.4",
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/cache": "^4.0.0",
|
||||
"@actions/core": "^1.11.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/tool-cache": "^2.0.1"
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.1.13",
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"prettier": {
|
||||
"quoteProps": "preserve"
|
||||
"patchedDependencies": {
|
||||
"compare-versions@6.1.1": "patches/compare-versions@6.1.1.patch"
|
||||
},
|
||||
"overrides": {
|
||||
"form-data": "^4.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
67
patches/compare-versions@6.1.1.patch
Normal file
67
patches/compare-versions@6.1.1.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
diff --git a/lib/esm/satisfies.js b/lib/esm/satisfies.js
|
||||
index 7586b71657332f855431c4dd4f05e9394fd9aac3..a6ec29bfc98907c67ed4af71fca73bd8bff88798 100644
|
||||
--- a/lib/esm/satisfies.js
|
||||
+++ b/lib/esm/satisfies.js
|
||||
@@ -40,8 +40,9 @@ export const satisfies = (version, range) => {
|
||||
// else range of either "~" or "^" is assumed
|
||||
const [v1, v2, v3, , vp] = validateAndParse(version);
|
||||
const [r1, r2, r3, , rp] = validateAndParse(range);
|
||||
- const v = [v1, v2, v3];
|
||||
+ const v = [v1, v2 !== null && v2 !== void 0 ? v2 : 'x', v3 !== null && v3 !== void 0 ? v3 : 'x'];
|
||||
const r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x'];
|
||||
+
|
||||
// validate pre-release
|
||||
if (rp) {
|
||||
if (!vp)
|
||||
diff --git a/lib/esm/utils.js b/lib/esm/utils.js
|
||||
index b5cc8b9927ab38fc67032c133b531e95ec4cec15..ec56105fd2d806aa922f1488a27b02c56aff1865 100644
|
||||
--- a/lib/esm/utils.js
|
||||
+++ b/lib/esm/utils.js
|
||||
@@ -28,7 +28,7 @@ const compareStrings = (a, b) => {
|
||||
};
|
||||
export const compareSegments = (a, b) => {
|
||||
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
||||
- const r = compareStrings(a[i] || '0', b[i] || '0');
|
||||
+ const r = compareStrings(a[i] || 'x', b[i] || 'x');
|
||||
if (r !== 0)
|
||||
return r;
|
||||
}
|
||||
diff --git a/lib/umd/index.js b/lib/umd/index.js
|
||||
index 2cfef261bca520e21ed41fc14950732b8aa6339b..1059784db86635f3aaaba83b5a72c5015e1d8490 100644
|
||||
--- a/lib/umd/index.js
|
||||
+++ b/lib/umd/index.js
|
||||
@@ -152,7 +152,7 @@
|
||||
// else range of either "~" or "^" is assumed
|
||||
const [v1, v2, v3, , vp] = validateAndParse(version);
|
||||
const [r1, r2, r3, , rp] = validateAndParse(range);
|
||||
- const v = [v1, v2, v3];
|
||||
+ const v = [v1, v2 !== null && v2 !== void 0 ? v2 : 'x', v3 !== null && v3 !== void 0 ? v3 : 'x'];
|
||||
const r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x'];
|
||||
// validate pre-release
|
||||
if (rp) {
|
||||
diff --git a/package.json b/package.json
|
||||
index b05b3daf706d7ba4e594233f8791fc3007a8e2cd..e51e76b86f95e9ebf0b5dba3b82aeb119628528d 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -26,7 +26,7 @@
|
||||
"prepublishOnly": "npm run build",
|
||||
"test": "c8 --reporter=lcov mocha"
|
||||
},
|
||||
- "main": "./lib/umd/index.js",
|
||||
+ "main": "./lib/src/index.ts",
|
||||
"module": "./lib/esm/index.js",
|
||||
"types": "./lib/esm/index.d.ts",
|
||||
"sideEffects": false,
|
||||
diff --git a/src/satisfies.ts b/src/satisfies.ts
|
||||
index 66cb171d7f32e68fdda6929d2da223b97a053737..6b4973f037843f264338a01efdc4ace5dcf042cd 100644
|
||||
--- a/src/satisfies.ts
|
||||
+++ b/src/satisfies.ts
|
||||
@@ -43,7 +43,7 @@ export const satisfies = (version: string, range: string): boolean => {
|
||||
// else range of either "~" or "^" is assumed
|
||||
const [v1, v2, v3, , vp] = validateAndParse(version);
|
||||
const [r1, r2, r3, , rp] = validateAndParse(range);
|
||||
- const v = [v1, v2, v3];
|
||||
+ const v = [v1, v2 ?? 'x', v3 ?? 'x'];
|
||||
const r = [r1, r2 ?? 'x', r3 ?? 'x'];
|
||||
|
||||
// validate pre-release
|
||||
171
src/action.ts
171
src/action.ts
@@ -1,3 +1,4 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import {
|
||||
@@ -6,12 +7,18 @@ import {
|
||||
symlinkSync,
|
||||
renameSync,
|
||||
copyFileSync,
|
||||
existsSync,
|
||||
} from "node:fs";
|
||||
import { addPath, info, warning } from "@actions/core";
|
||||
import { isFeatureAvailable, restoreCache, saveCache } from "@actions/cache";
|
||||
import { isFeatureAvailable, restoreCache } from "@actions/cache";
|
||||
import { downloadTool, extractZip } from "@actions/tool-cache";
|
||||
import { getExecOutput } from "@actions/exec";
|
||||
import { Registry } from "./registry";
|
||||
import { writeBunfig } from "./bunfig";
|
||||
import { saveState } from "@actions/core";
|
||||
import { addExtension } from "./utils";
|
||||
import { getDownloadUrl } from "./download-url";
|
||||
import { cwd } from "node:process";
|
||||
|
||||
export type Input = {
|
||||
customUrl?: string;
|
||||
@@ -20,21 +27,31 @@ export type Input = {
|
||||
arch?: string;
|
||||
avx2?: boolean;
|
||||
profile?: boolean;
|
||||
scope?: string;
|
||||
registryUrl?: string;
|
||||
registries?: Registry[];
|
||||
noCache?: boolean;
|
||||
token?: string;
|
||||
};
|
||||
|
||||
export type Output = {
|
||||
version: string;
|
||||
revision: string;
|
||||
bunPath: string;
|
||||
url: string;
|
||||
cacheHit: boolean;
|
||||
};
|
||||
|
||||
export default async (options: Input): Promise<Output> => {
|
||||
const bunfigPath = join(process.cwd(), "bunfig.toml");
|
||||
writeBunfig(bunfigPath, options);
|
||||
export type CacheState = {
|
||||
cacheEnabled: boolean;
|
||||
cacheHit: boolean;
|
||||
bunPath: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
const url = getDownloadUrl(options);
|
||||
export default async (options: Input): Promise<Output> => {
|
||||
const bunfigPath = join(cwd(), "bunfig.toml");
|
||||
writeBunfig(bunfigPath, options.registries);
|
||||
|
||||
const url = await getDownloadUrl(options);
|
||||
const cacheEnabled = isCacheEnabled(options);
|
||||
|
||||
const binPath = join(homedir(), ".bun", "bin");
|
||||
@@ -60,60 +77,114 @@ export default async (options: Input): Promise<Output> => {
|
||||
|
||||
let revision: string | undefined;
|
||||
let cacheHit = false;
|
||||
if (cacheEnabled) {
|
||||
const cacheRestored = await restoreCache([bunPath], url);
|
||||
if (cacheRestored) {
|
||||
revision = await getRevision(bunPath);
|
||||
if (revision) {
|
||||
cacheHit = true;
|
||||
info(`Using a cached version of Bun: ${revision}`);
|
||||
} else {
|
||||
warning(
|
||||
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`
|
||||
);
|
||||
}
|
||||
|
||||
// Check if Bun executable already exists and matches requested version
|
||||
if (!options.customUrl && existsSync(bunPath)) {
|
||||
const existingRevision = await getRevision(bunPath);
|
||||
if (existingRevision && isVersionMatch(existingRevision, options.version)) {
|
||||
revision = existingRevision;
|
||||
cacheHit = true; // Treat as cache hit to avoid unnecessary network requests
|
||||
info(`Using existing Bun installation: ${revision}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!cacheHit) {
|
||||
info(`Downloading a new version of Bun: ${url}`);
|
||||
const zipPath = await downloadTool(url);
|
||||
const extractedZipPath = await extractZip(zipPath);
|
||||
const extractedBunPath = await extractBun(extractedZipPath);
|
||||
try {
|
||||
renameSync(extractedBunPath, bunPath);
|
||||
} catch {
|
||||
// If mv does not work, try to copy the file instead.
|
||||
// For example: EXDEV: cross-device link not permitted
|
||||
copyFileSync(extractedBunPath, bunPath);
|
||||
if (!revision) {
|
||||
if (cacheEnabled) {
|
||||
const cacheKey = createHash("sha1").update(url).digest("base64");
|
||||
|
||||
const cacheRestored = await restoreCache([bunPath], cacheKey);
|
||||
if (cacheRestored) {
|
||||
revision = await getRevision(bunPath);
|
||||
if (revision) {
|
||||
cacheHit = true;
|
||||
info(`Using a cached version of Bun: ${revision}`);
|
||||
} else {
|
||||
warning(
|
||||
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!cacheHit) {
|
||||
info(`Downloading a new version of Bun: ${url}`);
|
||||
revision = await downloadBun(url, bunPath);
|
||||
}
|
||||
revision = await getRevision(bunPath);
|
||||
}
|
||||
|
||||
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.",
|
||||
);
|
||||
}
|
||||
|
||||
if (cacheEnabled && !cacheHit) {
|
||||
try {
|
||||
await saveCache([bunPath], url);
|
||||
} catch (error) {
|
||||
warning("Failed to save Bun to cache.");
|
||||
}
|
||||
}
|
||||
|
||||
const [version] = revision.split("+");
|
||||
|
||||
const cacheState: CacheState = {
|
||||
cacheEnabled,
|
||||
cacheHit,
|
||||
bunPath,
|
||||
url,
|
||||
};
|
||||
|
||||
saveState("cache", JSON.stringify(cacheState));
|
||||
|
||||
return {
|
||||
version,
|
||||
revision,
|
||||
bunPath,
|
||||
url,
|
||||
cacheHit,
|
||||
};
|
||||
};
|
||||
|
||||
function isVersionMatch(
|
||||
existingRevision: string,
|
||||
requestedVersion?: string,
|
||||
): boolean {
|
||||
// If no version specified, default is "latest" - don't match existing
|
||||
if (!requestedVersion) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Non-pinned versions should never match existing installations
|
||||
if (/^(latest|canary|action)$/i.test(requestedVersion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const [existingVersion] = existingRevision.split("+");
|
||||
|
||||
const normalizeVersion = (v: string) => v.replace(/^v/i, "");
|
||||
|
||||
return (
|
||||
normalizeVersion(existingVersion) === normalizeVersion(requestedVersion)
|
||||
);
|
||||
}
|
||||
|
||||
async function downloadBun(
|
||||
url: 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");
|
||||
const extractedZipPath = await extractZip(zipPath);
|
||||
const extractedBunPath = await extractBun(extractedZipPath);
|
||||
try {
|
||||
renameSync(extractedBunPath, bunPath);
|
||||
} catch {
|
||||
// If mv does not work, try to copy the file instead.
|
||||
// For example: EXDEV: cross-device link not permitted
|
||||
copyFileSync(extractedBunPath, bunPath);
|
||||
}
|
||||
|
||||
return await getRevision(bunPath);
|
||||
}
|
||||
|
||||
function isCacheEnabled(options: Input): boolean {
|
||||
const { customUrl, version } = options;
|
||||
const { customUrl, version, noCache } = options;
|
||||
if (noCache) {
|
||||
return false;
|
||||
}
|
||||
if (customUrl) {
|
||||
return false;
|
||||
}
|
||||
@@ -123,24 +194,6 @@ function isCacheEnabled(options: Input): boolean {
|
||||
return isFeatureAvailable();
|
||||
}
|
||||
|
||||
function getDownloadUrl(options: Input): string {
|
||||
const { customUrl } = options;
|
||||
if (customUrl) {
|
||||
return customUrl;
|
||||
}
|
||||
const { version, os, arch, avx2, profile } = options;
|
||||
const eversion = encodeURIComponent(version ?? "latest");
|
||||
const eos = encodeURIComponent(os ?? process.platform);
|
||||
const earch = encodeURIComponent(arch ?? process.arch);
|
||||
const eavx2 = encodeURIComponent(avx2 ?? true);
|
||||
const eprofile = encodeURIComponent(profile ?? false);
|
||||
const { href } = new URL(
|
||||
`${eversion}/${eos}/${earch}?avx2=${eavx2}&profile=${eprofile}`,
|
||||
"https://bun.sh/download/"
|
||||
);
|
||||
return href;
|
||||
}
|
||||
|
||||
async function extractBun(path: string): Promise<string> {
|
||||
for (const entry of readdirSync(path, { withFileTypes: true })) {
|
||||
const { name } = entry;
|
||||
|
||||
113
src/bunfig.ts
113
src/bunfig.ts
@@ -1,50 +1,81 @@
|
||||
import { EOL } from "node:os";
|
||||
import { appendFileSync } from "node:fs";
|
||||
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { info } from "@actions/core";
|
||||
import { parse, stringify } from "@iarna/toml";
|
||||
import { Registry } from "./registry";
|
||||
|
||||
type BunfigOptions = {
|
||||
registryUrl?: string;
|
||||
scope?: string;
|
||||
type BunfigConfig = {
|
||||
install?: {
|
||||
registry?: {
|
||||
url: string;
|
||||
token?: string;
|
||||
};
|
||||
scopes?: Record<string, { url: string; token?: string }>;
|
||||
};
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
export function createBunfig(options: BunfigOptions): string | null {
|
||||
const { registryUrl, scope } = options;
|
||||
|
||||
let url: URL | undefined;
|
||||
if (registryUrl) {
|
||||
try {
|
||||
url = new URL(registryUrl);
|
||||
} catch {
|
||||
throw new Error(`Invalid registry-url: ${registryUrl}`);
|
||||
}
|
||||
}
|
||||
|
||||
let owner: string | undefined;
|
||||
if (scope) {
|
||||
owner = scope.startsWith("@")
|
||||
? scope.toLocaleLowerCase()
|
||||
: `@${scope.toLocaleLowerCase()}`;
|
||||
}
|
||||
|
||||
if (url && owner) {
|
||||
return `[install.scopes]${EOL}'${owner}' = { token = "$BUN_AUTH_TOKEN", url = "${url}"}${EOL}`;
|
||||
}
|
||||
|
||||
if (url && !owner) {
|
||||
return `[install]${EOL}registry = "${url}"${EOL}`;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export function writeBunfig(path: string, options: BunfigOptions): void {
|
||||
const bunfig = createBunfig(options);
|
||||
if (!bunfig) {
|
||||
export function writeBunfig(path: string, registries: Registry[]): void {
|
||||
if (!registries.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
info(`Writing bunfig.toml to '${path}'.`);
|
||||
appendFileSync(path, bunfig, {
|
||||
encoding: "utf8",
|
||||
let globalRegistryCount = 0;
|
||||
registries.forEach((registry) => {
|
||||
try {
|
||||
new URL(registry.url);
|
||||
} catch {
|
||||
throw new Error(`Invalid registry URL: ${registry.url}`);
|
||||
}
|
||||
|
||||
if (!registry.scope) {
|
||||
globalRegistryCount++;
|
||||
}
|
||||
});
|
||||
|
||||
if (globalRegistryCount > 1) {
|
||||
throw new Error("You can't have more than one global registry.");
|
||||
}
|
||||
|
||||
info(`Writing bunfig.toml to '${path}'.`);
|
||||
|
||||
let config: BunfigConfig = {};
|
||||
if (existsSync(path)) {
|
||||
try {
|
||||
const content = readFileSync(path, { encoding: "utf-8" });
|
||||
config = parse(content) as BunfigConfig;
|
||||
} catch (error) {
|
||||
info(`Error reading existing bunfig: ${error.message}`);
|
||||
config = {};
|
||||
}
|
||||
}
|
||||
|
||||
config.install = config?.install || {};
|
||||
config.install.scopes = config?.install.scopes || {};
|
||||
|
||||
const globalRegistry = registries.find((r) => !r.scope);
|
||||
if (globalRegistry) {
|
||||
config.install.registry = {
|
||||
url: globalRegistry.url,
|
||||
...(globalRegistry.token ? { token: globalRegistry.token } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
for (const registry of registries) {
|
||||
if (registry.scope) {
|
||||
const scopeName = registry.scope.startsWith("@")
|
||||
? registry.scope.toLowerCase()
|
||||
: `@${registry.scope.toLowerCase()}`;
|
||||
|
||||
config.install.scopes[scopeName] = {
|
||||
url: registry.url,
|
||||
...(registry.token ? { token: registry.token } : {}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(config.install.scopes).length === 0) {
|
||||
delete config.install.scopes;
|
||||
}
|
||||
|
||||
writeFileSync(path, stringify(config), { encoding: "utf8" });
|
||||
}
|
||||
|
||||
17
src/cache-save.ts
Normal file
17
src/cache-save.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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) {
|
||||
const cacheKey = createHash("sha1").update(state.url).digest("base64");
|
||||
|
||||
try {
|
||||
await saveCache([state.bunPath], cacheKey);
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
warning("Failed to save Bun to cache.");
|
||||
}
|
||||
}
|
||||
})();
|
||||
69
src/download-url.ts
Normal file
69
src/download-url.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import { compareVersions, satisfies, validate } from "compare-versions";
|
||||
import { Input } from "./action";
|
||||
import { getArchitecture, getAvx2, getPlatform, request } from "./utils";
|
||||
|
||||
export async function getDownloadUrl(options: Input): Promise<string> {
|
||||
const { customUrl } = options;
|
||||
if (customUrl) {
|
||||
return customUrl;
|
||||
}
|
||||
|
||||
return await getSemverDownloadUrl(options);
|
||||
}
|
||||
|
||||
async function getSemverDownloadUrl(options: Input): Promise<string> {
|
||||
const res = (await (
|
||||
await request("https://api.github.com/repos/oven-sh/bun/git/refs/tags", {
|
||||
headers: options.token
|
||||
? { "Authorization": `Bearer ${options.token}` }
|
||||
: {},
|
||||
})
|
||||
).json()) as { ref: string }[];
|
||||
|
||||
let tags = res
|
||||
.filter(
|
||||
(tag) =>
|
||||
tag.ref.startsWith("refs/tags/bun-v") || tag.ref === "refs/tags/canary",
|
||||
)
|
||||
.map((item) => item.ref.replace(/refs\/tags\/(bun-v)?/g, ""))
|
||||
.filter(Boolean);
|
||||
|
||||
const { version, os, arch, avx2, profile } = options;
|
||||
|
||||
let tag = tags.find((t) => t === version);
|
||||
if (!tag) {
|
||||
tags = tags.filter((t) => validate(t)).sort(compareVersions);
|
||||
|
||||
const matchedTag =
|
||||
version === "latest" || !version
|
||||
? tags.at(-1)
|
||||
: tags.filter((t) => satisfies(t, version)).at(-1);
|
||||
|
||||
if (!matchedTag) {
|
||||
throw new Error(`No Bun release found matching version '${version}'`);
|
||||
}
|
||||
|
||||
tag = `bun-v${matchedTag}`;
|
||||
} else if (validate(tag)) {
|
||||
tag = `bun-v${tag}`;
|
||||
}
|
||||
|
||||
const eversion = encodeURIComponent(tag ?? version);
|
||||
const eos = encodeURIComponent(os ?? getPlatform());
|
||||
const earch = encodeURIComponent(
|
||||
getArchitecture(os ?? getPlatform(), arch ?? process.arch),
|
||||
);
|
||||
const eavx2 = encodeURIComponent(
|
||||
getAvx2(os ?? getPlatform(), arch ?? process.arch, avx2) === false
|
||||
? "-baseline"
|
||||
: "",
|
||||
);
|
||||
const eprofile = encodeURIComponent(profile === true ? "-profile" : "");
|
||||
|
||||
const { href } = new URL(
|
||||
`${eversion}/bun-${eos}-${earch}${eavx2}${eprofile}.zip`,
|
||||
"https://github.com/oven-sh/bun/releases/download/",
|
||||
);
|
||||
|
||||
return href;
|
||||
}
|
||||
55
src/index.ts
55
src/index.ts
@@ -1,46 +1,47 @@
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { getInput, setOutput, setFailed, warning } from "@actions/core";
|
||||
import { getInput, setOutput, setFailed, getBooleanInput } from "@actions/core";
|
||||
import runAction from "./action.js";
|
||||
import { readVersionFromFile } from "./utils.js";
|
||||
import { parseRegistries } from "./registry.js";
|
||||
|
||||
if (!process.env.RUNNER_TEMP) {
|
||||
process.env.RUNNER_TEMP = tmpdir();
|
||||
}
|
||||
|
||||
function readVersionFromPackageJson(): string | undefined {
|
||||
const cwd = process.env.GITHUB_WORKSPACE;
|
||||
if (!cwd) {
|
||||
return;
|
||||
}
|
||||
const path = join(cwd, "package.json");
|
||||
try {
|
||||
if (!existsSync(path)) {
|
||||
return;
|
||||
}
|
||||
const { packageManager } = JSON.parse(readFileSync(path, "utf8"));
|
||||
if (!packageManager?.includes("bun@")) {
|
||||
return;
|
||||
}
|
||||
const [_, version] = packageManager.split("bun@");
|
||||
return version;
|
||||
} catch (error) {
|
||||
const { message } = error as Error;
|
||||
warning(`Failed to read package.json: ${message}`);
|
||||
}
|
||||
const registries = parseRegistries(getInput("registries"));
|
||||
|
||||
// Backwards compatibility for the `registry-url` and `scope` inputs
|
||||
const registryUrl = getInput("registry-url");
|
||||
const scope = getInput("scope");
|
||||
|
||||
if (registryUrl) {
|
||||
registries.push({
|
||||
url: registryUrl,
|
||||
scope: scope,
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
});
|
||||
}
|
||||
|
||||
runAction({
|
||||
version: getInput("bun-version") || readVersionFromPackageJson() || undefined,
|
||||
version:
|
||||
getInput("bun-version") ||
|
||||
readVersionFromFile(getInput("bun-version-file")) ||
|
||||
readVersionFromFile("package.json", true) ||
|
||||
undefined,
|
||||
customUrl: getInput("bun-download-url") || undefined,
|
||||
registryUrl: getInput("registry-url") || undefined,
|
||||
scope: getInput("scope") || undefined,
|
||||
registries: registries,
|
||||
noCache: getBooleanInput("no-cache") || false,
|
||||
token: getInput("token"),
|
||||
})
|
||||
.then(({ version, revision, cacheHit }) => {
|
||||
.then(({ version, revision, bunPath, url, cacheHit }) => {
|
||||
setOutput("bun-version", version);
|
||||
setOutput("bun-revision", revision);
|
||||
setOutput("bun-path", bunPath);
|
||||
setOutput("bun-download-url", url);
|
||||
setOutput("cache-hit", cacheHit);
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((error) => {
|
||||
setFailed(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
62
src/registry.ts
Normal file
62
src/registry.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
export type Registry = {
|
||||
url: string;
|
||||
scope: string;
|
||||
token?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse registries from the simplified format:
|
||||
* - Default registry: https://registry.npmjs.org/
|
||||
* - Default registry with token: https://registry.npmjs.org/|token123
|
||||
* - With scope and credentials in URL: @myorg:https://username:password@registry.myorg.com/
|
||||
* - With scope and separate token: @partner:https://registry.partner.com/|basic_token
|
||||
*/
|
||||
export function parseRegistries(input: string): Registry[] {
|
||||
if (!input?.trim()) return [];
|
||||
|
||||
return input
|
||||
.split("\n")
|
||||
.map((line) => line.trim())
|
||||
.filter(Boolean)
|
||||
.map(parseLine)
|
||||
.filter(Boolean) as Registry[];
|
||||
}
|
||||
|
||||
function parseLine(line: string): Registry | null {
|
||||
const scopeMatch = line.match(
|
||||
/^(@[a-z0-9-_.]+|[a-z0-9-_.]+(?=:[a-z]+:\/\/)):(.+)$/i,
|
||||
);
|
||||
|
||||
if (scopeMatch) {
|
||||
const scope = scopeMatch[1];
|
||||
const urlPart = scopeMatch[2].trim();
|
||||
|
||||
const [url, token] = urlPart.split("|", 2).map((p) => p?.trim());
|
||||
|
||||
try {
|
||||
new URL(url);
|
||||
|
||||
return {
|
||||
url,
|
||||
scope,
|
||||
...(token && { token }),
|
||||
};
|
||||
} catch (e) {
|
||||
throw new Error(`Invalid URL in registry configuration: ${url}`);
|
||||
}
|
||||
} else {
|
||||
const [url, token] = line.split("|", 2).map((p) => p?.trim());
|
||||
|
||||
try {
|
||||
new URL(url);
|
||||
|
||||
return {
|
||||
url,
|
||||
scope: "",
|
||||
...(token && { token }),
|
||||
};
|
||||
} catch (e) {
|
||||
throw new Error(`Invalid URL in registry configuration: ${url}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
131
src/utils.ts
Normal file
131
src/utils.ts
Normal file
@@ -0,0 +1,131 @@
|
||||
import { debug, warning } from "@actions/core";
|
||||
import { info } from "node:console";
|
||||
import { existsSync, readFileSync, renameSync } from "node:fs";
|
||||
import { resolve, basename } from "node:path";
|
||||
|
||||
export async function request(
|
||||
url: string,
|
||||
init?: RequestInit,
|
||||
): Promise<Response> {
|
||||
const headers = new Headers(init?.headers);
|
||||
if (!headers.has("User-Agent")) {
|
||||
headers.set("User-Agent", "@oven-sh/setup-bun");
|
||||
}
|
||||
|
||||
const res = await fetch(url, {
|
||||
...init,
|
||||
headers,
|
||||
});
|
||||
if (!res.ok) {
|
||||
const body = await res.text().catch(() => "");
|
||||
throw new Error(
|
||||
`Failed to fetch url ${url}. (status code: ${res.status}, status text: ${res.statusText})${body ? `\n${body}` : ""}`,
|
||||
);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
export function addExtension(path: string, ext: string): string {
|
||||
if (!path.endsWith(ext)) {
|
||||
renameSync(path, path + ext);
|
||||
return path + ext;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
export function getPlatform(): string {
|
||||
const platform = process.platform;
|
||||
if (platform === "win32") return "windows";
|
||||
|
||||
return platform;
|
||||
}
|
||||
|
||||
export function getArchitecture(os: string, arch: string): string {
|
||||
if (os === "windows" && (arch === "aarch64" || arch === "arm64")) {
|
||||
warning(
|
||||
[
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows.",
|
||||
"Using x64 baseline build which will run through Microsoft's x64 emulation layer.",
|
||||
"This may result in reduced performance and potential compatibility issues.",
|
||||
"💡 For best performance, consider using x64 Windows runners or other platforms with native support.",
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
return "x64";
|
||||
}
|
||||
|
||||
if (arch === "arm64") return "aarch64";
|
||||
return arch;
|
||||
}
|
||||
|
||||
export function getAvx2(os: string, arch: string, avx2?: boolean): boolean {
|
||||
// Temporary workaround for absence of arm64 builds on Windows (#130)
|
||||
if (os === "windows" && (arch === "aarch64" || arch === "arm64")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return avx2 ?? true;
|
||||
}
|
||||
|
||||
const FILE_VERSION_READERS = {
|
||||
"package.json": (content: string) => {
|
||||
const pkg = JSON.parse(content);
|
||||
return pkg.packageManager?.split("bun@")?.[1] ?? pkg.engines?.bun;
|
||||
},
|
||||
".tool-versions": (content: string) =>
|
||||
content.match(/^bun\s*(?<version>.*?)$/m)?.groups?.version,
|
||||
".bumrc": (content: string) => content, // https://github.com/owenizedd/bum
|
||||
".bun-version": (content: string) => content,
|
||||
};
|
||||
|
||||
export function readVersionFromFile(
|
||||
file: string,
|
||||
silent = false,
|
||||
): string | undefined {
|
||||
const cwd = process.env.GITHUB_WORKSPACE;
|
||||
if (!cwd) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
|
||||
debug(`Reading version from ${file}`);
|
||||
|
||||
const path = resolve(cwd, file);
|
||||
const base = basename(file);
|
||||
|
||||
if (!existsSync(path)) {
|
||||
if (!silent) {
|
||||
warning(`File ${path} not found`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const reader = FILE_VERSION_READERS[base] ?? (() => undefined);
|
||||
|
||||
let output: string | undefined;
|
||||
try {
|
||||
output = reader(readFileSync(path, "utf8"))?.trim();
|
||||
|
||||
if (!output) {
|
||||
if (!silent) {
|
||||
warning(`Failed to read version from ${file}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
const { message } = error as Error;
|
||||
if (!silent) {
|
||||
warning(`Failed to read ${file}: ${message}`);
|
||||
}
|
||||
} finally {
|
||||
if (output) {
|
||||
info(`Obtained version ${output} from ${file}`);
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
291
tests/bunfig.spec.ts
Normal file
291
tests/bunfig.spec.ts
Normal file
@@ -0,0 +1,291 @@
|
||||
import { afterEach, describe, expect, it } from "bun:test";
|
||||
import { existsSync, unlinkSync } from "node:fs";
|
||||
import { writeBunfig } from "../src/bunfig";
|
||||
import { EOL } from "os";
|
||||
|
||||
describe("writeBunfig", () => {
|
||||
const filePath = "bunfig_test.toml";
|
||||
|
||||
async function getFileAndContents() {
|
||||
const file = Bun.file(filePath);
|
||||
const contents = (await file.text()).split(EOL);
|
||||
|
||||
return { file, contents };
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
if (existsSync(filePath)) unlinkSync(filePath);
|
||||
console.log(`${filePath} was deleted`);
|
||||
});
|
||||
|
||||
describe("when no bunfig_test.toml file exists", () => {
|
||||
it("should create a new file with scopes content", async () => {
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "foo-bar",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
'[install.scopes."@foo-bar"]',
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
|
||||
it("should create a new file with global registry", async () => {
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "",
|
||||
},
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
"[install.registry]",
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
|
||||
it("should create a new file with global registry & token", async () => {
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
"[install.registry]",
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when local bunfig_test.toml file exists", () => {
|
||||
it("and no [install.scopes] exists, should concatenate file correctly", async () => {
|
||||
const bunfig = `[install]${EOL}optional = true${EOL}${EOL}[install.cache]${EOL}disable = true`;
|
||||
|
||||
await Bun.write(filePath, bunfig);
|
||||
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "foo-bar",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
"[install]",
|
||||
"optional = true",
|
||||
"",
|
||||
" [install.cache]",
|
||||
" disable = true",
|
||||
"",
|
||||
'[install.scopes."@foo-bar"]',
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
|
||||
it("and [install.scopes] exists and it's not the same registry, should concatenate file correctly", async () => {
|
||||
const bunfig = `[install]${EOL}optional = true${EOL}${EOL}[install.scopes]${EOL}'@bla-ble' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }${EOL}${EOL}[install.cache]${EOL}disable = true`;
|
||||
|
||||
await Bun.write(filePath, bunfig);
|
||||
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "foo-bar",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
"[install]",
|
||||
"optional = true",
|
||||
"",
|
||||
'[install.scopes."@bla-ble"]',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
'url = "https://npm.pkg.github.com/"',
|
||||
"",
|
||||
'[install.scopes."@foo-bar"]',
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
" [install.cache]",
|
||||
" disable = true",
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
|
||||
it("and [install.scopes] exists and it's the same registry, should concatenate file correctly", async () => {
|
||||
const bunfig = `[install]${EOL}optional = true${EOL}${EOL}[install.scopes]${EOL}'@foo-bar' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }${EOL}'@bla-ble' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }${EOL}${EOL}[install.cache]${EOL}disable = true`;
|
||||
|
||||
await Bun.write(filePath, bunfig);
|
||||
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "foo-bar",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
"[install]",
|
||||
"optional = true",
|
||||
"",
|
||||
'[install.scopes."@foo-bar"]',
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
'[install.scopes."@bla-ble"]',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
'url = "https://npm.pkg.github.com/"',
|
||||
"",
|
||||
" [install.cache]",
|
||||
" disable = true",
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
|
||||
it("and [install.scopes] and [install] exists, should concantenate file correctly", async () => {
|
||||
const bunfig = `[install]${EOL}optional = true${EOL}${EOL}[install.scopes]${EOL}'@foo-bar' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }${EOL}'@bla-ble' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }${EOL}${EOL}[install.cache]${EOL}disable = true`;
|
||||
|
||||
await Bun.write(filePath, bunfig);
|
||||
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "foo-bar",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
{
|
||||
url: "https://bun.sh",
|
||||
scope: "",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
}, // global registry
|
||||
]);
|
||||
|
||||
const { file, contents } = await getFileAndContents();
|
||||
|
||||
expect(file.exists()).resolves.toBeTrue();
|
||||
|
||||
const expectedContents = [
|
||||
"[install]",
|
||||
"optional = true",
|
||||
"",
|
||||
'[install.scopes."@foo-bar"]',
|
||||
'url = "https://npm.pkg.github.com"',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
'[install.scopes."@bla-ble"]',
|
||||
'token = "$BUN_AUTH_TOKEN"',
|
||||
'url = "https://npm.pkg.github.com/"',
|
||||
"",
|
||||
" [install.cache]",
|
||||
" disable = true",
|
||||
"",
|
||||
" [install.registry]",
|
||||
' url = "https://bun.sh"',
|
||||
' token = "$BUN_AUTH_TOKEN"',
|
||||
"",
|
||||
];
|
||||
|
||||
contents.forEach((content, index) =>
|
||||
expect(content).toBe(expectedContents[index])
|
||||
);
|
||||
|
||||
expect(contents.length).toBe(expectedContents.length);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when multiple global registries are provided", () => {
|
||||
it("should throw an error", () => {
|
||||
expect(() => {
|
||||
writeBunfig(filePath, [
|
||||
{
|
||||
url: "https://npm.pkg.github.com",
|
||||
scope: "",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
{
|
||||
url: "https://bun.sh",
|
||||
scope: "",
|
||||
token: "$BUN_AUTH_TOKEN",
|
||||
},
|
||||
]);
|
||||
}).toThrow("You can't have more than one global registry.");
|
||||
});
|
||||
});
|
||||
});
|
||||
170
tests/registry.spec.ts
Normal file
170
tests/registry.spec.ts
Normal file
@@ -0,0 +1,170 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { parseRegistries } from "../src/registry";
|
||||
|
||||
describe("registry", () => {
|
||||
describe("parseRegistries", () => {
|
||||
it("should return an empty array for empty input", () => {
|
||||
expect(parseRegistries("")).toEqual([]);
|
||||
expect(parseRegistries(" ")).toEqual([]);
|
||||
expect(parseRegistries(null as any)).toEqual([]);
|
||||
expect(parseRegistries(undefined as any)).toEqual([]);
|
||||
});
|
||||
|
||||
it("should parse default registry without token", () => {
|
||||
const input = "https://registry.npmjs.org/";
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.npmjs.org/",
|
||||
scope: "",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should parse default registry with token", () => {
|
||||
const input = "https://registry.npmjs.org/|npm_token123";
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.npmjs.org/",
|
||||
scope: "",
|
||||
token: "npm_token123",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should parse scoped registry with URL credentials", () => {
|
||||
const input = "@myorg:https://username:password@registry.myorg.com/";
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://username:password@registry.myorg.com/",
|
||||
scope: "@myorg",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should parse scoped registry with separate token", () => {
|
||||
const input = "@partner:https://registry.partner.com/|token_abc123";
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.partner.com/",
|
||||
scope: "@partner",
|
||||
token: "token_abc123",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should parse multiple registries", () => {
|
||||
const input = `
|
||||
https://registry.npmjs.org/
|
||||
@myorg:https://username:password@registry.myorg.com/
|
||||
@partner:https://registry.partner.com/|token_abc123
|
||||
`;
|
||||
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.npmjs.org/",
|
||||
scope: "",
|
||||
},
|
||||
{
|
||||
url: "https://username:password@registry.myorg.com/",
|
||||
scope: "@myorg",
|
||||
},
|
||||
{
|
||||
url: "https://registry.partner.com/",
|
||||
scope: "@partner",
|
||||
token: "token_abc123",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should handle scope names without @ prefix", () => {
|
||||
const input = "myorg:https://registry.myorg.com/|token123";
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.myorg.com/",
|
||||
scope: "myorg",
|
||||
token: "token123",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should throw error for invalid URLs", () => {
|
||||
expect(() => {
|
||||
parseRegistries("@myorg:not-a-valid-url");
|
||||
}).toThrow("Invalid URL in registry configuration: not-a-valid-url");
|
||||
|
||||
expect(() => {
|
||||
parseRegistries("also-not-a-valid-url");
|
||||
}).toThrow("Invalid URL in registry configuration: also-not-a-valid-url");
|
||||
});
|
||||
|
||||
it("should handle whitespace and empty lines", () => {
|
||||
const input = `
|
||||
|
||||
https://registry.npmjs.org/
|
||||
|
||||
@myorg:https://registry.myorg.com/|token123
|
||||
|
||||
`;
|
||||
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.npmjs.org/",
|
||||
scope: "",
|
||||
},
|
||||
{
|
||||
url: "https://registry.myorg.com/",
|
||||
scope: "@myorg",
|
||||
token: "token123",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should handle URLs with paths and query parameters", () => {
|
||||
const input =
|
||||
"@myorg:https://registry.myorg.com/npm/registry/?timeout=5000|token123";
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.myorg.com/npm/registry/?timeout=5000",
|
||||
scope: "@myorg",
|
||||
token: "token123",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("should correctly handle scopes with hyphens and underscores", () => {
|
||||
const input = `
|
||||
@my-org:https://registry.myorg.com/
|
||||
@my_org:https://registry.myorg.com/
|
||||
`;
|
||||
|
||||
const result = parseRegistries(input);
|
||||
|
||||
expect(result).toEqual([
|
||||
{
|
||||
url: "https://registry.myorg.com/",
|
||||
scope: "@my-org",
|
||||
},
|
||||
{
|
||||
url: "https://registry.myorg.com/",
|
||||
scope: "@my_org",
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
8
tests/tsconfig.json
Normal file
8
tests/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": [
|
||||
"bun"
|
||||
]
|
||||
}
|
||||
}
|
||||
124
tests/utils.spec.ts
Normal file
124
tests/utils.spec.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import { afterEach, describe, expect, it, spyOn } from "bun:test";
|
||||
import { getArchitecture, getAvx2 } from "../src/utils";
|
||||
import * as core from "@actions/core";
|
||||
|
||||
describe("getArchitecture", () => {
|
||||
let warningSpy: ReturnType<typeof spyOn>;
|
||||
|
||||
afterEach(() => {
|
||||
warningSpy?.mockRestore();
|
||||
});
|
||||
|
||||
it("should return x64 for Windows with arm64 architecture", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "arm64");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows."
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should return x64 for Windows with aarch64 architecture", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "aarch64");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows."
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should return aarch64 for non-Windows platforms with arm64", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("linux", "arm64");
|
||||
|
||||
expect(result).toBe("aarch64");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return aarch64 for macOS with arm64", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("darwin", "arm64");
|
||||
|
||||
expect(result).toBe("aarch64");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return original arch value for x64", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "x64");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return original arch value for x86", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("linux", "x86");
|
||||
|
||||
expect(result).toBe("x86");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return original arch value for aarch64 on Linux", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("linux", "aarch64");
|
||||
|
||||
expect(result).toBe("aarch64");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("getAvx2", () => {
|
||||
it("should return false when called with os: 'windows' and arch: 'arm64'", () => {
|
||||
const result = getAvx2("windows", "arm64");
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false when called with os: 'windows' and arch: 'aarch64'", () => {
|
||||
const result = getAvx2("windows", "aarch64");
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false when called with os: 'windows', arch: 'arm64', and avx2: true", () => {
|
||||
const result = getAvx2("windows", "arm64", true);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false when called with os: 'windows', arch: 'aarch64', and avx2: false", () => {
|
||||
const result = getAvx2("windows", "aarch64", false);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should return the provided avx2 value (true) when specified and not on Windows ARM64", () => {
|
||||
expect(getAvx2("linux", "x64", true)).toBe(true);
|
||||
expect(getAvx2("darwin", "x64", true)).toBe(true);
|
||||
expect(getAvx2("windows", "x64", true)).toBe(true);
|
||||
});
|
||||
|
||||
it("should return the provided avx2 value (false) when specified and not on Windows ARM64", () => {
|
||||
expect(getAvx2("linux", "x64", false)).toBe(false);
|
||||
expect(getAvx2("darwin", "x64", false)).toBe(false);
|
||||
expect(getAvx2("windows", "x64", false)).toBe(false);
|
||||
});
|
||||
|
||||
it("should return true by default when avx2 is not specified and not on Windows ARM64", () => {
|
||||
// x64 architecture on various platforms
|
||||
expect(getAvx2("linux", "x64")).toBe(true);
|
||||
expect(getAvx2("darwin", "x64")).toBe(true);
|
||||
expect(getAvx2("windows", "x64")).toBe(true);
|
||||
|
||||
// ARM architecture on non-Windows platforms
|
||||
expect(getAvx2("linux", "arm64")).toBe(true);
|
||||
expect(getAvx2("linux", "aarch64")).toBe(true);
|
||||
expect(getAvx2("darwin", "arm64")).toBe(true);
|
||||
expect(getAvx2("darwin", "aarch64")).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user