@holo-js/cli 0.2.6 → 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.
- package/dist/bin/holo.mjs +409 -104
- package/dist/{broadcast-JBQWQZSO.mjs → broadcast-5VZM5SGQ.mjs} +13 -11
- package/dist/{broadcast-YGJFCEPP.mjs → broadcast-AABT52BK.mjs} +10 -8
- package/dist/cache-A42JSVYA.mjs +138 -0
- package/dist/cache-DUVBBOZU.mjs +138 -0
- package/dist/{cache-migrations-77TLXIVG.mjs → cache-migrations-4WKSEN2Q.mjs} +12 -10
- package/dist/{cache-migrations-FKAHRP24.mjs → cache-migrations-PD2T5AV4.mjs} +14 -12
- package/dist/chunk-3RFRE7XG.mjs +491 -0
- package/dist/{chunk-7B2RVYLL.mjs → chunk-6BHJLCAO.mjs} +256 -392
- package/dist/{chunk-KS5TWO75.mjs → chunk-EQUFFLRG.mjs} +7 -7
- package/dist/chunk-HX6MOYBO.mjs +2 -0
- package/dist/{chunk-YEFJBN56.mjs → chunk-JVLZ3SOW.mjs} +11 -8
- package/dist/{chunk-4K4CWMMP.mjs → chunk-KRADH7PK.mjs} +53 -49
- package/dist/chunk-LALDNNPH.mjs +428 -0
- package/dist/chunk-LHK5YUR4.mjs +156 -0
- package/dist/{chunk-LBJAJLKU.mjs → chunk-M3IPUCTM.mjs} +1 -1
- package/dist/{chunk-C624G3R2.mjs → chunk-OI54DOHK.mjs} +256 -392
- package/dist/{chunk-LXGQCG56.mjs → chunk-OLZEMIDQ.mjs} +1 -1
- package/dist/{chunk-VP2E62DF.mjs → chunk-QSVMXMTQ.mjs} +49 -349
- package/dist/{chunk-J76GH2DR.mjs → chunk-R4ZYMEDU.mjs} +129 -86
- package/dist/{chunk-AJLRAC5M.mjs → chunk-TH5YCOZB.mjs} +55 -51
- package/dist/chunk-TRYHX5S4.mjs +360 -0
- package/dist/chunk-XBOVM6LO.mjs +41 -0
- package/dist/{chunk-ILU426CF.mjs → chunk-YACY2572.mjs} +482 -2
- package/dist/{config-MD27U4FM.mjs → config-BZHQK532.mjs} +3 -3
- package/dist/{dev-L4Y2GU2E.mjs → dev-7KGRV56X.mjs} +10 -8
- package/dist/{dev-YPBQBEOE.mjs → dev-GQT37XJU.mjs} +10 -8
- package/dist/{discovery-GWTBF5RZ.mjs → discovery-HNH3BLDL.mjs} +8 -6
- package/dist/{generators-VCYISHWO.mjs → generators-3FVW4AEJ.mjs} +18 -15
- package/dist/{generators-H4NTV4DB.mjs → generators-JWVNGUUE.mjs} +14 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +407 -102
- package/dist/{media-migrations-BNVAPYEM.mjs → media-migrations-EG34NYAG.mjs} +13 -11
- package/dist/{media-migrations-NNB3DAQR.mjs → media-migrations-LGI7R7AR.mjs} +11 -9
- package/dist/plugins-ZGLB6JO6.mjs +24 -0
- package/dist/{queue-5BXSDFCO.mjs → queue-BEZDCZCY.mjs} +54 -16
- package/dist/{queue-D4LSWNS2.mjs → queue-R54DUUYA.mjs} +54 -16
- package/dist/{queue-migrations-EF4AMMSY.mjs → queue-migrations-AM3AKT76.mjs} +16 -11
- package/dist/{queue-migrations-LXEWXJYT.mjs → queue-migrations-U477YSFD.mjs} +18 -13
- package/dist/{runtime-RPMZMTD4.mjs → runtime-4TJYZLQV.mjs} +10 -8
- package/dist/{runtime-UKBJQFXM.mjs → runtime-MSRQD5W5.mjs} +10 -8
- package/dist/{runtime-GSXF4NB3.mjs → runtime-VR5BDPYQ.mjs} +1 -1
- package/dist/runtime-worker.mjs +7 -1
- package/dist/{scaffold-NJ5VH73M.mjs → scaffold-ASEX5LEX.mjs} +8 -4
- package/dist/{scaffold-VV3KTYGO.mjs → scaffold-ZAD3XUSD.mjs} +8 -4
- package/dist/{security-K5PZS3E3.mjs → security-4QLV7QCH.mjs} +8 -6
- package/dist/{security-JR4P7L2C.mjs → security-KYTLP4DF.mjs} +8 -6
- package/package.json +35 -8
- package/dist/cache-HUGRWOHQ.mjs +0 -66
- package/dist/cache-OSJ4PD52.mjs +0 -66
- package/dist/chunk-D7O4SU6N.mjs +0 -2
- 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-
|
|
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
|
|
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
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
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
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
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
|
-
|
|
979
|
-
|
|
980
|
-
{ path: "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
1100
|
+
" return { command: binaryPath, args: [...runner.buildArgs] }",
|
|
1053
1101
|
" }",
|
|
1054
1102
|
"",
|
|
1055
1103
|
" if (mode === 'start') {",
|
|
1056
|
-
" if (
|
|
1057
|
-
" return { command: binaryPath, args: [
|
|
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
|
-
"
|
|
1065
|
-
"
|
|
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 =
|
|
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
|
|
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 (
|
|
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' ||
|
|
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' &&
|
|
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 (
|
|
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 {
|
|
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-
|
|
4
|
-
import {
|
|
5
|
-
prepareProjectDiscovery
|
|
6
|
-
} from "./chunk-VP2E62DF.mjs";
|
|
3
|
+
} from "./chunk-LHK5YUR4.mjs";
|
|
7
4
|
import {
|
|
8
5
|
syncManagedDriverDependencies
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6BHJLCAO.mjs";
|
|
10
7
|
import {
|
|
11
8
|
ensureGeneratedSchemaPlaceholder,
|
|
12
9
|
ensureProjectConfig
|
|
13
|
-
} from "./chunk-
|
|
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
|
-
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
loadProjectPluginFrameworkDescriptors
|
|
19
|
+
} from "./chunk-3RFRE7XG.mjs";
|
|
17
20
|
import {
|
|
21
|
+
getFrameworkDescriptorByIdFrom,
|
|
22
|
+
getFrameworkDescriptorsWith,
|
|
18
23
|
readTextFile,
|
|
19
24
|
writeTextFile
|
|
20
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-YACY2572.mjs";
|
|
21
26
|
|
|
22
27
|
// src/dev.ts
|
|
23
28
|
import { spawnSync, spawn } from "child_process";
|
|
@@ -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
|
-
|
|
170
|
-
|
|
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
|
-
|
|
179
|
-
|
|
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
|
|
190
|
-
if (!
|
|
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,
|
|
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
|
-
|
|
202
|
-
|
|
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
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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 {
|