Skip to content

Commit

Permalink
fix: add bun.lock to .gitattributes, .gitignore, and docs
Browse files Browse the repository at this point in the history
Fixes oven-sh#16462. Supersedes oven-sh#16324.
  • Loading branch information
fel1x-developer committed Jan 18, 2025
1 parent c1b9c44 commit 856d000
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*.mjs text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.mts text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2

*.lockb binary diff=lockb
bun.lock linguist-language=json
bun.lockb binary diff=lockb

.vscode/launch.json linguist-generated
src/api/schema.d.ts linguist-generated
Expand Down
1 change: 1 addition & 0 deletions bench/install/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node_modules
package-lock.json
yarn.lock
pnpm-lock.yaml
bun.lock
bun.lockb
2 changes: 1 addition & 1 deletion bench/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ hyperfine --prepare 'rm -rf node_modules' --runs 1 'bun install' 'pnpm install
To run the benchmark with offline mode but without lockfiles:

```sh
$ hyperfine --prepare 'rm -rf node_modules' --warmup 1 'rm bun.lockb && bun install' 'rm pnpm-lock.yaml && pnpm install --prefer-offline' 'rm yarn.lock && yarn --offline' 'rm package-lock.json && npm install --prefer-offline'
$ hyperfine --prepare 'rm -rf node_modules' --warmup 1 'rm bun.lock && bun install' 'rm pnpm-lock.yaml && pnpm install --prefer-offline' 'rm yarn.lock && yarn --offline' 'rm package-lock.json && npm install --prefer-offline'
```

##
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Running `bun install` will:

- **Install** all `dependencies`, `devDependencies`, and `optionalDependencies`. Bun will install `peerDependencies` by default.
- **Run** your project's `{pre|post}install` and `{pre|post}prepare` scripts at the appropriate time. For security reasons Bun _does not execute_ lifecycle scripts of installed dependencies.
- **Write** a `bun.lockb` lockfile to the project root.
- **Write** a `bun.lock` or `bun.lockb` lockfile to the project root.

## Logging

Expand Down
2 changes: 1 addition & 1 deletion docs/runtime/autoimport.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The first time you run this script, Bun will auto-install `"foo"` and cache it.

To determine which version to install, Bun follows the following algorithm:

1. Check for a `bun.lockb` file in the project root. If it exists, use the version specified in the lockfile.
1. Check for a `bun.lock` or `bun.lockb` file in the project root. If it exists, use the version specified in the lockfile.
2. Otherwise, scan up the tree for a `package.json` that includes `"foo"` as a dependency. If found, use the specified semver version or version range.
3. Otherwise, use `latest`.

Expand Down
1 change: 1 addition & 0 deletions misctools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ httpbench
fetch
tgz2hop
hop
bun.lock
bun.lockb
2 changes: 1 addition & 1 deletion packages/bun-vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ At its core is the _Bun runtime_, a fast JavaScript runtime designed as a drop-i
- Test runner codelens
- Debugger support
- Run scripts from package.json
- Visual lockfile viewer (`bun.lockb`)
- Visual binary lockfile viewer (`bun.lockb`)

## In-editor error messages

Expand Down
1 change: 1 addition & 0 deletions test/cli/install/migration/complex-workspace/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
!package-lock.json
bun.lock
bun.lockb
1 change: 1 addition & 0 deletions test/cli/install/migration/contoso-test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
!package-lock.json
bun.lock
bun.lockb

0 comments on commit 856d000

Please sign in to comment.