@donotdev/cli 0.3.6 → 0.3.8

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.
@@ -10897,6 +10897,61 @@ Happy coding!`,
10897
10897
 
10898
10898
  // packages/tooling/src/scaffolding/create-project.ts
10899
10899
  init_utils2();
10900
+
10901
+ // packages/tooling/src/maintenance/template-sync.ts
10902
+ init_utils2();
10903
+ init_pathResolver();
10904
+ var PROJECT_MANIFEST = [
10905
+ // Documentation: the framework's instructions and rules for any agent
10906
+ { pattern: "AGENTS.md.example", kind: "docs", strategy: "replace" },
10907
+ { pattern: "CLAUDE.md.example", kind: "docs", strategy: "create-if-missing" },
10908
+ {
10909
+ pattern: ".claude/rules/**/*.md.example",
10910
+ ignore: [".claude/rules/consumer-ux.md.example"],
10911
+ kind: "docs",
10912
+ strategy: "replace"
10913
+ },
10914
+ { pattern: ".cursor/rules/**/*.mdc.example", kind: "docs", strategy: "replace" },
10915
+ { pattern: ".dndev/args.json.example", kind: "docs", strategy: "create-if-missing" },
10916
+ // AI harness: agents, skills, hooks, their registration, the MCP servers
10917
+ { pattern: ".claude/agents/**/*.md.example", kind: "harness", strategy: "replace" },
10918
+ { pattern: ".claude/skills/**/*", kind: "harness", strategy: "replace" },
10919
+ { pattern: ".claude/hooks/**/*.example", kind: "harness", strategy: "replace" },
10920
+ { pattern: ".claude/settings.json.example", kind: "harness", strategy: "merge-settings" },
10921
+ { pattern: ".claude/rules/consumer-ux.md.example", kind: "harness", strategy: "replace" },
10922
+ { pattern: ".mcp.json.example", kind: "harness", strategy: "merge-mcp" },
10923
+ { pattern: ".cursor/mcp.json.example", kind: "harness", strategy: "merge-mcp" },
10924
+ { pattern: ".gemini/settings.json.example", kind: "harness", strategy: "merge-mcp" }
10925
+ ];
10926
+ function isGlobalHarness() {
10927
+ return process.env.DNDEV_HARNESS === "global";
10928
+ }
10929
+ function toDest(relativeTemplatePath) {
10930
+ return relativeTemplatePath.endsWith(".example") ? relativeTemplatePath.slice(0, -".example".length) : relativeTemplatePath;
10931
+ }
10932
+ async function listTemplateFiles(sourceRoot, kind) {
10933
+ const root = normalizePath(sourceRoot);
10934
+ const files = [];
10935
+ for (const entry of PROJECT_MANIFEST) {
10936
+ if (entry.kind !== kind) continue;
10937
+ const matches = await glob(entry.pattern, {
10938
+ cwd: root,
10939
+ onlyFiles: true,
10940
+ ignore: entry.ignore
10941
+ });
10942
+ for (const match of matches) {
10943
+ const relativeTemplatePath = normalizePath(match);
10944
+ files.push({
10945
+ sourceFile: joinPath(root, relativeTemplatePath),
10946
+ relativeDest: toDest(relativeTemplatePath),
10947
+ strategy: entry.strategy
10948
+ });
10949
+ }
10950
+ }
10951
+ return files;
10952
+ }
10953
+
10954
+ // packages/tooling/src/scaffolding/create-project.ts
10900
10955
  init_cli_input();
10901
10956
  init_cli_output();
10902
10957
  init_create_utils();
@@ -11179,21 +11234,6 @@ async function main(_options, name) {
11179
11234
  joinPath(entitiesDir, "index.ts"),
11180
11235
  "// entities/index.ts\n// Add your entity files here\n// Entities are shared between frontend and backend\n// Next.js builds import this module (sitemap, llms.txt): keep it a module while empty.\nexport {};\n"
11181
11236
  );
11182
- const geminiDir = joinPath(projectDirNormalized, ".gemini");
11183
- await ensureDir(geminiDir);
11184
- const geminiSettings = {
11185
- mcpServers: {
11186
- donotdev: {
11187
- command: "npx",
11188
- args: ["-y", "@donotdev/mcp-server@latest"],
11189
- trust: true
11190
- }
11191
- }
11192
- };
11193
- await write(joinPath(geminiDir, "settings.json"), geminiSettings, {
11194
- format: "json",
11195
- overwrite: true
11196
- });
11197
11237
  const entitiesPackageJson = generatePackageJson(
11198
11238
  "entities",
11199
11239
  executionMode
@@ -11260,6 +11300,11 @@ async function main(_options, name) {
11260
11300
  dot: true,
11261
11301
  onlyFiles: true
11262
11302
  });
11303
+ const skippedHarness = new Set(
11304
+ isGlobalHarness() ? (await listTemplateFiles(rootTemplateDir, "harness")).map(
11305
+ (f) => f.relativeDest
11306
+ ) : []
11307
+ );
11263
11308
  for (const file of files) {
11264
11309
  if (file === "package.json.example") continue;
11265
11310
  const sourcePath = joinPath(rootTemplateDir, file);
@@ -11267,6 +11312,7 @@ async function main(_options, name) {
11267
11312
  if (destFileName.endsWith(".example")) {
11268
11313
  destFileName = destFileName.slice(0, -8);
11269
11314
  }
11315
+ if (skippedHarness.has(destFileName)) continue;
11270
11316
  const destPath = joinPath(projectDirNormalized, destFileName);
11271
11317
  await ensureDir(getDirname(destPath));
11272
11318
  await copy(sourcePath, destPath);