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.
- package/dist/api-contract.cjs.map +1 -1
- package/dist/api-contract.mjs.map +1 -1
- package/dist/cli/catalog.cjs.map +1 -1
- package/dist/cli/catalog.mjs.map +1 -1
- package/dist/cli/framework-version.cjs.map +1 -1
- package/dist/cli/framework-version.mjs.map +1 -1
- package/dist/cli/infra.cjs +1 -1
- package/dist/cli/infra.cjs.map +1 -1
- package/dist/cli/infra.mjs +1 -1
- package/dist/cli/infra.mjs.map +1 -1
- package/dist/cli/init.cjs +127 -121
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +6 -6
- package/dist/cli/init.d.cts.map +1 -1
- package/dist/cli/init.d.mts +6 -6
- package/dist/cli/init.d.mts.map +1 -1
- package/dist/cli/init.mjs +125 -121
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/parse.cjs.map +1 -1
- package/dist/cli/parse.mjs.map +1 -1
- package/dist/cli/prompts.cjs +29 -25
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +28 -25
- package/dist/cli/prompts.mjs.map +1 -1
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.mjs.map +1 -1
- package/dist/cli/sync.cjs +46 -93
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +49 -96
- package/dist/cli/sync.mjs.map +1 -1
- package/dist/cli/timing.cjs.map +1 -1
- package/dist/cli/timing.mjs.map +1 -1
- package/dist/cli/upgrade.cjs +41 -20
- package/dist/cli/upgrade.cjs.map +1 -1
- package/dist/cli/upgrade.mjs +43 -22
- package/dist/cli/upgrade.mjs.map +1 -1
- package/dist/cli.cjs +187 -12
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +187 -12
- package/dist/cli.mjs.map +1 -1
- package/dist/components/dev-view.cjs.map +1 -1
- package/dist/components/dev-view.mjs.map +1 -1
- package/dist/components/streaming-view.cjs.map +1 -1
- package/dist/components/streaming-view.mjs.map +1 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contract.cjs +174 -173
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +48 -44
- package/dist/contract.d.cts.map +1 -1
- package/dist/contract.d.mts +48 -44
- package/dist/contract.d.mts.map +1 -1
- package/dist/contract.mjs +3 -1
- package/dist/contract.mjs.map +1 -1
- package/dist/dev-logs.cjs.map +1 -1
- package/dist/dev-logs.mjs.map +1 -1
- package/dist/dev-session.cjs +0 -1
- package/dist/dev-session.mjs +1 -1
- package/dist/fastkv.cjs.map +1 -1
- package/dist/fastkv.mjs.map +1 -1
- package/dist/index.cjs +2 -4
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -2
- package/dist/integrity.cjs.map +1 -1
- package/dist/integrity.mjs.map +1 -1
- package/dist/internal/manifest-normalizer.cjs.map +1 -1
- package/dist/internal/manifest-normalizer.mjs.map +1 -1
- package/dist/merge.cjs.map +1 -1
- package/dist/merge.mjs.map +1 -1
- package/dist/near-cli.cjs +1 -1
- package/dist/near-cli.cjs.map +1 -1
- package/dist/near-cli.mjs +1 -1
- package/dist/near-cli.mjs.map +1 -1
- package/dist/orchestrator.cjs +1 -1
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs +1 -1
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/plugin.cjs +182 -171
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +72 -39
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +71 -39
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +170 -160
- package/dist/plugin.mjs.map +1 -1
- package/dist/sdk.cjs +2 -2
- package/dist/sdk.d.cts +1 -1
- package/dist/sdk.d.mts +1 -1
- package/dist/sdk.mjs +1 -1
- package/dist/service-descriptor.d.cts +34 -0
- package/dist/service-descriptor.d.cts.map +1 -0
- package/dist/service-descriptor.d.mts +36 -0
- package/dist/service-descriptor.d.mts.map +1 -0
- package/dist/shared.cjs.map +1 -1
- package/dist/shared.mjs.map +1 -1
- package/dist/types.cjs +184 -184
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +5 -5
- package/dist/types.d.mts +5 -5
- package/dist/types.mjs +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/ui/types.d.cts +1 -0
- package/dist/ui/types.d.cts.map +1 -1
- package/dist/ui/types.d.mts +1 -0
- package/dist/ui/types.d.mts.map +1 -1
- package/dist/utils/banner.cjs.map +1 -1
- package/dist/utils/banner.mjs.map +1 -1
- package/dist/utils/run.cjs.map +1 -1
- package/dist/utils/run.mjs.map +1 -1
- package/package.json +3 -3
- package/skills/init-upgrade/SKILL.md +22 -16
- package/skills/publish-sync/SKILL.md +7 -18
- package/dist/utils/path-match.cjs +0 -18
- package/dist/utils/path-match.cjs.map +0 -1
- package/dist/utils/path-match.mjs +0 -17
- package/dist/utils/path-match.mjs.map +0 -1
- package/src/api-contract.ts +0 -623
- package/src/app.ts +0 -193
- package/src/cli/catalog.ts +0 -49
- package/src/cli/framework-version.ts +0 -61
- package/src/cli/help.ts +0 -13
- package/src/cli/infra.ts +0 -190
- package/src/cli/init.ts +0 -1202
- package/src/cli/parse.ts +0 -147
- package/src/cli/prompts.ts +0 -135
- package/src/cli/snapshot.ts +0 -46
- package/src/cli/status.ts +0 -99
- package/src/cli/sync.ts +0 -518
- package/src/cli/timing.ts +0 -63
- package/src/cli/upgrade.ts +0 -828
- package/src/cli.ts +0 -516
- package/src/components/dev-view.tsx +0 -352
- package/src/components/streaming-view.ts +0 -177
- package/src/config.ts +0 -893
- package/src/contract.meta.ts +0 -140
- package/src/contract.ts +0 -325
- package/src/dev-logs.ts +0 -92
- package/src/dev-session.ts +0 -283
- package/src/fastkv.ts +0 -181
- package/src/index.ts +0 -8
- package/src/integrity.ts +0 -138
- package/src/internal/manifest-normalizer.ts +0 -290
- package/src/merge.ts +0 -187
- package/src/mf.ts +0 -147
- package/src/near-cli.ts +0 -259
- package/src/network.ts +0 -3
- package/src/orchestrator.ts +0 -493
- package/src/plugin.ts +0 -1821
- package/src/sdk.ts +0 -14
- package/src/service-descriptor.ts +0 -281
- package/src/shared.ts +0 -249
- package/src/sidebar.ts +0 -140
- package/src/types.ts +0 -330
- package/src/ui/head.ts +0 -83
- package/src/ui/index.ts +0 -5
- package/src/ui/metadata.ts +0 -95
- package/src/ui/router.ts +0 -88
- package/src/ui/runtime.ts +0 -42
- package/src/ui/types.ts +0 -64
- package/src/utils/banner.ts +0 -21
- package/src/utils/linkify.ts +0 -11
- package/src/utils/path-match.ts +0 -16
- package/src/utils/run.ts +0 -31
- package/src/utils/save-config.ts +0 -20
- 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
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
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")
|
|
321
|
-
|
|
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
|
|
329
|
-
|
|
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"
|
|
332
|
-
rewrite("dev:ui"
|
|
333
|
-
rewrite("dev:api"
|
|
334
|
-
rewrite("dev:proxy"
|
|
335
|
-
rewrite("build"
|
|
336
|
-
rewrite("deploy"
|
|
337
|
-
rewrite("publish"
|
|
338
|
-
rewrite("start"
|
|
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
|
-
|
|
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)
|
|
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
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
const
|
|
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
|
-
}
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
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")
|
|
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,
|
|
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
|
|
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 =
|
|
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,
|
|
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
|