everything-dev 1.14.0 → 1.14.1
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/contract.d.cts +2 -2
- package/dist/contract.d.mts +2 -2
- package/dist/plugin.cjs +39 -44
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +2 -2
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.mjs +39 -44
- package/dist/plugin.mjs.map +1 -1
- package/dist/service-descriptor.d.cts +1 -1
- package/dist/service-descriptor.d.mts +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/package.json +1 -1
- package/src/plugin.ts +57 -49
|
@@ -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: "
|
|
29
|
+
env: "production" | "development" | "staging";
|
|
30
30
|
account: string;
|
|
31
31
|
networkId: "testnet" | "mainnet";
|
|
32
32
|
host: {
|
package/dist/types.d.cts
CHANGED
|
@@ -348,8 +348,8 @@ declare const BosConfigSchema: z.ZodObject<{
|
|
|
348
348
|
type BosConfig = z.infer<typeof BosConfigSchema>;
|
|
349
349
|
declare const RuntimeConfigSchema: z.ZodObject<{
|
|
350
350
|
env: z.ZodEnum<{
|
|
351
|
-
development: "development";
|
|
352
351
|
production: "production";
|
|
352
|
+
development: "development";
|
|
353
353
|
staging: "staging";
|
|
354
354
|
}>;
|
|
355
355
|
account: z.ZodString;
|
|
@@ -489,8 +489,8 @@ type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;
|
|
|
489
489
|
declare const ClientRuntimeConfigSchema: z.ZodObject<{
|
|
490
490
|
cspNonce: z.ZodOptional<z.ZodString>;
|
|
491
491
|
env: z.ZodEnum<{
|
|
492
|
-
development: "development";
|
|
493
492
|
production: "production";
|
|
493
|
+
development: "development";
|
|
494
494
|
staging: "staging";
|
|
495
495
|
}>;
|
|
496
496
|
account: z.ZodString;
|
package/dist/types.d.mts
CHANGED
|
@@ -348,8 +348,8 @@ declare const BosConfigSchema: z.ZodObject<{
|
|
|
348
348
|
type BosConfig = z.infer<typeof BosConfigSchema>;
|
|
349
349
|
declare const RuntimeConfigSchema: z.ZodObject<{
|
|
350
350
|
env: z.ZodEnum<{
|
|
351
|
-
development: "development";
|
|
352
351
|
production: "production";
|
|
352
|
+
development: "development";
|
|
353
353
|
staging: "staging";
|
|
354
354
|
}>;
|
|
355
355
|
account: z.ZodString;
|
|
@@ -489,8 +489,8 @@ type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;
|
|
|
489
489
|
declare const ClientRuntimeConfigSchema: z.ZodObject<{
|
|
490
490
|
cspNonce: z.ZodOptional<z.ZodString>;
|
|
491
491
|
env: z.ZodEnum<{
|
|
492
|
-
development: "development";
|
|
493
492
|
production: "production";
|
|
493
|
+
development: "development";
|
|
494
494
|
staging: "staging";
|
|
495
495
|
}>;
|
|
496
496
|
account: z.ZodString;
|
package/package.json
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -243,20 +243,41 @@ function listPluginAttachments(config: BosConfig | null) {
|
|
|
243
243
|
.sort((a, b) => a.key.localeCompare(b.key));
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
interface GeneratedArtifacts {
|
|
247
|
+
sidebarPath: string;
|
|
248
|
+
resolvedConfigPath?: string;
|
|
249
|
+
contractBridgePath: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async function generateCodeArtifacts(
|
|
247
253
|
configDir: string,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
254
|
+
config: BosConfig,
|
|
255
|
+
opts?: {
|
|
256
|
+
env?: BosEnv;
|
|
257
|
+
extendsChain?: string[];
|
|
258
|
+
runtimeConfig?: RuntimeConfig;
|
|
259
|
+
},
|
|
260
|
+
): Promise<GeneratedArtifacts | null> {
|
|
261
|
+
writePluginSidebarGen(configDir, config);
|
|
262
|
+
|
|
263
|
+
if (opts?.env) {
|
|
264
|
+
writeResolvedConfig(configDir, config, opts.env, opts.extendsChain);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const runtimeConfig = opts?.runtimeConfig ?? (await loadConfig({ cwd: configDir }))?.runtime;
|
|
268
|
+
if (!runtimeConfig) return null;
|
|
252
269
|
|
|
253
|
-
await syncApiContractBridge({
|
|
270
|
+
const bridge = await syncApiContractBridge({
|
|
254
271
|
configDir,
|
|
255
|
-
runtimeConfig
|
|
256
|
-
apiBaseUrl:
|
|
272
|
+
runtimeConfig,
|
|
273
|
+
apiBaseUrl: runtimeConfig.api.url,
|
|
257
274
|
});
|
|
258
275
|
|
|
259
|
-
|
|
276
|
+
return {
|
|
277
|
+
sidebarPath: join(configDir, "ui/src/lib/plugin-sidebar.gen.ts"),
|
|
278
|
+
resolvedConfigPath: opts?.env ? join(configDir, ".bos/bos.resolved-config.json") : undefined,
|
|
279
|
+
contractBridgePath: bridge.bridgePath,
|
|
280
|
+
};
|
|
260
281
|
}
|
|
261
282
|
|
|
262
283
|
function extractPublishedUrl(output: string): string | null {
|
|
@@ -512,7 +533,7 @@ export default createPlugin({
|
|
|
512
533
|
};
|
|
513
534
|
|
|
514
535
|
await saveBosConfig(deps.configDir, deps.bosConfig);
|
|
515
|
-
await
|
|
536
|
+
await generateCodeArtifacts(deps.configDir, deps.bosConfig);
|
|
516
537
|
|
|
517
538
|
const stored = deps.bosConfig.plugins?.[key];
|
|
518
539
|
const storedObj = stored && typeof stored === "object" ? stored : {};
|
|
@@ -552,7 +573,7 @@ export default createPlugin({
|
|
|
552
573
|
};
|
|
553
574
|
|
|
554
575
|
await saveBosConfig(deps.configDir, deps.bosConfig);
|
|
555
|
-
await
|
|
576
|
+
await generateCodeArtifacts(deps.configDir, deps.bosConfig);
|
|
556
577
|
|
|
557
578
|
return {
|
|
558
579
|
status: "removed" as const,
|
|
@@ -749,7 +770,7 @@ export default createPlugin({
|
|
|
749
770
|
}
|
|
750
771
|
}
|
|
751
772
|
|
|
752
|
-
await
|
|
773
|
+
await generateCodeArtifacts(deps.configDir, deps.bosConfig);
|
|
753
774
|
}
|
|
754
775
|
|
|
755
776
|
return {
|
|
@@ -808,16 +829,6 @@ export default createPlugin({
|
|
|
808
829
|
deps.bosConfig = refreshed?.config ?? deps.bosConfig;
|
|
809
830
|
deps.runtimeConfig = refreshed?.runtime ?? deps.runtimeConfig;
|
|
810
831
|
|
|
811
|
-
if (deps.bosConfig) {
|
|
812
|
-
writeResolvedConfig(
|
|
813
|
-
deps.configDir,
|
|
814
|
-
deps.bosConfig,
|
|
815
|
-
"development",
|
|
816
|
-
refreshed?.source.extended,
|
|
817
|
-
);
|
|
818
|
-
writePluginSidebarGen(deps.configDir, deps.bosConfig);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
832
|
if (!deps.bosConfig) {
|
|
822
833
|
return {
|
|
823
834
|
status: "error" as const,
|
|
@@ -848,6 +859,12 @@ export default createPlugin({
|
|
|
848
859
|
ssr,
|
|
849
860
|
});
|
|
850
861
|
|
|
862
|
+
await generateCodeArtifacts(deps.configDir, deps.bosConfig, {
|
|
863
|
+
env: "development",
|
|
864
|
+
extendsChain: refreshed?.source.extended,
|
|
865
|
+
runtimeConfig,
|
|
866
|
+
});
|
|
867
|
+
|
|
851
868
|
const services = buildServiceDescriptorMap(runtimeConfig, { ssr, proxy });
|
|
852
869
|
const packages = [...services.keys()];
|
|
853
870
|
const displayEnv: Record<string, string> = {};
|
|
@@ -857,12 +874,6 @@ export default createPlugin({
|
|
|
857
874
|
if (proxyUrl) displayEnv.API_PROXY = proxyUrl;
|
|
858
875
|
}
|
|
859
876
|
|
|
860
|
-
await syncApiContractBridge({
|
|
861
|
-
configDir: deps.configDir,
|
|
862
|
-
runtimeConfig: runtimeConfig,
|
|
863
|
-
apiBaseUrl: runtimeConfig.api.url,
|
|
864
|
-
});
|
|
865
|
-
|
|
866
877
|
const orchestrator: AppOrchestrator = {
|
|
867
878
|
packages,
|
|
868
879
|
env: displayEnv,
|
|
@@ -937,7 +948,10 @@ export default createPlugin({
|
|
|
937
948
|
plugins: runtimePlugins,
|
|
938
949
|
});
|
|
939
950
|
|
|
940
|
-
|
|
951
|
+
await generateCodeArtifacts(deps.configDir, config, {
|
|
952
|
+
env: "production",
|
|
953
|
+
runtimeConfig,
|
|
954
|
+
});
|
|
941
955
|
|
|
942
956
|
// ── Production Readiness Validation ──
|
|
943
957
|
const productionEnv: Record<string, string> = {};
|
|
@@ -979,12 +993,6 @@ export default createPlugin({
|
|
|
979
993
|
|
|
980
994
|
const services = buildServiceDescriptorMap(runtimeConfig);
|
|
981
995
|
|
|
982
|
-
await syncApiContractBridge({
|
|
983
|
-
configDir: deps.configDir,
|
|
984
|
-
runtimeConfig: runtimeConfig,
|
|
985
|
-
apiBaseUrl: runtimeConfig.api.url,
|
|
986
|
-
});
|
|
987
|
-
|
|
988
996
|
const stagingEnvVars: Record<string, string> = isStaging
|
|
989
997
|
? { BOS_GATEWAY: config.staging?.domain ?? config.domain ?? "" }
|
|
990
998
|
: {};
|
|
@@ -1052,9 +1060,6 @@ export default createPlugin({
|
|
|
1052
1060
|
|
|
1053
1061
|
const buildEnv: BosEnv = input.deploy ? "production" : "development";
|
|
1054
1062
|
|
|
1055
|
-
writeResolvedConfig(deps.configDir, deps.bosConfig, buildEnv);
|
|
1056
|
-
writePluginSidebarGen(deps.configDir, deps.bosConfig);
|
|
1057
|
-
|
|
1058
1063
|
const targets = selectWorkspaceTargets(input.packages, deps.bosConfig);
|
|
1059
1064
|
if (targets.length === 0) {
|
|
1060
1065
|
return {
|
|
@@ -1073,10 +1078,9 @@ export default createPlugin({
|
|
|
1073
1078
|
plugins: deps.runtimeConfig?.plugins,
|
|
1074
1079
|
});
|
|
1075
1080
|
|
|
1076
|
-
await
|
|
1077
|
-
|
|
1081
|
+
await generateCodeArtifacts(deps.configDir, deps.bosConfig, {
|
|
1082
|
+
env: buildEnv,
|
|
1078
1083
|
runtimeConfig,
|
|
1079
|
-
apiBaseUrl: runtimeConfig.api.url,
|
|
1080
1084
|
});
|
|
1081
1085
|
|
|
1082
1086
|
const { built, skipped } = await buildWorkspaceTargets({
|
|
@@ -1141,6 +1145,11 @@ export default createPlugin({
|
|
|
1141
1145
|
}
|
|
1142
1146
|
|
|
1143
1147
|
if (input.deploy) {
|
|
1148
|
+
await generateCodeArtifacts(deps.configDir, deps.bosConfig, {
|
|
1149
|
+
env: "production",
|
|
1150
|
+
runtimeConfig: deps.runtimeConfig ?? undefined,
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1144
1153
|
const result = await buildWorkspaceTargets({
|
|
1145
1154
|
configDir: deps.configDir,
|
|
1146
1155
|
bosConfig: deps.bosConfig,
|
|
@@ -1423,7 +1432,7 @@ export default createPlugin({
|
|
|
1423
1432
|
|
|
1424
1433
|
const initConfig = await loadConfig({ cwd: directory });
|
|
1425
1434
|
if (initConfig?.config) {
|
|
1426
|
-
|
|
1435
|
+
await generateCodeArtifacts(directory, initConfig.config);
|
|
1427
1436
|
}
|
|
1428
1437
|
|
|
1429
1438
|
s.stop("Project initialized");
|
|
@@ -1480,7 +1489,7 @@ export default createPlugin({
|
|
|
1480
1489
|
if (result.status === "synced" || result.status === "dry-run") {
|
|
1481
1490
|
const syncedConfig = await loadConfig({ cwd: projectDir });
|
|
1482
1491
|
if (syncedConfig?.config) {
|
|
1483
|
-
|
|
1492
|
+
await generateCodeArtifacts(projectDir, syncedConfig.config);
|
|
1484
1493
|
}
|
|
1485
1494
|
}
|
|
1486
1495
|
|
|
@@ -1595,13 +1604,12 @@ export default createPlugin({
|
|
|
1595
1604
|
};
|
|
1596
1605
|
}
|
|
1597
1606
|
|
|
1598
|
-
|
|
1599
|
-
configDir: projectDir,
|
|
1607
|
+
await generateCodeArtifacts(projectDir, refreshed.config, {
|
|
1600
1608
|
runtimeConfig: refreshed.runtime,
|
|
1601
|
-
apiBaseUrl: refreshed.runtime.api.url,
|
|
1602
1609
|
});
|
|
1603
1610
|
|
|
1604
1611
|
const generated = [
|
|
1612
|
+
"ui/src/lib/plugin-sidebar.gen.ts",
|
|
1605
1613
|
"ui/src/lib/api-types.gen.ts",
|
|
1606
1614
|
"api/src/lib/plugins-types.gen.ts",
|
|
1607
1615
|
"api/src/lib/auth-types.gen.ts",
|
|
@@ -1619,10 +1627,10 @@ export default createPlugin({
|
|
|
1619
1627
|
return {
|
|
1620
1628
|
status: "success" as const,
|
|
1621
1629
|
generated,
|
|
1622
|
-
fetched:
|
|
1623
|
-
skipped:
|
|
1630
|
+
fetched: refreshed.runtime.api.source === "remote" ? [refreshed.runtime.api.url] : [],
|
|
1631
|
+
skipped: refreshed.runtime.api.source === "local" ? ["api (local)"] : [],
|
|
1624
1632
|
failed: [],
|
|
1625
|
-
source:
|
|
1633
|
+
source: refreshed.runtime.api.source,
|
|
1626
1634
|
};
|
|
1627
1635
|
} catch (error) {
|
|
1628
1636
|
return {
|