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.
@@ -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;
@@ -174,6 +174,9 @@ peer = true
174
174
  # equivalent to `--production` flag
175
175
  production = false
176
176
 
177
+ # equivalent to `--save-text-lockfile` flag
178
+ saveTextLockfile = false
179
+
177
180
  # equivalent to `--frozen-lockfile` flag
178
181
  frozenLockfile = false
179
182
 
@@ -86,6 +86,9 @@ peer = true
86
86
  # equivalent to `--production` flag
87
87
  production = false
88
88
 
89
+ # equivalent to `--save-text-lockfile` flag
90
+ saveTextLockfile = false
91
+
89
92
  # equivalent to `--frozen-lockfile` flag
90
93
  frozenLockfile = false
91
94
 
@@ -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" %}
@@ -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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.39",
2
+ "version": "1.1.40-canary.20241218T140547",
3
3
  "name": "bun-types",
4
4
  "license": "MIT",
5
5
  "main": "",