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>
This commit is contained in:
Jozef Steinhübl 2025-07-10 20:58:50 +02:00 committed by GitHub
parent 34f777aec1
commit 56169ab7b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 51 additions and 43 deletions

View file

@ -90,21 +90,27 @@ jobs:
- windows-latest
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: /foo/package.json (bun@1.1.0)
file: /foo/package.json
- name: foo/package.json (packageManager bun@1.1.0)
file: foo/package.json
run: |
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > /foo/package.json
mkdir -p foo
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > foo/package.json
- name: package.json (yarn@bun@1.1.0)
- 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