everything-dev 0.0.11 → 0.0.13
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/package.json +15 -31
- package/src/cli.ts +82 -0
- package/src/contract.ts +41 -0
- package/src/lib/orchestrator.ts +1 -1
- package/src/lib/process.ts +1 -1
- package/src/plugin.ts +198 -8
- package/src/types.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "everything-dev",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -13,25 +13,6 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"catalog": {
|
|
17
|
-
"react": "^19.2.3",
|
|
18
|
-
"react-dom": "^19.2.3",
|
|
19
|
-
"@tanstack/react-query": "^5.90.11",
|
|
20
|
-
"@tanstack/react-router": "^1.153.2",
|
|
21
|
-
"@hot-labs/near-connect": "^0.8.2",
|
|
22
|
-
"near-kit": "^0.10.0",
|
|
23
|
-
"better-auth": "^1.4.6",
|
|
24
|
-
"better-near-auth": "^0.3.4",
|
|
25
|
-
"every-plugin": "0.8.9",
|
|
26
|
-
"drizzle-orm": "^0.45.1",
|
|
27
|
-
"drizzle-kit": "^0.31.8",
|
|
28
|
-
"@libsql/client": "^0.17.0",
|
|
29
|
-
"typescript": "^5.9.3",
|
|
30
|
-
"vitest": "^4.0.17",
|
|
31
|
-
"@types/node": "^25.0.3",
|
|
32
|
-
"@types/react": "^19.2.7",
|
|
33
|
-
"@types/react-dom": "^19.2.3"
|
|
34
|
-
},
|
|
35
16
|
"bin": {
|
|
36
17
|
"bos": "./src/cli.ts"
|
|
37
18
|
},
|
|
@@ -40,33 +21,36 @@
|
|
|
40
21
|
"typecheck": "tsc --noEmit"
|
|
41
22
|
},
|
|
42
23
|
"dependencies": {
|
|
43
|
-
"@clack/prompts": "^0.
|
|
44
|
-
"@effect/platform": "^0.
|
|
45
|
-
"@effect/platform-bun": "^0.
|
|
24
|
+
"@clack/prompts": "^1.0.0",
|
|
25
|
+
"@effect/platform": "^0.94.2",
|
|
26
|
+
"@effect/platform-bun": "^0.87.1",
|
|
27
|
+
"effect": "3.19.15",
|
|
28
|
+
"zod": "4.3.5",
|
|
46
29
|
"@hono/node-server": "^1.19.9",
|
|
47
|
-
"@module-federation/enhanced": "^0.13.0",
|
|
48
|
-
"@module-federation/runtime-core": "^0.13.0",
|
|
49
30
|
"@inquirer/prompts": "^8.2.0",
|
|
50
31
|
"@libsql/client": "^0.17.0",
|
|
32
|
+
"@module-federation/enhanced": "^0.23.0",
|
|
33
|
+
"@module-federation/runtime-core": "^0.23.0",
|
|
51
34
|
"borsh": "^2.0.0",
|
|
52
35
|
"boxen": "^8.0.1",
|
|
53
36
|
"chalk": "^5.6.2",
|
|
54
37
|
"commander": "^14.0.2",
|
|
55
38
|
"degit": "^2.8.4",
|
|
56
|
-
"
|
|
57
|
-
"every-plugin": "0.8.9",
|
|
39
|
+
"every-plugin": "0.9.0",
|
|
58
40
|
"execa": "^9.6.1",
|
|
59
41
|
"gradient-string": "^3.0.0",
|
|
60
42
|
"ink": "^5.2.1",
|
|
61
|
-
"near-kit": "^0.
|
|
62
|
-
"near-social-js": "^2.0.
|
|
63
|
-
"nova-sdk-js": "^1.0.
|
|
43
|
+
"near-kit": "^0.10.0",
|
|
44
|
+
"near-social-js": "^2.0.4",
|
|
45
|
+
"nova-sdk-js": "^1.0.3",
|
|
64
46
|
"open": "^11.0.0",
|
|
65
|
-
"react": "
|
|
47
|
+
"react": "18.3.1",
|
|
48
|
+
"react-dom": "18.3.1"
|
|
66
49
|
},
|
|
67
50
|
"devDependencies": {
|
|
68
51
|
"@types/bun": "latest",
|
|
69
52
|
"@types/react": "^18.3.0",
|
|
53
|
+
"@types/react-dom": "^18.3.0",
|
|
70
54
|
"@types/gradient-string": "^1.1.6",
|
|
71
55
|
"typescript": "^5.9.3"
|
|
72
56
|
}
|
package/src/cli.ts
CHANGED
|
@@ -701,6 +701,88 @@ Zephyr Configuration:
|
|
|
701
701
|
console.log();
|
|
702
702
|
});
|
|
703
703
|
|
|
704
|
+
const depsCmd = program
|
|
705
|
+
.command("deps")
|
|
706
|
+
.description("Manage shared dependencies");
|
|
707
|
+
|
|
708
|
+
depsCmd
|
|
709
|
+
.command("update")
|
|
710
|
+
.description("Interactive update of shared dependencies (bun update -i style)")
|
|
711
|
+
.argument("[category]", "Dependency category (ui | api)", "ui")
|
|
712
|
+
.action(async (category: string) => {
|
|
713
|
+
console.log();
|
|
714
|
+
console.log(` ${icons.pkg} Updating shared.${category} dependencies...`);
|
|
715
|
+
|
|
716
|
+
const result = await client.depsUpdate({
|
|
717
|
+
category: category as "ui" | "api",
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
if (result.status === "error") {
|
|
721
|
+
console.error(colors.error(`${icons.err} ${result.error || "Update failed"}`));
|
|
722
|
+
process.exit(1);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
if (result.status === "cancelled") {
|
|
726
|
+
console.log();
|
|
727
|
+
console.log(colors.dim(" No updates selected"));
|
|
728
|
+
console.log();
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
console.log();
|
|
733
|
+
console.log(colors.cyan(frames.top(52)));
|
|
734
|
+
console.log(` ${icons.ok} ${gradients.cyber("DEPENDENCIES UPDATED")}`);
|
|
735
|
+
console.log(colors.cyan(frames.bottom(52)));
|
|
736
|
+
console.log();
|
|
737
|
+
|
|
738
|
+
for (const { name, from, to } of result.updated) {
|
|
739
|
+
console.log(` ${colors.dim("•")} ${colors.white(name)}`);
|
|
740
|
+
console.log(` ${colors.dim(from)} → ${colors.green(to)}`);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
if (result.syncStatus === "synced") {
|
|
744
|
+
console.log();
|
|
745
|
+
console.log(colors.green(` ${icons.ok} Catalog synced & bun install complete`));
|
|
746
|
+
}
|
|
747
|
+
console.log();
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
depsCmd
|
|
751
|
+
.command("sync")
|
|
752
|
+
.description("Sync bos.config.json shared deps to package.json catalog")
|
|
753
|
+
.argument("[category]", "Dependency category (ui | api)", "ui")
|
|
754
|
+
.option("--no-install", "Skip running bun install")
|
|
755
|
+
.action(async (category: string, options: { install: boolean }) => {
|
|
756
|
+
console.log();
|
|
757
|
+
console.log(` ${icons.pkg} Syncing shared.${category} to catalog...`);
|
|
758
|
+
|
|
759
|
+
const result = await client.depsSync({
|
|
760
|
+
category: category as "ui" | "api",
|
|
761
|
+
install: options.install,
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
if (result.status === "error") {
|
|
765
|
+
console.error(colors.error(`${icons.err} ${result.error || "Sync failed"}`));
|
|
766
|
+
process.exit(1);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
console.log();
|
|
770
|
+
console.log(colors.green(`${icons.ok} Synced ${result.synced.length} dependencies to catalog`));
|
|
771
|
+
|
|
772
|
+
if (result.synced.length > 0) {
|
|
773
|
+
for (const name of result.synced) {
|
|
774
|
+
console.log(` ${colors.dim("•")} ${name}`);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (options.install) {
|
|
779
|
+
console.log(colors.dim(" bun install complete"));
|
|
780
|
+
} else {
|
|
781
|
+
console.log(colors.dim(" Run 'bun install' to update lockfile"));
|
|
782
|
+
}
|
|
783
|
+
console.log();
|
|
784
|
+
});
|
|
785
|
+
|
|
704
786
|
program
|
|
705
787
|
.command("login")
|
|
706
788
|
.description("Login to NOVA for encrypted secrets management")
|
package/src/contract.ts
CHANGED
|
@@ -229,6 +229,33 @@ const SyncResultSchema = z.object({
|
|
|
229
229
|
error: z.string().optional(),
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
+
const DepsUpdateOptionsSchema = z.object({
|
|
233
|
+
category: z.enum(["ui", "api"]).default("ui"),
|
|
234
|
+
packages: z.array(z.string()).optional(),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const DepsUpdateResultSchema = z.object({
|
|
238
|
+
status: z.enum(["updated", "cancelled", "error"]),
|
|
239
|
+
updated: z.array(z.object({
|
|
240
|
+
name: z.string(),
|
|
241
|
+
from: z.string(),
|
|
242
|
+
to: z.string(),
|
|
243
|
+
})),
|
|
244
|
+
syncStatus: z.enum(["synced", "skipped", "error"]).optional(),
|
|
245
|
+
error: z.string().optional(),
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
const DepsSyncOptionsSchema = z.object({
|
|
249
|
+
category: z.enum(["ui", "api"]).default("ui"),
|
|
250
|
+
install: z.boolean().default(true),
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
const DepsSyncResultSchema = z.object({
|
|
254
|
+
status: z.enum(["synced", "error"]),
|
|
255
|
+
synced: z.array(z.string()),
|
|
256
|
+
error: z.string().optional(),
|
|
257
|
+
});
|
|
258
|
+
|
|
232
259
|
export const bosContract = oc.router({
|
|
233
260
|
dev: oc
|
|
234
261
|
.route({ method: "POST", path: "/dev" })
|
|
@@ -325,6 +352,16 @@ export const bosContract = oc.router({
|
|
|
325
352
|
.route({ method: "POST", path: "/sync" })
|
|
326
353
|
.input(SyncOptionsSchema)
|
|
327
354
|
.output(SyncResultSchema),
|
|
355
|
+
|
|
356
|
+
depsUpdate: oc
|
|
357
|
+
.route({ method: "POST", path: "/deps/update" })
|
|
358
|
+
.input(DepsUpdateOptionsSchema)
|
|
359
|
+
.output(DepsUpdateResultSchema),
|
|
360
|
+
|
|
361
|
+
depsSync: oc
|
|
362
|
+
.route({ method: "POST", path: "/deps/sync" })
|
|
363
|
+
.input(DepsSyncOptionsSchema)
|
|
364
|
+
.output(DepsSyncResultSchema),
|
|
328
365
|
});
|
|
329
366
|
|
|
330
367
|
export type BosContract = typeof bosContract;
|
|
@@ -359,3 +396,7 @@ export type LoginResult = z.infer<typeof LoginResultSchema>;
|
|
|
359
396
|
export type LogoutResult = z.infer<typeof LogoutResultSchema>;
|
|
360
397
|
export type SyncOptions = z.infer<typeof SyncOptionsSchema>;
|
|
361
398
|
export type SyncResult = z.infer<typeof SyncResultSchema>;
|
|
399
|
+
export type DepsUpdateOptions = z.infer<typeof DepsUpdateOptionsSchema>;
|
|
400
|
+
export type DepsUpdateResult = z.infer<typeof DepsUpdateResultSchema>;
|
|
401
|
+
export type DepsSyncOptions = z.infer<typeof DepsSyncOptionsSchema>;
|
|
402
|
+
export type DepsSyncResult = z.infer<typeof DepsSyncResultSchema>;
|
package/src/lib/orchestrator.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { appendFile } from "node:fs/promises";
|
|
2
2
|
import { BunContext, BunRuntime } from "@effect/platform-bun";
|
|
3
|
-
import { Effect } from "effect";
|
|
3
|
+
import { Effect } from "every-plugin/effect";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import type { AppConfig } from "../config";
|
|
6
6
|
import {
|
package/src/lib/process.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import { Command } from "@effect/platform";
|
|
3
|
-
import { Deferred, Effect, Fiber, Ref, Stream } from "effect";
|
|
3
|
+
import { Deferred, Effect, Fiber, Ref, Stream } from "every-plugin/effect";
|
|
4
4
|
import { getConfigDir, getPortsFromConfig, type SourceMode } from "../config";
|
|
5
5
|
import type { ProcessStatus } from "../components/dev-view";
|
|
6
6
|
import { loadSecretsFor } from "./secrets";
|
package/src/plugin.ts
CHANGED
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
getRemotes,
|
|
16
16
|
loadConfig,
|
|
17
17
|
type RemoteConfig,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
type SourceMode,
|
|
19
|
+
setConfig
|
|
20
20
|
} from "./config";
|
|
21
21
|
import { bosContract } from "./contract";
|
|
22
22
|
import { getBuildEnv, hasZephyrConfig, loadBosEnv, ZEPHYR_DOCS_URL } from "./lib/env";
|
|
@@ -401,16 +401,15 @@ export default createPlugin({
|
|
|
401
401
|
const bosEnv = yield* loadBosEnv;
|
|
402
402
|
const privateKey = nearPrivateKey || bosEnv.NEAR_PRIVATE_KEY;
|
|
403
403
|
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
});
|
|
404
|
+
const cliVersion = bosConfig.cli?.version;
|
|
405
|
+
if (!cliVersion) {
|
|
406
|
+
return yield* Effect.fail(new Error("bos.config.json is missing 'cli.version'. Add it before publishing."));
|
|
407
|
+
}
|
|
409
408
|
|
|
410
409
|
const configToPublish = {
|
|
411
410
|
...bosConfig,
|
|
412
411
|
cli: {
|
|
413
|
-
version:
|
|
412
|
+
version: cliVersion,
|
|
414
413
|
},
|
|
415
414
|
};
|
|
416
415
|
|
|
@@ -1036,6 +1035,197 @@ export default createPlugin({
|
|
|
1036
1035
|
}
|
|
1037
1036
|
}),
|
|
1038
1037
|
|
|
1038
|
+
depsUpdate: builder.depsUpdate.handler(async ({ input }) => {
|
|
1039
|
+
const { configDir, bosConfig } = deps;
|
|
1040
|
+
|
|
1041
|
+
if (!bosConfig) {
|
|
1042
|
+
return {
|
|
1043
|
+
status: "error" as const,
|
|
1044
|
+
updated: [],
|
|
1045
|
+
error: "No bos.config.json found. Run from a BOS project directory.",
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
const category = input.category;
|
|
1050
|
+
const sharedDeps = bosConfig.shared?.[category];
|
|
1051
|
+
|
|
1052
|
+
if (!sharedDeps || Object.keys(sharedDeps).length === 0) {
|
|
1053
|
+
return {
|
|
1054
|
+
status: "error" as const,
|
|
1055
|
+
updated: [],
|
|
1056
|
+
error: `No shared.${category} dependencies found in bos.config.json`,
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
const { mkdtemp, rm } = await import("fs/promises");
|
|
1061
|
+
const { tmpdir } = await import("os");
|
|
1062
|
+
const { join } = await import("path");
|
|
1063
|
+
const { execa } = await import("execa");
|
|
1064
|
+
|
|
1065
|
+
const tempDir = await mkdtemp(join(tmpdir(), "bos-deps-"));
|
|
1066
|
+
|
|
1067
|
+
try {
|
|
1068
|
+
const tempDeps: Record<string, string> = {};
|
|
1069
|
+
for (const [name, config] of Object.entries(sharedDeps)) {
|
|
1070
|
+
const version = (config as { requiredVersion?: string }).requiredVersion || "*";
|
|
1071
|
+
tempDeps[name] = version.replace(/^[\^~]/, "");
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
const tempPkg = {
|
|
1075
|
+
name: "bos-deps-update",
|
|
1076
|
+
private: true,
|
|
1077
|
+
dependencies: tempDeps,
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
await Bun.write(join(tempDir, "package.json"), JSON.stringify(tempPkg, null, 2));
|
|
1081
|
+
|
|
1082
|
+
await execa("bun", ["install"], {
|
|
1083
|
+
cwd: tempDir,
|
|
1084
|
+
stdio: "inherit",
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
await execa("bun", ["update", "-i"], {
|
|
1088
|
+
cwd: tempDir,
|
|
1089
|
+
stdio: "inherit",
|
|
1090
|
+
});
|
|
1091
|
+
|
|
1092
|
+
const updatedPkg = await Bun.file(join(tempDir, "package.json")).json() as {
|
|
1093
|
+
dependencies: Record<string, string>;
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
const updated: { name: string; from: string; to: string }[] = [];
|
|
1097
|
+
const updatedConfig = { ...bosConfig };
|
|
1098
|
+
|
|
1099
|
+
if (!updatedConfig.shared) {
|
|
1100
|
+
updatedConfig.shared = {};
|
|
1101
|
+
}
|
|
1102
|
+
if (!updatedConfig.shared[category]) {
|
|
1103
|
+
updatedConfig.shared[category] = {};
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
for (const [name, newVersion] of Object.entries(updatedPkg.dependencies)) {
|
|
1107
|
+
const oldVersion = (sharedDeps[name] as { requiredVersion?: string })?.requiredVersion || "";
|
|
1108
|
+
if (newVersion !== oldVersion) {
|
|
1109
|
+
updated.push({ name, from: oldVersion, to: newVersion });
|
|
1110
|
+
updatedConfig.shared[category][name] = {
|
|
1111
|
+
...(sharedDeps[name] as object),
|
|
1112
|
+
requiredVersion: newVersion,
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
if (updated.length > 0) {
|
|
1118
|
+
const bosConfigPath = `${configDir}/bos.config.json`;
|
|
1119
|
+
await Bun.write(bosConfigPath, JSON.stringify(updatedConfig, null, 2));
|
|
1120
|
+
|
|
1121
|
+
const rootPkgPath = `${configDir}/package.json`;
|
|
1122
|
+
const rootPkg = await Bun.file(rootPkgPath).json() as {
|
|
1123
|
+
workspaces?: { catalog?: Record<string, string> };
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
if (rootPkg.workspaces?.catalog) {
|
|
1127
|
+
for (const { name, to } of updated) {
|
|
1128
|
+
rootPkg.workspaces.catalog[name] = to;
|
|
1129
|
+
}
|
|
1130
|
+
await Bun.write(rootPkgPath, JSON.stringify(rootPkg, null, 2));
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
await execa("bun", ["install"], {
|
|
1134
|
+
cwd: configDir,
|
|
1135
|
+
stdio: "inherit",
|
|
1136
|
+
});
|
|
1137
|
+
|
|
1138
|
+
return {
|
|
1139
|
+
status: "updated" as const,
|
|
1140
|
+
updated,
|
|
1141
|
+
syncStatus: "synced" as const,
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
return {
|
|
1146
|
+
status: "cancelled" as const,
|
|
1147
|
+
updated: [],
|
|
1148
|
+
};
|
|
1149
|
+
} catch (error) {
|
|
1150
|
+
return {
|
|
1151
|
+
status: "error" as const,
|
|
1152
|
+
updated: [],
|
|
1153
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
1154
|
+
};
|
|
1155
|
+
} finally {
|
|
1156
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
1157
|
+
}
|
|
1158
|
+
}),
|
|
1159
|
+
|
|
1160
|
+
depsSync: builder.depsSync.handler(async ({ input }) => {
|
|
1161
|
+
const { configDir, bosConfig } = deps;
|
|
1162
|
+
|
|
1163
|
+
if (!bosConfig) {
|
|
1164
|
+
return {
|
|
1165
|
+
status: "error" as const,
|
|
1166
|
+
synced: [],
|
|
1167
|
+
error: "No bos.config.json found. Run from a BOS project directory.",
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
const category = input.category;
|
|
1172
|
+
const sharedDeps = bosConfig.shared?.[category];
|
|
1173
|
+
|
|
1174
|
+
if (!sharedDeps || Object.keys(sharedDeps).length === 0) {
|
|
1175
|
+
return {
|
|
1176
|
+
status: "error" as const,
|
|
1177
|
+
synced: [],
|
|
1178
|
+
error: `No shared.${category} dependencies found in bos.config.json`,
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
try {
|
|
1183
|
+
const rootPkgPath = `${configDir}/package.json`;
|
|
1184
|
+
const rootPkg = await Bun.file(rootPkgPath).json() as {
|
|
1185
|
+
workspaces?: { packages?: string[]; catalog?: Record<string, string> };
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
if (!rootPkg.workspaces) {
|
|
1189
|
+
rootPkg.workspaces = {};
|
|
1190
|
+
}
|
|
1191
|
+
if (!rootPkg.workspaces.catalog) {
|
|
1192
|
+
rootPkg.workspaces.catalog = {};
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
const synced: string[] = [];
|
|
1196
|
+
|
|
1197
|
+
for (const [name, config] of Object.entries(sharedDeps)) {
|
|
1198
|
+
const version = (config as { requiredVersion?: string }).requiredVersion;
|
|
1199
|
+
if (version) {
|
|
1200
|
+
const cleanVersion = version.replace(/^[\^~]/, "");
|
|
1201
|
+
rootPkg.workspaces.catalog[name] = cleanVersion;
|
|
1202
|
+
synced.push(name);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
await Bun.write(rootPkgPath, JSON.stringify(rootPkg, null, 2));
|
|
1207
|
+
|
|
1208
|
+
if (input.install) {
|
|
1209
|
+
const { execa } = await import("execa");
|
|
1210
|
+
await execa("bun", ["install"], {
|
|
1211
|
+
cwd: configDir,
|
|
1212
|
+
stdio: "inherit",
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
return {
|
|
1217
|
+
status: "synced" as const,
|
|
1218
|
+
synced,
|
|
1219
|
+
};
|
|
1220
|
+
} catch (error) {
|
|
1221
|
+
return {
|
|
1222
|
+
status: "error" as const,
|
|
1223
|
+
synced: [],
|
|
1224
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
}),
|
|
1228
|
+
|
|
1039
1229
|
sync: builder.sync.handler(async ({ input }) => {
|
|
1040
1230
|
const { configDir, bosConfig } = deps;
|
|
1041
1231
|
|
package/src/types.ts
CHANGED
|
@@ -30,6 +30,14 @@ export const GatewayConfigSchema = z.object({
|
|
|
30
30
|
});
|
|
31
31
|
export type GatewayConfig = z.infer<typeof GatewayConfigSchema>;
|
|
32
32
|
|
|
33
|
+
export const SharedDepConfigSchema = z.object({
|
|
34
|
+
requiredVersion: z.string().optional(),
|
|
35
|
+
singleton: z.boolean().optional(),
|
|
36
|
+
eager: z.boolean().optional(),
|
|
37
|
+
strictVersion: z.boolean().optional(),
|
|
38
|
+
});
|
|
39
|
+
export type SharedDepConfig = z.infer<typeof SharedDepConfigSchema>;
|
|
40
|
+
|
|
33
41
|
export const BosConfigSchema = z.object({
|
|
34
42
|
account: z.string(),
|
|
35
43
|
gateway: GatewayConfigSchema,
|
|
@@ -38,6 +46,7 @@ export const BosConfigSchema = z.object({
|
|
|
38
46
|
cli: z.object({
|
|
39
47
|
version: z.string().optional(),
|
|
40
48
|
}).optional(),
|
|
49
|
+
shared: z.record(z.string(), z.record(z.string(), SharedDepConfigSchema)).optional(),
|
|
41
50
|
app: z.object({
|
|
42
51
|
host: HostConfigSchema,
|
|
43
52
|
}).catchall(z.union([HostConfigSchema, RemoteConfigSchema])),
|