dlw-machine-setup 0.4.10 → 0.4.11

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 +59 -8
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -3240,9 +3240,9 @@ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursor
3240
3240
  });
3241
3241
 
3242
3242
  // src/index.ts
3243
- var import_fs5 = require("fs");
3243
+ var import_fs6 = require("fs");
3244
3244
  var import_readline = require("readline");
3245
- var import_path5 = require("path");
3245
+ var import_path6 = require("path");
3246
3246
 
3247
3247
  // src/utils/fetch.ts
3248
3248
  var DEFAULT_TIMEOUT_MS = 3e4;
@@ -4010,6 +4010,44 @@ alwaysApply: true
4010
4010
  }
4011
4011
  }
4012
4012
 
4013
+ // src/utils/setup/setup-gitignore.ts
4014
+ var import_fs5 = require("fs");
4015
+ var import_path5 = require("path");
4016
+ var MARKER_START2 = "# one-shot-installer:start";
4017
+ var MARKER_END2 = "# one-shot-installer:end";
4018
+ var GITIGNORE_ENTRIES = [
4019
+ "# One-Shot installer generated files",
4020
+ ".one-shot-state.json",
4021
+ ".mcp.json",
4022
+ "_ai-context/",
4023
+ "_bmad/",
4024
+ "_bmad-output/",
4025
+ "",
4026
+ "# Claude Code local/generated files",
4027
+ ".claude/agents/",
4028
+ ".claude/agent-memory/",
4029
+ ".claude/plans/",
4030
+ ".claude/settings.local.json"
4031
+ ];
4032
+ function setupGitignore(projectPath) {
4033
+ const gitignorePath = (0, import_path5.join)(projectPath, ".gitignore");
4034
+ const block = [MARKER_START2, ...GITIGNORE_ENTRIES, MARKER_END2].join("\n");
4035
+ if (!(0, import_fs5.existsSync)(gitignorePath)) {
4036
+ (0, import_fs5.writeFileSync)(gitignorePath, block + "\n", "utf-8");
4037
+ return;
4038
+ }
4039
+ const existing = (0, import_fs5.readFileSync)(gitignorePath, "utf-8");
4040
+ const start = existing.indexOf(MARKER_START2);
4041
+ const end = existing.indexOf(MARKER_END2);
4042
+ if (start !== -1 && end !== -1 && end > start) {
4043
+ const updated = existing.slice(0, start) + block + existing.slice(end + MARKER_END2.length);
4044
+ (0, import_fs5.writeFileSync)(gitignorePath, updated, "utf-8");
4045
+ } else {
4046
+ const separator = existing.endsWith("\n") ? "\n" : "\n\n";
4047
+ (0, import_fs5.writeFileSync)(gitignorePath, existing + separator + block + "\n", "utf-8");
4048
+ }
4049
+ }
4050
+
4013
4051
  // src/utils/mod.ts
4014
4052
  async function loadWizardOptions(token, repo) {
4015
4053
  const remote = await fetchWizardOptions(token, repo);
@@ -4030,7 +4068,7 @@ async function loadWizardOptions(token, repo) {
4030
4068
  }
4031
4069
 
4032
4070
  // src/index.ts
4033
- var INSTALLER_VERSION = "0.4.10";
4071
+ var INSTALLER_VERSION = "0.4.11";
4034
4072
  function getInstructionFilePath(agent) {
4035
4073
  switch (agent) {
4036
4074
  case "claude-code":
@@ -4128,13 +4166,13 @@ async function collectInputs(options, releaseVersion) {
4128
4166
  }
4129
4167
  const projectInput = await esm_default4({
4130
4168
  message: "Project directory:",
4131
- default: (0, import_path5.resolve)(process.cwd())
4169
+ default: (0, import_path6.resolve)(process.cwd())
4132
4170
  });
4133
4171
  return {
4134
4172
  personas: selectedPersonas,
4135
4173
  agent,
4136
4174
  azureDevOpsOrg,
4137
- projectPath: (0, import_path5.resolve)(projectInput),
4175
+ projectPath: (0, import_path6.resolve)(projectInput),
4138
4176
  baseMcpServers: options.baseMcpServers,
4139
4177
  mcpConfig,
4140
4178
  releaseVersion
@@ -4182,7 +4220,8 @@ async function execute(config, token, repo) {
4182
4220
  instructionFilePath,
4183
4221
  mcpConfigured: false,
4184
4222
  mcpConfigPath,
4185
- mcpServersAdded: []
4223
+ mcpServersAdded: [],
4224
+ gitignoreUpdated: false
4186
4225
  };
4187
4226
  console.log("");
4188
4227
  const uniqueDomains = [...new Set(config.personas.flatMap((p) => p.domains))];
@@ -4221,7 +4260,7 @@ async function execute(config, token, repo) {
4221
4260
  const filteredMcpConfig = Object.fromEntries(
4222
4261
  Object.entries(config.mcpConfig).filter(([name]) => successfulMcpServers.has(name))
4223
4262
  );
4224
- const statePath = (0, import_path5.join)(config.projectPath, ".one-shot-state.json");
4263
+ const statePath = (0, import_path6.join)(config.projectPath, ".one-shot-state.json");
4225
4264
  const allDomains = result.domainsInstalled;
4226
4265
  process.stdout.write(` Writing ${instructionFilePath}... `);
4227
4266
  try {
@@ -4253,6 +4292,15 @@ async function execute(config, token, repo) {
4253
4292
  console.log(` Error: ${error instanceof Error ? error.message : String(error)}`);
4254
4293
  console.log(` Path: ${mcpConfigPath}`);
4255
4294
  }
4295
+ process.stdout.write(` Updating .gitignore... `);
4296
+ try {
4297
+ setupGitignore(config.projectPath);
4298
+ result.gitignoreUpdated = true;
4299
+ console.log("\u2713");
4300
+ } catch (error) {
4301
+ console.log("\u2717");
4302
+ console.log(` Error: ${error instanceof Error ? error.message : String(error)}`);
4303
+ }
4256
4304
  result.success = result.domainsFailed.length === 0 && result.instructionsCreated && result.mcpConfigured;
4257
4305
  const allPersonas = config.personas.map((p) => p.id);
4258
4306
  const state = {
@@ -4272,7 +4320,7 @@ async function execute(config, token, repo) {
4272
4320
  }
4273
4321
  };
4274
4322
  try {
4275
- (0, import_fs5.writeFileSync)(statePath, JSON.stringify(state, null, 2), "utf-8");
4323
+ (0, import_fs6.writeFileSync)(statePath, JSON.stringify(state, null, 2), "utf-8");
4276
4324
  } catch {
4277
4325
  }
4278
4326
  return result;
@@ -4291,6 +4339,9 @@ function printSummary(result) {
4291
4339
  const serverList = result.mcpServersAdded.length > 0 ? ` (${result.mcpServersAdded.join(", ")})` : "";
4292
4340
  console.log(` ${result.mcpConfigPath} written${serverList}`);
4293
4341
  }
4342
+ if (result.gitignoreUpdated) {
4343
+ console.log(` .gitignore updated`);
4344
+ }
4294
4345
  if (hasErrors) {
4295
4346
  console.log("\n What went wrong:");
4296
4347
  if (result.domainsFailed.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"