bun-types 1.1.39 → 1.1.40-canary.20241218T140547
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/cli/bun-install.md +4 -0
- package/docs/cli/install.md +3 -0
- package/docs/install/index.md +3 -0
- package/docs/install/lockfile.md +18 -0
- package/docs/runtime/bunfig.md +11 -0
- package/package.json +1 -1
package/docs/cli/bun-install.md
CHANGED
|
@@ -47,6 +47,9 @@ registry = "https://registry.yarnpkg.com/"
|
|
|
47
47
|
# Install for production? This is the equivalent to the "--production" CLI argument
|
|
48
48
|
production = false
|
|
49
49
|
|
|
50
|
+
# Save a text-based lockfile? This is equivalent to the "--save-text-lockfile" CLI argument
|
|
51
|
+
saveTextLockfile = false
|
|
52
|
+
|
|
50
53
|
# Disallow changes to lockfile? This is the equivalent to the "--frozen-lockfile" CLI argument
|
|
51
54
|
frozenLockfile = false
|
|
52
55
|
|
|
@@ -108,6 +111,7 @@ export interface Install {
|
|
|
108
111
|
scopes: Scopes;
|
|
109
112
|
registry: Registry;
|
|
110
113
|
production: boolean;
|
|
114
|
+
saveTextLockfile: boolean;
|
|
111
115
|
frozenLockfile: boolean;
|
|
112
116
|
dryRun: boolean;
|
|
113
117
|
optional: boolean;
|
package/docs/cli/install.md
CHANGED
package/docs/install/index.md
CHANGED
package/docs/install/lockfile.md
CHANGED
|
@@ -72,6 +72,24 @@ $ bun install --yarn
|
|
|
72
72
|
print = "yarn"
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
### Text-based lockfile
|
|
76
|
+
|
|
77
|
+
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at [no cost to performance](https://bun.sh/blog/bun-lock-text-lockfile#cached-bun-install-gets-30-faster).
|
|
78
|
+
|
|
79
|
+
To generate the lockfile, use `--save-text-lockfile` with `bun install`. You can do this for new projects and existing projects already using `bun.lockb` (resolutions will be preserved).
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
$ bun install --save-text-lockfile
|
|
83
|
+
$ head -n3 bun.lock
|
|
84
|
+
{
|
|
85
|
+
"lockfileVersion": 0,
|
|
86
|
+
"workspaces": {
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Once `bun.lock` is generated, Bun will use it for all subsequent installs and updates through commands that read and modify the lockfile. If both lockfiles exist, `bun.lock` will be choosen over `bun.lockb`.
|
|
90
|
+
|
|
91
|
+
Bun v1.2.0 will switch the default lockfile format to `bun.lock`.
|
|
92
|
+
|
|
75
93
|
{% /codetabs %}
|
|
76
94
|
|
|
77
95
|
{% details summary="Configuring lockfile" %}
|
package/docs/runtime/bunfig.md
CHANGED
|
@@ -238,6 +238,17 @@ By default Bun uses caret ranges; if the `latest` version of a package is `2.4.1
|
|
|
238
238
|
exact = false
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
+
### `install.saveTextLockfile`
|
|
242
|
+
|
|
243
|
+
Generate `bun.lock`, a human-readable text-based lockfile. Once generated, Bun will use this file instead of `bun.lockb`, choosing it over the binary lockfile if both are present.
|
|
244
|
+
|
|
245
|
+
Default `false`. In Bun v1.2.0 the default lockfile format will change to `bun.lock`.
|
|
246
|
+
|
|
247
|
+
```toml
|
|
248
|
+
[install]
|
|
249
|
+
saveTextLockfile = true
|
|
250
|
+
```
|
|
251
|
+
|
|
241
252
|
<!--
|
|
242
253
|
### `install.prefer`
|
|
243
254
|
|
package/package.json
CHANGED