@holo-js/cli 0.2.5 → 0.3.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.
Files changed (53) hide show
  1. package/dist/{agent-skills-MSEMQUXT.mjs → agent-skills-CHAXS2YN.mjs} +13 -6
  2. package/dist/bin/holo.mjs +436 -109
  3. package/dist/{broadcast-5MJ3GJK7.mjs → broadcast-5VZM5SGQ.mjs} +13 -10
  4. package/dist/{broadcast-MRJGFCFH.mjs → broadcast-AABT52BK.mjs} +13 -10
  5. package/dist/cache-A42JSVYA.mjs +138 -0
  6. package/dist/cache-DUVBBOZU.mjs +138 -0
  7. package/dist/{cache-migrations-CPYQC7T6.mjs → cache-migrations-4WKSEN2Q.mjs} +12 -10
  8. package/dist/{cache-migrations-APDFSFEX.mjs → cache-migrations-PD2T5AV4.mjs} +14 -12
  9. package/dist/chunk-3RFRE7XG.mjs +491 -0
  10. package/dist/{chunk-PT72AMV7.mjs → chunk-6BHJLCAO.mjs} +256 -392
  11. package/dist/{chunk-KS5TWO75.mjs → chunk-EQUFFLRG.mjs} +7 -7
  12. package/dist/chunk-HX6MOYBO.mjs +2 -0
  13. package/dist/{chunk-YEFJBN56.mjs → chunk-JVLZ3SOW.mjs} +11 -8
  14. package/dist/{chunk-UPXQONEH.mjs → chunk-KRADH7PK.mjs} +55 -51
  15. package/dist/chunk-LALDNNPH.mjs +428 -0
  16. package/dist/chunk-LHK5YUR4.mjs +156 -0
  17. package/dist/{chunk-LBJAJLKU.mjs → chunk-M3IPUCTM.mjs} +1 -1
  18. package/dist/{chunk-TWITVSFZ.mjs → chunk-OI54DOHK.mjs} +256 -392
  19. package/dist/{chunk-LXGQCG56.mjs → chunk-OLZEMIDQ.mjs} +1 -1
  20. package/dist/{chunk-VP2E62DF.mjs → chunk-QSVMXMTQ.mjs} +49 -349
  21. package/dist/{chunk-J76GH2DR.mjs → chunk-R4ZYMEDU.mjs} +129 -86
  22. package/dist/{chunk-XDRCZ3Z5.mjs → chunk-TH5YCOZB.mjs} +57 -53
  23. package/dist/chunk-TRYHX5S4.mjs +360 -0
  24. package/dist/chunk-XBOVM6LO.mjs +41 -0
  25. package/dist/{chunk-ILU426CF.mjs → chunk-YACY2572.mjs} +482 -2
  26. package/dist/{config-MD27U4FM.mjs → config-BZHQK532.mjs} +3 -3
  27. package/dist/{dev-CT4DRTLN.mjs → dev-7KGRV56X.mjs} +10 -8
  28. package/dist/{dev-QDLR6C7K.mjs → dev-GQT37XJU.mjs} +10 -8
  29. package/dist/{discovery-GWTBF5RZ.mjs → discovery-HNH3BLDL.mjs} +8 -6
  30. package/dist/{generators-PUN5TFP5.mjs → generators-3FVW4AEJ.mjs} +18 -15
  31. package/dist/{generators-WQHI7DBW.mjs → generators-JWVNGUUE.mjs} +14 -11
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.mjs +434 -107
  34. package/dist/{media-migrations-D3CDNMPT.mjs → media-migrations-EG34NYAG.mjs} +13 -11
  35. package/dist/{media-migrations-IWCSCKSA.mjs → media-migrations-LGI7R7AR.mjs} +11 -9
  36. package/dist/plugins-ZGLB6JO6.mjs +24 -0
  37. package/dist/{queue-O3OSLGOV.mjs → queue-BEZDCZCY.mjs} +54 -16
  38. package/dist/{queue-GRB2IH5M.mjs → queue-R54DUUYA.mjs} +54 -16
  39. package/dist/{queue-migrations-7T42S4FX.mjs → queue-migrations-AM3AKT76.mjs} +16 -11
  40. package/dist/{queue-migrations-HFZB64OG.mjs → queue-migrations-U477YSFD.mjs} +18 -13
  41. package/dist/{runtime-TTRP2DGL.mjs → runtime-4TJYZLQV.mjs} +10 -8
  42. package/dist/{runtime-M3G5OKQV.mjs → runtime-MSRQD5W5.mjs} +10 -8
  43. package/dist/{runtime-GSXF4NB3.mjs → runtime-VR5BDPYQ.mjs} +1 -1
  44. package/dist/runtime-worker.mjs +7 -1
  45. package/dist/{scaffold-5BOVJYF3.mjs → scaffold-ASEX5LEX.mjs} +8 -4
  46. package/dist/{scaffold-NY3MWUZF.mjs → scaffold-ZAD3XUSD.mjs} +8 -4
  47. package/dist/{security-ST6ED7EK.mjs → security-4QLV7QCH.mjs} +8 -6
  48. package/dist/{security-H7AGDFBX.mjs → security-KYTLP4DF.mjs} +8 -6
  49. package/package.json +35 -8
  50. package/dist/cache-KVRYC7FB.mjs +0 -66
  51. package/dist/cache-WWE4Q4YE.mjs +0 -66
  52. package/dist/chunk-D7O4SU6N.mjs +0 -2
  53. package/dist/chunk-FGQ2I2YH.mjs +0 -22
@@ -29,11 +29,12 @@ import {
29
29
  GENERATED_SVELTE_SERVER_HOOKS_PATH,
30
30
  GENERATED_TSCONFIG_PATH,
31
31
  SUPPORTED_CONFIG_EXTENSIONS,
32
+ getFrameworkDescriptor,
32
33
  importProjectModule,
33
34
  isRecord,
34
35
  makeProjectRelativePath,
35
36
  normalizeScaffoldOptionalPackages
36
- } from "./chunk-ILU426CF.mjs";
37
+ } from "./chunk-YACY2572.mjs";
37
38
 
38
39
  // src/templates.ts
39
40
  import { dirname, relative, resolve } from "path";
@@ -888,13 +889,9 @@ function renderSveltePage(projectName) {
888
889
  }
889
890
  function renderSvelteHoloHelper() {
890
891
  return [
891
- "import { dirname, resolve } from 'node:path'",
892
- "import { fileURLToPath } from 'node:url'",
893
892
  "import { createSvelteKitHoloHelpers } from '@holo-js/adapter-sveltekit'",
894
893
  "",
895
- "const projectRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../../..')",
896
- "",
897
- "export const holo = createSvelteKitHoloHelpers({ projectRoot })",
894
+ "export const holo = createSvelteKitHoloHelpers()",
898
895
  ""
899
896
  ].join("\n");
900
897
  }
@@ -956,71 +953,117 @@ function renderSvelteHostedAuthRouteFiles(provider) {
956
953
  { path: `src/routes/api/auth/${provider}/logout/+server.ts`, contents: renderSvelteHostedAuthLogoutRoute(spec) }
957
954
  ];
958
955
  }
959
- function renderAuthProviderRouteFiles(framework, features) {
960
- return getRequestedHostedAuthProviders(features).flatMap((provider) => {
961
- if (framework === "nuxt") {
962
- return renderNuxtHostedAuthRouteFiles(provider);
963
- }
964
- if (framework === "next") {
965
- return renderNextHostedAuthRouteFiles(provider);
956
+ var FRAMEWORK_RENDERERS = {
957
+ nuxt: {
958
+ authProviderRouteFiles: renderNuxtHostedAuthRouteFiles,
959
+ authRouteFiles: () => [
960
+ { path: "server/api/auth/user.get.ts", contents: renderNuxtCurrentAuthRoute() }
961
+ ],
962
+ managedHostedAuthRouteFiles: () => [],
963
+ broadcastInstallFiles: () => [],
964
+ broadcastAuthSupportFiles: () => [],
965
+ frameworkFiles: (options) => {
966
+ const optionalPackages = normalizeScaffoldOptionalPackages(options.optionalPackages);
967
+ const authEnabled = optionalPackages.includes("auth");
968
+ return [
969
+ { path: "app/app.vue", contents: renderNuxtAppVue(options.projectName) },
970
+ { path: "nuxt.config.ts", contents: renderNuxtConfig() },
971
+ { path: "shared/.gitkeep", contents: "" },
972
+ ...authEnabled ? renderAuthRouteFiles("nuxt") : []
973
+ ];
966
974
  }
967
- return renderSvelteHostedAuthRouteFiles(provider);
968
- });
969
- }
970
- function renderAuthRouteFiles(framework) {
971
- if (framework === "next") {
972
- return [
975
+ },
976
+ next: {
977
+ authProviderRouteFiles: renderNextHostedAuthRouteFiles,
978
+ authRouteFiles: () => [
973
979
  { path: "app/api/auth/user/route.ts", contents: renderNextCurrentAuthRoute() },
974
980
  { path: ".holo-js/generated/next/holo.ts", contents: renderNextHoloHelper() },
975
981
  { path: ".holo-js/generated/next/bootstrap.mjs", contents: renderNextRuntimeBootstrap() }
976
- ];
977
- }
978
- if (framework === "nuxt") {
979
- return [
980
- { path: "server/api/auth/user.get.ts", contents: renderNuxtCurrentAuthRoute() }
981
- ];
982
+ ],
983
+ managedHostedAuthRouteFiles: renderNextManagedHostedAuthRouteFiles,
984
+ broadcastInstallFiles: () => [
985
+ { path: ".holo-js/generated/next/holo.ts", contents: renderNextHoloHelper() },
986
+ { path: "app/broadcasting/config/route.ts", contents: renderNextBroadcastConfigRoute() },
987
+ { path: ".holo-js/generated/next/broadcast-config-route.ts", contents: renderNextGeneratedBroadcastConfigRoute() }
988
+ ],
989
+ broadcastAuthSupportFiles: () => [
990
+ { path: "app/broadcasting/auth/route.ts", contents: renderNextBroadcastAuthRoute() },
991
+ { path: ".holo-js/generated/next/holo.ts", contents: renderNextHoloHelper() },
992
+ { path: ".holo-js/generated/next/broadcast-auth-route.ts", contents: renderNextGeneratedBroadcastAuthRoute() }
993
+ ],
994
+ frameworkFiles: (options) => {
995
+ const optionalPackages = normalizeScaffoldOptionalPackages(options.optionalPackages);
996
+ const storageEnabled = optionalPackages.includes("storage");
997
+ const authEnabled = optionalPackages.includes("auth");
998
+ const broadcastEnabled = optionalPackages.includes("broadcast");
999
+ const realtimeEnabled = optionalPackages.includes("realtime");
1000
+ return [
1001
+ { path: "next.config.ts", contents: renderNextConfig() },
1002
+ { path: "next-env.d.ts", contents: renderNextEnvDts() },
1003
+ { path: "app/layout.tsx", contents: renderNextLayout(options.projectName) },
1004
+ { path: "app/page.tsx", contents: renderNextPage(options.projectName) },
1005
+ ...authEnabled ? [{ path: "app/api/auth/user/route.ts", contents: renderNextCurrentAuthRoute() }] : [],
1006
+ ...storageEnabled ? [{ path: "app/storage/[[...path]]/route.ts", contents: renderNextStorageRoute() }] : [],
1007
+ ...broadcastEnabled ? [{ path: "app/broadcasting/config/route.ts", contents: renderNextBroadcastConfigRoute() }] : [],
1008
+ ...renderNextManagedRouteFiles({ authEnabled, broadcastEnabled, storageEnabled, realtimeEnabled })
1009
+ ];
1010
+ }
1011
+ },
1012
+ sveltekit: {
1013
+ authProviderRouteFiles: renderSvelteHostedAuthRouteFiles,
1014
+ authRouteFiles: () => [],
1015
+ managedHostedAuthRouteFiles: () => [],
1016
+ broadcastInstallFiles: () => [
1017
+ { path: ".holo-js/generated/sveltekit/holo.ts", contents: renderSvelteHoloHelper() }
1018
+ ],
1019
+ broadcastAuthSupportFiles: () => [
1020
+ { path: ".holo-js/generated/sveltekit/holo.ts", contents: renderSvelteHoloHelper() }
1021
+ ],
1022
+ frameworkFiles: (options) => {
1023
+ const optionalPackages = normalizeScaffoldOptionalPackages(options.optionalPackages);
1024
+ const storageEnabled = optionalPackages.includes("storage");
1025
+ const authEnabled = optionalPackages.includes("auth");
1026
+ const realtimeEnabled = optionalPackages.includes("realtime");
1027
+ return [
1028
+ { path: "svelte.config.js", contents: renderSvelteConfig() },
1029
+ { path: "vite.config.ts", contents: renderSvelteViteConfig(storageEnabled, realtimeEnabled) },
1030
+ { path: "src/hooks.ts", contents: renderSvelteUserHooks() },
1031
+ { path: "src/hooks.server.ts", contents: renderSvelteServerUserHooks() },
1032
+ { path: "src/app.html", contents: renderSvelteAppHtml() },
1033
+ { path: "src/routes/+page.svelte", contents: renderSveltePage(options.projectName) },
1034
+ ...authEnabled ? renderAuthRouteFiles("sveltekit") : [],
1035
+ ...renderSvelteManagedRuntimeFiles()
1036
+ ];
1037
+ }
982
1038
  }
983
- return [];
1039
+ };
1040
+ function getFrameworkRenderer(framework) {
1041
+ return FRAMEWORK_RENDERERS[framework];
1042
+ }
1043
+ function renderAuthProviderRouteFiles(framework, features) {
1044
+ const renderer = getFrameworkRenderer(framework);
1045
+ return getRequestedHostedAuthProviders(features).flatMap((provider) => renderer.authProviderRouteFiles(provider));
1046
+ }
1047
+ function renderAuthRouteFiles(framework) {
1048
+ return getFrameworkRenderer(framework).authRouteFiles();
1049
+ }
1050
+ function renderManagedHostedAuthRouteFiles(framework, features) {
1051
+ return getFrameworkRenderer(framework).managedHostedAuthRouteFiles(features);
1052
+ }
1053
+ function renderBroadcastInstallFrameworkFiles(framework) {
1054
+ return getFrameworkRenderer(framework).broadcastInstallFiles();
1055
+ }
1056
+ function renderBroadcastAuthSupportFrameworkFiles(framework) {
1057
+ return getFrameworkRenderer(framework).broadcastAuthSupportFiles();
984
1058
  }
985
1059
  function renderFrameworkFiles(options) {
986
- const optionalPackages = normalizeScaffoldOptionalPackages(options.optionalPackages);
987
- const storageEnabled = optionalPackages.includes("storage");
988
- const authEnabled = optionalPackages.includes("auth");
989
- const broadcastEnabled = optionalPackages.includes("broadcast");
990
- const realtimeEnabled = optionalPackages.includes("realtime");
991
- if (options.framework === "nuxt") {
992
- return [
993
- { path: "app/app.vue", contents: renderNuxtAppVue(options.projectName) },
994
- { path: "nuxt.config.ts", contents: renderNuxtConfig() },
995
- { path: "shared/.gitkeep", contents: "" },
996
- ...authEnabled ? renderAuthRouteFiles("nuxt") : []
997
- ];
998
- }
999
- if (options.framework === "next") {
1000
- return [
1001
- { path: "next.config.ts", contents: renderNextConfig() },
1002
- { path: "next-env.d.ts", contents: renderNextEnvDts() },
1003
- { path: "app/layout.tsx", contents: renderNextLayout(options.projectName) },
1004
- { path: "app/page.tsx", contents: renderNextPage(options.projectName) },
1005
- ...authEnabled ? [{ path: "app/api/auth/user/route.ts", contents: renderNextCurrentAuthRoute() }] : [],
1006
- ...storageEnabled ? [{ path: "app/storage/[[...path]]/route.ts", contents: renderNextStorageRoute() }] : [],
1007
- ...broadcastEnabled ? [{ path: "app/broadcasting/config/route.ts", contents: renderNextBroadcastConfigRoute() }] : [],
1008
- ...renderNextManagedRouteFiles({ authEnabled, broadcastEnabled, storageEnabled, realtimeEnabled })
1009
- ];
1010
- }
1011
- return [
1012
- { path: "svelte.config.js", contents: renderSvelteConfig() },
1013
- { path: "vite.config.ts", contents: renderSvelteViteConfig(storageEnabled, realtimeEnabled) },
1014
- { path: "src/hooks.ts", contents: renderSvelteUserHooks() },
1015
- { path: "src/hooks.server.ts", contents: renderSvelteServerUserHooks() },
1016
- { path: "src/app.html", contents: renderSvelteAppHtml() },
1017
- { path: "src/routes/+page.svelte", contents: renderSveltePage(options.projectName) },
1018
- ...authEnabled ? renderAuthRouteFiles("sveltekit") : [],
1019
- ...renderSvelteManagedRuntimeFiles()
1020
- ];
1060
+ return getFrameworkRenderer(options.framework).frameworkFiles(options);
1021
1061
  }
1022
1062
  function renderFrameworkRunner(options) {
1023
- const commandName = options.framework === "nuxt" ? "nuxt" : options.framework === "next" ? "next" : "vite";
1063
+ return renderFrameworkRunnerForDescriptor(getFrameworkDescriptor(options.framework));
1064
+ }
1065
+ function renderFrameworkRunnerForDescriptor(descriptor) {
1066
+ const runner = descriptor.runner;
1024
1067
  return [
1025
1068
  "import { existsSync, readFileSync, readlinkSync } from 'node:fs'",
1026
1069
  "import { dirname, resolve } from 'node:path'",
@@ -1034,7 +1077,8 @@ function renderFrameworkRunner(options) {
1034
1077
  "const nextRuntimeBootstrapPath = resolve(projectRoot, '.holo-js/generated/next/bootstrap.mjs')",
1035
1078
  "const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))",
1036
1079
  "const framework = String(manifest.framework ?? '')",
1037
- `const commandName = ${JSON.stringify(commandName)}`,
1080
+ `const runner = ${JSON.stringify(runner)}`,
1081
+ `const commandName = ${JSON.stringify(runner.commandName)}`,
1038
1082
  "const passthroughArgs = process.argv.slice(3)",
1039
1083
  "const binaryPath = resolve(",
1040
1084
  " projectRoot,",
@@ -1043,27 +1087,26 @@ function renderFrameworkRunner(options) {
1043
1087
  " process.platform === 'win32' ? `${commandName}.cmd` : commandName,",
1044
1088
  ")",
1045
1089
  "",
1090
+ "function resolveProjectPath(value) {",
1091
+ " return resolve(projectRoot, value)",
1092
+ "}",
1093
+ "",
1046
1094
  "function resolveCommandInvocation() {",
1047
1095
  " if (mode === 'dev') {",
1048
1096
  " return { command: binaryPath, args: ['dev'] }",
1049
1097
  " }",
1050
1098
  "",
1051
1099
  " if (mode === 'build') {",
1052
- " return { command: binaryPath, args: framework === 'sveltekit' ? ['build', '--logLevel', 'error'] : ['build'] }",
1100
+ " return { command: binaryPath, args: [...runner.buildArgs] }",
1053
1101
  " }",
1054
1102
  "",
1055
1103
  " if (mode === 'start') {",
1056
- " if (framework === 'next') {",
1057
- " return { command: binaryPath, args: ['start', ...passthroughArgs] }",
1058
- " }",
1059
- "",
1060
- " if (framework === 'nuxt') {",
1061
- " return { command: process.execPath, args: [resolve(projectRoot, '.output/server/index.mjs'), ...passthroughArgs] }",
1104
+ " if (runner.startUsesFrameworkBinary) {",
1105
+ " return { command: binaryPath, args: [...runner.start, ...passthroughArgs] }",
1062
1106
  " }",
1063
1107
  "",
1064
- " if (framework === 'sveltekit') {",
1065
- " return { command: process.execPath, args: [resolve(projectRoot, 'build/index.js'), ...passthroughArgs] }",
1066
- " }",
1108
+ " const [entry, ...args] = runner.start",
1109
+ " return { command: process.execPath, args: [resolveProjectPath(entry), ...args, ...passthroughArgs] }",
1067
1110
  " }",
1068
1111
  "",
1069
1112
  " return undefined",
@@ -1076,7 +1119,7 @@ function renderFrameworkRunner(options) {
1076
1119
  " process.exit(1)",
1077
1120
  "}",
1078
1121
  "",
1079
- "const suppressedOutput = framework === 'sveltekit'",
1122
+ "const suppressedOutput = runner.suppressSvelteKitOutput",
1080
1123
  " ? new Set([",
1081
1124
  ` '"try_get_request_store" is imported from external module "@sveltejs/kit/internal/server" but never used in ".svelte-kit/adapter-node/index.js".',`,
1082
1125
  " ])",
@@ -1087,7 +1130,7 @@ function renderFrameworkRunner(options) {
1087
1130
  " return true",
1088
1131
  " }",
1089
1132
  "",
1090
- " return framework === 'sveltekit'",
1133
+ " return runner.suppressSvelteKitOutput",
1091
1134
  " && line.startsWith('Circular dependency: ')",
1092
1135
  " && line.includes('/node_modules/semver/')",
1093
1136
  "}",
@@ -1121,7 +1164,7 @@ function renderFrameworkRunner(options) {
1121
1164
  "}",
1122
1165
  "",
1123
1166
  "function extractNextConflictInfo(lines) {",
1124
- " if (framework !== 'next' || mode !== 'dev') {",
1167
+ " if (!runner.nextDevServerConflictHandling || mode !== 'dev') {",
1125
1168
  " return undefined",
1126
1169
  " }",
1127
1170
  "",
@@ -1232,12 +1275,12 @@ function renderFrameworkRunner(options) {
1232
1275
  " return waitForProcessExit(pid)",
1233
1276
  "}",
1234
1277
  "",
1235
- "if ((mode !== 'start' || framework === 'next') && !existsSync(binaryPath)) {",
1278
+ "if ((mode !== 'start' || runner.startUsesFrameworkBinary) && !existsSync(binaryPath)) {",
1236
1279
  ' console.error(`[holo] Missing framework binary "${commandName}" for "${framework}". Run your package manager install first.`)',
1237
1280
  " process.exit(1)",
1238
1281
  "}",
1239
1282
  "",
1240
- "if (mode === 'start' && framework !== 'next' && !existsSync(commandInvocation.args[0])) {",
1283
+ "if (mode === 'start' && !runner.startUsesFrameworkBinary && !existsSync(commandInvocation.args[0])) {",
1241
1284
  ' console.error(`[holo] Missing production server entry "${commandInvocation.args[0]}". Run "holo build" before "holo start".`)',
1242
1285
  " process.exit(1)",
1243
1286
  "}",
@@ -1283,7 +1326,7 @@ function renderFrameworkRunner(options) {
1283
1326
  " childEnv.HOLO_INTERNAL_FRAMEWORK_BUILD = '1'",
1284
1327
  " }",
1285
1328
  " const preloads = [runtimeSchemaPath]",
1286
- " if (framework === 'next') {",
1329
+ " if (runner.preloadNextRuntime) {",
1287
1330
  " preloads.push(nextRuntimeBootstrapPath)",
1288
1331
  " }",
1289
1332
  " const preloadOptions = preloads",
@@ -1356,7 +1399,8 @@ import { constants as fsConstants } from "fs";
1356
1399
  import { access, mkdir as mkdir2, readFile as readFile2, readdir as readdir2, writeFile as writeFile2 } from "fs/promises";
1357
1400
  import { dirname as dirname3, extname as extname2, join, resolve as resolve3 } from "path";
1358
1401
  import { loadConfigDirectory } from "@holo-js/config";
1359
- import { DEFAULT_HOLO_PROJECT_PATHS, renderGeneratedSchemaRuntimeModule } from "@holo-js/db";
1402
+ import { renderGeneratedSchemaRuntimeModule } from "@holo-js/db";
1403
+ import { DEFAULT_HOLO_PROJECT_PATHS } from "@holo-js/kernel";
1360
1404
 
1361
1405
  // src/project/registry-svelte.ts
1362
1406
  import { mkdir, readdir, readFile, rm, stat, writeFile } from "fs/promises";
@@ -1873,7 +1917,7 @@ async function removeLegacyManagedHoloHelper(path, managedContents) {
1873
1917
  const trimmedContents = contents?.trim();
1874
1918
  const trimmedManagedContents = managedContents.trim();
1875
1919
  const isLegacyManagedHelper = trimmedContents === [
1876
- "import { createNextHoloHelpers } from '@holo-js/adapter-next'",
1920
+ "import { createNextHoloHelpers } from '@holo-js/adapter-next/runtime'",
1877
1921
  "",
1878
1922
  "export const holo = createNextHoloHelpers()"
1879
1923
  ].join("\n") || trimmedContents === [
@@ -2825,18 +2869,17 @@ export {
2825
2869
  resolveArtifactPath,
2826
2870
  renderNextHoloHelper,
2827
2871
  renderNextRuntimeBootstrap,
2828
- renderNextBroadcastAuthRoute,
2829
2872
  renderNextBroadcastConfigRoute,
2830
- renderNextGeneratedBroadcastConfigRoute,
2831
- renderNextGeneratedBroadcastAuthRoute,
2832
2873
  renderNextGeneratedRealtimeDefinitions,
2833
- renderNextManagedHostedAuthRouteFiles,
2834
2874
  renderSvelteViteConfig,
2835
- renderSvelteHoloHelper,
2836
2875
  renderAuthProviderRouteFiles,
2837
2876
  renderAuthRouteFiles,
2877
+ renderManagedHostedAuthRouteFiles,
2878
+ renderBroadcastInstallFrameworkFiles,
2879
+ renderBroadcastAuthSupportFrameworkFiles,
2838
2880
  renderFrameworkFiles,
2839
2881
  renderFrameworkRunner,
2882
+ renderFrameworkRunnerForDescriptor,
2840
2883
  renderGeneratedModelTypes,
2841
2884
  writeGeneratedProjectRegistry,
2842
2885
  loadGeneratedProjectRegistry
@@ -1,23 +1,28 @@
1
1
  import {
2
2
  hasProjectDependency
3
- } from "./chunk-FGQ2I2YH.mjs";
4
- import {
5
- prepareProjectDiscovery
6
- } from "./chunk-VP2E62DF.mjs";
3
+ } from "./chunk-LHK5YUR4.mjs";
7
4
  import {
8
5
  syncManagedDriverDependencies
9
- } from "./chunk-TWITVSFZ.mjs";
6
+ } from "./chunk-6BHJLCAO.mjs";
10
7
  import {
11
8
  ensureGeneratedSchemaPlaceholder,
12
9
  ensureProjectConfig
13
- } from "./chunk-YEFJBN56.mjs";
10
+ } from "./chunk-JVLZ3SOW.mjs";
11
+ import {
12
+ prepareProjectDiscovery
13
+ } from "./chunk-QSVMXMTQ.mjs";
14
+ import {
15
+ renderFrameworkRunnerForDescriptor
16
+ } from "./chunk-R4ZYMEDU.mjs";
14
17
  import {
15
- renderFrameworkRunner
16
- } from "./chunk-J76GH2DR.mjs";
18
+ loadProjectPluginFrameworkDescriptors
19
+ } from "./chunk-3RFRE7XG.mjs";
17
20
  import {
21
+ getFrameworkDescriptorByIdFrom,
22
+ getFrameworkDescriptorsWith,
18
23
  readTextFile,
19
24
  writeTextFile
20
- } from "./chunk-ILU426CF.mjs";
25
+ } from "./chunk-YACY2572.mjs";
21
26
 
22
27
  // src/dev.ts
23
28
  import { spawnSync, spawn } from "child_process";
@@ -97,9 +102,9 @@ async function runProjectBuild(io, projectRoot, spawn2 = spawnSync) {
97
102
  throw new Error(result.stderr?.trim() || result.stdout?.trim() || "Project build failed.");
98
103
  }
99
104
  }
100
- async function runProjectStartServer(io, projectRoot, spawnProcess = spawn) {
105
+ async function runProjectStartServer(io, projectRoot, spawnProcess = spawn, passthroughArgs = []) {
101
106
  const invocation = resolveFrameworkRunnerInvocation(projectRoot, "start");
102
- const child = spawnProcess(invocation.command, [...invocation.args], {
107
+ const child = spawnProcess(invocation.command, [...invocation.args, ...passthroughArgs], {
103
108
  cwd: projectRoot,
104
109
  env: process.env,
105
110
  stdio: ["pipe", "pipe", "pipe"]
@@ -137,37 +142,17 @@ async function runProjectDependencyInstall(io, projectRoot, spawn2 = spawnSync)
137
142
  throw new Error(result.stderr?.trim() || result.stdout?.trim() || "Project dependency installation failed.");
138
143
  }
139
144
  }
140
- var FRAMEWORK_SYNC_DEFINITIONS = [
141
- {
142
- framework: "nuxt",
143
- commands: {
144
- bun: ["bun", "x", "nuxt", "prepare"],
145
- npm: ["npm", "exec", "--", "nuxt", "prepare"],
146
- pnpm: ["pnpm", "exec", "nuxt", "prepare"],
147
- yarn: ["yarn", "run", "nuxt", "prepare"]
148
- },
149
- errorLabel: "nuxt prepare"
150
- },
151
- {
152
- framework: "sveltekit",
153
- commands: {
154
- bun: ["bun", "x", "svelte-kit", "sync"],
155
- npm: ["npm", "exec", "--", "svelte-kit", "sync"],
156
- pnpm: ["pnpm", "exec", "svelte-kit", "sync"],
157
- yarn: ["yarn", "run", "svelte-kit", "sync"]
158
- },
159
- errorLabel: "svelte-kit sync"
160
- }
161
- ];
162
145
  async function runProjectPrepare(projectRoot, io, options = {}) {
163
146
  const project = await ensureProjectConfig(projectRoot);
164
147
  await ensureGeneratedSchemaPlaceholder(projectRoot, project.config);
165
148
  await prepareProjectDiscovery(projectRoot, project.config);
166
149
  await refreshFrameworkRunner(projectRoot);
167
150
  const syncFramework = options.syncFramework ?? true;
151
+ const syncDefinitions = syncFramework ? await resolveProjectFrameworkSyncDefinitions(projectRoot) : [];
168
152
  if (syncFramework) {
169
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[0]);
170
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[1]);
153
+ for (const definition of syncDefinitions) {
154
+ await runFrameworkSync(projectRoot, definition);
155
+ }
171
156
  }
172
157
  const updatedDependencies = await syncManagedDriverDependencies(projectRoot);
173
158
  if (updatedDependencies && io) {
@@ -175,8 +160,9 @@ async function runProjectPrepare(projectRoot, io, options = {}) {
175
160
  await prepareProjectDiscovery(projectRoot, project.config);
176
161
  await refreshFrameworkRunner(projectRoot);
177
162
  if (syncFramework) {
178
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[0]);
179
- await runFrameworkSync(projectRoot, FRAMEWORK_SYNC_DEFINITIONS[1]);
163
+ for (const definition of syncDefinitions) {
164
+ await runFrameworkSync(projectRoot, definition);
165
+ }
180
166
  }
181
167
  }
182
168
  }
@@ -186,35 +172,53 @@ async function runProjectHotPrepare(projectRoot, io) {
186
172
  async function refreshFrameworkRunner(projectRoot) {
187
173
  const frameworkProjectPath = resolve(projectRoot, ".holo-js/framework/project.json");
188
174
  const frameworkRunnerPath = resolve(projectRoot, ".holo-js/framework/run.mjs");
189
- const framework = await resolveProjectFramework(projectRoot, frameworkProjectPath);
190
- if (!framework) {
175
+ const descriptor = await resolveProjectFramework(projectRoot, frameworkProjectPath);
176
+ if (!descriptor) {
191
177
  return;
192
178
  }
193
- await writeTextFile(frameworkProjectPath, `${JSON.stringify({ framework }, null, 2)}
179
+ await writeTextFile(frameworkProjectPath, `${JSON.stringify({ framework: descriptor.id }, null, 2)}
194
180
  `);
195
- await writeTextFile(frameworkRunnerPath, renderFrameworkRunner({ framework }));
181
+ await writeTextFile(frameworkRunnerPath, renderFrameworkRunnerForDescriptor(descriptor));
196
182
  }
197
183
  async function resolveProjectFramework(projectRoot, frameworkProjectPath) {
184
+ const pluginDescriptors = await loadProjectPluginFrameworkDescriptors(projectRoot);
198
185
  try {
199
186
  const content = await readFile(frameworkProjectPath, "utf8");
200
187
  const manifest = JSON.parse(content);
201
- if (manifest.framework !== "next" && manifest.framework !== "nuxt" && manifest.framework !== "sveltekit") {
202
- return;
203
- }
204
- return manifest.framework;
188
+ const descriptor = typeof manifest.framework === "string" ? getFrameworkDescriptorByIdFrom(manifest.framework, pluginDescriptors) : void 0;
189
+ return descriptor ?? resolveProjectFrameworkFromDependencies(projectRoot, pluginDescriptors);
205
190
  } catch {
191
+ return resolveProjectFrameworkFromDependencies(projectRoot, pluginDescriptors);
206
192
  }
207
- if (await hasProjectDependency(projectRoot, "next")) {
208
- return "next";
209
- }
210
- if (await hasProjectDependency(projectRoot, "nuxt")) {
211
- return "nuxt";
212
- }
213
- if (await hasProjectDependency(projectRoot, "@sveltejs/kit")) {
214
- return "sveltekit";
193
+ }
194
+ async function resolveProjectFrameworkFromDependencies(projectRoot, pluginDescriptors = []) {
195
+ for (const descriptor of getFrameworkDescriptorsWith(pluginDescriptors)) {
196
+ const matches = await Promise.all(
197
+ descriptor.detectPackages.map((packageName) => hasProjectDependency(projectRoot, packageName))
198
+ );
199
+ if (matches.some(Boolean)) {
200
+ return descriptor;
201
+ }
215
202
  }
216
203
  return void 0;
217
204
  }
205
+ async function resolveProjectFrameworkSyncDefinitions(projectRoot) {
206
+ const pluginDescriptors = await loadProjectPluginFrameworkDescriptors(projectRoot);
207
+ const seen = /* @__PURE__ */ new Set();
208
+ const definitions = [];
209
+ for (const descriptor of getFrameworkDescriptorsWith(pluginDescriptors)) {
210
+ if (!descriptor.sync || seen.has(descriptor.id)) {
211
+ continue;
212
+ }
213
+ seen.add(descriptor.id);
214
+ definitions.push({
215
+ framework: descriptor.id,
216
+ commands: descriptor.sync.commands,
217
+ errorLabel: descriptor.sync.errorLabel
218
+ });
219
+ }
220
+ return Object.freeze(definitions);
221
+ }
218
222
  async function runFrameworkSync(projectRoot, definition) {
219
223
  const frameworkProjectPath = resolve(projectRoot, ".holo-js/framework/project.json");
220
224
  try {