everything-dev 1.8.8 → 1.8.10

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.
@@ -37,7 +37,7 @@ declare const makeDevProcess: (pkg: string, callbacks: ProcessCallbacks, portOve
37
37
  kill: Effect.Effect<void, never, never>;
38
38
  waitForReady: Effect.Effect<void, Error, never>;
39
39
  waitForExit: Effect.Effect<ExitCode, _$_effect_platform_Error0.PlatformError, never>;
40
- }, string | Error | _$_effect_platform_Error0.PlatformError, _$effect_Scope0.Scope | ServiceDescriptorMap | DevRuntimeConfig | _$_effect_platform_CommandExecutor0.CommandExecutor>;
40
+ }, string | Error | _$_effect_platform_Error0.PlatformError, ServiceDescriptorMap | DevRuntimeConfig | _$effect_Scope0.Scope | _$_effect_platform_CommandExecutor0.CommandExecutor>;
41
41
  declare function getProcessStates(packages: string[], services: Map<string, ServiceDescriptor>, portOverride?: number): ProcessState[];
42
42
  //#endregion
43
43
  export { ProcessCallbacks, ProcessHandle, ProcessState, ProcessStatus, getProcessStates, makeDevProcess };
package/dist/plugin.d.cts CHANGED
@@ -27,8 +27,8 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
27
27
  interactive: z.ZodOptional<z.ZodBoolean>;
28
28
  }, z.core.$strip>, z.ZodObject<{
29
29
  status: z.ZodEnum<{
30
- started: "started";
31
30
  error: "error";
31
+ started: "started";
32
32
  }>;
33
33
  description: z.ZodString;
34
34
  processes: z.ZodArray<z.ZodString>;
@@ -393,7 +393,7 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
393
393
  }> | undefined;
394
394
  } | null;
395
395
  runtimeConfig: {
396
- env: "production" | "development";
396
+ env: "development" | "production";
397
397
  account: string;
398
398
  networkId: "testnet" | "mainnet";
399
399
  host: {
package/dist/plugin.d.mts CHANGED
@@ -27,8 +27,8 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
27
27
  interactive: z.ZodOptional<z.ZodBoolean>;
28
28
  }, z.core.$strip>, z.ZodObject<{
29
29
  status: z.ZodEnum<{
30
- started: "started";
31
30
  error: "error";
31
+ started: "started";
32
32
  }>;
33
33
  description: z.ZodString;
34
34
  processes: z.ZodArray<z.ZodString>;
@@ -393,7 +393,7 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
393
393
  }> | undefined;
394
394
  } | null;
395
395
  runtimeConfig: {
396
- env: "production" | "development";
396
+ env: "development" | "production";
397
397
  account: string;
398
398
  networkId: "testnet" | "mainnet";
399
399
  host: {
@@ -26,7 +26,7 @@ interface ServiceDescriptor {
26
26
  declare const ServiceDescriptorMap_base: Context.TagClass<ServiceDescriptorMap, "ServiceDescriptorMap", Map<string, ServiceDescriptor>>;
27
27
  declare class ServiceDescriptorMap extends ServiceDescriptorMap_base {}
28
28
  declare const DevRuntimeConfig_base: Context.TagClass<DevRuntimeConfig, "DevRuntimeConfig", {
29
- env: "production" | "development";
29
+ env: "development" | "production";
30
30
  account: string;
31
31
  networkId: "testnet" | "mainnet";
32
32
  host: {
@@ -26,7 +26,7 @@ interface ServiceDescriptor {
26
26
  declare const ServiceDescriptorMap_base: Context.TagClass<ServiceDescriptorMap, "ServiceDescriptorMap", Map<string, ServiceDescriptor>>;
27
27
  declare class ServiceDescriptorMap extends ServiceDescriptorMap_base {}
28
28
  declare const DevRuntimeConfig_base: Context.TagClass<DevRuntimeConfig, "DevRuntimeConfig", {
29
- env: "production" | "development";
29
+ env: "development" | "production";
30
30
  account: string;
31
31
  networkId: "testnet" | "mainnet";
32
32
  host: {
package/dist/types.d.cts CHANGED
@@ -192,8 +192,8 @@ declare const BosConfigSchema: z.ZodObject<{
192
192
  type BosConfig = z.infer<typeof BosConfigSchema>;
193
193
  declare const RuntimeConfigSchema: z.ZodObject<{
194
194
  env: z.ZodEnum<{
195
- production: "production";
196
195
  development: "development";
196
+ production: "production";
197
197
  }>;
198
198
  account: z.ZodString;
199
199
  domain: z.ZodOptional<z.ZodString>;
@@ -299,8 +299,8 @@ type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;
299
299
  declare const ClientRuntimeConfigSchema: z.ZodObject<{
300
300
  cspNonce: z.ZodOptional<z.ZodString>;
301
301
  env: z.ZodEnum<{
302
- production: "production";
303
302
  development: "development";
303
+ production: "production";
304
304
  }>;
305
305
  account: z.ZodString;
306
306
  networkId: z.ZodEnum<{
package/dist/types.d.mts CHANGED
@@ -192,8 +192,8 @@ declare const BosConfigSchema: z.ZodObject<{
192
192
  type BosConfig = z.infer<typeof BosConfigSchema>;
193
193
  declare const RuntimeConfigSchema: z.ZodObject<{
194
194
  env: z.ZodEnum<{
195
- production: "production";
196
195
  development: "development";
196
+ production: "production";
197
197
  }>;
198
198
  account: z.ZodString;
199
199
  domain: z.ZodOptional<z.ZodString>;
@@ -299,8 +299,8 @@ type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;
299
299
  declare const ClientRuntimeConfigSchema: z.ZodObject<{
300
300
  cspNonce: z.ZodOptional<z.ZodString>;
301
301
  env: z.ZodEnum<{
302
- production: "production";
303
302
  development: "development";
303
+ production: "production";
304
304
  }>;
305
305
  account: z.ZodString;
306
306
  networkId: z.ZodEnum<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "everything-dev",
3
- "version": "1.8.8",
3
+ "version": "1.8.10",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -156,7 +156,7 @@
156
156
  "chalk": "^5.6.2",
157
157
  "effect": "^3.21.0",
158
158
  "every-plugin": "^2.5.3",
159
- "glob": "^11.0.0",
159
+ "glob": "^13.0.6",
160
160
  "gradient-string": "^3.0.0",
161
161
  "hono": "^4.7.11",
162
162
  "ink": "^6.8.0",
@@ -350,6 +350,12 @@ export async function syncApiContractBridge(opts: {
350
350
  }
351
351
 
352
352
  for (const [key, plugin] of pluginEntries) {
353
+ if (!plugin.url && !plugin.localPath) {
354
+ console.warn(
355
+ `[API Contract] Skipping plugin "${key}" — no URL resolved (local path missing and no production URL configured)`,
356
+ );
357
+ continue;
358
+ }
353
359
  const source = await resolveContractSource({
354
360
  configDir: opts.configDir,
355
361
  runtimeDir,
package/src/cli/init.ts CHANGED
@@ -24,6 +24,36 @@ import { writeSnapshot } from "./snapshot";
24
24
 
25
25
  const require = createRequire(import.meta.url);
26
26
 
27
+ const BOS_CONFIG_ORDER = [
28
+ "extends",
29
+ "account",
30
+ "domain",
31
+ "testnet",
32
+ "staging",
33
+ "repository",
34
+ "app",
35
+ "plugins",
36
+ "shared",
37
+ ];
38
+
39
+ function rebuildOrderedConfig(config: Record<string, unknown>): Record<string, unknown> {
40
+ const ordered: Record<string, unknown> = {};
41
+
42
+ for (const key of BOS_CONFIG_ORDER) {
43
+ if (key in config) {
44
+ ordered[key] = config[key];
45
+ }
46
+ }
47
+
48
+ for (const key of Object.keys(config)) {
49
+ if (!BOS_CONFIG_ORDER.includes(key)) {
50
+ ordered[key] = config[key];
51
+ }
52
+ }
53
+
54
+ return ordered;
55
+ }
56
+
27
57
  interface SourceResult {
28
58
  sourceDir: string;
29
59
  parentConfig: BosConfig;
@@ -259,8 +289,10 @@ export async function personalizeConfig(
259
289
  plugins?: string[];
260
290
  pluginRoutes?: Record<string, string[]>;
261
291
  workspaceOpts?: { localOverrides?: boolean; sourceDir?: string };
292
+ mode?: "init" | "sync";
262
293
  },
263
294
  ): Promise<void> {
295
+ const isInit = opts.mode !== "sync";
264
296
  const configPath = join(destination, "bos.config.json");
265
297
  if (existsSync(configPath)) {
266
298
  const config = JSON.parse(readFileSync(configPath, "utf-8")) as Record<string, unknown>;
@@ -274,7 +306,7 @@ export async function personalizeConfig(
274
306
  config.domain = opts.domain;
275
307
  }
276
308
 
277
- if (config.app && typeof config.app === "object") {
309
+ if (isInit && config.app && typeof config.app === "object") {
278
310
  const app = config.app as Record<string, unknown>;
279
311
  for (const entryKey of Object.keys(app)) {
280
312
  const entry = app[entryKey];
@@ -299,21 +331,23 @@ export async function personalizeConfig(
299
331
  }
300
332
  }
301
333
 
302
- for (const pluginKey of Object.keys(plugins)) {
303
- const plugin = plugins[pluginKey];
304
- if (plugin && typeof plugin === "object") {
305
- const p = plugin as Record<string, unknown>;
306
- delete p.production;
307
- delete p.integrity;
334
+ if (isInit) {
335
+ for (const pluginKey of Object.keys(plugins)) {
336
+ const plugin = plugins[pluginKey];
337
+ if (plugin && typeof plugin === "object") {
338
+ const p = plugin as Record<string, unknown>;
339
+ delete p.production;
340
+ delete p.integrity;
341
+ }
308
342
  }
309
343
  }
310
344
 
311
345
  if (Object.keys(plugins).length === 0) {
312
- delete config.plugins;
346
+ config.plugins = {};
313
347
  }
314
348
  }
315
349
 
316
- writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`);
350
+ writeFileSync(configPath, `${JSON.stringify(rebuildOrderedConfig(config), null, 2)}\n`);
317
351
  }
318
352
 
319
353
  const pkgPath = join(destination, "package.json");
@@ -16,10 +16,7 @@ function deriveAccountFromDomain(domain: string, extendsAccount: string): string
16
16
  return `${firstSegment}.${suffix}`;
17
17
  }
18
18
 
19
- const AVAILABLE_PLUGINS = [
20
- { value: "_template", label: "template" },
21
- { value: "registry", label: "registry" },
22
- ];
19
+ const AVAILABLE_PLUGINS = [{ value: "_template", label: "template" }];
23
20
 
24
21
  export async function promptInitOptions(input: {
25
22
  extendsAccount?: string;
package/src/cli/sync.ts CHANGED
@@ -74,6 +74,78 @@ function backupFiles(projectDir: string, filePaths: string[]): string | null {
74
74
  return backupDir;
75
75
  }
76
76
 
77
+ function isPlainObject(value: unknown): value is Record<string, unknown> {
78
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
79
+ }
80
+
81
+ function mergeJsonValues(local: unknown, template: unknown): unknown {
82
+ if (isPlainObject(local) && isPlainObject(template)) {
83
+ const merged: Record<string, unknown> = {};
84
+ // Preserve local key order first
85
+ for (const key of Object.keys(local)) {
86
+ merged[key] = mergeJsonValues(local[key], template[key]);
87
+ }
88
+ // Append any new template keys at the end
89
+ for (const key of Object.keys(template)) {
90
+ if (!(key in merged)) {
91
+ merged[key] = template[key];
92
+ }
93
+ }
94
+ return merged;
95
+ }
96
+ // For arrays and primitives, local always wins
97
+ return local ?? template;
98
+ }
99
+
100
+ function mergeBosConfig(
101
+ local: Record<string, unknown>,
102
+ template: Record<string, unknown>,
103
+ ): Record<string, unknown> {
104
+ const merged: Record<string, unknown> = {};
105
+
106
+ // 1. extends always first
107
+ if (local.extends !== undefined) merged.extends = local.extends;
108
+ else if (template.extends !== undefined) merged.extends = template.extends;
109
+
110
+ // 2. Fixed trailing group: app, plugins, shared
111
+ const TRAIL_GROUP = ["app", "plugins", "shared"];
112
+
113
+ const localKeys = Object.keys(local).filter((k) => k !== "extends");
114
+ const templateKeys = Object.keys(template).filter(
115
+ (k) => k !== "extends" && !localKeys.includes(k),
116
+ );
117
+
118
+ // Find the first trailing-group key present locally ("app" comes first in the group)
119
+ const firstTrailIndex = localKeys.findIndex((k) => TRAIL_GROUP.includes(k));
120
+
121
+ const orderedKeys: string[] = [];
122
+
123
+ if (firstTrailIndex >= 0) {
124
+ // Keys before the trail group stay in local order
125
+ orderedKeys.push(...localKeys.slice(0, firstTrailIndex));
126
+ // New template keys inserted right before the trail group
127
+ orderedKeys.push(...templateKeys);
128
+ // Trail group keys (app, plugins, shared) in canonical order, preserving local if present
129
+ for (const trailKey of TRAIL_GROUP) {
130
+ if (localKeys.includes(trailKey)) orderedKeys.push(trailKey);
131
+ }
132
+ } else {
133
+ // No trail group found locally — keep local order then append new keys and trail group
134
+ orderedKeys.push(...localKeys);
135
+ orderedKeys.push(...templateKeys);
136
+ for (const trailKey of TRAIL_GROUP) {
137
+ if (templateKeys.includes(trailKey)) orderedKeys.push(trailKey);
138
+ }
139
+ }
140
+
141
+ // 3. Merge values for each key
142
+ for (const key of orderedKeys) {
143
+ merged[key] = mergeJsonValues(local[key], template[key]);
144
+ }
145
+
146
+ return merged;
147
+ }
148
+
77
149
  function mergePackageJson(
78
150
  local: Record<string, unknown>,
79
151
  template: Record<string, unknown>,
@@ -130,6 +202,19 @@ function writeSyncedFile(sourceDir: string, projectDir: string, filePath: string
130
202
  const dest = join(projectDir, destPath);
131
203
  mkdirSync(dirname(dest), { recursive: true });
132
204
 
205
+ if (filePath.endsWith("bos.config.json")) {
206
+ const localContent = existsSync(dest) ? readFileSync(dest, "utf-8") : null;
207
+ const templateContent = readFileSync(src, "utf-8");
208
+
209
+ if (localContent) {
210
+ const local = JSON.parse(localContent) as Record<string, unknown>;
211
+ const template = JSON.parse(templateContent) as Record<string, unknown>;
212
+ const merged = mergeBosConfig(local, template);
213
+ writeFileSync(dest, `${JSON.stringify(merged, null, 2)}\n`);
214
+ return;
215
+ }
216
+ }
217
+
133
218
  if (filePath.endsWith("package.json")) {
134
219
  const localContent = existsSync(dest) ? readFileSync(dest, "utf-8") : null;
135
220
  const templateContent = readFileSync(src, "utf-8");
@@ -348,6 +433,7 @@ export async function syncTemplate(projectDir: string, options: SyncOptions): Pr
348
433
  plugins: childPlugins,
349
434
  pluginRoutes,
350
435
  workspaceOpts: { sourceDir },
436
+ mode: "sync",
351
437
  });
352
438
 
353
439
  if (!options.noInstall) {