everything-dev 1.26.0 → 1.27.0

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 (121) hide show
  1. package/dist/api-contract.cjs.map +1 -1
  2. package/dist/api-contract.mjs.map +1 -1
  3. package/dist/cli/catalog.cjs.map +1 -1
  4. package/dist/cli/catalog.mjs.map +1 -1
  5. package/dist/cli/framework-version.cjs.map +1 -1
  6. package/dist/cli/framework-version.mjs.map +1 -1
  7. package/dist/cli/infra.cjs.map +1 -1
  8. package/dist/cli/infra.mjs.map +1 -1
  9. package/dist/cli/init.cjs +127 -114
  10. package/dist/cli/init.cjs.map +1 -1
  11. package/dist/cli/init.d.cts +7 -6
  12. package/dist/cli/init.d.cts.map +1 -1
  13. package/dist/cli/init.d.mts +7 -6
  14. package/dist/cli/init.d.mts.map +1 -1
  15. package/dist/cli/init.mjs +124 -114
  16. package/dist/cli/init.mjs.map +1 -1
  17. package/dist/cli/parse.cjs.map +1 -1
  18. package/dist/cli/parse.mjs.map +1 -1
  19. package/dist/cli/prompts.cjs +3 -3
  20. package/dist/cli/prompts.cjs.map +1 -1
  21. package/dist/cli/prompts.mjs +2 -2
  22. package/dist/cli/prompts.mjs.map +1 -1
  23. package/dist/cli/status.cjs.map +1 -1
  24. package/dist/cli/status.mjs.map +1 -1
  25. package/dist/cli/sync.cjs +42 -92
  26. package/dist/cli/sync.cjs.map +1 -1
  27. package/dist/cli/sync.mjs +45 -95
  28. package/dist/cli/sync.mjs.map +1 -1
  29. package/dist/cli/timing.cjs.map +1 -1
  30. package/dist/cli/timing.mjs.map +1 -1
  31. package/dist/cli/upgrade.cjs +43 -22
  32. package/dist/cli/upgrade.cjs.map +1 -1
  33. package/dist/cli/upgrade.mjs +44 -23
  34. package/dist/cli/upgrade.mjs.map +1 -1
  35. package/dist/cli.cjs +1 -1
  36. package/dist/cli.cjs.map +1 -1
  37. package/dist/cli.mjs +1 -1
  38. package/dist/cli.mjs.map +1 -1
  39. package/dist/components/dev-view.cjs.map +1 -1
  40. package/dist/components/dev-view.mjs.map +1 -1
  41. package/dist/components/streaming-view.cjs.map +1 -1
  42. package/dist/components/streaming-view.mjs.map +1 -1
  43. package/dist/config.cjs.map +1 -1
  44. package/dist/config.mjs.map +1 -1
  45. package/dist/contract.cjs +174 -173
  46. package/dist/contract.cjs.map +1 -1
  47. package/dist/contract.d.cts +3 -3
  48. package/dist/contract.d.cts.map +1 -1
  49. package/dist/contract.d.mts +3 -3
  50. package/dist/contract.d.mts.map +1 -1
  51. package/dist/contract.meta.cjs +1 -1
  52. package/dist/contract.meta.cjs.map +1 -1
  53. package/dist/contract.meta.d.cts +1 -1
  54. package/dist/contract.meta.d.mts +1 -1
  55. package/dist/contract.meta.mjs +1 -1
  56. package/dist/contract.meta.mjs.map +1 -1
  57. package/dist/contract.mjs +2 -1
  58. package/dist/contract.mjs.map +1 -1
  59. package/dist/dev-logs.cjs.map +1 -1
  60. package/dist/dev-logs.mjs.map +1 -1
  61. package/dist/fastkv.cjs.map +1 -1
  62. package/dist/fastkv.mjs.map +1 -1
  63. package/dist/index.cjs +3 -3
  64. package/dist/index.d.cts +1 -1
  65. package/dist/index.d.mts +1 -1
  66. package/dist/index.mjs +1 -1
  67. package/dist/integrity.cjs.map +1 -1
  68. package/dist/integrity.mjs.map +1 -1
  69. package/dist/internal/manifest-normalizer.cjs.map +1 -1
  70. package/dist/internal/manifest-normalizer.mjs.map +1 -1
  71. package/dist/merge.cjs.map +1 -1
  72. package/dist/merge.mjs.map +1 -1
  73. package/dist/near-cli.cjs.map +1 -1
  74. package/dist/near-cli.mjs.map +1 -1
  75. package/dist/orchestrator.cjs.map +1 -1
  76. package/dist/orchestrator.mjs.map +1 -1
  77. package/dist/plugin.cjs +72 -50
  78. package/dist/plugin.cjs.map +1 -1
  79. package/dist/plugin.d.cts +2 -2
  80. package/dist/plugin.d.cts.map +1 -1
  81. package/dist/plugin.d.mts +2 -2
  82. package/dist/plugin.d.mts.map +1 -1
  83. package/dist/plugin.mjs +53 -32
  84. package/dist/plugin.mjs.map +1 -1
  85. package/dist/sdk.cjs +2 -2
  86. package/dist/sdk.d.cts +1 -1
  87. package/dist/sdk.d.mts +1 -1
  88. package/dist/sdk.mjs +1 -1
  89. package/dist/shared.cjs.map +1 -1
  90. package/dist/shared.mjs.map +1 -1
  91. package/dist/types.cjs +184 -184
  92. package/dist/types.cjs.map +1 -1
  93. package/dist/types.d.cts +3 -3
  94. package/dist/types.d.mts +3 -3
  95. package/dist/types.mjs +1 -1
  96. package/dist/types.mjs.map +1 -1
  97. package/dist/ui/types.d.cts +1 -0
  98. package/dist/ui/types.d.cts.map +1 -1
  99. package/dist/ui/types.d.mts +1 -0
  100. package/dist/ui/types.d.mts.map +1 -1
  101. package/dist/utils/banner.cjs.map +1 -1
  102. package/dist/utils/banner.mjs.map +1 -1
  103. package/dist/utils/run.cjs.map +1 -1
  104. package/dist/utils/run.mjs.map +1 -1
  105. package/package.json +2 -2
  106. package/skills/init-upgrade/SKILL.md +22 -16
  107. package/skills/publish-sync/SKILL.md +7 -18
  108. package/src/cli/init.ts +149 -195
  109. package/src/cli/prompts.ts +1 -1
  110. package/src/cli/sync.ts +48 -137
  111. package/src/cli/upgrade.ts +66 -25
  112. package/src/contract.meta.ts +1 -1
  113. package/src/contract.ts +2 -1
  114. package/src/plugin.ts +69 -34
  115. package/src/sdk.ts +1 -1
  116. package/src/types.ts +1 -1
  117. package/src/ui/types.ts +1 -0
  118. package/dist/utils/path-match.cjs +0 -18
  119. package/dist/utils/path-match.cjs.map +0 -1
  120. package/dist/utils/path-match.mjs +0 -17
  121. package/dist/utils/path-match.mjs.map +0 -1
package/dist/cli/init.cjs CHANGED
@@ -2,7 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  const require_fastkv = require('../fastkv.cjs');
4
4
  const require_manifest_normalizer = require('../internal/manifest-normalizer.cjs');
5
- const require_path_match = require('../utils/path-match.cjs');
6
5
  const require_save_config = require('../utils/save-config.cjs');
7
6
  const require_snapshot = require('./snapshot.cjs');
8
7
  let node_fs = require("node:fs");
@@ -16,6 +15,25 @@ let glob = require("glob");
16
15
 
17
16
  //#region src/cli/init.ts
18
17
  const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
18
+ const INIT_ROOT_PATTERNS = [
19
+ "bos.config.json",
20
+ "package.json",
21
+ ".env.example",
22
+ ".gitignore",
23
+ "biome.json",
24
+ "bunfig.toml",
25
+ "Dockerfile",
26
+ "docker-compose.yml",
27
+ "railway.json",
28
+ ".agent/**",
29
+ "AGENTS.md",
30
+ ".opencode/skills/everything-dev/**",
31
+ ".changeset/config.json",
32
+ ".changeset/README.md",
33
+ "README.md",
34
+ "CONTRIBUTING.md",
35
+ ".github/templates/**"
36
+ ];
19
37
  const FRAMEWORK_PACKAGES = ["every-plugin", "everything-dev"];
20
38
  const OVERRIDE_WORKSPACE_MAP = {
21
39
  ui: ["ui"],
@@ -57,13 +75,18 @@ async function resolveSourceDir(opts) {
57
75
  cleanup: async () => {}
58
76
  };
59
77
  }
60
- async function readTemplatekeep(sourceDir) {
61
- const keepFile = (0, node_path.join)(sourceDir, ".templatekeep");
62
- if (!(0, node_fs.existsSync)(keepFile)) return [];
63
- const patterns = (0, node_fs.readFileSync)(keepFile, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
64
- if (!patterns.includes(".templatekeep")) patterns.unshift(".templatekeep");
78
+ function buildInitPatterns(overrides, plugins) {
79
+ const has = (section) => overrides.includes(section);
80
+ const patterns = [...INIT_ROOT_PATTERNS];
81
+ if (has("ui")) patterns.push("ui/**");
82
+ if (has("api")) patterns.push("api/**");
83
+ if (has("host")) patterns.push("host/**");
84
+ if (has("plugins")) for (const plugin of plugins ?? []) patterns.push(`plugins/${plugin}/**`);
65
85
  return patterns;
66
86
  }
87
+ function sourcePathToDestinationPath(filePath) {
88
+ return filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
89
+ }
67
90
  async function fetchParentConfig(extendsAccount, extendsGateway) {
68
91
  return require_fastkv.fetchBosConfigFromFastKv(`bos://${extendsAccount}/${extendsGateway}`);
69
92
  }
@@ -187,62 +210,30 @@ function parseGitHubUrl(url) {
187
210
  };
188
211
  return null;
189
212
  }
190
- function filterPatternsByOverrides(patterns, overrides, _plugins) {
191
- const has = (section) => overrides.includes(section);
192
- let filtered = [...patterns];
193
- if (!has("host")) filtered = filtered.filter((p) => !p.startsWith("host/") && p !== "host/**");
194
- if (!has("ui")) filtered = filtered.filter((p) => !p.startsWith("ui/") && p !== "ui/**");
195
- if (!has("api")) filtered = filtered.filter((p) => !p.startsWith("api/") && p !== "api/**");
196
- if (!has("plugins")) filtered = filtered.filter((p) => !p.startsWith("plugins/") && p !== "plugins/**");
197
- return filtered;
198
- }
199
- async function copyFilteredFiles(sourceDir, destination, patterns, options) {
213
+ async function copyFilteredFiles(sourceDir, destination, patterns, _options) {
200
214
  if (patterns.length === 0) return 0;
201
- const has = (section) => options.overrides.includes(section);
202
- const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
203
- if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
204
- const excludedRoutePatterns = [];
205
- if (options.pluginRoutes) {
206
- for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
207
- }
208
215
  const allFiles = /* @__PURE__ */ new Set();
209
- for (const pattern of effectivePatterns) {
216
+ for (const pattern of patterns) {
210
217
  const matches = await (0, glob.glob)(pattern, {
211
218
  cwd: sourceDir,
212
219
  nodir: true,
213
220
  dot: true,
214
- absolute: false
221
+ absolute: false,
222
+ ignore: [
223
+ "**/node_modules/**",
224
+ "**/.git/**",
225
+ "**/dist/**",
226
+ "**/.bos/**"
227
+ ]
215
228
  });
216
- for (const match of matches) {
217
- const pluginMatch = match.match(/^plugins\/([^/]+)/);
218
- if (pluginMatch) {
219
- const pluginName = pluginMatch[1];
220
- if (!(options.plugins?.includes(pluginName) ?? true)) continue;
221
- }
222
- if (require_path_match.isPathExcluded(match, excludedRoutePatterns)) continue;
223
- allFiles.add(match);
224
- }
229
+ for (const match of matches) allFiles.add(match);
225
230
  }
226
- const routeFiles = /* @__PURE__ */ new Set();
227
- if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
228
- if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
229
- for (const rp of routePatterns) {
230
- const matches = await (0, glob.glob)(rp, {
231
- cwd: sourceDir,
232
- nodir: true,
233
- dot: true,
234
- absolute: false
235
- });
236
- for (const match of matches) if (!require_path_match.isPathExcluded(match, excludedRoutePatterns)) routeFiles.add(match);
237
- }
238
- }
239
- for (const f of routeFiles) allFiles.add(f);
240
231
  (0, node_fs.mkdirSync)(destination, { recursive: true });
241
232
  let count = 0;
242
233
  for (const filePath of allFiles) {
243
234
  const src = (0, node_path.join)(sourceDir, filePath);
244
235
  if (!(0, node_fs.lstatSync)(src).isFile()) continue;
245
- const dest = (0, node_path.join)(destination, filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath);
236
+ const dest = (0, node_path.join)(destination, sourcePathToDestinationPath(filePath));
246
237
  (0, node_fs.mkdirSync)((0, node_path.dirname)(dest), { recursive: true });
247
238
  (0, node_fs.writeFileSync)(dest, (0, node_fs.readFileSync)(src));
248
239
  count++;
@@ -327,24 +318,28 @@ async function personalizeConfig(destination, opts) {
327
318
  }
328
319
  if (pkg.scripts && typeof pkg.scripts === "object") {
329
320
  const scripts = pkg.scripts;
330
- const rewrite = (key, from, to) => {
331
- if (scripts[key]?.includes(from)) scripts[key] = scripts[key].replaceAll(from, to);
321
+ const FROM = "bun packages/everything-dev/src/cli.ts";
322
+ const TO = "node_modules/.bin/bos";
323
+ const rewrite = (key) => {
324
+ if (scripts[key]?.includes(FROM)) scripts[key] = scripts[key].replaceAll(FROM, TO);
332
325
  };
333
- rewrite("dev", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
334
- rewrite("dev:ui", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
335
- rewrite("dev:api", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
336
- rewrite("dev:proxy", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
337
- rewrite("build", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
338
- rewrite("deploy", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
339
- rewrite("publish", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
340
- rewrite("start", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
326
+ rewrite("dev");
327
+ rewrite("dev:ui");
328
+ rewrite("dev:api");
329
+ rewrite("dev:proxy");
330
+ rewrite("build");
331
+ rewrite("deploy");
332
+ rewrite("publish");
333
+ rewrite("start");
334
+ rewrite("bos");
341
335
  scripts.postinstall = "node_modules/.bin/bos types gen || true";
342
336
  scripts["types:gen"] = "node_modules/.bin/bos types gen";
343
337
  if (scripts.typecheck) {
344
338
  scripts.typecheck = scripts.typecheck.replace("bun run types:gen && ", "").replace(/bun run --cwd packages\/everything-dev typecheck & ?/, "");
339
+ if (!has("ui")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd ui tsc --noEmit & ?/, "");
340
+ if (!has("api")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd api tsc --noEmit & ?/, "");
345
341
  if (!has("host")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd host tsc --noEmit & ?/, "");
346
342
  }
347
- if (!scripts.bos) scripts.bos = "node_modules/.bin/bos";
348
343
  }
349
344
  if (pkg.devDependencies && typeof pkg.devDependencies === "object") {
350
345
  const deps = pkg.devDependencies;
@@ -461,10 +456,25 @@ async function runBunInstall(destination, spinner) {
461
456
  await runWithProgress("bun", ["install", "--ignore-scripts"], destination, spinner, "Installing dependencies");
462
457
  }
463
458
  async function runBunInstallForUpgrade(destination, spinner) {
464
- await runWithProgress("bun", ["install"], destination, spinner, "Installing dependencies");
459
+ await runWithProgress("bun", ["install", "--force"], destination, spinner, "Installing dependencies");
465
460
  }
466
461
  async function runTypesGen(destination, spinner) {
467
- await runWithProgress("node_modules/.bin/bos", ["types", "gen"], destination, spinner, "Generating types");
462
+ if ((0, node_fs.existsSync)((0, node_path.join)(destination, "node_modules", ".bin", "bos"))) {
463
+ await runWithProgress("node_modules/.bin/bos", ["types", "gen"], destination, spinner, "Generating types");
464
+ return;
465
+ }
466
+ if ((0, node_fs.existsSync)((0, node_path.join)(destination, "packages", "everything-dev", "src", "cli.ts"))) {
467
+ await runWithProgress("bun", [
468
+ "run",
469
+ "--cwd",
470
+ "packages/everything-dev",
471
+ "src/cli.ts",
472
+ "types",
473
+ "gen"
474
+ ], destination, spinner, "Generating types");
475
+ return;
476
+ }
477
+ throw new Error("Unable to locate bos CLI for types generation");
468
478
  }
469
479
  async function runDockerComposeUp(destination) {
470
480
  await execCommand("docker", [
@@ -514,36 +524,54 @@ function stripOrphanedWorkspacesFromLockfile(lockfilePath, allowedWorkspaces) {
514
524
  }
515
525
  if (changed) (0, node_fs.writeFileSync)(lockfilePath, `${JSON.stringify(lockfile, null, 2)}\n`);
516
526
  }
527
+ function removeInitLockfile(lockfilePath) {
528
+ if (!(0, node_fs.existsSync)(lockfilePath)) return;
529
+ (0, node_fs.rmSync)(lockfilePath, { force: true });
530
+ }
517
531
  const WORKSPACE_LOCAL_PATHS = {
518
532
  "everything-dev": "packages/everything-dev",
519
533
  "every-plugin": "packages/every-plugin"
520
534
  };
535
+ function readJsonFile(filePath) {
536
+ return JSON.parse((0, node_fs.readFileSync)(filePath, "utf-8"));
537
+ }
538
+ function tryResolvePackageJson(packageName) {
539
+ try {
540
+ return require$1.resolve(`${packageName}/package.json`);
541
+ } catch {
542
+ return null;
543
+ }
544
+ }
521
545
  function resolveFrameworkCatalog() {
522
546
  const catalog = {};
523
- try {
524
- const monorepoPkgPath = (0, node_path.join)((0, node_path.dirname)(require$1.resolve("everything-dev/package.json")), "..", "..", "package.json");
525
- if ((0, node_fs.existsSync)(monorepoPkgPath)) {
526
- const sourceCatalog = JSON.parse((0, node_fs.readFileSync)(monorepoPkgPath, "utf-8")).workspaces?.catalog;
547
+ const everythingDevPackageJson = tryResolvePackageJson("everything-dev");
548
+ if (everythingDevPackageJson) {
549
+ try {
550
+ const monorepoPkgPath = (0, node_path.join)((0, node_path.dirname)(everythingDevPackageJson), "..", "..", "package.json");
551
+ if ((0, node_fs.existsSync)(monorepoPkgPath)) {
552
+ const sourceCatalog = readJsonFile(monorepoPkgPath).workspaces?.catalog;
553
+ if (sourceCatalog && typeof sourceCatalog === "object") {
554
+ for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
555
+ }
556
+ }
557
+ } catch {}
558
+ try {
559
+ const selfPkg = readJsonFile(everythingDevPackageJson);
560
+ if (selfPkg.version && !catalog["everything-dev"]) catalog["everything-dev"] = `^${selfPkg.version}`;
561
+ const sourceCatalog = selfPkg.workspaces?.catalog;
527
562
  if (sourceCatalog && typeof sourceCatalog === "object") {
528
- for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
563
+ for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string" && !catalog[name]) catalog[name] = version;
529
564
  }
530
- }
531
- } catch {}
532
- try {
533
- const selfPkgPath = require$1.resolve("everything-dev/package.json");
534
- const selfPkg = JSON.parse((0, node_fs.readFileSync)(selfPkgPath, "utf-8"));
535
- if (selfPkg.version && !catalog["everything-dev"]) catalog["everything-dev"] = `^${selfPkg.version}`;
536
- const sourceCatalog = selfPkg.workspaces?.catalog;
537
- if (sourceCatalog && typeof sourceCatalog === "object") {
538
- for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string" && !catalog[name]) catalog[name] = version;
539
- }
540
- } catch {}
541
- if (Object.keys(catalog).length > 0) return catalog;
542
- for (const packageName of FRAMEWORK_PACKAGES) try {
543
- const resolved = require$1.resolve(`${packageName}/package.json`);
544
- const pkg = JSON.parse((0, node_fs.readFileSync)(resolved, "utf-8"));
545
- if (pkg.version) catalog[packageName] = `^${pkg.version}`;
546
- } catch {}
565
+ } catch {}
566
+ }
567
+ for (const packageName of FRAMEWORK_PACKAGES) {
568
+ const resolved = tryResolvePackageJson(packageName);
569
+ if (!resolved) continue;
570
+ try {
571
+ const pkg = readJsonFile(resolved);
572
+ if (pkg.version) catalog[packageName] = `^${pkg.version}`;
573
+ } catch {}
574
+ }
547
575
  return catalog;
548
576
  }
549
577
  async function scaffoldMinimalProject(destination, parentConfig, opts) {
@@ -658,47 +686,29 @@ async function resolveWorkspaceRefs(destination, options) {
658
686
  }
659
687
  }
660
688
  }
661
- async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns, options) {
662
- const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
663
- const has = (section) => options.overrides.includes(section);
664
- if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
665
- const excludedRoutePatterns = [];
666
- if (options.pluginRoutes) {
667
- for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
668
- }
689
+ async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns, _options) {
669
690
  const allFiles = /* @__PURE__ */ new Set();
670
- for (const pattern of effectivePatterns) {
691
+ for (const pattern of patterns) {
671
692
  const matches = await (0, glob.glob)(pattern, {
672
693
  cwd: sourceDir,
673
694
  nodir: true,
674
695
  dot: true,
675
- absolute: false
696
+ absolute: false,
697
+ ignore: [
698
+ "**/node_modules/**",
699
+ "**/.git/**",
700
+ "**/dist/**",
701
+ "**/.bos/**"
702
+ ]
676
703
  });
677
- for (const match of matches) {
678
- const pluginMatch = match.match(/^plugins\/([^/]+)/);
679
- if (pluginMatch && !(options.plugins?.includes(pluginMatch[1]) ?? true)) continue;
680
- if (require_path_match.isPathExcluded(match, excludedRoutePatterns)) continue;
681
- allFiles.add(match);
682
- }
683
- }
684
- if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
685
- if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
686
- for (const rp of routePatterns) {
687
- const matches = await (0, glob.glob)(rp, {
688
- cwd: sourceDir,
689
- nodir: true,
690
- dot: true,
691
- absolute: false
692
- });
693
- for (const match of matches) if (!require_path_match.isPathExcluded(match, excludedRoutePatterns)) allFiles.add(match);
694
- }
704
+ for (const match of matches) allFiles.add(match);
695
705
  }
696
706
  const fileHashes = {};
697
707
  for (const filePath of allFiles) {
698
708
  const src = (0, node_path.join)(sourceDir, filePath);
699
709
  if (!(0, node_fs.lstatSync)(src).isFile()) continue;
700
710
  const content = (0, node_fs.readFileSync)(src);
701
- const destPath = filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
711
+ const destPath = sourcePathToDestinationPath(filePath);
702
712
  fileHashes[destPath] = computeHash(content);
703
713
  }
704
714
  await require_snapshot.writeSnapshot(destination, {
@@ -783,6 +793,8 @@ dist/
783
793
  }
784
794
 
785
795
  //#endregion
796
+ exports.INIT_ROOT_PATTERNS = INIT_ROOT_PATTERNS;
797
+ exports.buildInitPatterns = buildInitPatterns;
786
798
  exports.copyFilteredFiles = copyFilteredFiles;
787
799
  exports.detectGitRemoteUrl = detectGitRemoteUrl;
788
800
  exports.downloadTarball = downloadTarball;
@@ -790,7 +802,7 @@ exports.execCommand = execCommand;
790
802
  exports.fetchParentConfig = fetchParentConfig;
791
803
  exports.generateDatabaseMigrations = generateDatabaseMigrations;
792
804
  exports.personalizeConfig = personalizeConfig;
793
- exports.readTemplatekeep = readTemplatekeep;
805
+ exports.removeInitLockfile = removeInitLockfile;
794
806
  exports.resolveRepositoryViaExtendsChain = resolveRepositoryViaExtendsChain;
795
807
  exports.resolveSourceDir = resolveSourceDir;
796
808
  exports.runBunInstall = runBunInstall;
@@ -798,6 +810,7 @@ exports.runBunInstallForUpgrade = runBunInstallForUpgrade;
798
810
  exports.runDockerComposeUp = runDockerComposeUp;
799
811
  exports.runTypesGen = runTypesGen;
800
812
  exports.scaffoldMinimalProject = scaffoldMinimalProject;
813
+ exports.sourcePathToDestinationPath = sourcePathToDestinationPath;
801
814
  exports.stripOrphanedWorkspacesFromLockfile = stripOrphanedWorkspacesFromLockfile;
802
815
  exports.writeInitSnapshot = writeInitSnapshot;
803
816
  //# sourceMappingURL=init.cjs.map