bun-nested-workspace 0.2.0 → 0.2.1
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/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { a as syncNestedWorkspace, i as loadNestedWorkspace, n as checkNestedWorkspace, r as isInSync, t as BunInstallError, y as getErrorMessage } from "./workspace-
|
|
2
|
+
import { a as syncNestedWorkspace, i as loadNestedWorkspace, n as checkNestedWorkspace, r as isInSync, t as BunInstallError, y as getErrorMessage } from "./workspace-DOgB-vkj.mjs";
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
const usage = `Usage:
|
|
5
5
|
bun-nested-workspace [bun install options] Sync package.json and bun.lock, then run bun install
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as BunInstallError, d as applyManifestToLockfile, n as checkNestedWorkspace, g as diffManifests, o as findDirectDependencyMismatches, s as findOwnDependencyChanges, c as findTransitiveMismatches, l as findUncoveredWorkspaces, u as findWorkspaceMismatches, r as isInSync, i as loadNestedWorkspace, f as mergeLockfiles, p as parseLockfile, m as relocateLockfile, h as supportedLockfileVersions, _ as syncManifest, a as syncNestedWorkspace, v as syncedFields } from "./workspace-
|
|
1
|
+
export { t as BunInstallError, d as applyManifestToLockfile, n as checkNestedWorkspace, g as diffManifests, o as findDirectDependencyMismatches, s as findOwnDependencyChanges, c as findTransitiveMismatches, l as findUncoveredWorkspaces, u as findWorkspaceMismatches, r as isInSync, i as loadNestedWorkspace, f as mergeLockfiles, p as parseLockfile, m as relocateLockfile, h as supportedLockfileVersions, _ as syncManifest, a as syncNestedWorkspace, v as syncedFields } from "./workspace-DOgB-vkj.mjs";
|
|
@@ -27,13 +27,21 @@ function parseResolvedSpec(spec) {
|
|
|
27
27
|
version
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
/** Error thrown when `bun.lock` has a structure that the tools do not support. */
|
|
31
|
+
var BunLockFormatError = class extends Error {
|
|
32
|
+
constructor(message) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = "BunLockFormatError";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/** Parses `bun.lock` text and throws `BunLockFormatError` on unsupported structure. */
|
|
30
38
|
function parseBunLock(lockText) {
|
|
31
39
|
const parsed = JSON5.parse(lockText);
|
|
32
|
-
if (!isObject(parsed)) throw new
|
|
40
|
+
if (!isObject(parsed)) throw new BunLockFormatError("bun.lock must parse to an object");
|
|
33
41
|
const overrides = parsed.overrides;
|
|
34
42
|
if (overrides !== void 0) {
|
|
35
|
-
if (!isObject(overrides) || Array.isArray(overrides)) throw new
|
|
36
|
-
for (const [name, value] of Object.entries(overrides)) if (typeof value !== "string") throw new
|
|
43
|
+
if (!isObject(overrides) || Array.isArray(overrides)) throw new BunLockFormatError("bun.lock overrides must be an object");
|
|
44
|
+
for (const [name, value] of Object.entries(overrides)) if (typeof value !== "string") throw new BunLockFormatError(`bun.lock override ${JSON.stringify(name)} is scoped to a parent package or a version selector; only overrides by package name are supported`);
|
|
37
45
|
}
|
|
38
46
|
return parsed;
|
|
39
47
|
}
|
|
@@ -41,7 +49,8 @@ function parseBunLock(lockText) {
|
|
|
41
49
|
/**
|
|
42
50
|
* Read the exact bare-name override Bun stores for a dependency.
|
|
43
51
|
*
|
|
44
|
-
*
|
|
52
|
+
* `parseBunLock` rejects overrides scoped to a parent package or a version selector.
|
|
53
|
+
* Bun versions before 1.4 keep selector keys as strings without applying them,
|
|
45
54
|
* so matching those here would diverge from the package manager.
|
|
46
55
|
*/
|
|
47
56
|
function dependencyOverrideRange(lock, dependencyName) {
|
package/package.json
CHANGED