everything-dev 1.26.1 → 1.28.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 (166) 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 +1 -1
  8. package/dist/cli/infra.cjs.map +1 -1
  9. package/dist/cli/infra.mjs +1 -1
  10. package/dist/cli/infra.mjs.map +1 -1
  11. package/dist/cli/init.cjs +127 -121
  12. package/dist/cli/init.cjs.map +1 -1
  13. package/dist/cli/init.d.cts +6 -6
  14. package/dist/cli/init.d.cts.map +1 -1
  15. package/dist/cli/init.d.mts +6 -6
  16. package/dist/cli/init.d.mts.map +1 -1
  17. package/dist/cli/init.mjs +125 -121
  18. package/dist/cli/init.mjs.map +1 -1
  19. package/dist/cli/parse.cjs.map +1 -1
  20. package/dist/cli/parse.mjs.map +1 -1
  21. package/dist/cli/prompts.cjs +29 -25
  22. package/dist/cli/prompts.cjs.map +1 -1
  23. package/dist/cli/prompts.mjs +28 -25
  24. package/dist/cli/prompts.mjs.map +1 -1
  25. package/dist/cli/status.cjs.map +1 -1
  26. package/dist/cli/status.mjs.map +1 -1
  27. package/dist/cli/sync.cjs +46 -93
  28. package/dist/cli/sync.cjs.map +1 -1
  29. package/dist/cli/sync.mjs +49 -96
  30. package/dist/cli/sync.mjs.map +1 -1
  31. package/dist/cli/timing.cjs.map +1 -1
  32. package/dist/cli/timing.mjs.map +1 -1
  33. package/dist/cli/upgrade.cjs +41 -20
  34. package/dist/cli/upgrade.cjs.map +1 -1
  35. package/dist/cli/upgrade.mjs +43 -22
  36. package/dist/cli/upgrade.mjs.map +1 -1
  37. package/dist/cli.cjs +187 -12
  38. package/dist/cli.cjs.map +1 -1
  39. package/dist/cli.mjs +187 -12
  40. package/dist/cli.mjs.map +1 -1
  41. package/dist/components/dev-view.cjs.map +1 -1
  42. package/dist/components/dev-view.mjs.map +1 -1
  43. package/dist/components/streaming-view.cjs.map +1 -1
  44. package/dist/components/streaming-view.mjs.map +1 -1
  45. package/dist/config.cjs.map +1 -1
  46. package/dist/config.mjs.map +1 -1
  47. package/dist/contract.cjs +174 -173
  48. package/dist/contract.cjs.map +1 -1
  49. package/dist/contract.d.cts +48 -44
  50. package/dist/contract.d.cts.map +1 -1
  51. package/dist/contract.d.mts +48 -44
  52. package/dist/contract.d.mts.map +1 -1
  53. package/dist/contract.mjs +3 -1
  54. package/dist/contract.mjs.map +1 -1
  55. package/dist/dev-logs.cjs.map +1 -1
  56. package/dist/dev-logs.mjs.map +1 -1
  57. package/dist/dev-session.cjs +0 -1
  58. package/dist/dev-session.mjs +1 -1
  59. package/dist/fastkv.cjs.map +1 -1
  60. package/dist/fastkv.mjs.map +1 -1
  61. package/dist/index.cjs +2 -4
  62. package/dist/index.d.cts +3 -3
  63. package/dist/index.d.mts +3 -3
  64. package/dist/index.mjs +1 -2
  65. package/dist/integrity.cjs.map +1 -1
  66. package/dist/integrity.mjs.map +1 -1
  67. package/dist/internal/manifest-normalizer.cjs.map +1 -1
  68. package/dist/internal/manifest-normalizer.mjs.map +1 -1
  69. package/dist/merge.cjs.map +1 -1
  70. package/dist/merge.mjs.map +1 -1
  71. package/dist/near-cli.cjs +1 -1
  72. package/dist/near-cli.cjs.map +1 -1
  73. package/dist/near-cli.mjs +1 -1
  74. package/dist/near-cli.mjs.map +1 -1
  75. package/dist/orchestrator.cjs +1 -1
  76. package/dist/orchestrator.cjs.map +1 -1
  77. package/dist/orchestrator.mjs +1 -1
  78. package/dist/orchestrator.mjs.map +1 -1
  79. package/dist/plugin.cjs +182 -171
  80. package/dist/plugin.cjs.map +1 -1
  81. package/dist/plugin.d.cts +72 -39
  82. package/dist/plugin.d.cts.map +1 -1
  83. package/dist/plugin.d.mts +71 -39
  84. package/dist/plugin.d.mts.map +1 -1
  85. package/dist/plugin.mjs +170 -160
  86. package/dist/plugin.mjs.map +1 -1
  87. package/dist/sdk.cjs +2 -2
  88. package/dist/sdk.d.cts +1 -1
  89. package/dist/sdk.d.mts +1 -1
  90. package/dist/sdk.mjs +1 -1
  91. package/dist/service-descriptor.d.cts +34 -0
  92. package/dist/service-descriptor.d.cts.map +1 -0
  93. package/dist/service-descriptor.d.mts +36 -0
  94. package/dist/service-descriptor.d.mts.map +1 -0
  95. package/dist/shared.cjs.map +1 -1
  96. package/dist/shared.mjs.map +1 -1
  97. package/dist/types.cjs +184 -184
  98. package/dist/types.cjs.map +1 -1
  99. package/dist/types.d.cts +5 -5
  100. package/dist/types.d.mts +5 -5
  101. package/dist/types.mjs +1 -1
  102. package/dist/types.mjs.map +1 -1
  103. package/dist/ui/types.d.cts +1 -0
  104. package/dist/ui/types.d.cts.map +1 -1
  105. package/dist/ui/types.d.mts +1 -0
  106. package/dist/ui/types.d.mts.map +1 -1
  107. package/dist/utils/banner.cjs.map +1 -1
  108. package/dist/utils/banner.mjs.map +1 -1
  109. package/dist/utils/run.cjs.map +1 -1
  110. package/dist/utils/run.mjs.map +1 -1
  111. package/package.json +3 -3
  112. package/skills/init-upgrade/SKILL.md +22 -16
  113. package/skills/publish-sync/SKILL.md +7 -18
  114. package/dist/utils/path-match.cjs +0 -18
  115. package/dist/utils/path-match.cjs.map +0 -1
  116. package/dist/utils/path-match.mjs +0 -17
  117. package/dist/utils/path-match.mjs.map +0 -1
  118. package/src/api-contract.ts +0 -623
  119. package/src/app.ts +0 -193
  120. package/src/cli/catalog.ts +0 -49
  121. package/src/cli/framework-version.ts +0 -61
  122. package/src/cli/help.ts +0 -13
  123. package/src/cli/infra.ts +0 -190
  124. package/src/cli/init.ts +0 -1202
  125. package/src/cli/parse.ts +0 -147
  126. package/src/cli/prompts.ts +0 -135
  127. package/src/cli/snapshot.ts +0 -46
  128. package/src/cli/status.ts +0 -99
  129. package/src/cli/sync.ts +0 -518
  130. package/src/cli/timing.ts +0 -63
  131. package/src/cli/upgrade.ts +0 -828
  132. package/src/cli.ts +0 -516
  133. package/src/components/dev-view.tsx +0 -352
  134. package/src/components/streaming-view.ts +0 -177
  135. package/src/config.ts +0 -893
  136. package/src/contract.meta.ts +0 -140
  137. package/src/contract.ts +0 -325
  138. package/src/dev-logs.ts +0 -92
  139. package/src/dev-session.ts +0 -283
  140. package/src/fastkv.ts +0 -181
  141. package/src/index.ts +0 -8
  142. package/src/integrity.ts +0 -138
  143. package/src/internal/manifest-normalizer.ts +0 -290
  144. package/src/merge.ts +0 -187
  145. package/src/mf.ts +0 -147
  146. package/src/near-cli.ts +0 -259
  147. package/src/network.ts +0 -3
  148. package/src/orchestrator.ts +0 -493
  149. package/src/plugin.ts +0 -1821
  150. package/src/sdk.ts +0 -14
  151. package/src/service-descriptor.ts +0 -281
  152. package/src/shared.ts +0 -249
  153. package/src/sidebar.ts +0 -140
  154. package/src/types.ts +0 -330
  155. package/src/ui/head.ts +0 -83
  156. package/src/ui/index.ts +0 -5
  157. package/src/ui/metadata.ts +0 -95
  158. package/src/ui/router.ts +0 -88
  159. package/src/ui/runtime.ts +0 -42
  160. package/src/ui/types.ts +0 -64
  161. package/src/utils/banner.ts +0 -21
  162. package/src/utils/linkify.ts +0 -11
  163. package/src/utils/path-match.ts +0 -16
  164. package/src/utils/run.ts +0 -31
  165. package/src/utils/save-config.ts +0 -20
  166. package/src/utils/theme.ts +0 -39
package/dist/cli/init.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  import { fetchBosConfigFromFastKv } from "../fastkv.mjs";
2
2
  import { loadManifestNormalizationSpec, normalizePackageManifestsInTree } from "../internal/manifest-normalizer.mjs";
3
- import { isPathExcluded } from "../utils/path-match.mjs";
4
3
  import { saveBosConfig } from "../utils/save-config.mjs";
5
4
  import { writeSnapshot } from "./snapshot.mjs";
6
5
  import { createRequire } from "node:module";
@@ -14,6 +13,24 @@ import { glob } from "glob";
14
13
 
15
14
  //#region src/cli/init.ts
16
15
  const require = createRequire(import.meta.url);
16
+ const INIT_ROOT_PATTERNS = [
17
+ "bos.config.json",
18
+ "package.json",
19
+ ".env.example",
20
+ ".gitignore",
21
+ "biome.json",
22
+ "bunfig.toml",
23
+ "Dockerfile",
24
+ "railway.json",
25
+ ".agent/**",
26
+ "AGENTS.md",
27
+ ".opencode/skills/everything-dev/**",
28
+ ".changeset/config.json",
29
+ ".changeset/README.md",
30
+ "README.md",
31
+ "CONTRIBUTING.md",
32
+ ".github/templates/**"
33
+ ];
17
34
  const FRAMEWORK_PACKAGES = ["every-plugin", "everything-dev"];
18
35
  const OVERRIDE_WORKSPACE_MAP = {
19
36
  ui: ["ui"],
@@ -55,13 +72,18 @@ async function resolveSourceDir(opts) {
55
72
  cleanup: async () => {}
56
73
  };
57
74
  }
58
- async function readTemplatekeep(sourceDir) {
59
- const keepFile = join(sourceDir, ".templatekeep");
60
- if (!existsSync(keepFile)) return [];
61
- const patterns = readFileSync(keepFile, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
62
- if (!patterns.includes(".templatekeep")) patterns.unshift(".templatekeep");
75
+ function buildInitPatterns(overrides, plugins) {
76
+ const has = (section) => overrides.includes(section);
77
+ const patterns = [...INIT_ROOT_PATTERNS];
78
+ if (has("ui")) patterns.push("ui/**");
79
+ if (has("api")) patterns.push("api/**");
80
+ if (has("host")) patterns.push("host/**");
81
+ if (has("plugins")) for (const plugin of plugins ?? []) patterns.push(`plugins/${plugin}/**`);
63
82
  return patterns;
64
83
  }
84
+ function sourcePathToDestinationPath(filePath) {
85
+ return filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
86
+ }
65
87
  async function fetchParentConfig(extendsAccount, extendsGateway) {
66
88
  return fetchBosConfigFromFastKv(`bos://${extendsAccount}/${extendsGateway}`);
67
89
  }
@@ -185,62 +207,30 @@ function parseGitHubUrl(url) {
185
207
  };
186
208
  return null;
187
209
  }
188
- function filterPatternsByOverrides(patterns, overrides, _plugins) {
189
- const has = (section) => overrides.includes(section);
190
- let filtered = [...patterns];
191
- if (!has("host")) filtered = filtered.filter((p) => !p.startsWith("host/") && p !== "host/**");
192
- if (!has("ui")) filtered = filtered.filter((p) => !p.startsWith("ui/") && p !== "ui/**");
193
- if (!has("api")) filtered = filtered.filter((p) => !p.startsWith("api/") && p !== "api/**");
194
- if (!has("plugins")) filtered = filtered.filter((p) => !p.startsWith("plugins/") && p !== "plugins/**");
195
- return filtered;
196
- }
197
- async function copyFilteredFiles(sourceDir, destination, patterns, options) {
210
+ async function copyFilteredFiles(sourceDir, destination, patterns, _options) {
198
211
  if (patterns.length === 0) return 0;
199
- const has = (section) => options.overrides.includes(section);
200
- const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
201
- if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
202
- const excludedRoutePatterns = [];
203
- if (options.pluginRoutes) {
204
- for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
205
- }
206
212
  const allFiles = /* @__PURE__ */ new Set();
207
- for (const pattern of effectivePatterns) {
213
+ for (const pattern of patterns) {
208
214
  const matches = await glob(pattern, {
209
215
  cwd: sourceDir,
210
216
  nodir: true,
211
217
  dot: true,
212
- absolute: false
218
+ absolute: false,
219
+ ignore: [
220
+ "**/node_modules/**",
221
+ "**/.git/**",
222
+ "**/dist/**",
223
+ "**/.bos/**"
224
+ ]
213
225
  });
214
- for (const match of matches) {
215
- const pluginMatch = match.match(/^plugins\/([^/]+)/);
216
- if (pluginMatch) {
217
- const pluginName = pluginMatch[1];
218
- if (!(options.plugins?.includes(pluginName) ?? true)) continue;
219
- }
220
- if (isPathExcluded(match, excludedRoutePatterns)) continue;
221
- allFiles.add(match);
222
- }
223
- }
224
- const routeFiles = /* @__PURE__ */ new Set();
225
- if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
226
- if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
227
- for (const rp of routePatterns) {
228
- const matches = await glob(rp, {
229
- cwd: sourceDir,
230
- nodir: true,
231
- dot: true,
232
- absolute: false
233
- });
234
- for (const match of matches) if (!isPathExcluded(match, excludedRoutePatterns)) routeFiles.add(match);
235
- }
226
+ for (const match of matches) allFiles.add(match);
236
227
  }
237
- for (const f of routeFiles) allFiles.add(f);
238
228
  mkdirSync(destination, { recursive: true });
239
229
  let count = 0;
240
230
  for (const filePath of allFiles) {
241
231
  const src = join(sourceDir, filePath);
242
232
  if (!lstatSync(src).isFile()) continue;
243
- const dest = join(destination, filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath);
233
+ const dest = join(destination, sourcePathToDestinationPath(filePath));
244
234
  mkdirSync(dirname(dest), { recursive: true });
245
235
  writeFileSync(dest, readFileSync(src));
246
236
  count++;
@@ -312,37 +302,38 @@ async function personalizeConfig(destination, opts) {
312
302
  ws.packages = ws.packages.filter((p) => {
313
303
  if (p.startsWith("packages/")) return false;
314
304
  if (p === "host") return has("host");
315
- if (p === "plugins/*") return false;
316
- const pluginMatch = p.match(/^plugins\/([^/]+)/);
317
- if (pluginMatch) return has("plugins") && (opts.plugins?.includes(pluginMatch[1]) ?? true);
305
+ if (p.startsWith("plugins/")) return false;
318
306
  return true;
319
307
  });
320
- if (has("plugins") && (opts.plugins?.length ?? 0) > 0) for (const plugin of opts.plugins ?? []) {
321
- const pluginWorkspace = `plugins/${plugin}`;
322
- if (!ws.packages.includes(pluginWorkspace)) ws.packages.push(pluginWorkspace);
308
+ if (has("plugins")) {
309
+ if (!ws.packages.includes("plugins/*")) ws.packages.push("plugins/*");
323
310
  }
324
311
  }
325
312
  }
326
313
  if (pkg.scripts && typeof pkg.scripts === "object") {
327
314
  const scripts = pkg.scripts;
328
- const rewrite = (key, from, to) => {
329
- if (scripts[key]?.includes(from)) scripts[key] = scripts[key].replaceAll(from, to);
315
+ const FROM = "bun packages/everything-dev/src/cli.ts";
316
+ const TO = "node_modules/.bin/bos";
317
+ const rewrite = (key) => {
318
+ if (scripts[key]?.includes(FROM)) scripts[key] = scripts[key].replaceAll(FROM, TO);
330
319
  };
331
- rewrite("dev", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
332
- rewrite("dev:ui", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
333
- rewrite("dev:api", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
334
- rewrite("dev:proxy", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
335
- rewrite("build", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
336
- rewrite("deploy", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
337
- rewrite("publish", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
338
- rewrite("start", "packages/everything-dev/src/cli.ts", "node_modules/.bin/bos");
320
+ rewrite("dev");
321
+ rewrite("dev:ui");
322
+ rewrite("dev:api");
323
+ rewrite("dev:proxy");
324
+ rewrite("build");
325
+ rewrite("deploy");
326
+ rewrite("publish");
327
+ rewrite("start");
328
+ rewrite("bos");
339
329
  scripts.postinstall = "node_modules/.bin/bos types gen || true";
340
330
  scripts["types:gen"] = "node_modules/.bin/bos types gen";
341
331
  if (scripts.typecheck) {
342
332
  scripts.typecheck = scripts.typecheck.replace("bun run types:gen && ", "").replace(/bun run --cwd packages\/everything-dev typecheck & ?/, "");
333
+ if (!has("ui")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd ui tsc --noEmit & ?/, "");
334
+ if (!has("api")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd api tsc --noEmit & ?/, "");
343
335
  if (!has("host")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd host tsc --noEmit & ?/, "");
344
336
  }
345
- if (!scripts.bos) scripts.bos = "node_modules/.bin/bos";
346
337
  }
347
338
  if (pkg.devDependencies && typeof pkg.devDependencies === "object") {
348
339
  const deps = pkg.devDependencies;
@@ -462,7 +453,22 @@ async function runBunInstallForUpgrade(destination, spinner) {
462
453
  await runWithProgress("bun", ["install", "--force"], destination, spinner, "Installing dependencies");
463
454
  }
464
455
  async function runTypesGen(destination, spinner) {
465
- await runWithProgress("node_modules/.bin/bos", ["types", "gen"], destination, spinner, "Generating types");
456
+ if (existsSync(join(destination, "node_modules", ".bin", "bos"))) {
457
+ await runWithProgress("node_modules/.bin/bos", ["types", "gen"], destination, spinner, "Generating types");
458
+ return;
459
+ }
460
+ if (existsSync(join(destination, "packages", "everything-dev", "src", "cli.ts"))) {
461
+ await runWithProgress("bun", [
462
+ "run",
463
+ "--cwd",
464
+ "packages/everything-dev",
465
+ "src/cli.ts",
466
+ "types",
467
+ "gen"
468
+ ], destination, spinner, "Generating types");
469
+ return;
470
+ }
471
+ throw new Error("Unable to locate bos CLI for types generation");
466
472
  }
467
473
  async function runDockerComposeUp(destination) {
468
474
  await execCommand("docker", [
@@ -506,7 +512,9 @@ function stripOrphanedWorkspacesFromLockfile(lockfilePath, allowedWorkspaces) {
506
512
  const allowed = new Set(["", ...allowedWorkspaces]);
507
513
  const keys = Object.keys(workspaceMap);
508
514
  let changed = false;
509
- for (const key of keys) if (!allowed.has(key)) {
515
+ for (const key of keys) {
516
+ if (allowed.has(key)) continue;
517
+ if (allowedWorkspaces.some((pattern) => pattern.endsWith("/*") && key.startsWith(pattern.slice(0, -1)))) continue;
510
518
  delete workspaceMap[key];
511
519
  changed = true;
512
520
  }
@@ -520,32 +528,46 @@ const WORKSPACE_LOCAL_PATHS = {
520
528
  "everything-dev": "packages/everything-dev",
521
529
  "every-plugin": "packages/every-plugin"
522
530
  };
531
+ function readJsonFile(filePath) {
532
+ return JSON.parse(readFileSync(filePath, "utf-8"));
533
+ }
534
+ function tryResolvePackageJson(packageName) {
535
+ try {
536
+ return require.resolve(`${packageName}/package.json`);
537
+ } catch {
538
+ return null;
539
+ }
540
+ }
523
541
  function resolveFrameworkCatalog() {
524
542
  const catalog = {};
525
- try {
526
- const monorepoPkgPath = join(dirname(require.resolve("everything-dev/package.json")), "..", "..", "package.json");
527
- if (existsSync(monorepoPkgPath)) {
528
- const sourceCatalog = JSON.parse(readFileSync(monorepoPkgPath, "utf-8")).workspaces?.catalog;
543
+ const everythingDevPackageJson = tryResolvePackageJson("everything-dev");
544
+ if (everythingDevPackageJson) {
545
+ try {
546
+ const monorepoPkgPath = join(dirname(everythingDevPackageJson), "..", "..", "package.json");
547
+ if (existsSync(monorepoPkgPath)) {
548
+ const sourceCatalog = readJsonFile(monorepoPkgPath).workspaces?.catalog;
549
+ if (sourceCatalog && typeof sourceCatalog === "object") {
550
+ for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
551
+ }
552
+ }
553
+ } catch {}
554
+ try {
555
+ const selfPkg = readJsonFile(everythingDevPackageJson);
556
+ if (selfPkg.version && !catalog["everything-dev"]) catalog["everything-dev"] = `^${selfPkg.version}`;
557
+ const sourceCatalog = selfPkg.workspaces?.catalog;
529
558
  if (sourceCatalog && typeof sourceCatalog === "object") {
530
- for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
559
+ for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string" && !catalog[name]) catalog[name] = version;
531
560
  }
532
- }
533
- } catch {}
534
- try {
535
- const selfPkgPath = require.resolve("everything-dev/package.json");
536
- const selfPkg = JSON.parse(readFileSync(selfPkgPath, "utf-8"));
537
- if (selfPkg.version && !catalog["everything-dev"]) catalog["everything-dev"] = `^${selfPkg.version}`;
538
- const sourceCatalog = selfPkg.workspaces?.catalog;
539
- if (sourceCatalog && typeof sourceCatalog === "object") {
540
- for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string" && !catalog[name]) catalog[name] = version;
541
- }
542
- } catch {}
543
- if (Object.keys(catalog).length > 0) return catalog;
544
- for (const packageName of FRAMEWORK_PACKAGES) try {
545
- const resolved = require.resolve(`${packageName}/package.json`);
546
- const pkg = JSON.parse(readFileSync(resolved, "utf-8"));
547
- if (pkg.version) catalog[packageName] = `^${pkg.version}`;
548
- } catch {}
561
+ } catch {}
562
+ }
563
+ for (const packageName of FRAMEWORK_PACKAGES) {
564
+ const resolved = tryResolvePackageJson(packageName);
565
+ if (!resolved) continue;
566
+ try {
567
+ const pkg = readJsonFile(resolved);
568
+ if (pkg.version) catalog[packageName] = `^${pkg.version}`;
569
+ } catch {}
570
+ }
549
571
  return catalog;
550
572
  }
551
573
  async function scaffoldMinimalProject(destination, parentConfig, opts) {
@@ -596,7 +618,7 @@ async function scaffoldMinimalProject(destination, parentConfig, opts) {
596
618
  await saveBosConfig(destination, config);
597
619
  const workspacePackages = [];
598
620
  for (const section of opts.overrides) workspacePackages.push(...OVERRIDE_WORKSPACE_MAP[section]);
599
- if (has("plugins") && opts.plugins) for (const plugin of opts.plugins) workspacePackages.push(`plugins/${plugin}`);
621
+ if (has("plugins")) workspacePackages.push("plugins/*");
600
622
  const catalog = resolveFrameworkCatalog();
601
623
  const pkg = {
602
624
  name: opts.domain || opts.extendsGateway,
@@ -660,47 +682,29 @@ async function resolveWorkspaceRefs(destination, options) {
660
682
  }
661
683
  }
662
684
  }
663
- async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns, options) {
664
- const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
665
- const has = (section) => options.overrides.includes(section);
666
- if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
667
- const excludedRoutePatterns = [];
668
- if (options.pluginRoutes) {
669
- for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
670
- }
685
+ async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns, _options) {
671
686
  const allFiles = /* @__PURE__ */ new Set();
672
- for (const pattern of effectivePatterns) {
687
+ for (const pattern of patterns) {
673
688
  const matches = await glob(pattern, {
674
689
  cwd: sourceDir,
675
690
  nodir: true,
676
691
  dot: true,
677
- absolute: false
692
+ absolute: false,
693
+ ignore: [
694
+ "**/node_modules/**",
695
+ "**/.git/**",
696
+ "**/dist/**",
697
+ "**/.bos/**"
698
+ ]
678
699
  });
679
- for (const match of matches) {
680
- const pluginMatch = match.match(/^plugins\/([^/]+)/);
681
- if (pluginMatch && !(options.plugins?.includes(pluginMatch[1]) ?? true)) continue;
682
- if (isPathExcluded(match, excludedRoutePatterns)) continue;
683
- allFiles.add(match);
684
- }
685
- }
686
- if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
687
- if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
688
- for (const rp of routePatterns) {
689
- const matches = await glob(rp, {
690
- cwd: sourceDir,
691
- nodir: true,
692
- dot: true,
693
- absolute: false
694
- });
695
- for (const match of matches) if (!isPathExcluded(match, excludedRoutePatterns)) allFiles.add(match);
696
- }
700
+ for (const match of matches) allFiles.add(match);
697
701
  }
698
702
  const fileHashes = {};
699
703
  for (const filePath of allFiles) {
700
704
  const src = join(sourceDir, filePath);
701
705
  if (!lstatSync(src).isFile()) continue;
702
706
  const content = readFileSync(src);
703
- const destPath = filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
707
+ const destPath = sourcePathToDestinationPath(filePath);
704
708
  fileHashes[destPath] = computeHash(content);
705
709
  }
706
710
  await writeSnapshot(destination, {
@@ -785,5 +789,5 @@ dist/
785
789
  }
786
790
 
787
791
  //#endregion
788
- export { copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig, readTemplatekeep, removeInitLockfile, resolveRepositoryViaExtendsChain, resolveSourceDir, runBunInstall, runBunInstallForUpgrade, runDockerComposeUp, runTypesGen, scaffoldMinimalProject, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot };
792
+ export { INIT_ROOT_PATTERNS, buildInitPatterns, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, fetchParentConfig, generateDatabaseMigrations, personalizeConfig, removeInitLockfile, resolveRepositoryViaExtendsChain, resolveSourceDir, runBunInstall, runBunInstallForUpgrade, runDockerComposeUp, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, stripOrphanedWorkspacesFromLockfile, writeInitSnapshot };
789
793
  //# sourceMappingURL=init.mjs.map