everything-dev 1.16.2 → 1.16.3

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.
Files changed (56) hide show
  1. package/dist/api-contract.cjs +16 -5
  2. package/dist/api-contract.cjs.map +1 -1
  3. package/dist/api-contract.mjs +16 -5
  4. package/dist/api-contract.mjs.map +1 -1
  5. package/dist/cli/timing.cjs +30 -0
  6. package/dist/cli/timing.cjs.map +1 -0
  7. package/dist/cli/timing.mjs +27 -0
  8. package/dist/cli/timing.mjs.map +1 -0
  9. package/dist/cli/upgrade.cjs +66 -47
  10. package/dist/cli/upgrade.cjs.map +1 -1
  11. package/dist/cli/upgrade.mjs +66 -47
  12. package/dist/cli/upgrade.mjs.map +1 -1
  13. package/dist/cli.cjs +9 -0
  14. package/dist/cli.cjs.map +1 -1
  15. package/dist/cli.mjs +9 -0
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/components/dev-view.cjs +1 -1
  18. package/dist/components/dev-view.mjs +1 -1
  19. package/dist/components/streaming-view.cjs +1 -1
  20. package/dist/components/streaming-view.mjs +1 -1
  21. package/dist/contract.cjs +7 -0
  22. package/dist/contract.cjs.map +1 -1
  23. package/dist/contract.d.cts +24 -3
  24. package/dist/contract.d.cts.map +1 -1
  25. package/dist/contract.d.mts +24 -3
  26. package/dist/contract.d.mts.map +1 -1
  27. package/dist/contract.mjs +7 -1
  28. package/dist/contract.mjs.map +1 -1
  29. package/dist/dev-session.cjs +5 -3
  30. package/dist/dev-session.cjs.map +1 -1
  31. package/dist/dev-session.mjs +3 -3
  32. package/dist/dev-session.mjs.map +1 -1
  33. package/dist/index.cjs +1 -0
  34. package/dist/index.d.cts +2 -2
  35. package/dist/index.d.mts +2 -2
  36. package/dist/index.mjs +2 -2
  37. package/dist/orchestrator.cjs +1 -1
  38. package/dist/orchestrator.mjs +1 -1
  39. package/dist/plugin.cjs +38 -24
  40. package/dist/plugin.cjs.map +1 -1
  41. package/dist/plugin.d.cts +10 -2
  42. package/dist/plugin.d.cts.map +1 -1
  43. package/dist/plugin.d.mts +10 -2
  44. package/dist/plugin.d.mts.map +1 -1
  45. package/dist/plugin.mjs +37 -23
  46. package/dist/plugin.mjs.map +1 -1
  47. package/dist/types.d.cts +2 -2
  48. package/dist/types.d.mts +2 -2
  49. package/package.json +1 -1
  50. package/src/api-contract.ts +21 -3
  51. package/src/cli/timing.ts +36 -0
  52. package/src/cli/upgrade.ts +82 -53
  53. package/src/cli.ts +15 -0
  54. package/src/contract.ts +8 -0
  55. package/src/dev-session.ts +1 -1
  56. package/src/plugin.ts +75 -38
package/dist/plugin.d.cts CHANGED
@@ -307,6 +307,10 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
307
307
  extends: z.ZodString;
308
308
  plugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
309
309
  filesCopied: z.ZodNumber;
310
+ timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
311
+ name: z.ZodString;
312
+ durationMs: z.ZodNumber;
313
+ }, z.core.$strip>>>;
310
314
  error: z.ZodOptional<z.ZodString>;
311
315
  }, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
312
316
  sync: ContractProcedure<z.ZodObject<{
@@ -354,6 +358,10 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
354
358
  migrated: z.ZodOptional<z.ZodArray<z.ZodString>>;
355
359
  availablePlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
356
360
  selectedPlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
361
+ timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
362
+ name: z.ZodString;
363
+ durationMs: z.ZodNumber;
364
+ }, z.core.$strip>>>;
357
365
  changelogUrl: z.ZodOptional<z.ZodString>;
358
366
  error: z.ZodOptional<z.ZodString>;
359
367
  }, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
@@ -381,8 +389,8 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
381
389
  }, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
382
390
  typesGen: ContractProcedure<z.ZodObject<{
383
391
  env: z.ZodOptional<z.ZodEnum<{
384
- production: "production";
385
392
  development: "development";
393
+ production: "production";
386
394
  }>>;
387
395
  dryRun: z.ZodDefault<z.ZodBoolean>;
388
396
  }, z.core.$strip>, z.ZodObject<{
@@ -506,7 +514,7 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
506
514
  }> | undefined;
507
515
  } | null;
508
516
  runtimeConfig: {
509
- env: "production" | "development" | "staging";
517
+ env: "development" | "production" | "staging";
510
518
  account: string;
511
519
  networkId: "testnet" | "mainnet";
512
520
  host: {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;cA+CwC,QAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;cAoDwC,QAAA"}
package/dist/plugin.d.mts CHANGED
@@ -307,6 +307,10 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
307
307
  extends: z.ZodString;
308
308
  plugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
309
309
  filesCopied: z.ZodNumber;
310
+ timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
311
+ name: z.ZodString;
312
+ durationMs: z.ZodNumber;
313
+ }, z.core.$strip>>>;
310
314
  error: z.ZodOptional<z.ZodString>;
311
315
  }, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
312
316
  sync: ContractProcedure<z.ZodObject<{
@@ -354,6 +358,10 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
354
358
  migrated: z.ZodOptional<z.ZodArray<z.ZodString>>;
355
359
  availablePlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
356
360
  selectedPlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
361
+ timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
362
+ name: z.ZodString;
363
+ durationMs: z.ZodNumber;
364
+ }, z.core.$strip>>>;
357
365
  changelogUrl: z.ZodOptional<z.ZodString>;
358
366
  error: z.ZodOptional<z.ZodString>;
359
367
  }, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
@@ -381,8 +389,8 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
381
389
  }, z.core.$strip>, MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
382
390
  typesGen: ContractProcedure<z.ZodObject<{
383
391
  env: z.ZodOptional<z.ZodEnum<{
384
- production: "production";
385
392
  development: "development";
393
+ production: "production";
386
394
  }>>;
387
395
  dryRun: z.ZodDefault<z.ZodBoolean>;
388
396
  }, z.core.$strip>, z.ZodObject<{
@@ -506,7 +514,7 @@ declare const _default: _$every_plugin0.LoadedPluginWithBinding<{
506
514
  }> | undefined;
507
515
  } | null;
508
516
  runtimeConfig: {
509
- env: "production" | "development" | "staging";
517
+ env: "development" | "production" | "staging";
510
518
  account: string;
511
519
  networkId: "testnet" | "mainnet";
512
520
  host: {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;cA+CwC,QAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;cAoDwC,QAAA"}
package/dist/plugin.mjs CHANGED
@@ -11,21 +11,24 @@ import { copyFilteredFiles, fetchParentConfig, generateDatabaseMigrations, perso
11
11
  import { promptInitOptions } from "./cli/prompts.mjs";
12
12
  import { getStatus } from "./cli/status.mjs";
13
13
  import { syncTemplate } from "./cli/sync.mjs";
14
+ import { timePhase } from "./cli/timing.mjs";
14
15
  import { upgradeTemplate } from "./cli/upgrade.mjs";
15
- import { colors } from "./utils/theme.mjs";
16
16
  import { computeSriHashForUrl } from "./integrity.mjs";
17
- import { buildDescription, buildServiceDescriptorMap } from "./service-descriptor.mjs";
18
- import { devApp, startApp } from "./dev-session.mjs";
19
17
  import { addFunctionCallAccessKey, ensureNearCli, executeTransaction } from "./near-cli.mjs";
18
+ import { buildDescription, buildServiceDescriptorMap } from "./service-descriptor.mjs";
20
19
  import { syncAndGenerateSharedUi } from "./shared.mjs";
21
20
  import { writePluginSidebarGen } from "./sidebar.mjs";
22
21
  import { run } from "./utils/run.mjs";
22
+ import { colors } from "./utils/theme.mjs";
23
23
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
24
24
  import { basename, dirname, join, resolve } from "node:path";
25
25
  import * as p from "@clack/prompts";
26
26
  import { Effect } from "effect";
27
27
 
28
28
  //#region src/plugin.ts
29
+ async function loadDevSession() {
30
+ return import("./dev-session.mjs");
31
+ }
29
32
  const buildCommands = {
30
33
  host: {
31
34
  cmd: "bun",
@@ -531,6 +534,7 @@ var plugin_default = createPlugin({
531
534
  port: runtimeConfig.host.port,
532
535
  interactive: input.interactive
533
536
  };
537
+ const { devApp } = await loadDevSession();
534
538
  devApp(orchestrator, services, runtimeConfig);
535
539
  return {
536
540
  status: "started",
@@ -609,7 +613,7 @@ var plugin_default = createPlugin({
609
613
  }
610
614
  summaryLines.push("");
611
615
  console.log(summaryLines.join("\n"));
612
- startApp({
616
+ const orchestrator = {
613
617
  packages: ["host"],
614
618
  env: {
615
619
  NODE_ENV: "production",
@@ -620,7 +624,9 @@ var plugin_default = createPlugin({
620
624
  port,
621
625
  interactive: input.interactive,
622
626
  noLogs: true
623
- }, services, runtimeConfig);
627
+ };
628
+ const { startApp } = await loadDevSession();
629
+ startApp(orchestrator, services, runtimeConfig);
624
630
  return {
625
631
  status: "running",
626
632
  url: `http://localhost:${port}`
@@ -818,6 +824,7 @@ var plugin_default = createPlugin({
818
824
  }),
819
825
  init: builder.init.handler(async ({ input }) => {
820
826
  try {
827
+ const timings = [];
821
828
  let extendsAccount = input.extendsAccount;
822
829
  let extendsGateway = input.extendsGateway;
823
830
  let directory = input.directory;
@@ -837,7 +844,7 @@ var plugin_default = createPlugin({
837
844
  let parentPluginKeys = [];
838
845
  let parentConfig = null;
839
846
  try {
840
- parentConfig = await fetchParentConfig(extendsAccount, extendsGateway);
847
+ parentConfig = await timePhase(timings, "parent config", () => fetchParentConfig(extendsAccount, extendsGateway));
841
848
  if (parentConfig?.plugins && typeof parentConfig.plugins === "object") parentPluginKeys = Object.keys(parentConfig.plugins);
842
849
  } catch {}
843
850
  if (!input.noInteractive) {
@@ -864,7 +871,7 @@ var plugin_default = createPlugin({
864
871
  const targetDir = resolve(directory);
865
872
  plugins = plugins ?? [];
866
873
  if (!parentConfig) try {
867
- parentConfig = await fetchParentConfig(extendsAccount, extendsGateway);
874
+ parentConfig = await timePhase(timings, "parent config", () => fetchParentConfig(extendsAccount, extendsGateway));
868
875
  } catch {
869
876
  return {
870
877
  status: "error",
@@ -876,14 +883,15 @@ var plugin_default = createPlugin({
876
883
  extends: `bos://${extendsAccount}/${extendsGateway}`,
877
884
  plugins: plugins ?? [],
878
885
  filesCopied: 0,
886
+ timings,
879
887
  error: `No config found at bos://${extendsAccount}/${extendsGateway} — are you sure this is the right parent?`
880
888
  };
881
889
  }
882
- const { sourceDir, parentConfig: resolvedParentConfig, cleanup } = await resolveSourceDir({
890
+ const { sourceDir, parentConfig: resolvedParentConfig, cleanup } = await timePhase(timings, "template source", () => resolveSourceDir({
883
891
  extendsAccount,
884
892
  extendsGateway,
885
893
  source: input.source
886
- });
894
+ }));
887
895
  parentConfig = resolvedParentConfig;
888
896
  try {
889
897
  const patterns = await readTemplatekeep(sourceDir);
@@ -906,12 +914,12 @@ var plugin_default = createPlugin({
906
914
  }
907
915
  const s = p.spinner();
908
916
  s.start("Setting up project");
909
- const filesCopied = await copyFilteredFiles(sourceDir, targetDir, patterns, {
917
+ const filesCopied = await timePhase(timings, "copy files", () => copyFilteredFiles(sourceDir, targetDir, patterns, {
910
918
  withHost,
911
919
  plugins,
912
920
  pluginRoutes
913
- });
914
- await personalizeConfig(targetDir, {
921
+ }));
922
+ await timePhase(timings, "personalize config", () => personalizeConfig(targetDir, {
915
923
  extendsAccount,
916
924
  extendsGateway,
917
925
  account: account || extendsAccount,
@@ -920,21 +928,25 @@ var plugin_default = createPlugin({
920
928
  pluginRoutes,
921
929
  workspaceOpts: { sourceDir },
922
930
  withHost
923
- });
924
- await writeInitSnapshot(targetDir, extendsAccount, extendsGateway, sourceDir, patterns, {
931
+ }));
932
+ await timePhase(timings, "write snapshot", () => writeInitSnapshot(targetDir, extendsAccount, extendsGateway, sourceDir, patterns, {
925
933
  withHost,
926
934
  plugins,
927
935
  pluginRoutes
936
+ }));
937
+ const initConfig = await timePhase(timings, "resolve config", () => loadConfig({ cwd: targetDir }));
938
+ if (initConfig?.runtime) await timePhase(timings, "generate env/docker", async () => {
939
+ writeGeneratedInfra(targetDir, initConfig.runtime);
940
+ });
941
+ await timePhase(timings, "create env file", async () => {
942
+ ensureEnvFile(targetDir);
928
943
  });
929
- const initConfig = await loadConfig({ cwd: targetDir });
930
- if (initConfig?.runtime) writeGeneratedInfra(targetDir, initConfig.runtime);
931
- ensureEnvFile(targetDir);
932
944
  if (!input.noInstall) {
933
- await runBunInstall(targetDir);
934
- await runTypesGen(targetDir);
935
- await generateDatabaseMigrations(targetDir);
945
+ await timePhase(timings, "install dependencies", () => runBunInstall(targetDir));
946
+ await timePhase(timings, "generate types", () => runTypesGen(targetDir));
947
+ await timePhase(timings, "generate migrations", () => generateDatabaseMigrations(targetDir));
936
948
  }
937
- if (initConfig?.config) await generateCodeArtifacts(targetDir, initConfig.config);
949
+ if (input.noInstall && initConfig?.config) await timePhase(timings, "generate code artifacts", () => generateCodeArtifacts(targetDir, initConfig.config));
938
950
  s.stop("Project initialized");
939
951
  if (!input.noInteractive) {
940
952
  if (await p.confirm({
@@ -944,7 +956,7 @@ var plugin_default = createPlugin({
944
956
  const dockerSpinner = p.spinner();
945
957
  dockerSpinner.start("Starting Docker services");
946
958
  try {
947
- await runDockerComposeUp(targetDir);
959
+ await timePhase(timings, "docker compose up", () => runDockerComposeUp(targetDir));
948
960
  dockerSpinner.stop("Docker services ready");
949
961
  } catch (error) {
950
962
  dockerSpinner.stop("Docker services not started");
@@ -961,7 +973,8 @@ var plugin_default = createPlugin({
961
973
  domain,
962
974
  extends: `bos://${extendsAccount}/${extendsGateway}`,
963
975
  plugins,
964
- filesCopied
976
+ filesCopied,
977
+ timings
965
978
  };
966
979
  } finally {
967
980
  await cleanup();
@@ -977,6 +990,7 @@ var plugin_default = createPlugin({
977
990
  extends: input.extendsAccount && input.extendsGateway ? `bos://${input.extendsAccount}/${input.extendsGateway}` : "",
978
991
  plugins: input.plugins ?? [],
979
992
  filesCopied: 0,
993
+ timings: [],
980
994
  error: error instanceof Error ? error.message : "Unknown error"
981
995
  };
982
996
  }