30 Commits

Author SHA1 Message Date
autofix-ci[bot]
db6bcf6eb8 [autofix.ci] apply automated fixes 2026-01-16 03:38:02 +00:00
Jarred Sumner
4a638a4fad Bump form-data 2026-01-15 19:37:24 -08:00
Copilot
563911925f feat: use packageManager from package.json as default bun version (#152)
* Initial plan

* feat: make packageManager from package.json the default bun version

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* test: improve cross-platform compatibility and cleanup in utils tests

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* docs: update README to document automatic package.json version detection

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* conflicts

* ci: setup-bun-from-package-json-without-specified-field

* ci: setup-bun-from-package-json-without-specified-field

* ci: no cache

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>
Co-authored-by: Jozef Steinhübl <contact@xhyrom.dev>
2026-01-05 12:45:25 +01:00
Jozef Steinhübl
b02f8a8a6e feat: fallback arm64 to x64 architecture for win32 platform (#131)
* feat: fallback arm64 to x64 architecture for win32 platform

closes https://github.com/oven-sh/setup-bun/issues/130

* [autofix.ci] apply automated fixes

* ci: test on windows-11-arm runner

* refactor: move logic to getEffectiveArch func

* [autofix.ci] apply automated fixes

* feat: add warning message for windows arm64 fallback to x64

* [autofix.ci] apply automated fixes

* feat: don't mention arch in warning msg aboout fallback

* [autofix.ci] apply automated fixes

* debug time

* [autofix.ci] apply automated fixes

* feat: force baseline for win32 arm fallback to x64

* [autofix.ci] apply automated fixes

* ci: dont use windows-11-arm on setup bun from download url

* fix

* [autofix.ci] apply automated fixes

* fix

* [autofix.ci] apply automated fixes

* fix

* [autofix.ci] apply automated fixes

* fix

* [autofix.ci] apply automated fixes

* fix

* [autofix.ci] apply automated fixes

* apply changes

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* docs: clarify

* [autofix.ci] apply automated fixes

* test: add unit tests for getAvx2 Windows ARM64 fallback logic (#154)

* Initial plan

* Add unit tests for getAvx2 function

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* Consolidate duplicate test assertions in getAvx2 tests

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* Fix whitespace formatting in test file

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* test: add unit tests for getArchitecture and getAvx2 Windows ARM64 fallback logic (#153)

* Initial plan

* Add unit tests for getArchitecture function

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* Remove unused import in utils.spec.ts

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Merge pr-131 and resolve test file conflicts

Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>
Co-authored-by: Jozef Steinhübl <generalkubo@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-01-05 01:16:53 +01:00
Jozef Steinhübl
8c296f9cb7 feat: implement wildcard resolution into the action (#93)
* feat: remove retry attempts

* [autofix.ci] apply automated fixes

* feat: get download url from github's api

* [autofix.ci] apply automated fixes

* fix: add token property to action definition & fix satisfies params

* [autofix.ci] apply automated fixes

* fix: getPlatform, getArchitecture + eversion

* [autofix.ci] apply automated fixes

* fix: duplicate v

* [autofix.ci] apply automated fixes

* fix: check if valid semver and add bun-v

* [autofix.ci] apply automated fixes

* refactor: wrap validation

* [autofix.ci] apply automated fixes

* ci(format): use bun

bun install is rqeuired for patches

* ci(format): use bun

bun install is rqeuired for patches

* [autofix.ci] apply automated fixes

* feat: bring back support for sha downloads

* [autofix.ci] apply automated fixes

* fix: add bearer prefix for token

* [autofix.ci] apply automated fixes

* fix: proper error when artifact is not found

* [autofix.ci] apply automated fixes

* conflicts

* autofix build

* fix

* fix

* fix

* fix

* fix

* autofix build

* fix

* [autofix.ci] apply automated fixes

* fix

* [autofix.ci] apply automated fixes

* fix

* [autofix.ci] apply automated fixes

* fix

* fix

* [autofix.ci] apply automated fixes

* fix

* fix

* [autofix.ci] apply automated fixes

* fix: drop sha support for now

* [autofix.ci] apply automated fixes

* fix: filter tags

* [autofix.ci] apply automated fixes

* docs: token

* docs: token

* docs: token

* refactor: cleanup

* [autofix.ci] apply automated fixes

* refactor: cleanup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-05 00:03:34 +01:00
Jozef Steinhübl
b7a1c7ccf2 release: v2.1.0 (#151)
* release: v2.1.0

* release: v2.1.0
2026-01-04 00:53:29 +01:00
bashonly
ad1208bf19 docs: restore missing no-cache input (#149)
* docs: restore missing `no-cache` input

accidentally removed in ef00e4ac8e

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-04 00:21:55 +01:00
autofix-ci[bot]
bc6f04ce3b [autofix.ci] apply automated fixes 2025-12-23 18:57:05 +00:00
Erik Axel Nielsen
1dbab0699e feat: Check for existing bun before downloading (#138)
* feat: Check for existing bun before downloading

Check for existing bun with same version number, if it exists we skip any futher actions. This avoids downloading cache or bun over the network.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-23 19:56:47 +01:00
dgilmanuni
635640504f chore(ci): Pin GitHub Actions to SHA-1s (#140) 2025-10-09 07:20:42 +02:00
Jozef Steinhübl
22457c87c1 docs: remove unnecessary note 2025-07-10 21:09:16 +02:00
autofix-ci[bot]
237a6a77d8 [autofix.ci] apply automated fixes 2025-07-10 19:07:39 +00:00
Jozef Steinhübl
53e6487b6e ci(format): use bun 2025-07-10 21:07:00 +02:00
Jozef Steinhübl
68643ea879 ci: disable tests with version selectors (#133) 2025-07-10 21:02:01 +02:00
Jozef Steinhübl
56169ab7b0 feat: read engines from package json (#132)
* feat: read engines from package.json

closes https://github.com/oven-sh/setup-bun/issues/115

* ci: test for engines package.json

* [autofix.ci] apply automated fixes

* ci: test for engines package.json

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-10 20:58:50 +02:00
Jozef Steinhübl
34f777aec1 feat: support for multiple registries (#109)
* feat: support for multiple registries

* [autofix.ci] apply automated fixes

* refactor: drop unnecessary check

* fix: pass empty array instead undefined

* [autofix.ci] apply automated fixes

* fix: dont add registry set line

* [autofix.ci] apply automated fixes

* feat: few more tests

* feat: add bun types

* docs: explain registries

* feat: save globally

* [autofix.ci] apply automated fixes

* ci: jsr registry test

* ci: add ,

* ci: test

* ci: test

* ci: test

* ci: test

* [autofix.ci] apply automated fixes

* feat: use @iarna/toml

* [autofix.ci] apply automated fixes

* feat: registry parsing

* [autofix.ci] apply automated fixes

* ci: verbose add

* ci: registry install check

* ci: registry install check

* ci: registry install check

* ci: verify registry usage

* docs: registries

* docs: important block

* docs: show table

* docs: show table

* ci: shell

* ci: registry test on linux

* ci: registry test on linux

* build: text lockfile

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-09 12:22:12 +02:00
Okinea Dev
7c641390eb chore: add settings for vscode (#120)
* chore: update Prettier settings and add settings for vscode

* rollback semi

* fix: exclude `dist` from search and lock changes to some files

* Added `search.exclude` to ignore `dist/**` during searches.
* Configured `files.readonlyInclude` to lock changes to `dist/**`, `bun.lock`, and `package-lock.json`.
2025-07-08 15:29:27 +02:00
autofix-ci[bot]
735343b667 [autofix.ci] apply automated fixes 2025-04-27 13:53:50 +00:00
Jozef Steinhübl
27ecfffdee ci: update autofix ci 2025-04-27 15:53:25 +02:00
Afonso Jorge Ramos
fcc30ed971 fix(docs): remove wildcard in version (#124)
until https://github.com/oven-sh/setup-bun/issues/37 gets fixed
2025-04-27 15:48:05 +02:00
Jozef Steinhübl
56408e9a3f release: v2.0.2 2025-04-27 15:47:24 +02:00
Robert Michalak
85cb7f6e7e build: bump @actions/cache version (#128)
* bump @actions/cache version

* fix runtime error
2025-04-27 15:46:35 +02:00
Okinea Dev
54cb141c5c ci: remove unnecessary steps & cleanup (#118)
* refactor(ci): refactor GitHub Actions for better readablility

* upd

* remove ""
2025-02-04 18:31:38 +01:00
Okinea Dev
6fb6603cc1 build: use text-based Bun lockfile (#116)
chore: 🔒 use text-based Bun lockfile

Support for the text lockfile format was introduced in version `1.1.40` (https://bun.sh/blog/bun-v1.1.40), it will soon replace the binary lockfile format `.lockb` in the upcoming version `1.2.0`

In addition, cached bun install will become 30% faster thanks to the text-based lockfile format - https://bun.sh/blog/bun-lock-text-lockfile#cached-bun-install-gets-30-faster

Read https://bun.sh/blog/bun-lock-text-lockfile
2025-01-05 12:45:22 +01:00
autofix-ci[bot]
9bdeab4320 [autofix.ci] apply automated fixes 2024-12-09 17:46:42 +00:00
Florian Barbare
f09eb1edd0 fix: make bun resolve to given file path when an absolute path is given (#114)
* Make bun resolve to single file path when an absolute path is given

* Update test not to use the workspace folder
2024-12-09 18:46:15 +01:00
Jozef Steinhübl
8f1bc2eeb3 ci: add setup bun download url (#105)
* ci: add setup bun download url

* ci: change runs-on

* ci: aarch64, not arm64
2024-10-08 15:30:45 +02:00
Jozef Steinhübl
a8913c42f4 fix: use hash instead of url for primary cache key (#102) (#103)
* fix: use hash instead of url for primary cache key (#102)

* Update cache-save.ts

* Update action.ts

* Update cache-save.ts

* build

* format

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Daniil Zotov <142039751+zoto-ff@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-08 15:19:42 +02:00
マルコメ
b9d34de66d chore(docs): missing version on examples (#96) 2024-08-06 11:21:46 +02:00
Seiya Kokushi
1e54087d4f fix: allow more spaces for .tool-versions (#94)
* update: allow more spaces for .tool-versions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-30 22:30:50 +02:00
28 changed files with 2459 additions and 342 deletions

View File

@@ -1,28 +1,86 @@
name: Compare Bun Version
description: Compare the version of Bun to a specified version
name: ⚖️ Compare Bun Version
description: Compare the installed Bun version against a version specification.
inputs:
bun-version:
description: "The version of Bun to compare against"
description: The version spec to compare against (e.g., '1.1.0', 'canary', '>1.2.0', '1.x').
required: true
default: "1.1.0"
runs:
using: "composite"
using: composite
steps:
- name: Get installed Bun version
- name: 🛠️ Get installed Bun version and revision
id: bun
shell: bash
run: |
bun --version
echo "version=$(bun --version)" >> $GITHUB_OUTPUT
echo "version=$(bun --version | tr -d '\r\n')" >> $GITHUB_OUTPUT
echo "revision=$(bun --revision 2>/dev/null || true)" >> $GITHUB_OUTPUT
- name: Compare versions
- name: ⚖️ Compare versions
shell: bash
env:
REQUESTED_SPEC: ${{ inputs.bun-version }}
ACTUAL_VERSION: ${{ steps.bun.outputs.version }}
ACTUAL_REVISION: ${{ steps.bun.outputs.revision }}
run: |
if [[ "${{ steps.bun.outputs.version }}" == "${{ inputs.bun-version }}" ]]; then
echo "Version is ${{ inputs.bun-version }}"
else
echo "Expected version to be ${{ inputs.bun-version }}, got ${{ steps.bun.outputs.version }}"
exit 1
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}'."

View File

@@ -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

View File

@@ -1,25 +1,27 @@
name: Release new action version
name: 🚀 Release new action version
on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
description: Tag name that the major tag will point to
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/publish-action@v0.3.0
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 }}

View File

@@ -1,4 +1,4 @@
name: Test
name: 🧪 Test
on:
workflow_dispatch:
@@ -15,34 +15,44 @@ jobs:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 📥 Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install github cli
run: |
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
- run: |
gh cache delete --all || true
- 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]
needs: [remove-cache, tests]
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
- windows-11-arm
bun-version:
- latest
- canary
@@ -51,73 +61,223 @@ jobs:
- "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
steps:
- name: 📥 Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: 🛠️ Setup Bun
uses: ./
id: setup_bun
with:
bun-version: ${{ matrix.bun-version }}
no-cache: true
- name: Run Bun
- name: ▶️ Run Bun
id: run_bun
run: |
bun --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]
needs: [remove-cache, tests]
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
- windows-11-arm
file:
- name: package.json (bun@1.1.0)
- 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 (yarn@bun@1.1.0)
- 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
run: echo "bun 1.1.0" > .tool-versions
- name: .tool-versions (bun1.1.0)
file: .tool-versions
run: |
echo "bun1.1.0" > .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
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@v4
run: echo "1.1.0" > .bun-version
- name: Setup file
steps:
- name: 📥 Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: 📄 Setup file
run: ${{ matrix.file.run }}
- name: Setup Bun
- name: 🛠️ Setup Bun
uses: ./
with:
bun-version-file: ${{ matrix.file.file }}
no-cache: true
- name: Compare versions
- 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
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: |
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 "Failed to install from default registry"
exit 1
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
View File

@@ -0,0 +1,4 @@
{
"semi": true,
"quoteProps": "preserve"
}

3
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "github.vscode-github-actions"]
}

12
.vscode/settings.json vendored Normal file
View 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
},
}

View File

@@ -4,6 +4,18 @@ Download, install, and setup [Bun](https://bun.sh) in GitHub Actions.
## Usage
```yaml
- 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:
@@ -18,47 +30,63 @@ Download, install, and setup [Bun](https://bun.sh) in GitHub Actions.
bun-version-file: ".bun-version"
```
### Using a custom NPM registry
## 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
- uses: oven-sh/setup-bun@v2
with:
registry-url: "https://npm.pkg.github.com/"
scope: "@foo"
```
registries: |
https://registry.npmjs.org/
@myorg:https://npm.pkg.github.com/|$GITHUB_TOKEN
@internal:https://username:$INTERNAL_PASSWORD@registry.internal.com/
If you need to authenticate with a private registry, you can set the `BUN_AUTH_TOKEN` environment variable.
```yaml
- name: Install Dependencies
- name: Install dependencies
env:
BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bun install --frozen-lockfile
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
- uses: oven-sh/setup-bun@v2
with:
bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip"
```
### Node.js not needed
In most cases, you shouldn't need to use the [setup-node](https://github.com/actions/setup-node) GitHub Action.
## Inputs
| Name | Description | Default | Examples |
| ------------------ | ----------------------------------------------------- | ----------- | ------------------------------------------------ |
| `bun-version` | The version of Bun to download and install. | `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"` |
| 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

View File

@@ -1,31 +1,49 @@
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")'
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."
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."
description: Disable caching of bun executable.
token:
required: false
default: ${{ 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.
outputs:
bun-version:
description: The version of Bun that was installed.

239
bun.lock Normal file
View 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=="],
}
}

BIN
bun.lockb

Binary file not shown.

2
bunfig.toml Normal file
View File

@@ -0,0 +1,2 @@
[install]
saveTextLockfile = true

81
dist/cache-save/index.js generated vendored

File diff suppressed because one or more lines are too long

102
dist/setup/index.js generated vendored

File diff suppressed because one or more lines are too long

733
package-lock.json generated
View File

@@ -1,33 +1,37 @@
{
"name": "setup-bun",
"version": "2.0.1",
"version": "2.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "setup-bun",
"version": "2.0.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"

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "setup-bun",
"version": "2.0.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 --outfile=dist/setup/index.js --bundle --minify --platform=node --format=cjs src/index.ts && esbuild --target=node20 --outfile=dist/cache-save/index.js --bundle --minify --platform=node --format=cjs src/cache-save.ts",
"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"
}
}

View 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

View File

@@ -1,3 +1,4 @@
import { createHash } from "node:crypto";
import { homedir } from "node:os";
import { join } from "node:path";
import {
@@ -6,14 +7,18 @@ import {
symlinkSync,
renameSync,
copyFileSync,
existsSync,
} from "node:fs";
import { addPath, info, warning } from "@actions/core";
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, retry } from "./utils";
import { addExtension } from "./utils";
import { getDownloadUrl } from "./download-url";
import { cwd } from "node:process";
export type Input = {
customUrl?: string;
@@ -22,9 +27,9 @@ export type Input = {
arch?: string;
avx2?: boolean;
profile?: boolean;
scope?: string;
registryUrl?: string;
registries?: Registry[];
noCache?: boolean;
token?: string;
};
export type Output = {
@@ -43,10 +48,10 @@ export type CacheState = {
};
export default async (options: Input): Promise<Output> => {
const bunfigPath = join(process.cwd(), "bunfig.toml");
writeBunfig(bunfigPath, options);
const bunfigPath = join(cwd(), "bunfig.toml");
writeBunfig(bunfigPath, options.registries);
const url = getDownloadUrl(options);
const url = await getDownloadUrl(options);
const cacheEnabled = isCacheEnabled(options);
const binPath = join(homedir(), ".bun", "bin");
@@ -72,30 +77,44 @@ 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}`);
// TODO: remove this, temporary fix for https://github.com/oven-sh/setup-bun/issues/73
revision = await retry(async () => await downloadBun(url, bunPath), 3);
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);
}
}
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.",
);
}
@@ -119,9 +138,32 @@ export default async (options: Input): Promise<Output> => {
};
};
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
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");
@@ -152,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;

View File

@@ -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" });
}

View File

@@ -1,12 +1,14 @@
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], state.url);
await saveCache([state.bunPath], cacheKey);
process.exit(0);
} catch (error) {
warning("Failed to save Bun to cache.");

69
src/download-url.ts Normal file
View 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;
}

View File

@@ -2,20 +2,36 @@ import { tmpdir } from "node:os";
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();
}
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") ||
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, bunPath, url, cacheHit }) => {
setOutput("bun-version", version);

62
src/registry.ts Normal file
View 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}`);
}
}
}

View File

@@ -1,21 +1,29 @@
import { debug, warning } from "@actions/core";
import { info } from "node:console";
import { existsSync, readFileSync, renameSync } from "node:fs";
import { join, basename } from "node:path";
import { resolve, basename } from "node:path";
export function retry<T>(
fn: () => Promise<T>,
retries: number,
timeout = 10000
): Promise<T> {
return fn().catch((err) => {
if (retries <= 0) {
throw err;
}
return new Promise((resolve) => setTimeout(resolve, timeout)).then(() =>
retry(fn, retries - 1, timeout)
);
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 {
@@ -27,16 +35,55 @@ export function addExtension(path: string, ext: string): string {
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) =>
JSON.parse(content).packageManager?.split("bun@")?.[1],
"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,
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): string | undefined {
export function readVersionFromFile(
file: string,
silent = false,
): string | undefined {
const cwd = process.env.GITHUB_WORKSPACE;
if (!cwd) {
return;
@@ -48,11 +95,13 @@ export function readVersionFromFile(file: string): string | undefined {
debug(`Reading version from ${file}`);
const path = join(cwd, file);
const path = resolve(cwd, file);
const base = basename(file);
if (!existsSync(path)) {
warning(`File ${path} not found`);
if (!silent) {
warning(`File ${path} not found`);
}
return;
}
@@ -63,12 +112,16 @@ export function readVersionFromFile(file: string): string | undefined {
output = reader(readFileSync(path, "utf8"))?.trim();
if (!output) {
warning(`Failed to read version from ${file}`);
if (!silent) {
warning(`Failed to read version from ${file}`);
}
return;
}
} catch (error) {
const { message } = error as Error;
warning(`Failed to read ${file}: ${message}`);
if (!silent) {
warning(`Failed to read ${file}: ${message}`);
}
} finally {
if (output) {
info(`Obtained version ${output} from ${file}`);

291
tests/bunfig.spec.ts Normal file
View 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
View 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
View File

@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": [
"bun"
]
}
}

124
tests/utils.spec.ts Normal file
View 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);
});
});