dlw-machine-setup 0.9.3 → 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 +29 -16
  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) {
@@ -5568,7 +5577,13 @@ var write_state_default = defineStep({
5568
5577
  instructions: target.instructions,
5569
5578
  mcpConfig: target.mcpConfig,
5570
5579
  contexts: "_ai-context/",
5571
- factory: ctx.installed.factoryInstalled ? "factory/" : null,
5580
+ /* Factory v2 bundle lands assets under .claude/ via the
5581
+ * Claude Code profile (agents/, skills/, factory/, hooks/, plus
5582
+ * a merge into .claude/settings.json). The legacy 'factory/'
5583
+ * top-level path was retired in installer v0.8.0 when the
5584
+ * per-agent profile dispatch took over — keeping it here would
5585
+ * mislead the uninstall preview which reads this field. */
5586
+ factory: ctx.installed.factoryInstalled ? ".claude/" : null,
5572
5587
  abapHooks: ctx.installed.abapHooksInstalled ? ".claude/hooks/" : null,
5573
5588
  globalConfig: (0, import_path14.join)((0, import_os2.homedir)(), ".one-shot-installer")
5574
5589
  }
@@ -5969,15 +5984,13 @@ async function previewAndConfirm(config, options) {
5969
5984
  console.log(` ${instructionFile.padEnd(domainColWidth + 14)}${instructionMode}`);
5970
5985
  console.log(` ${mcpConfigFile.padEnd(domainColWidth + 14)}${mcpMode}`);
5971
5986
  console.log(` ${".gitignore".padEnd(domainColWidth + 14)}${gitignoreMode}`);
5972
- if (config.installFactory) {
5973
- const factoryExists = (0, import_fs16.existsSync)((0, import_path16.join)(config.projectPath, "factory"));
5974
- const factoryMode = factoryExists ? yellow2("overwrite") : green2("create");
5975
- console.log(` ${"factory/".padEnd(domainColWidth + 14)}${factoryMode}`);
5976
- }
5977
- if (config.installAbapHooks) {
5978
- const hooksDir = (0, import_path16.join)(config.projectPath, ".claude", "hooks");
5979
- const hooksMode = (0, import_fs16.existsSync)(hooksDir) ? yellow2("merge") : green2("create");
5980
- console.log(` ${".claude/hooks/".padEnd(domainColWidth + 14)}${hooksMode}`);
5987
+ if (config.installFactory || config.installAbapHooks) {
5988
+ const claudeDir = (0, import_path16.join)(config.projectPath, ".claude");
5989
+ const claudeMode = (0, import_fs16.existsSync)(claudeDir) ? yellow2("merge") : green2("create");
5990
+ console.log(` ${".claude/".padEnd(domainColWidth + 14)}${claudeMode}`);
5991
+ const settingsPath = (0, import_path16.join)(config.projectPath, ".claude", "settings.json");
5992
+ const settingsMode = (0, import_fs16.existsSync)(settingsPath) ? yellow2("merge") : green2("create");
5993
+ console.log(` ${".claude/settings.json".padEnd(domainColWidth + 14)}${settingsMode}`);
5981
5994
  }
5982
5995
  if (serverEntries.length > 0) {
5983
5996
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.9.3",
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"