dlw-machine-setup 0.9.4 → 0.9.5

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.
Files changed (2) hide show
  1. package/bin/installer.js +15 -6
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -4465,20 +4465,29 @@ function runBundleV2(manifest, ctx) {
4465
4465
  filesPatched: [],
4466
4466
  markerBlockFiles: []
4467
4467
  };
4468
- const hookPatches = /* @__PURE__ */ new Map();
4468
+ const mergePatches = /* @__PURE__ */ new Map();
4469
4469
  for (const asset of manifest.assets ?? []) {
4470
- runAsset(asset, profile, hookPatches, ctx, result);
4470
+ runAsset(asset, profile, mergePatches, ctx, result);
4471
4471
  result.opsExecuted++;
4472
4472
  }
4473
- for (const [file, patch] of hookPatches) {
4474
- runMergeJson({ op: "merge-json", file, patch }, manifest.name, ctx, result);
4475
- }
4476
4473
  for (const op of manifest.ops ?? []) {
4477
4474
  if (op.when === "hooks-supported" && !profile.handlers.hook.supported) continue;
4478
4475
  if (op.when === "statusline-supported" && !profile.statusLineSupported) continue;
4479
- executeOp(substituteHookDir(op, profile), manifest.name, ctx, result);
4476
+ const substituted = substituteHookDir(op, profile);
4477
+ if (substituted.op === "merge-json") {
4478
+ const existing = mergePatches.get(substituted.file);
4479
+ mergePatches.set(
4480
+ substituted.file,
4481
+ deepMerge2(existing ?? {}, substituted.patch)
4482
+ );
4483
+ } else {
4484
+ executeOp(substituted, manifest.name, ctx, result);
4485
+ }
4480
4486
  result.opsExecuted++;
4481
4487
  }
4488
+ for (const [file, patch] of mergePatches) {
4489
+ runMergeJson({ op: "merge-json", file, patch }, manifest.name, ctx, result);
4490
+ }
4482
4491
  writeGitignoreBlock(manifest, ctx, result);
4483
4492
  const snippet = result.instructionsSnippet;
4484
4493
  if (snippet) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"