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.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,24 @@ 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
|
+
"railway.json",
|
|
27
|
+
".agent/**",
|
|
28
|
+
"AGENTS.md",
|
|
29
|
+
".opencode/skills/everything-dev/**",
|
|
30
|
+
".changeset/config.json",
|
|
31
|
+
".changeset/README.md",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CONTRIBUTING.md",
|
|
34
|
+
".github/templates/**"
|
|
35
|
+
];
|
|
19
36
|
const FRAMEWORK_PACKAGES = ["every-plugin", "everything-dev"];
|
|
20
37
|
const OVERRIDE_WORKSPACE_MAP = {
|
|
21
38
|
ui: ["ui"],
|
|
@@ -57,13 +74,18 @@ async function resolveSourceDir(opts) {
|
|
|
57
74
|
cleanup: async () => {}
|
|
58
75
|
};
|
|
59
76
|
}
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
77
|
+
function buildInitPatterns(overrides, plugins) {
|
|
78
|
+
const has = (section) => overrides.includes(section);
|
|
79
|
+
const patterns = [...INIT_ROOT_PATTERNS];
|
|
80
|
+
if (has("ui")) patterns.push("ui/**");
|
|
81
|
+
if (has("api")) patterns.push("api/**");
|
|
82
|
+
if (has("host")) patterns.push("host/**");
|
|
83
|
+
if (has("plugins")) for (const plugin of plugins ?? []) patterns.push(`plugins/${plugin}/**`);
|
|
65
84
|
return patterns;
|
|
66
85
|
}
|
|
86
|
+
function sourcePathToDestinationPath(filePath) {
|
|
87
|
+
return filePath.startsWith(".github/templates/") ? filePath.replace(/^\.github\/templates\//, ".github/") : filePath;
|
|
88
|
+
}
|
|
67
89
|
async function fetchParentConfig(extendsAccount, extendsGateway) {
|
|
68
90
|
return require_fastkv.fetchBosConfigFromFastKv(`bos://${extendsAccount}/${extendsGateway}`);
|
|
69
91
|
}
|
|
@@ -187,62 +209,30 @@ function parseGitHubUrl(url) {
|
|
|
187
209
|
};
|
|
188
210
|
return null;
|
|
189
211
|
}
|
|
190
|
-
function
|
|
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) {
|
|
212
|
+
async function copyFilteredFiles(sourceDir, destination, patterns, _options) {
|
|
200
213
|
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
214
|
const allFiles = /* @__PURE__ */ new Set();
|
|
209
|
-
for (const pattern of
|
|
215
|
+
for (const pattern of patterns) {
|
|
210
216
|
const matches = await (0, glob.glob)(pattern, {
|
|
211
217
|
cwd: sourceDir,
|
|
212
218
|
nodir: true,
|
|
213
219
|
dot: true,
|
|
214
|
-
absolute: false
|
|
220
|
+
absolute: false,
|
|
221
|
+
ignore: [
|
|
222
|
+
"**/node_modules/**",
|
|
223
|
+
"**/.git/**",
|
|
224
|
+
"**/dist/**",
|
|
225
|
+
"**/.bos/**"
|
|
226
|
+
]
|
|
215
227
|
});
|
|
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
|
-
}
|
|
225
|
-
}
|
|
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
|
-
}
|
|
228
|
+
for (const match of matches) allFiles.add(match);
|
|
238
229
|
}
|
|
239
|
-
for (const f of routeFiles) allFiles.add(f);
|
|
240
230
|
(0, node_fs.mkdirSync)(destination, { recursive: true });
|
|
241
231
|
let count = 0;
|
|
242
232
|
for (const filePath of allFiles) {
|
|
243
233
|
const src = (0, node_path.join)(sourceDir, filePath);
|
|
244
234
|
if (!(0, node_fs.lstatSync)(src).isFile()) continue;
|
|
245
|
-
const dest = (0, node_path.join)(destination,
|
|
235
|
+
const dest = (0, node_path.join)(destination, sourcePathToDestinationPath(filePath));
|
|
246
236
|
(0, node_fs.mkdirSync)((0, node_path.dirname)(dest), { recursive: true });
|
|
247
237
|
(0, node_fs.writeFileSync)(dest, (0, node_fs.readFileSync)(src));
|
|
248
238
|
count++;
|
|
@@ -314,37 +304,38 @@ async function personalizeConfig(destination, opts) {
|
|
|
314
304
|
ws.packages = ws.packages.filter((p) => {
|
|
315
305
|
if (p.startsWith("packages/")) return false;
|
|
316
306
|
if (p === "host") return has("host");
|
|
317
|
-
if (p
|
|
318
|
-
const pluginMatch = p.match(/^plugins\/([^/]+)/);
|
|
319
|
-
if (pluginMatch) return has("plugins") && (opts.plugins?.includes(pluginMatch[1]) ?? true);
|
|
307
|
+
if (p.startsWith("plugins/")) return false;
|
|
320
308
|
return true;
|
|
321
309
|
});
|
|
322
|
-
if (has("plugins")
|
|
323
|
-
|
|
324
|
-
if (!ws.packages.includes(pluginWorkspace)) ws.packages.push(pluginWorkspace);
|
|
310
|
+
if (has("plugins")) {
|
|
311
|
+
if (!ws.packages.includes("plugins/*")) ws.packages.push("plugins/*");
|
|
325
312
|
}
|
|
326
313
|
}
|
|
327
314
|
}
|
|
328
315
|
if (pkg.scripts && typeof pkg.scripts === "object") {
|
|
329
316
|
const scripts = pkg.scripts;
|
|
330
|
-
const
|
|
331
|
-
|
|
317
|
+
const FROM = "bun packages/everything-dev/src/cli.ts";
|
|
318
|
+
const TO = "node_modules/.bin/bos";
|
|
319
|
+
const rewrite = (key) => {
|
|
320
|
+
if (scripts[key]?.includes(FROM)) scripts[key] = scripts[key].replaceAll(FROM, TO);
|
|
332
321
|
};
|
|
333
|
-
rewrite("dev"
|
|
334
|
-
rewrite("dev:ui"
|
|
335
|
-
rewrite("dev:api"
|
|
336
|
-
rewrite("dev:proxy"
|
|
337
|
-
rewrite("build"
|
|
338
|
-
rewrite("deploy"
|
|
339
|
-
rewrite("publish"
|
|
340
|
-
rewrite("start"
|
|
322
|
+
rewrite("dev");
|
|
323
|
+
rewrite("dev:ui");
|
|
324
|
+
rewrite("dev:api");
|
|
325
|
+
rewrite("dev:proxy");
|
|
326
|
+
rewrite("build");
|
|
327
|
+
rewrite("deploy");
|
|
328
|
+
rewrite("publish");
|
|
329
|
+
rewrite("start");
|
|
330
|
+
rewrite("bos");
|
|
341
331
|
scripts.postinstall = "node_modules/.bin/bos types gen || true";
|
|
342
332
|
scripts["types:gen"] = "node_modules/.bin/bos types gen";
|
|
343
333
|
if (scripts.typecheck) {
|
|
344
334
|
scripts.typecheck = scripts.typecheck.replace("bun run types:gen && ", "").replace(/bun run --cwd packages\/everything-dev typecheck & ?/, "");
|
|
335
|
+
if (!has("ui")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd ui tsc --noEmit & ?/, "");
|
|
336
|
+
if (!has("api")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd api tsc --noEmit & ?/, "");
|
|
345
337
|
if (!has("host")) scripts.typecheck = scripts.typecheck.replace(/bun run --cwd host tsc --noEmit & ?/, "");
|
|
346
338
|
}
|
|
347
|
-
if (!scripts.bos) scripts.bos = "node_modules/.bin/bos";
|
|
348
339
|
}
|
|
349
340
|
if (pkg.devDependencies && typeof pkg.devDependencies === "object") {
|
|
350
341
|
const deps = pkg.devDependencies;
|
|
@@ -464,7 +455,22 @@ async function runBunInstallForUpgrade(destination, spinner) {
|
|
|
464
455
|
await runWithProgress("bun", ["install", "--force"], destination, spinner, "Installing dependencies");
|
|
465
456
|
}
|
|
466
457
|
async function runTypesGen(destination, spinner) {
|
|
467
|
-
|
|
458
|
+
if ((0, node_fs.existsSync)((0, node_path.join)(destination, "node_modules", ".bin", "bos"))) {
|
|
459
|
+
await runWithProgress("node_modules/.bin/bos", ["types", "gen"], destination, spinner, "Generating types");
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if ((0, node_fs.existsSync)((0, node_path.join)(destination, "packages", "everything-dev", "src", "cli.ts"))) {
|
|
463
|
+
await runWithProgress("bun", [
|
|
464
|
+
"run",
|
|
465
|
+
"--cwd",
|
|
466
|
+
"packages/everything-dev",
|
|
467
|
+
"src/cli.ts",
|
|
468
|
+
"types",
|
|
469
|
+
"gen"
|
|
470
|
+
], destination, spinner, "Generating types");
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
throw new Error("Unable to locate bos CLI for types generation");
|
|
468
474
|
}
|
|
469
475
|
async function runDockerComposeUp(destination) {
|
|
470
476
|
await execCommand("docker", [
|
|
@@ -508,7 +514,9 @@ function stripOrphanedWorkspacesFromLockfile(lockfilePath, allowedWorkspaces) {
|
|
|
508
514
|
const allowed = new Set(["", ...allowedWorkspaces]);
|
|
509
515
|
const keys = Object.keys(workspaceMap);
|
|
510
516
|
let changed = false;
|
|
511
|
-
for (const key of keys)
|
|
517
|
+
for (const key of keys) {
|
|
518
|
+
if (allowed.has(key)) continue;
|
|
519
|
+
if (allowedWorkspaces.some((pattern) => pattern.endsWith("/*") && key.startsWith(pattern.slice(0, -1)))) continue;
|
|
512
520
|
delete workspaceMap[key];
|
|
513
521
|
changed = true;
|
|
514
522
|
}
|
|
@@ -522,32 +530,46 @@ const WORKSPACE_LOCAL_PATHS = {
|
|
|
522
530
|
"everything-dev": "packages/everything-dev",
|
|
523
531
|
"every-plugin": "packages/every-plugin"
|
|
524
532
|
};
|
|
533
|
+
function readJsonFile(filePath) {
|
|
534
|
+
return JSON.parse((0, node_fs.readFileSync)(filePath, "utf-8"));
|
|
535
|
+
}
|
|
536
|
+
function tryResolvePackageJson(packageName) {
|
|
537
|
+
try {
|
|
538
|
+
return require$1.resolve(`${packageName}/package.json`);
|
|
539
|
+
} catch {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
525
543
|
function resolveFrameworkCatalog() {
|
|
526
544
|
const catalog = {};
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
const
|
|
545
|
+
const everythingDevPackageJson = tryResolvePackageJson("everything-dev");
|
|
546
|
+
if (everythingDevPackageJson) {
|
|
547
|
+
try {
|
|
548
|
+
const monorepoPkgPath = (0, node_path.join)((0, node_path.dirname)(everythingDevPackageJson), "..", "..", "package.json");
|
|
549
|
+
if ((0, node_fs.existsSync)(monorepoPkgPath)) {
|
|
550
|
+
const sourceCatalog = readJsonFile(monorepoPkgPath).workspaces?.catalog;
|
|
551
|
+
if (sourceCatalog && typeof sourceCatalog === "object") {
|
|
552
|
+
for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
} catch {}
|
|
556
|
+
try {
|
|
557
|
+
const selfPkg = readJsonFile(everythingDevPackageJson);
|
|
558
|
+
if (selfPkg.version && !catalog["everything-dev"]) catalog["everything-dev"] = `^${selfPkg.version}`;
|
|
559
|
+
const sourceCatalog = selfPkg.workspaces?.catalog;
|
|
531
560
|
if (sourceCatalog && typeof sourceCatalog === "object") {
|
|
532
|
-
for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string") catalog[name] = version;
|
|
561
|
+
for (const [name, version] of Object.entries(sourceCatalog)) if (typeof version === "string" && !catalog[name]) catalog[name] = version;
|
|
533
562
|
}
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
} catch {}
|
|
545
|
-
if (Object.keys(catalog).length > 0) return catalog;
|
|
546
|
-
for (const packageName of FRAMEWORK_PACKAGES) try {
|
|
547
|
-
const resolved = require$1.resolve(`${packageName}/package.json`);
|
|
548
|
-
const pkg = JSON.parse((0, node_fs.readFileSync)(resolved, "utf-8"));
|
|
549
|
-
if (pkg.version) catalog[packageName] = `^${pkg.version}`;
|
|
550
|
-
} catch {}
|
|
563
|
+
} catch {}
|
|
564
|
+
}
|
|
565
|
+
for (const packageName of FRAMEWORK_PACKAGES) {
|
|
566
|
+
const resolved = tryResolvePackageJson(packageName);
|
|
567
|
+
if (!resolved) continue;
|
|
568
|
+
try {
|
|
569
|
+
const pkg = readJsonFile(resolved);
|
|
570
|
+
if (pkg.version) catalog[packageName] = `^${pkg.version}`;
|
|
571
|
+
} catch {}
|
|
572
|
+
}
|
|
551
573
|
return catalog;
|
|
552
574
|
}
|
|
553
575
|
async function scaffoldMinimalProject(destination, parentConfig, opts) {
|
|
@@ -598,7 +620,7 @@ async function scaffoldMinimalProject(destination, parentConfig, opts) {
|
|
|
598
620
|
await require_save_config.saveBosConfig(destination, config);
|
|
599
621
|
const workspacePackages = [];
|
|
600
622
|
for (const section of opts.overrides) workspacePackages.push(...OVERRIDE_WORKSPACE_MAP[section]);
|
|
601
|
-
if (has("plugins")
|
|
623
|
+
if (has("plugins")) workspacePackages.push("plugins/*");
|
|
602
624
|
const catalog = resolveFrameworkCatalog();
|
|
603
625
|
const pkg = {
|
|
604
626
|
name: opts.domain || opts.extendsGateway,
|
|
@@ -662,47 +684,29 @@ async function resolveWorkspaceRefs(destination, options) {
|
|
|
662
684
|
}
|
|
663
685
|
}
|
|
664
686
|
}
|
|
665
|
-
async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns,
|
|
666
|
-
const effectivePatterns = filterPatternsByOverrides(patterns, options.overrides, options.plugins);
|
|
667
|
-
const has = (section) => options.overrides.includes(section);
|
|
668
|
-
if (has("host") && !effectivePatterns.some((p) => p.startsWith("host/") || p === "host/**")) effectivePatterns.push("host/**");
|
|
669
|
-
const excludedRoutePatterns = [];
|
|
670
|
-
if (options.pluginRoutes) {
|
|
671
|
-
for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) if (!(options.plugins?.includes(pluginKey) ?? true)) excludedRoutePatterns.push(...routePatterns);
|
|
672
|
-
}
|
|
687
|
+
async function writeInitSnapshot(destination, extendsAccount, extendsGateway, sourceDir, patterns, _options) {
|
|
673
688
|
const allFiles = /* @__PURE__ */ new Set();
|
|
674
|
-
for (const pattern of
|
|
689
|
+
for (const pattern of patterns) {
|
|
675
690
|
const matches = await (0, glob.glob)(pattern, {
|
|
676
691
|
cwd: sourceDir,
|
|
677
692
|
nodir: true,
|
|
678
693
|
dot: true,
|
|
679
|
-
absolute: false
|
|
694
|
+
absolute: false,
|
|
695
|
+
ignore: [
|
|
696
|
+
"**/node_modules/**",
|
|
697
|
+
"**/.git/**",
|
|
698
|
+
"**/dist/**",
|
|
699
|
+
"**/.bos/**"
|
|
700
|
+
]
|
|
680
701
|
});
|
|
681
|
-
for (const match of matches)
|
|
682
|
-
const pluginMatch = match.match(/^plugins\/([^/]+)/);
|
|
683
|
-
if (pluginMatch && !(options.plugins?.includes(pluginMatch[1]) ?? true)) continue;
|
|
684
|
-
if (require_path_match.isPathExcluded(match, excludedRoutePatterns)) continue;
|
|
685
|
-
allFiles.add(match);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
if (options.pluginRoutes) for (const [pluginKey, routePatterns] of Object.entries(options.pluginRoutes)) {
|
|
689
|
-
if (!(options.plugins?.includes(pluginKey) ?? true)) continue;
|
|
690
|
-
for (const rp of routePatterns) {
|
|
691
|
-
const matches = await (0, glob.glob)(rp, {
|
|
692
|
-
cwd: sourceDir,
|
|
693
|
-
nodir: true,
|
|
694
|
-
dot: true,
|
|
695
|
-
absolute: false
|
|
696
|
-
});
|
|
697
|
-
for (const match of matches) if (!require_path_match.isPathExcluded(match, excludedRoutePatterns)) allFiles.add(match);
|
|
698
|
-
}
|
|
702
|
+
for (const match of matches) allFiles.add(match);
|
|
699
703
|
}
|
|
700
704
|
const fileHashes = {};
|
|
701
705
|
for (const filePath of allFiles) {
|
|
702
706
|
const src = (0, node_path.join)(sourceDir, filePath);
|
|
703
707
|
if (!(0, node_fs.lstatSync)(src).isFile()) continue;
|
|
704
708
|
const content = (0, node_fs.readFileSync)(src);
|
|
705
|
-
const destPath =
|
|
709
|
+
const destPath = sourcePathToDestinationPath(filePath);
|
|
706
710
|
fileHashes[destPath] = computeHash(content);
|
|
707
711
|
}
|
|
708
712
|
await require_snapshot.writeSnapshot(destination, {
|
|
@@ -787,6 +791,8 @@ dist/
|
|
|
787
791
|
}
|
|
788
792
|
|
|
789
793
|
//#endregion
|
|
794
|
+
exports.INIT_ROOT_PATTERNS = INIT_ROOT_PATTERNS;
|
|
795
|
+
exports.buildInitPatterns = buildInitPatterns;
|
|
790
796
|
exports.copyFilteredFiles = copyFilteredFiles;
|
|
791
797
|
exports.detectGitRemoteUrl = detectGitRemoteUrl;
|
|
792
798
|
exports.downloadTarball = downloadTarball;
|
|
@@ -794,7 +800,6 @@ exports.execCommand = execCommand;
|
|
|
794
800
|
exports.fetchParentConfig = fetchParentConfig;
|
|
795
801
|
exports.generateDatabaseMigrations = generateDatabaseMigrations;
|
|
796
802
|
exports.personalizeConfig = personalizeConfig;
|
|
797
|
-
exports.readTemplatekeep = readTemplatekeep;
|
|
798
803
|
exports.removeInitLockfile = removeInitLockfile;
|
|
799
804
|
exports.resolveRepositoryViaExtendsChain = resolveRepositoryViaExtendsChain;
|
|
800
805
|
exports.resolveSourceDir = resolveSourceDir;
|
|
@@ -803,6 +808,7 @@ exports.runBunInstallForUpgrade = runBunInstallForUpgrade;
|
|
|
803
808
|
exports.runDockerComposeUp = runDockerComposeUp;
|
|
804
809
|
exports.runTypesGen = runTypesGen;
|
|
805
810
|
exports.scaffoldMinimalProject = scaffoldMinimalProject;
|
|
811
|
+
exports.sourcePathToDestinationPath = sourcePathToDestinationPath;
|
|
806
812
|
exports.stripOrphanedWorkspacesFromLockfile = stripOrphanedWorkspacesFromLockfile;
|
|
807
813
|
exports.writeInitSnapshot = writeInitSnapshot;
|
|
808
814
|
//# sourceMappingURL=init.cjs.map
|