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.
- 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.map +1 -1
- package/dist/cli/infra.mjs.map +1 -1
- package/dist/cli/init.cjs +127 -114
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +7 -6
- package/dist/cli/init.d.cts.map +1 -1
- package/dist/cli/init.d.mts +7 -6
- package/dist/cli/init.d.mts.map +1 -1
- package/dist/cli/init.mjs +124 -114
- 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 +3 -3
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +2 -2
- 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 +42 -92
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +45 -95
- 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 +43 -22
- package/dist/cli/upgrade.cjs.map +1 -1
- package/dist/cli/upgrade.mjs +44 -23
- package/dist/cli/upgrade.mjs.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- 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 +3 -3
- package/dist/contract.d.cts.map +1 -1
- package/dist/contract.d.mts +3 -3
- package/dist/contract.d.mts.map +1 -1
- package/dist/contract.meta.cjs +1 -1
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +1 -1
- package/dist/contract.meta.d.mts +1 -1
- package/dist/contract.meta.mjs +1 -1
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +2 -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/fastkv.cjs.map +1 -1
- package/dist/fastkv.mjs.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- 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.map +1 -1
- package/dist/near-cli.mjs.map +1 -1
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/plugin.cjs +72 -50
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +2 -2
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +53 -32
- 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/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 +3 -3
- package/dist/types.d.mts +3 -3
- 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 +2 -2
- package/skills/init-upgrade/SKILL.md +22 -16
- package/skills/publish-sync/SKILL.md +7 -18
- package/src/cli/init.ts +149 -195
- package/src/cli/prompts.ts +1 -1
- package/src/cli/sync.ts +48 -137
- package/src/cli/upgrade.ts +66 -25
- package/src/contract.meta.ts +1 -1
- package/src/contract.ts +2 -1
- package/src/plugin.ts +69 -34
- package/src/sdk.ts +1 -1
- package/src/types.ts +1 -1
- package/src/ui/types.ts +1 -0
- 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/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
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
331
|
-
|
|
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"
|
|
334
|
-
rewrite("dev:ui"
|
|
335
|
-
rewrite("dev:api"
|
|
336
|
-
rewrite("dev:proxy"
|
|
337
|
-
rewrite("build"
|
|
338
|
-
rewrite("deploy"
|
|
339
|
-
rewrite("publish"
|
|
340
|
-
rewrite("start"
|
|
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
|
-
|
|
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
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
const
|
|
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
|
-
}
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
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,
|
|
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
|
|
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 =
|
|
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.
|
|
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
|