zyrk 0.6.1 → 0.6.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- v0.6.1
1
+ v0.6.2
@@ -1 +1 @@
1
- {"version":3,"file":"realize.d.ts","sourceRoot":"","sources":["../../src/store/realize.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAQxC,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAOpC;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,sEAAsE;IACtE,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,mEAAmE;IACnE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE;IAC1C,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,aAAa,CAAC,CA0GzB;AA6KD,2FAA2F;AAC3F,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EAC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CACnC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,QAAQ,GACd,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA2ErB;AAED,iGAAiG;AACjG,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAQT"}
@@ -1,7 +1,7 @@
1
1
  import { chmod, link as fsLink, lstat, readdir, rename, symlink as fsSymlink, } from "node:fs/promises";
2
2
  import * as path from "node:path";
3
3
  import { ZyrkError } from "../errors.js";
4
- import { fsyncDir, isErrno, mkdirp, pathExists, rmrfNoFollow, } from "../util/fsx.js";
4
+ import { fsyncDir, mkdirp, pathExists, rmrfNoFollow } from "../util/fsx.js";
5
5
  import { contextIdFor, graphHash, } from "./graph.js";
6
6
  import { Store } from "./layout.js";
7
7
  import { openStoreDb } from "./db.js";
@@ -78,15 +78,13 @@ export async function realizeGraph(options) {
78
78
  if (!published) {
79
79
  // A concurrent publisher won the race; their tree is verified
80
80
  // before it is trusted, exactly like any other reuse.
81
- if (verify) {
82
- await verifyRealization({
83
- store,
84
- graph,
85
- rootKey: node.key,
86
- contextId,
87
- realizationDirs: directoryByKey,
88
- });
89
- }
81
+ await verifyRealization({
82
+ store,
83
+ graph,
84
+ rootKey: node.key,
85
+ contextId,
86
+ realizationDirs: directoryByKey,
87
+ });
90
88
  result.reused.push(contextId);
91
89
  continue;
92
90
  }
@@ -218,11 +216,11 @@ async function publishRealization(contextDir, stagingContext) {
218
216
  await rename(stagingContext, contextDir);
219
217
  }
220
218
  catch (error) {
221
- if ((isErrno(error, "ENOTEMPTY") || isErrno(error, "EEXIST")) &&
222
- (await pathExists(contextDir))) {
223
- // Another process published the same context first. Identical inputs
224
- // produce identical content, so reuse theirs and discard ours. The
225
- // caller verifies the winner before trusting it (S01).
219
+ if (await pathExists(contextDir).catch(() => false)) {
220
+ // Filesystems can report different rename errors when a concurrent
221
+ // publisher installs a read-only destination. Existence only selects
222
+ // the race path: the caller must fully verify this tree before reuse,
223
+ // even when the optional payload-verification measurement is disabled.
226
224
  await rmrfNoFollow(stagingContext);
227
225
  await fsyncDir(path.dirname(contextDir));
228
226
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zyrk",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Storage-efficient Node package manager: one verified store per user, shared across projects through links.",
5
5
  "license": "MIT",
6
6
  "type": "module",