everything-dev 1.27.0 → 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/cli/infra.cjs +1 -1
- package/dist/cli/infra.mjs +1 -1
- package/dist/cli/init.cjs +7 -9
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +1 -1
- package/dist/cli/init.d.cts.map +1 -1
- package/dist/cli/init.d.mts +1 -1
- package/dist/cli/init.d.mts.map +1 -1
- package/dist/cli/init.mjs +7 -9
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/prompts.cjs +28 -24
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +27 -24
- package/dist/cli/prompts.mjs.map +1 -1
- package/dist/cli/sync.cjs +4 -1
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +4 -1
- package/dist/cli/sync.mjs.map +1 -1
- package/dist/cli.cjs +187 -12
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +186 -11
- package/dist/cli.mjs.map +1 -1
- package/dist/contract.cjs +1 -1
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +38 -34
- package/dist/contract.d.cts.map +1 -1
- package/dist/contract.d.mts +38 -34
- package/dist/contract.d.mts.map +1 -1
- package/dist/contract.mjs +1 -0
- package/dist/contract.mjs.map +1 -1
- package/dist/dev-session.cjs +0 -1
- package/dist/dev-session.mjs +1 -1
- package/dist/index.cjs +0 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +0 -1
- package/dist/near-cli.cjs +1 -1
- package/dist/near-cli.mjs +1 -1
- package/dist/orchestrator.cjs +1 -1
- package/dist/orchestrator.mjs +1 -1
- package/dist/plugin.cjs +163 -139
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +67 -34
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +66 -34
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +153 -130
- package/dist/plugin.mjs.map +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/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/package.json +2 -2
- 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 -1145
- 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 -429
- package/src/cli/timing.ts +0 -63
- package/src/cli/upgrade.ts +0 -869
- 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 -326
- 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 -1799
- 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 -65
- 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/src/cli.ts
DELETED
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { findCommandDescriptor } from "./cli/catalog";
|
|
3
|
-
import { printHelp } from "./cli/help";
|
|
4
|
-
import { parseCommandInput } from "./cli/parse";
|
|
5
|
-
import { formatDuration, sumPhaseDurations } from "./cli/timing";
|
|
6
|
-
import { findConfigPath } from "./config";
|
|
7
|
-
import bosPlugin from "./plugin";
|
|
8
|
-
import { createPluginRuntime } from "./sdk";
|
|
9
|
-
import { printBanner } from "./utils/banner";
|
|
10
|
-
import { colors, frames, gradients, icons } from "./utils/theme";
|
|
11
|
-
|
|
12
|
-
function printConfigView(result: {
|
|
13
|
-
account: string;
|
|
14
|
-
domain?: string;
|
|
15
|
-
staging?: { domain: string };
|
|
16
|
-
app: {
|
|
17
|
-
host: { name?: string; development: string; production?: string };
|
|
18
|
-
ui: { name?: string; development?: string; production?: string; ssr?: string };
|
|
19
|
-
api: { name?: string; development?: string; production?: string; proxy?: string };
|
|
20
|
-
};
|
|
21
|
-
}) {
|
|
22
|
-
console.log();
|
|
23
|
-
console.log(colors.cyan(frames.top(52)));
|
|
24
|
-
console.log(` ${icons.app} ${gradients.cyber("CONFIG")}`);
|
|
25
|
-
console.log(colors.cyan(frames.bottom(52)));
|
|
26
|
-
console.log();
|
|
27
|
-
|
|
28
|
-
console.log(` ${colors.dim("Account")} ${colors.cyan(result.account)}`);
|
|
29
|
-
console.log(` ${colors.dim("Domain")} ${colors.white(result.domain ?? "not configured")}`);
|
|
30
|
-
if (result.staging) {
|
|
31
|
-
console.log(` ${colors.dim("Staging")} ${colors.magenta(result.staging.domain)}`);
|
|
32
|
-
}
|
|
33
|
-
console.log();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function formatTimeAgo(isoTimestamp: string): string {
|
|
37
|
-
const now = Date.now();
|
|
38
|
-
const then = new Date(isoTimestamp).getTime();
|
|
39
|
-
const diffMs = now - then;
|
|
40
|
-
const diffMins = Math.floor(diffMs / 60_000);
|
|
41
|
-
if (diffMins < 1) return "just now";
|
|
42
|
-
if (diffMins < 60) return `${diffMins} minute${diffMins > 1 ? "s" : ""} ago`;
|
|
43
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
44
|
-
if (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? "s" : ""} ago`;
|
|
45
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
46
|
-
if (diffDays < 30) return `${diffDays} day${diffDays > 1 ? "s" : ""} ago`;
|
|
47
|
-
return isoTimestamp.split("T")[0] ?? isoTimestamp;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function normalizeVersion(v: string): string {
|
|
51
|
-
return v.replace(/^[\^~>=v]+/, "").trim();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function printTimingSummary(timings: Array<{ name: string; durationMs: number }> | undefined) {
|
|
55
|
-
if (!timings || timings.length === 0) return;
|
|
56
|
-
|
|
57
|
-
console.log(` ${colors.dim("Timings:")}`);
|
|
58
|
-
for (const timing of timings) {
|
|
59
|
-
console.log(` ${colors.dim(timing.name.padEnd(22))} ${formatDuration(timing.durationMs)}`);
|
|
60
|
-
}
|
|
61
|
-
console.log(
|
|
62
|
-
` ${colors.dim("total".padEnd(22))} ${formatDuration(sumPhaseDurations(timings))}`,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function warnIfOutdated(client: any, command: string): Promise<void> {
|
|
67
|
-
if (!["dev", "build", "start"].includes(command)) return;
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
const status = await client.status();
|
|
71
|
-
if (status.status === "error" || !status.packages) return;
|
|
72
|
-
|
|
73
|
-
const frameworkPackages = ["everything-dev", "every-plugin"];
|
|
74
|
-
|
|
75
|
-
const outdated = status.packages.filter(
|
|
76
|
-
(p: { name: string; installed?: string; latest?: string }) =>
|
|
77
|
-
p.installed &&
|
|
78
|
-
p.latest &&
|
|
79
|
-
normalizeVersion(p.installed) !== normalizeVersion(p.latest) &&
|
|
80
|
-
frameworkPackages.includes(p.name),
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
if (outdated.length === 0) return;
|
|
84
|
-
|
|
85
|
-
console.log();
|
|
86
|
-
console.log(colors.yellow(` ! Outdated packages detected:`));
|
|
87
|
-
for (const pkg of outdated) {
|
|
88
|
-
console.log(colors.dim(` ${pkg.name} ${pkg.installed} → ${pkg.latest}`));
|
|
89
|
-
}
|
|
90
|
-
console.log(
|
|
91
|
-
colors.dim(
|
|
92
|
-
` Run ${colors.cyan("bos upgrade")} to update packages and sync template files.`,
|
|
93
|
-
),
|
|
94
|
-
);
|
|
95
|
-
console.log();
|
|
96
|
-
} catch {
|
|
97
|
-
// silently ignore if status check fails
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async function main() {
|
|
102
|
-
const args = process.argv.slice(2);
|
|
103
|
-
|
|
104
|
-
if (args.includes("--help") || args.includes("-h")) {
|
|
105
|
-
printHelp();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const invocationArgs = args.length > 0 ? args : ["dev"];
|
|
110
|
-
const command = invocationArgs[0] ?? "dev";
|
|
111
|
-
const configPath = findConfigPath();
|
|
112
|
-
|
|
113
|
-
const commandMatch = findCommandDescriptor(invocationArgs);
|
|
114
|
-
if (!commandMatch) {
|
|
115
|
-
console.error(`Unknown command: ${command}`);
|
|
116
|
-
process.exit(1);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const { descriptor, consumed } = commandMatch;
|
|
120
|
-
const commandArgs = invocationArgs.slice(consumed);
|
|
121
|
-
|
|
122
|
-
printBanner();
|
|
123
|
-
|
|
124
|
-
const runtime = createPluginRuntime({
|
|
125
|
-
registry: {
|
|
126
|
-
bos: { module: bosPlugin },
|
|
127
|
-
},
|
|
128
|
-
secrets: {},
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
const pluginRuntime: any = runtime;
|
|
132
|
-
const loadPlugin = pluginRuntime.usePlugin.bind(pluginRuntime);
|
|
133
|
-
const plugin = await loadPlugin("bos", {
|
|
134
|
-
variables: {
|
|
135
|
-
configPath: configPath ?? undefined,
|
|
136
|
-
},
|
|
137
|
-
secrets: {},
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
const client = plugin.createClient();
|
|
141
|
-
|
|
142
|
-
await warnIfOutdated(client, command);
|
|
143
|
-
|
|
144
|
-
try {
|
|
145
|
-
const input = parseCommandInput(descriptor, commandArgs);
|
|
146
|
-
const result = await (client as any)[descriptor.key](input);
|
|
147
|
-
|
|
148
|
-
if (descriptor.key === "config") {
|
|
149
|
-
if (!result.config) {
|
|
150
|
-
console.error("No bos.config.json found");
|
|
151
|
-
process.exit(1);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
printConfigView(result.config);
|
|
155
|
-
process.stdout.write(`${JSON.stringify(result.config, null, 2)}\n`);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (descriptor.key === "init") {
|
|
160
|
-
console.log();
|
|
161
|
-
if (result.status === "error") {
|
|
162
|
-
console.error(`[CLI] ${result.error || "Unknown error"}`);
|
|
163
|
-
process.exit(1);
|
|
164
|
-
}
|
|
165
|
-
console.log(colors.green(`${icons.ok} Project initialized`));
|
|
166
|
-
console.log(` ${colors.dim("Extends:")} ${result.extends}`);
|
|
167
|
-
console.log(` ${colors.dim("Directory:")} ${result.directory}`);
|
|
168
|
-
if (result.account) console.log(` ${colors.dim("Account:")} ${result.account}`);
|
|
169
|
-
if (result.domain) console.log(` ${colors.dim("Domain:")} ${result.domain}`);
|
|
170
|
-
if (result.overrides && result.overrides.length > 0)
|
|
171
|
-
console.log(` ${colors.dim("Overrides:")} ${result.overrides.join(", ")}`);
|
|
172
|
-
if (result.plugins && result.plugins.length > 0)
|
|
173
|
-
console.log(` ${colors.dim("Plugins:")} ${result.plugins.join(", ")}`);
|
|
174
|
-
console.log(` ${colors.dim("Files copied:")} ${result.filesCopied}`);
|
|
175
|
-
printTimingSummary(result.timings);
|
|
176
|
-
console.log();
|
|
177
|
-
console.log(colors.dim(" Next steps:"));
|
|
178
|
-
console.log(colors.dim(` cd ${result.directory}`));
|
|
179
|
-
if (result.status === "initialized" && !(input as any)?.noInstall) {
|
|
180
|
-
console.log(colors.dim(" docker compose up -d --wait"));
|
|
181
|
-
console.log(colors.dim(" bun run dev"));
|
|
182
|
-
} else {
|
|
183
|
-
console.log(colors.dim(" bun install"));
|
|
184
|
-
console.log(colors.dim(" docker compose up -d --wait"));
|
|
185
|
-
console.log(colors.dim(" bun run dev"));
|
|
186
|
-
}
|
|
187
|
-
console.log();
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (descriptor.key === "sync") {
|
|
192
|
-
console.log();
|
|
193
|
-
if (result.status === "error") {
|
|
194
|
-
console.error(`[CLI] ${result.error || "Unknown error"}`);
|
|
195
|
-
process.exit(1);
|
|
196
|
-
}
|
|
197
|
-
if (result.status === "dry-run") {
|
|
198
|
-
console.log(colors.cyan(`${icons.ok} Dry run — no files written`));
|
|
199
|
-
} else {
|
|
200
|
-
console.log(colors.green(`${icons.ok} Template synced`));
|
|
201
|
-
}
|
|
202
|
-
if (result.updated.length > 0) {
|
|
203
|
-
console.log(` ${colors.dim("Updated:")} ${result.updated.length} file(s)`);
|
|
204
|
-
for (const f of result.updated) console.log(` ${colors.dim(f)}`);
|
|
205
|
-
}
|
|
206
|
-
if (result.added.length > 0) {
|
|
207
|
-
console.log(` ${colors.dim("Added:")} ${result.added.length} file(s)`);
|
|
208
|
-
for (const f of result.added) console.log(` ${colors.dim(f)}`);
|
|
209
|
-
}
|
|
210
|
-
if (result.skipped.length > 0) {
|
|
211
|
-
console.log(
|
|
212
|
-
` ${colors.yellow("Skipped:")} ${result.skipped.length} file(s) (locally modified, use --force to overwrite)`,
|
|
213
|
-
);
|
|
214
|
-
for (const f of result.skipped) console.log(` ${colors.dim(f)}`);
|
|
215
|
-
}
|
|
216
|
-
if (result.updated.length === 0 && result.added.length === 0 && result.skipped.length === 0) {
|
|
217
|
-
console.log(` ${colors.dim("Already up to date")}`);
|
|
218
|
-
}
|
|
219
|
-
if (result.status !== "dry-run" && result.updated.length > 0) {
|
|
220
|
-
console.log();
|
|
221
|
-
console.log(colors.dim(" Review changes — your customizations take priority:"));
|
|
222
|
-
console.log(
|
|
223
|
-
colors.dim(
|
|
224
|
-
" • api/src/contract.ts, api/src/index.ts, api/src/db/schema.ts — never overwritten",
|
|
225
|
-
),
|
|
226
|
-
);
|
|
227
|
-
console.log(
|
|
228
|
-
colors.dim(" • ui/src/components/**, ui/src/styles.css — never overwritten"),
|
|
229
|
-
);
|
|
230
|
-
console.log(
|
|
231
|
-
colors.dim(
|
|
232
|
-
" • Other updated files — accept framework improvements, then restore your changes",
|
|
233
|
-
),
|
|
234
|
-
);
|
|
235
|
-
console.log(colors.dim(" • Skipped files — yours already, only update with --force"));
|
|
236
|
-
}
|
|
237
|
-
console.log();
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (descriptor.key === "upgrade") {
|
|
242
|
-
console.log();
|
|
243
|
-
if (result.status === "error") {
|
|
244
|
-
console.error(`[CLI] ${result.error || "Unknown error"}`);
|
|
245
|
-
process.exit(1);
|
|
246
|
-
}
|
|
247
|
-
if (result.status === "dry-run") {
|
|
248
|
-
console.log(colors.cyan(`${icons.ok} Dry run — no changes applied`));
|
|
249
|
-
} else {
|
|
250
|
-
console.log(colors.green(`${icons.ok} Upgrade successful`));
|
|
251
|
-
}
|
|
252
|
-
for (const pkg of result.packages) {
|
|
253
|
-
if (pkg.from && pkg.from !== pkg.to) {
|
|
254
|
-
console.log(` ${colors.dim(`${pkg.name}:`)} ${pkg.from} → ${pkg.to}`);
|
|
255
|
-
} else if (!pkg.from) {
|
|
256
|
-
console.log(` ${colors.dim(`${pkg.name}:`)} ${pkg.to} (new)`);
|
|
257
|
-
} else {
|
|
258
|
-
console.log(` ${colors.dim(`${pkg.name}:`)} ${pkg.to} (up to date)`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
if (result.changelogUrl) {
|
|
262
|
-
console.log(` ${colors.dim("Changelog:")} ${result.changelogUrl}`);
|
|
263
|
-
}
|
|
264
|
-
if (result.availablePlugins && result.availablePlugins.length > 0) {
|
|
265
|
-
console.log(` ${colors.dim("New parent plugins:")} ${result.availablePlugins.join(", ")}`);
|
|
266
|
-
}
|
|
267
|
-
if (result.selectedPlugins && result.selectedPlugins.length > 0) {
|
|
268
|
-
console.log(` ${colors.dim("Added plugins:")} ${result.selectedPlugins.join(", ")}`);
|
|
269
|
-
}
|
|
270
|
-
printTimingSummary(result.timings);
|
|
271
|
-
if (result.sync) {
|
|
272
|
-
const sync = result.sync;
|
|
273
|
-
if (sync.updated.length > 0) {
|
|
274
|
-
console.log(` ${colors.dim("Updated:")} ${sync.updated.length} file(s)`);
|
|
275
|
-
for (const f of sync.updated) console.log(` ${colors.dim(f)}`);
|
|
276
|
-
}
|
|
277
|
-
if (sync.added.length > 0) {
|
|
278
|
-
console.log(` ${colors.dim("Added:")} ${sync.added.length} file(s)`);
|
|
279
|
-
for (const f of sync.added) console.log(` ${colors.dim(f)}`);
|
|
280
|
-
}
|
|
281
|
-
if (sync.skipped.length > 0) {
|
|
282
|
-
console.log(
|
|
283
|
-
` ${colors.yellow("Skipped:")} ${sync.skipped.length} file(s) (locally modified, use --force to overwrite)`,
|
|
284
|
-
);
|
|
285
|
-
for (const f of sync.skipped) console.log(` ${colors.dim(f)}`);
|
|
286
|
-
}
|
|
287
|
-
if (
|
|
288
|
-
result.status !== "dry-run" &&
|
|
289
|
-
(sync.updated.length > 0 || sync.added.length > 0 || sync.skipped.length > 0)
|
|
290
|
-
) {
|
|
291
|
-
console.log();
|
|
292
|
-
console.log(colors.dim(" Resolve differences — your code takes priority:"));
|
|
293
|
-
console.log();
|
|
294
|
-
console.log(colors.dim(" Never overwritten (safe):"));
|
|
295
|
-
console.log(
|
|
296
|
-
colors.dim(" • api/src/contract.ts, api/src/index.ts, api/src/db/schema.ts"),
|
|
297
|
-
);
|
|
298
|
-
console.log(colors.dim(" • ui/src/components/**, ui/src/styles.css"));
|
|
299
|
-
console.log();
|
|
300
|
-
console.log(colors.dim(" Replaced — review and keep your changes:"));
|
|
301
|
-
console.log(
|
|
302
|
-
colors.dim(
|
|
303
|
-
" • api/drizzle.config.ts, api/tsconfig.json, api/tsconfig.contract.json",
|
|
304
|
-
),
|
|
305
|
-
);
|
|
306
|
-
console.log(colors.dim(" • api/plugin.dev.ts, api/rspack.config.js"));
|
|
307
|
-
console.log(colors.dim(" • ui/src/routes/* (core routes only)"));
|
|
308
|
-
console.log();
|
|
309
|
-
console.log(colors.dim(" Merged — your deps preserved:"));
|
|
310
|
-
console.log(colors.dim(" • package.json, api/package.json, ui/package.json"));
|
|
311
|
-
console.log();
|
|
312
|
-
console.log(colors.dim(" Skipped — already yours:"));
|
|
313
|
-
console.log(colors.dim(" • Use --force only if you want framework updates"));
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
if (result.migrated && result.migrated.length > 0) {
|
|
317
|
-
console.log(` ${colors.yellow("Removed:")} ${result.migrated.length} obsolete file(s)`);
|
|
318
|
-
for (const f of result.migrated) console.log(` ${colors.dim(f)}`);
|
|
319
|
-
}
|
|
320
|
-
console.log();
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (descriptor.key === "status") {
|
|
325
|
-
console.log();
|
|
326
|
-
if (result.status === "error") {
|
|
327
|
-
console.error(`[CLI] ${result.error || "Unknown error"}`);
|
|
328
|
-
process.exit(1);
|
|
329
|
-
}
|
|
330
|
-
console.log(colors.cyan(frames.top(52)));
|
|
331
|
-
console.log(` ${icons.app} ${gradients.cyber("STATUS")}`);
|
|
332
|
-
console.log(colors.cyan(frames.bottom(52)));
|
|
333
|
-
console.log();
|
|
334
|
-
if (result.extends) console.log(` ${colors.dim("Extends:")} ${result.extends}`);
|
|
335
|
-
if (result.account) console.log(` ${colors.dim("Account:")} ${result.account}`);
|
|
336
|
-
if (result.domain) console.log(` ${colors.dim("Domain:")} ${result.domain}`);
|
|
337
|
-
console.log();
|
|
338
|
-
console.log(` ${colors.dim("Packages:")}`);
|
|
339
|
-
for (const pkg of result.packages) {
|
|
340
|
-
const hasUpdate =
|
|
341
|
-
pkg.installed &&
|
|
342
|
-
pkg.latest &&
|
|
343
|
-
normalizeVersion(pkg.installed) !== normalizeVersion(pkg.latest);
|
|
344
|
-
const versionStr = hasUpdate
|
|
345
|
-
? `${pkg.installed} → ${pkg.latest}`
|
|
346
|
-
: pkg.installed || "not installed";
|
|
347
|
-
const label = hasUpdate ? colors.yellow(versionStr) : colors.dim(versionStr);
|
|
348
|
-
console.log(` ${colors.dim(`${pkg.name}`)} ${label}`);
|
|
349
|
-
}
|
|
350
|
-
console.log();
|
|
351
|
-
if (result.lastSync) {
|
|
352
|
-
const ago = formatTimeAgo(result.lastSync);
|
|
353
|
-
console.log(` ${colors.dim("Last sync:")} ${ago}`);
|
|
354
|
-
} else {
|
|
355
|
-
console.log(` ${colors.dim("Last sync:")} never`);
|
|
356
|
-
}
|
|
357
|
-
const envLabel =
|
|
358
|
-
result.envFile === "found"
|
|
359
|
-
? colors.green("found")
|
|
360
|
-
: result.envFile === "example-only"
|
|
361
|
-
? colors.yellow("missing (only .env.example found)")
|
|
362
|
-
: colors.error("missing");
|
|
363
|
-
console.log(` ${colors.dim(".env:")} ${envLabel}`);
|
|
364
|
-
if (result.parentReachable !== undefined) {
|
|
365
|
-
const parentLabel = result.parentReachable
|
|
366
|
-
? colors.green("reachable")
|
|
367
|
-
: colors.error("unreachable");
|
|
368
|
-
console.log(` ${colors.dim("Parent:")} ${parentLabel}`);
|
|
369
|
-
}
|
|
370
|
-
const hasUpdates = result.packages.some(
|
|
371
|
-
(p: { installed?: string; latest?: string }) =>
|
|
372
|
-
p.installed && p.latest && normalizeVersion(p.installed) !== normalizeVersion(p.latest),
|
|
373
|
-
);
|
|
374
|
-
if (hasUpdates) {
|
|
375
|
-
console.log();
|
|
376
|
-
console.log(
|
|
377
|
-
colors.dim(
|
|
378
|
-
` Run ${colors.cyan("bos upgrade")} to update packages and sync template files.`,
|
|
379
|
-
),
|
|
380
|
-
);
|
|
381
|
-
}
|
|
382
|
-
console.log();
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
if (descriptor.key === "typesGen") {
|
|
387
|
-
console.log();
|
|
388
|
-
if (result.status === "error") {
|
|
389
|
-
console.error(`[CLI] ${result.error || "Unknown error"}`);
|
|
390
|
-
process.exit(1);
|
|
391
|
-
}
|
|
392
|
-
console.log(colors.green(`${icons.ok} Types generated`));
|
|
393
|
-
if (result.source) {
|
|
394
|
-
console.log(
|
|
395
|
-
` ${colors.dim("Mode:")} ${result.source === "remote" ? colors.cyan("remote") : colors.dim("local")}`,
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
if (result.generated.length > 0) {
|
|
399
|
-
console.log(` ${colors.dim("Generated:")}`);
|
|
400
|
-
for (const f of result.generated) console.log(` ${colors.dim(f)}`);
|
|
401
|
-
}
|
|
402
|
-
if (result.fetched.length > 0) {
|
|
403
|
-
console.log(` ${colors.dim("Fetched from remote:")}`);
|
|
404
|
-
for (const url of result.fetched) console.log(` ${colors.dim(url)}`);
|
|
405
|
-
}
|
|
406
|
-
if (result.skipped.length > 0) {
|
|
407
|
-
console.log(` ${colors.dim("Skipped (local):")}`);
|
|
408
|
-
for (const s of result.skipped) console.log(` ${colors.dim(s)}`);
|
|
409
|
-
}
|
|
410
|
-
if (result.failed.length > 0) {
|
|
411
|
-
console.log(` ${colors.yellow("Failed:")}`);
|
|
412
|
-
for (const f of result.failed) console.log(` ${colors.error(f)}`);
|
|
413
|
-
}
|
|
414
|
-
console.log();
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
if (result?.status === "error") {
|
|
419
|
-
console.error(`[CLI] ${result.error || "Unknown error"}`);
|
|
420
|
-
process.exit(1);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
if (descriptor.key === "keyPublish") {
|
|
424
|
-
process.stdout.write(`Generated publish key for ${result.account}\n`);
|
|
425
|
-
process.stdout.write(` Network: ${result.network}\n`);
|
|
426
|
-
process.stdout.write(` Contract: ${result.contract}\n`);
|
|
427
|
-
process.stdout.write(` Allowance: ${result.allowance}\n`);
|
|
428
|
-
process.stdout.write(` Functions: ${result.functionNames.join(", ")}\n`);
|
|
429
|
-
process.stdout.write(` Public key: ${result.publicKey}\n`);
|
|
430
|
-
process.stdout.write(` Private key: ${result.privateKey}\n`);
|
|
431
|
-
process.stdout.write(` Copy: NEAR_PRIVATE_KEY=${result.privateKey}\n`);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
if (descriptor.key === "pluginAdd") {
|
|
435
|
-
console.log();
|
|
436
|
-
console.log(colors.green(`${icons.ok} Added plugin ${result.key}`));
|
|
437
|
-
if (result.development) console.log(` ${colors.dim("Development:")} ${result.development}`);
|
|
438
|
-
if (result.production) console.log(` ${colors.dim("Production:")} ${result.production}`);
|
|
439
|
-
console.log();
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (descriptor.key === "pluginRemove") {
|
|
444
|
-
console.log();
|
|
445
|
-
console.log(colors.green(`${icons.ok} Removed plugin ${result.key}`));
|
|
446
|
-
console.log();
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
if (descriptor.key === "pluginList") {
|
|
451
|
-
console.log();
|
|
452
|
-
console.log(colors.cyan(frames.top(52)));
|
|
453
|
-
console.log(` ${icons.config} ${gradients.cyber("PLUGINS")}`);
|
|
454
|
-
console.log(colors.cyan(frames.bottom(52)));
|
|
455
|
-
console.log();
|
|
456
|
-
if (result.plugins.length === 0) {
|
|
457
|
-
console.log(colors.dim(" No plugins configured"));
|
|
458
|
-
} else {
|
|
459
|
-
for (const pluginItem of result.plugins) {
|
|
460
|
-
console.log(` ${colors.cyan(pluginItem.key)}`);
|
|
461
|
-
if (pluginItem.development)
|
|
462
|
-
console.log(` ${colors.dim("Development:")} ${pluginItem.development}`);
|
|
463
|
-
if (pluginItem.production)
|
|
464
|
-
console.log(` ${colors.dim("Production:")} ${pluginItem.production}`);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
console.log();
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
if (descriptor.key === "pluginPublish") {
|
|
472
|
-
console.log();
|
|
473
|
-
console.log(colors.green(`${icons.ok} Published plugin ${result.key}`));
|
|
474
|
-
if (result.path) console.log(` ${colors.dim("Path:")} ${result.path}`);
|
|
475
|
-
if (result.script) console.log(` ${colors.dim("Script:")} bun run ${result.script}`);
|
|
476
|
-
if (result.production) console.log(` ${colors.dim("Production:")} ${result.production}`);
|
|
477
|
-
console.log();
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
if (descriptor.key === "publish") {
|
|
482
|
-
if (result.status === "dry-run") {
|
|
483
|
-
console.log();
|
|
484
|
-
console.log(colors.cyan(`${icons.ok} Dry run complete`));
|
|
485
|
-
console.log(` ${colors.dim("Registry URL:")} ${result.registryUrl}`);
|
|
486
|
-
console.log();
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
if (result.status === "published") {
|
|
491
|
-
console.log();
|
|
492
|
-
console.log(colors.green(`${icons.ok} Published successfully`));
|
|
493
|
-
console.log(` ${colors.dim("Registry URL:")} ${result.registryUrl}`);
|
|
494
|
-
if (result.txHash) {
|
|
495
|
-
console.log(` ${colors.dim("Transaction:")} ${result.txHash}`);
|
|
496
|
-
}
|
|
497
|
-
if (result.built && result.built.length > 0) {
|
|
498
|
-
console.log(` ${colors.dim("Built:")} ${result.built.join(", ")}`);
|
|
499
|
-
}
|
|
500
|
-
if (result.skipped && result.skipped.length > 0) {
|
|
501
|
-
console.log(` ${colors.dim("Skipped:")} ${result.skipped.join(", ")}`);
|
|
502
|
-
}
|
|
503
|
-
console.log();
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
} catch (error) {
|
|
508
|
-
console.error(`[CLI] ${error instanceof Error ? error.message : String(error)}`);
|
|
509
|
-
process.exit(1);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
main().catch((error) => {
|
|
514
|
-
console.error("[CLI] Fatal error:", error);
|
|
515
|
-
process.exit(1);
|
|
516
|
-
});
|