resuxjs 0.4.0-beta.4 → 0.4.0-beta.5
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/cli.d.ts +2 -2
- package/dist/compiler/implementation.d.ts +2 -0
- package/dist/compiler/implementation.js +24 -18
- package/dist/compiler/index.js.map +1 -1
- package/dist/deploy/vercel.js +9 -0
- package/dist/deploy/vercel.js.map +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/runtime/index.d.ts +7 -4
- package/dist/runtime/index.js +28 -7
- package/dist/runtime/index.js.map +1 -1
- package/package.json +1 -1
package/dist/deploy/vercel.js
CHANGED
|
@@ -103,6 +103,15 @@ async function postBuild(context) {
|
|
|
103
103
|
target: path.join(context.appRoot, ".vercel", "output", "static", "__resux")
|
|
104
104
|
}]);
|
|
105
105
|
await assertRuntimeClientAsset(path.join(context.appRoot, ".vercel", "output", "static"));
|
|
106
|
+
const appAssetsDir = path.join(context.appRoot, "assets");
|
|
107
|
+
const vercelStaticAssetsDir = path.join(context.appRoot, ".vercel", "output", "static", "assets");
|
|
108
|
+
if (await pathExists(appAssetsDir)) {
|
|
109
|
+
await mkdir(path.dirname(vercelStaticAssetsDir), { recursive: true });
|
|
110
|
+
await cp(appAssetsDir, vercelStaticAssetsDir, {
|
|
111
|
+
recursive: true,
|
|
112
|
+
force: true
|
|
113
|
+
});
|
|
114
|
+
}
|
|
106
115
|
const outputDir = path.join(context.appRoot, ".vercel", "output");
|
|
107
116
|
const functionsDir = path.join(outputDir, "functions");
|
|
108
117
|
await materializeLinkedFunctions(functionsDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.js","names":[],"sources":["../../src/deploy/vercel.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { cp, lstat, mkdir, readdir, realpath, rm, stat, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n assertRuntimeClientAsset,\n ensureResuxClientAssets,\n ensureResuxServerPayload,\n pathExists,\n readJsonRecord,\n writeJson,\n} from \"./common.js\";\nimport { ensureResuxFrameworkRuntime } from \"./framework-runtime.js\";\nimport { ensureResuxProductionReport } from \"./production-report.js\";\nimport {\n ensureRuntimeDependencyTrees,\n ensureServerRuntimeDependencyTrees,\n} from \"./runtime-dependencies.js\";\nimport type {\n DeployBuildContext,\n DeployDetectionContext,\n DeployTargetModule,\n} from \"./types.js\";\n\nconst SUPPORTED_NODE_VERSIONS = [18, 20, 22] as const;\n\ntype BuildOutputRoute = Record<string, unknown>;\n\ninterface BuildOutputConfig extends Record<string, unknown> {\n version?: unknown;\n routes?: unknown;\n}\n\nfunction parseMajorNodeVersion(version: string): number {\n const major = Number.parseInt(version.split(\".\")[0] ?? \"\", 10);\n return Number.isNaN(major) ? 22 : major;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nexport function resolveVercelNodeRuntime(nodeVersion = process.versions.node): string {\n const systemNodeVersion = parseMajorNodeVersion(nodeVersion);\n const runtimeVersion =\n SUPPORTED_NODE_VERSIONS.find((version) => version >= systemNodeVersion)\n ?? SUPPORTED_NODE_VERSIONS[SUPPORTED_NODE_VERSIONS.length - 1];\n return `nodejs${runtimeVersion}.x`;\n}\n\nfunction resolveFallbackFunctionName(functionNames: string[]): string | null {\n if (functionNames.includes(\"__fallback.func\")) {\n return \"__fallback\";\n }\n if (functionNames.includes(\"[...].func\")) {\n return \"[...]\";\n }\n const fallback = functionNames.find((name) => name.endsWith(\".func\"));\n return fallback ? fallback.slice(0, -5) : null;\n}\n\nfunction isCatchAllRouteSrc(src: unknown): boolean {\n if (typeof src !== \"string\") {\n return false;\n }\n\n return src === \"/(.*)\" || src === \"/(?:.*)\" || /^\\/\\((?:\\?:)?\\.\\*\\)$/.test(src);\n}\n\nfunction routeDestIncludesFunctionName(route: Record<string, unknown>, functionName: string): boolean {\n if (typeof route.dest !== \"string\" || !functionName) {\n return false;\n }\n\n const normalizedDest = route.dest.startsWith(\"/\") ? route.dest.slice(1) : route.dest;\n return normalizedDest === functionName;\n}\n\nfunction normalizeBuildOutputConfig(value: unknown): BuildOutputConfig {\n if (!isRecord(value)) {\n return {};\n }\n return value;\n}\n\nfunction isHeaderOnlyRoute(route: BuildOutputRoute): boolean {\n if (!isRecord(route)) {\n return false;\n }\n\n return (\n typeof route.src === \"string\"\n && isRecord(route.headers)\n && route.continue !== true\n && route.dest === undefined\n && route.handle === undefined\n && route.status === undefined\n && route.check === undefined\n && route.middlewarePath === undefined\n );\n}\n\nfunction normalizeRoute(route: BuildOutputRoute): BuildOutputRoute {\n if (isHeaderOnlyRoute(route)) {\n return { ...route, continue: true };\n }\n return route;\n}\n\nfunction isRunningInsideVercelContainer(appRoot: string): boolean {\n const normalizedRoot = appRoot.replace(/\\\\/g, \"/\");\n if (normalizedRoot.startsWith(\"/vercel/path\")) {\n return true;\n }\n\n return (\n existsSync(\"/vercel\")\n || existsSync(\"/vercel/path\")\n || existsSync(\"/vercel/path0\")\n || existsSync(\"/vercel/output\")\n );\n}\n\nasync function detect(context: DeployDetectionContext): Promise<boolean> {\n if (isRunningInsideVercelContainer(context.appRoot)) {\n return true;\n }\n\n if (context.env.NOW_BUILDER || context.env.VERCEL || context.env.VERCEL_ENV) {\n return true;\n }\n return false;\n}\n\nasync function materializeLinkedFunctions(functionsDir: string): Promise<void> {\n const entries = await readdir(functionsDir, { withFileTypes: true }).catch(() => []);\n\n for (const entry of entries) {\n if (!entry.name.endsWith(\".func\")) {\n continue;\n }\n\n const functionPath = path.join(functionsDir, entry.name);\n const stats = await lstat(functionPath).catch(() => null);\n if (!stats?.isSymbolicLink()) {\n continue;\n }\n\n const resolvedTarget = await realpath(functionPath).catch(() => null);\n if (!resolvedTarget) {\n continue;\n }\n\n await rm(functionPath, { recursive: true, force: true });\n await cp(resolvedTarget, functionPath, {\n recursive: true,\n force: true,\n });\n }\n}\n\nasync function listFunctionDirectories(functionsDir: string): Promise<string[]> {\n const entries = await readdir(functionsDir, { withFileTypes: true }).catch(() => []);\n const functionNames: string[] = [];\n\n for (const entry of entries) {\n if (!entry.name.endsWith(\".func\")) {\n continue;\n }\n\n const functionPath = path.join(functionsDir, entry.name);\n if (entry.isDirectory()) {\n functionNames.push(entry.name);\n continue;\n }\n\n if (!entry.isSymbolicLink()) {\n continue;\n }\n\n const linkedStats = await stat(functionPath).catch(() => null);\n if (linkedStats?.isDirectory()) {\n functionNames.push(entry.name);\n }\n }\n\n return functionNames;\n}\n\nasync function postBuild(context: DeployBuildContext): Promise<void> {\n await ensureResuxClientAssets(context.appRoot, [\n {\n root: path.join(context.appRoot, \".output\"),\n target: path.join(context.appRoot, \".output\", \"public\", \"__resux\"),\n },\n {\n root: path.join(context.appRoot, \".vercel\", \"output\"),\n target: path.join(context.appRoot, \".vercel\", \"output\", \"static\", \"__resux\"),\n },\n ]);\n await assertRuntimeClientAsset(path.join(context.appRoot, \".vercel\", \"output\", \"static\"));\n\n const outputDir = path.join(context.appRoot, \".vercel\", \"output\");\n const functionsDir = path.join(outputDir, \"functions\");\n await materializeLinkedFunctions(functionsDir);\n\n const functionNames = await listFunctionDirectories(functionsDir);\n if (!functionNames.length) {\n throw new Error(\n \"Resux vercel deployment output is missing function directories under .vercel/output/functions.\",\n );\n }\n\n const functionRoots = functionNames.map((functionName) =>\n path.join(functionsDir, functionName)\n );\n await ensureResuxServerPayload(\n context.appRoot,\n functionRoots.map((root) => path.join(root, \".resux\", \"server\")),\n );\n await ensureResuxClientAssets(\n context.appRoot,\n functionRoots.map((root) => ({\n root,\n target: path.join(root, \".resux\", \"client\"),\n })),\n );\n await ensureResuxProductionReport(context.appRoot, functionRoots);\n await ensureResuxFrameworkRuntime(context.appRoot, functionRoots);\n await ensureServerRuntimeDependencyTrees(\n context.appRoot,\n path.join(context.appRoot, \".resux\", \"server\"),\n functionRoots,\n \"Resux Vercel\",\n );\n await ensureRuntimeDependencyTrees(\n context.appRoot,\n functionRoots,\n \"sharp\",\n \"Resux Vercel image optimizer\",\n );\n for (const functionRoot of functionRoots) {\n const manifestPath = path.join(functionRoot, \".resux\", \"server\", \"manifest.mjs\");\n if (!(await pathExists(manifestPath))) {\n const chunkManifestPath = path.join(functionRoot, \"chunks\", \"raw\", \"manifest.mjs\");\n const hasChunkManifest = await pathExists(chunkManifestPath);\n throw new Error(\n hasChunkManifest\n ? `Resux vercel deployment output is missing ${manifestPath}. Found ${chunkManifestPath} but not the copied Resux server payload. Stop concurrent dev/watch processes, clean .vercel/output, and rerun build.`\n : `Resux vercel deployment output is missing ${manifestPath}.`,\n );\n }\n }\n\n const defaultFunctionConfig = {\n runtime: resolveVercelNodeRuntime(),\n handler: \"index.mjs\",\n launcherType: \"Nodejs\",\n shouldAddHelpers: false,\n supportsResponseStreaming: true,\n };\n\n for (const functionRoot of functionRoots) {\n const functionConfigPath = path.join(functionRoot, \".vc-config.json\");\n if (!(await pathExists(functionConfigPath))) {\n await writeFile(\n functionConfigPath,\n JSON.stringify(defaultFunctionConfig, null, 2),\n \"utf8\",\n );\n }\n }\n\n const outputConfigPath = path.join(outputDir, \"config.json\");\n const parsedOutputConfig = await readJsonRecord(outputConfigPath);\n const safeOutputConfig = normalizeBuildOutputConfig(parsedOutputConfig ?? {});\n const routes = Array.isArray(safeOutputConfig.routes)\n ? (safeOutputConfig.routes as BuildOutputRoute[]).map(normalizeRoute)\n : [];\n const hasFilesystemRoute = routes.some((route) => route?.handle === \"filesystem\");\n if (!hasFilesystemRoute) {\n routes.push({ handle: \"filesystem\" });\n }\n\n const fallbackFunctionName = resolveFallbackFunctionName(functionNames);\n const hasNativeCatchAllFunction = functionNames.includes(\"[...].func\");\n const hasCatchAllRoute =\n hasNativeCatchAllFunction || routes.some((route) => isCatchAllRouteSrc(route?.src));\n const hasFallbackDest = fallbackFunctionName\n ? routes.some((route) => routeDestIncludesFunctionName(route ?? {}, fallbackFunctionName))\n : false;\n if (fallbackFunctionName && !hasCatchAllRoute && !hasFallbackDest) {\n routes.push({ src: \"/(.*)\", dest: `/${fallbackFunctionName}` });\n }\n\n const outputConfig: BuildOutputConfig = {\n ...safeOutputConfig,\n version: 3,\n routes,\n };\n await mkdir(path.dirname(outputConfigPath), { recursive: true });\n await writeJson(outputConfigPath, outputConfig);\n}\n\nexport const vercelDeployModule: DeployTargetModule = {\n target: \"vercel\",\n presetAliases: [\"vercel\", \"vercel-edge\"],\n outputLabel: \".vercel/output\",\n detect,\n inferPreset: () => \"vercel\",\n postBuild,\n};\n"],"mappings":";;;;;;;;;AAuBA,MAAM,0BAA0B;CAAC;CAAI;CAAI;CAAG;AAS5C,SAAS,sBAAsB,SAAyB;CACtD,MAAM,QAAQ,OAAO,SAAS,QAAQ,MAAM,IAAI,CAAC,MAAM,IAAI,GAAG;AAC9D,QAAO,OAAO,MAAM,MAAM,GAAG,KAAK;;AAGpC,SAAS,SAAS,OAAkD;AAClE,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;;AAG7E,SAAgB,yBAAyB,cAAc,QAAQ,SAAS,MAAc;CACpF,MAAM,oBAAoB,sBAAsB,YAAY;AAI5D,QAAO,SAFL,wBAAwB,MAAM,YAAY,WAAW,kBAAkB,IACpE,wBAAwB,wBAAwB,SAAS,GAC/B;;AAGjC,SAAS,4BAA4B,eAAwC;AAC3E,KAAI,cAAc,SAAS,kBAAkB,CAC3C,QAAO;AAET,KAAI,cAAc,SAAS,aAAa,CACtC,QAAO;CAET,MAAM,WAAW,cAAc,MAAM,SAAS,KAAK,SAAS,QAAQ,CAAC;AACrE,QAAO,WAAW,SAAS,MAAM,GAAG,GAAG,GAAG;;AAG5C,SAAS,mBAAmB,KAAuB;AACjD,KAAI,OAAO,QAAQ,SACjB,QAAO;AAGT,QAAO,QAAQ,WAAW,QAAQ,aAAa,uBAAuB,KAAK,IAAI;;AAGjF,SAAS,8BAA8B,OAAgC,cAA+B;AACpG,KAAI,OAAO,MAAM,SAAS,Y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AC;CAC7E,MAAM,SAAS,MAAM,QAAQ,iBAAiB,OAAO,GAChD,iBAAiB,OAA8B,IAAI,eAAe,GACnE,EAAE;AAEN,KAAI,CADuB,OAAO,MAAM,UAAU,OAAO,WAAW,aAAa,CAE/E,QAAO,KAAK,EAAE,QAAQ,cAAc,CAAC;CAGvC,MAAM,uBAAuB,4BAA4B,cAAc;CAEvE,MAAM,mBAD4B,cAAc,SAAS,aAAa,IAEvC,OAAO,MAAM,UAAU,mBAAmB,OAAO,IAAI,CAAC;CACrF,MAAM,kBAAkB,uBACpB,OAAO,MAAM,UAAU,8BAA8B,SAAS,EAAE,EAAE,qBAAqB,CAAC,GACxF;AACJ,KAAI,wBAAwB,CAAC,oBAAoB,CAAC,gBAChD,QAAO,KAAK;EAAE,KAAK;EAAS,MAAM,IAAI;EAAwB,CAAC;CAGjE,MAAM,eAAkC;EACtC,GAAG;EACH,SAAS;EACT;EACD;AACD,OAAM,MAAM,KAAK,QAAQ,iBAAiB,EAAE,EAAE,WAAW,MAAM,CAAC;AAChE,OAAM,UAAU,kBAAkB,aAAa;;AAGjD,MAAa,qBAAyC;CACpD,QAAQ;CACR,eAAe,CAAC,UAAU,cAAc;CACxC,aAAa;CACb;CACA,mBAAmB;CACnB;CACD"}
|
|
1
|
+
{"version":3,"file":"vercel.js","names":[],"sources":["../../src/deploy/vercel.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { cp, lstat, mkdir, readdir, realpath, rm, stat, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n assertRuntimeClientAsset,\n ensureResuxClientAssets,\n ensureResuxServerPayload,\n pathExists,\n readJsonRecord,\n writeJson,\n} from \"./common.js\";\nimport { ensureResuxFrameworkRuntime } from \"./framework-runtime.js\";\nimport { ensureResuxProductionReport } from \"./production-report.js\";\nimport {\n ensureRuntimeDependencyTrees,\n ensureServerRuntimeDependencyTrees,\n} from \"./runtime-dependencies.js\";\nimport type {\n DeployBuildContext,\n DeployDetectionContext,\n DeployTargetModule,\n} from \"./types.js\";\n\nconst SUPPORTED_NODE_VERSIONS = [18, 20, 22] as const;\n\ntype BuildOutputRoute = Record<string, unknown>;\n\ninterface BuildOutputConfig extends Record<string, unknown> {\n version?: unknown;\n routes?: unknown;\n}\n\nfunction parseMajorNodeVersion(version: string): number {\n const major = Number.parseInt(version.split(\".\")[0] ?? \"\", 10);\n return Number.isNaN(major) ? 22 : major;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nexport function resolveVercelNodeRuntime(nodeVersion = process.versions.node): string {\n const systemNodeVersion = parseMajorNodeVersion(nodeVersion);\n const runtimeVersion =\n SUPPORTED_NODE_VERSIONS.find((version) => version >= systemNodeVersion)\n ?? SUPPORTED_NODE_VERSIONS[SUPPORTED_NODE_VERSIONS.length - 1];\n return `nodejs${runtimeVersion}.x`;\n}\n\nfunction resolveFallbackFunctionName(functionNames: string[]): string | null {\n if (functionNames.includes(\"__fallback.func\")) {\n return \"__fallback\";\n }\n if (functionNames.includes(\"[...].func\")) {\n return \"[...]\";\n }\n const fallback = functionNames.find((name) => name.endsWith(\".func\"));\n return fallback ? fallback.slice(0, -5) : null;\n}\n\nfunction isCatchAllRouteSrc(src: unknown): boolean {\n if (typeof src !== \"string\") {\n return false;\n }\n\n return src === \"/(.*)\" || src === \"/(?:.*)\" || /^\\/\\((?:\\?:)?\\.\\*\\)$/.test(src);\n}\n\nfunction routeDestIncludesFunctionName(route: Record<string, unknown>, functionName: string): boolean {\n if (typeof route.dest !== \"string\" || !functionName) {\n return false;\n }\n\n const normalizedDest = route.dest.startsWith(\"/\") ? route.dest.slice(1) : route.dest;\n return normalizedDest === functionName;\n}\n\nfunction normalizeBuildOutputConfig(value: unknown): BuildOutputConfig {\n if (!isRecord(value)) {\n return {};\n }\n return value;\n}\n\nfunction isHeaderOnlyRoute(route: BuildOutputRoute): boolean {\n if (!isRecord(route)) {\n return false;\n }\n\n return (\n typeof route.src === \"string\"\n && isRecord(route.headers)\n && route.continue !== true\n && route.dest === undefined\n && route.handle === undefined\n && route.status === undefined\n && route.check === undefined\n && route.middlewarePath === undefined\n );\n}\n\nfunction normalizeRoute(route: BuildOutputRoute): BuildOutputRoute {\n if (isHeaderOnlyRoute(route)) {\n return { ...route, continue: true };\n }\n return route;\n}\n\nfunction isRunningInsideVercelContainer(appRoot: string): boolean {\n const normalizedRoot = appRoot.replace(/\\\\/g, \"/\");\n if (normalizedRoot.startsWith(\"/vercel/path\")) {\n return true;\n }\n\n return (\n existsSync(\"/vercel\")\n || existsSync(\"/vercel/path\")\n || existsSync(\"/vercel/path0\")\n || existsSync(\"/vercel/output\")\n );\n}\n\nasync function detect(context: DeployDetectionContext): Promise<boolean> {\n if (isRunningInsideVercelContainer(context.appRoot)) {\n return true;\n }\n\n if (context.env.NOW_BUILDER || context.env.VERCEL || context.env.VERCEL_ENV) {\n return true;\n }\n return false;\n}\n\nasync function materializeLinkedFunctions(functionsDir: string): Promise<void> {\n const entries = await readdir(functionsDir, { withFileTypes: true }).catch(() => []);\n\n for (const entry of entries) {\n if (!entry.name.endsWith(\".func\")) {\n continue;\n }\n\n const functionPath = path.join(functionsDir, entry.name);\n const stats = await lstat(functionPath).catch(() => null);\n if (!stats?.isSymbolicLink()) {\n continue;\n }\n\n const resolvedTarget = await realpath(functionPath).catch(() => null);\n if (!resolvedTarget) {\n continue;\n }\n\n await rm(functionPath, { recursive: true, force: true });\n await cp(resolvedTarget, functionPath, {\n recursive: true,\n force: true,\n });\n }\n}\n\nasync function listFunctionDirectories(functionsDir: string): Promise<string[]> {\n const entries = await readdir(functionsDir, { withFileTypes: true }).catch(() => []);\n const functionNames: string[] = [];\n\n for (const entry of entries) {\n if (!entry.name.endsWith(\".func\")) {\n continue;\n }\n\n const functionPath = path.join(functionsDir, entry.name);\n if (entry.isDirectory()) {\n functionNames.push(entry.name);\n continue;\n }\n\n if (!entry.isSymbolicLink()) {\n continue;\n }\n\n const linkedStats = await stat(functionPath).catch(() => null);\n if (linkedStats?.isDirectory()) {\n functionNames.push(entry.name);\n }\n }\n\n return functionNames;\n}\n\nasync function postBuild(context: DeployBuildContext): Promise<void> {\n await ensureResuxClientAssets(context.appRoot, [\n {\n root: path.join(context.appRoot, \".output\"),\n target: path.join(context.appRoot, \".output\", \"public\", \"__resux\"),\n },\n {\n root: path.join(context.appRoot, \".vercel\", \"output\"),\n target: path.join(context.appRoot, \".vercel\", \"output\", \"static\", \"__resux\"),\n },\n ]);\n await assertRuntimeClientAsset(path.join(context.appRoot, \".vercel\", \"output\", \"static\"));\n\n const appAssetsDir = path.join(context.appRoot, \"assets\");\n const vercelStaticAssetsDir = path.join(context.appRoot, \".vercel\", \"output\", \"static\", \"assets\");\n if (await pathExists(appAssetsDir)) {\n await mkdir(path.dirname(vercelStaticAssetsDir), { recursive: true });\n await cp(appAssetsDir, vercelStaticAssetsDir, {\n recursive: true,\n force: true,\n });\n }\n\n const outputDir = path.join(context.appRoot, \".vercel\", \"output\");\n const functionsDir = path.join(outputDir, \"functions\");\n await materializeLinkedFunctions(functionsDir);\n\n const functionNames = await listFunctionDirectories(functionsDir);\n if (!functionNames.length) {\n throw new Error(\n \"Resux vercel deployment output is missing function directories under .vercel/output/functions.\",\n );\n }\n\n const functionRoots = functionNames.map((functionName) =>\n path.join(functionsDir, functionName)\n );\n await ensureResuxServerPayload(\n context.appRoot,\n functionRoots.map((root) => path.join(root, \".resux\", \"server\")),\n );\n await ensureResuxClientAssets(\n context.appRoot,\n functionRoots.map((root) => ({\n root,\n target: path.join(root, \".resux\", \"client\"),\n })),\n );\n await ensureResuxProductionReport(context.appRoot, functionRoots);\n await ensureResuxFrameworkRuntime(context.appRoot, functionRoots);\n await ensureServerRuntimeDependencyTrees(\n context.appRoot,\n path.join(context.appRoot, \".resux\", \"server\"),\n functionRoots,\n \"Resux Vercel\",\n );\n await ensureRuntimeDependencyTrees(\n context.appRoot,\n functionRoots,\n \"sharp\",\n \"Resux Vercel image optimizer\",\n );\n for (const functionRoot of functionRoots) {\n const manifestPath = path.join(functionRoot, \".resux\", \"server\", \"manifest.mjs\");\n if (!(await pathExists(manifestPath))) {\n const chunkManifestPath = path.join(functionRoot, \"chunks\", \"raw\", \"manifest.mjs\");\n const hasChunkManifest = await pathExists(chunkManifestPath);\n throw new Error(\n hasChunkManifest\n ? `Resux vercel deployment output is missing ${manifestPath}. Found ${chunkManifestPath} but not the copied Resux server payload. Stop concurrent dev/watch processes, clean .vercel/output, and rerun build.`\n : `Resux vercel deployment output is missing ${manifestPath}.`,\n );\n }\n }\n\n const defaultFunctionConfig = {\n runtime: resolveVercelNodeRuntime(),\n handler: \"index.mjs\",\n launcherType: \"Nodejs\",\n shouldAddHelpers: false,\n supportsResponseStreaming: true,\n };\n\n for (const functionRoot of functionRoots) {\n const functionConfigPath = path.join(functionRoot, \".vc-config.json\");\n if (!(await pathExists(functionConfigPath))) {\n await writeFile(\n functionConfigPath,\n JSON.stringify(defaultFunctionConfig, null, 2),\n \"utf8\",\n );\n }\n }\n\n const outputConfigPath = path.join(outputDir, \"config.json\");\n const parsedOutputConfig = await readJsonRecord(outputConfigPath);\n const safeOutputConfig = normalizeBuildOutputConfig(parsedOutputConfig ?? {});\n const routes = Array.isArray(safeOutputConfig.routes)\n ? (safeOutputConfig.routes as BuildOutputRoute[]).map(normalizeRoute)\n : [];\n const hasFilesystemRoute = routes.some((route) => route?.handle === \"filesystem\");\n if (!hasFilesystemRoute) {\n routes.push({ handle: \"filesystem\" });\n }\n\n const fallbackFunctionName = resolveFallbackFunctionName(functionNames);\n const hasNativeCatchAllFunction = functionNames.includes(\"[...].func\");\n const hasCatchAllRoute =\n hasNativeCatchAllFunction || routes.some((route) => isCatchAllRouteSrc(route?.src));\n const hasFallbackDest = fallbackFunctionName\n ? routes.some((route) => routeDestIncludesFunctionName(route ?? {}, fallbackFunctionName))\n : false;\n if (fallbackFunctionName && !hasCatchAllRoute && !hasFallbackDest) {\n routes.push({ src: \"/(.*)\", dest: `/${fallbackFunctionName}` });\n }\n\n const outputConfig: BuildOutputConfig = {\n ...safeOutputConfig,\n version: 3,\n routes,\n };\n await mkdir(path.dirname(outputConfigPath), { recursive: true });\n await writeJson(outputConfigPath, outputConfig);\n}\n\nexport const vercelDeployModule: DeployTargetModule = {\n target: \"vercel\",\n presetAliases: [\"vercel\", \"vercel-edge\"],\n outputLabel: \".vercel/output\",\n detect,\n inferPreset: () => \"vercel\",\n postBuild,\n};\n"],"mappings":";;;;;;;;;AAuBA,MAAM,0BAA0B;CAAC;CAAI;CAAI;CAAG;AAS5C,SAAS,sBAAsB,SAAyB;CACtD,MAAM,QAAQ,OAAO,SAAS,QAAQ,MAAM,IAAI,CAAC,MAAM,IAAI,GAAG;AAC9D,QAAO,OAAO,MAAM,MAAM,GAAG,KAAK;;AAGpC,SAAS,SAAS,OAAkD;AAClE,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;;AAG7E,SAAgB,yBAAyB,cAAc,QAAQ,SAAS,MAAc;CACpF,MAAM,oBAAoB,sBAAsB,YAAY;AAI5D,QAAO,SAFL,wBAAwB,MAAM,YAAY,WAAW,kBAAkB,IACpE,wBAAwB,wBAAwB,SAAS,GAC/B;;AAGjC,SAAS,4BAA4B,eAAwC;AAC3E,KAAI,cAAc,SAAS,kBAAkB,CAC3C,QAAO;AAET,KAAI,cAAc,SAAS,aAAa,CACtC,QAAO;CAET,MAAM,WAAW,cAAc,MAAM,SAAS,KAAK,SAAS,QAAQ,CAAC;AACrE,QAAO,WAAW,SAAS,MAAM,GAAG,GAAG,GAAG;;AAG5C,SAAS,mBAAmB,KAAuB;AACjD,KAAI,OAAO,QAAQ,SACjB,QAAO;AAGT,QAAO,QAAQ,WAAW,QAAQ,aAAa,uBAAuB,KAAK,IAAI;;AAGjF,SAAS,8BAA8B,OAAgC,cAA+B;AACpG,KAAI,OAAO,MAAM,SAAS,YAAY,CAAC,aACrC,QAAO;AAIT,SADuB,MAAM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MAAM,qBAAqB,KAAK,KAAK,cAAc,kBAAkB;AACrE,MAAI,CAAE,MAAM,WAAW,mBAAmB,CACxC,OAAM,UACJ,oBACA,KAAK,UAAU,uBAAuB,MAAM,EAAE,EAC9C,OACD;;CAIL,MAAM,mBAAmB,KAAK,KAAK,WAAW,cAAc;CAE5D,MAAM,mBAAmB,2BADE,MAAM,eAAe,iBAAiB,IACS,EAAE,CAAC;CAC7E,MAAM,SAAS,MAAM,QAAQ,iBAAiB,OAAO,GAChD,iBAAiB,OAA8B,IAAI,eAAe,GACnE,EAAE;AAEN,KAAI,CADuB,OAAO,MAAM,UAAU,OAAO,WAAW,aAAa,CAE/E,QAAO,KAAK,EAAE,QAAQ,cAAc,CAAC;CAGvC,MAAM,uBAAuB,4BAA4B,cAAc;CAEvE,MAAM,mBAD4B,cAAc,SAAS,aAAa,IAEvC,OAAO,MAAM,UAAU,mBAAmB,OAAO,IAAI,CAAC;CACrF,MAAM,kBAAkB,uBACpB,OAAO,MAAM,UAAU,8BAA8B,SAAS,EAAE,EAAE,qBAAqB,CAAC,GACxF;AACJ,KAAI,wBAAwB,CAAC,oBAAoB,CAAC,gBAChD,QAAO,KAAK;EAAE,KAAK;EAAS,MAAM,IAAI;EAAwB,CAAC;CAGjE,MAAM,eAAkC;EACtC,GAAG;EACH,SAAS;EACT;EACD;AACD,OAAM,MAAM,KAAK,QAAQ,iBAAiB,EAAE,EAAE,WAAW,MAAM,CAAC;AAChE,OAAM,UAAU,kBAAkB,aAAa;;AAGjD,MAAa,qBAAyC;CACpD,QAAQ;CACR,eAAe,CAAC,UAAU,cAAc;CACxC,aAAa;CACb;CACA,mBAAmB;CACnB;CACD"}
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -84,9 +84,9 @@ declare const Icon: vue0.DefineComponent<vue0.ExtractPropTypes<{
|
|
|
84
84
|
default: string;
|
|
85
85
|
};
|
|
86
86
|
}>> & Readonly<{}>, {
|
|
87
|
+
lazy: boolean;
|
|
87
88
|
size: string | number;
|
|
88
89
|
mode: string;
|
|
89
|
-
lazy: boolean;
|
|
90
90
|
loading: string;
|
|
91
91
|
apiProvider: string;
|
|
92
92
|
class: string;
|
|
@@ -152,9 +152,9 @@ declare const ResuxIcon: vue0.DefineComponent<vue0.ExtractPropTypes<{
|
|
|
152
152
|
default: string;
|
|
153
153
|
};
|
|
154
154
|
}>> & Readonly<{}>, {
|
|
155
|
+
lazy: boolean;
|
|
155
156
|
size: string | number;
|
|
156
157
|
mode: string;
|
|
157
|
-
lazy: boolean;
|
|
158
158
|
loading: string;
|
|
159
159
|
apiProvider: string;
|
|
160
160
|
class: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ import { isReactive, isReadonly, reactive, readonly } from "./reactivity/reactiv
|
|
|
4
4
|
import { computed } from "./reactivity/computed.js";
|
|
5
5
|
import { watch, watchEffect } from "./reactivity/watch.js";
|
|
6
6
|
import { nextTick } from "./reactivity/scheduler.js";
|
|
7
|
-
import { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, PackageAdapterContext, PackageAdapterDefinition, PageMeta, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, abortNavigation, clearError, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, navigateTo, parseUserAgent, readBody, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig } from "./runtime/index.js";
|
|
8
|
-
export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, MaybeRef, MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, ReactiveEffectOptions, ReactiveEffectRunner, Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, WatchCallback, WatchOptions, WatchSource, WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
|
|
7
|
+
import { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HeadInput, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, PackageAdapterContext, PackageAdapterDefinition, PageMeta, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, abortNavigation, clearError, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, navigateTo, parseUserAgent, readBody, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig } from "./runtime/index.js";
|
|
8
|
+
export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HeadInput, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, MaybeRef, MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, ReactiveEffectOptions, ReactiveEffectRunner, Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, WatchCallback, WatchOptions, WatchSource, WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -60,7 +60,10 @@ interface HeadEntry {
|
|
|
60
60
|
link?: Array<Record<string, string>>;
|
|
61
61
|
style?: ComponentStyle[];
|
|
62
62
|
htmlAttrs?: Record<string, string>;
|
|
63
|
+
bodyAttrs?: Record<string, string>;
|
|
63
64
|
}
|
|
65
|
+
type ReactiveHeadValue<T> = T extends Array<infer Item> ? MaybeRefOrGetter<Array<ReactiveHeadValue<Item>>> : T extends object ? MaybeRefOrGetter<{ [Key in keyof T]: ReactiveHeadValue<T[Key]> }> : MaybeRefOrGetter<T>;
|
|
66
|
+
type HeadInput = { [Key in keyof HeadEntry]?: ReactiveHeadValue<NonNullable<HeadEntry[Key]>> };
|
|
64
67
|
interface ComponentStyle {
|
|
65
68
|
id: string;
|
|
66
69
|
css: string;
|
|
@@ -163,8 +166,8 @@ interface ResuxAppLike {
|
|
|
163
166
|
payload: ResuxPayload;
|
|
164
167
|
$config: RuntimeConfig;
|
|
165
168
|
provides: ResuxAppProvides;
|
|
166
|
-
provide<Key extends keyof ResuxAppInjections & string>(key: Key, value: ResuxAppInjections[Key]): void;
|
|
167
|
-
provide<Key extends string, Value>(key: Key, value: Value): void;
|
|
169
|
+
provide<Key$1 extends keyof ResuxAppInjections & string>(key: Key$1, value: ResuxAppInjections[Key$1]): void;
|
|
170
|
+
provide<Key$1 extends string, Value>(key: Key$1, value: Value): void;
|
|
168
171
|
vueApp?: any;
|
|
169
172
|
}
|
|
170
173
|
type ResuxPlugin = (resuxApp: ResuxAppLike) => unknown | Promise<unknown>;
|
|
@@ -426,7 +429,7 @@ interface SetupContext {
|
|
|
426
429
|
defineModel<T>(name?: string, options?: unknown): Ref<T>;
|
|
427
430
|
useRoute(): RouteContext;
|
|
428
431
|
useRouter(): ResuxRouter;
|
|
429
|
-
useHead(input:
|
|
432
|
+
useHead(input: HeadInput): void;
|
|
430
433
|
useSeoMeta(input: SeoMetaInput): void;
|
|
431
434
|
useRuntimeConfig(): RuntimeConfig;
|
|
432
435
|
useResuxApp(): ResuxAppLike;
|
|
@@ -674,5 +677,5 @@ type ClientPatch = {
|
|
|
674
677
|
declare function renderClientPatches(template: TemplateNode[], scope: Record<string, unknown>, scopeId: string, styleScopeId?: string): ClientPatch[];
|
|
675
678
|
declare function getClientRuntimeSource(options?: ClientRuntimeSourceOptions): string;
|
|
676
679
|
//#endregion
|
|
677
|
-
export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, type ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, type MaybeRef, type MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, type ReactiveEffectOptions, type ReactiveEffectRunner, type Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
|
|
680
|
+
export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, type ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HeadInput, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, type MaybeRef, type MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, type ReactiveEffectOptions, type ReactiveEffectRunner, type Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
|
|
678
681
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/runtime/index.js
CHANGED
|
@@ -1030,12 +1030,15 @@ function renderDocument(result, title = "Resux App", options = {}) {
|
|
|
1030
1030
|
deferVueIslands: bootPlan.deferVueIslands
|
|
1031
1031
|
}) : "";
|
|
1032
1032
|
const mergedHead = mergeHead([{ title }, result.head]);
|
|
1033
|
+
const htmlAttrs = {
|
|
1034
|
+
lang: "en",
|
|
1035
|
+
...mergedHead.htmlAttrs ?? {}
|
|
1036
|
+
};
|
|
1037
|
+
const renderedBodyAttrs = renderAttributes(mergedHead.bodyAttrs ?? {});
|
|
1038
|
+
const bodyOpenTag = renderedBodyAttrs ? `<body ${renderedBodyAttrs}>` : "<body>";
|
|
1033
1039
|
return [
|
|
1034
1040
|
"<!doctype html>",
|
|
1035
|
-
`<html ${renderAttributes(
|
|
1036
|
-
lang: "en",
|
|
1037
|
-
...mergedHead.htmlAttrs ?? {}
|
|
1038
|
-
})}>`,
|
|
1041
|
+
`<html ${renderAttributes(htmlAttrs)}>`,
|
|
1039
1042
|
"<head>",
|
|
1040
1043
|
renderHead(mergedHead),
|
|
1041
1044
|
"<meta charset=\"utf-8\">",
|
|
@@ -1340,7 +1343,7 @@ function renderDocument(result, title = "Resux App", options = {}) {
|
|
|
1340
1343
|
}
|
|
1341
1344
|
</style>`,
|
|
1342
1345
|
"</head>",
|
|
1343
|
-
|
|
1346
|
+
bodyOpenTag,
|
|
1344
1347
|
"<div id=\"__resux\">",
|
|
1345
1348
|
result.html,
|
|
1346
1349
|
"</div>",
|
|
@@ -1512,6 +1515,19 @@ function createServerI18nContext(route, runtimeConfig) {
|
|
|
1512
1515
|
setLocale: () => {}
|
|
1513
1516
|
};
|
|
1514
1517
|
}
|
|
1518
|
+
function unwrapHeadValue(value) {
|
|
1519
|
+
if (isRef(value)) return unref(value);
|
|
1520
|
+
return typeof value === "function" ? value() : value;
|
|
1521
|
+
}
|
|
1522
|
+
function resolveHeadReactiveValue(value) {
|
|
1523
|
+
const unwrapped = unwrapHeadValue(value);
|
|
1524
|
+
if (Array.isArray(unwrapped)) return unwrapped.map((entry) => resolveHeadReactiveValue(entry));
|
|
1525
|
+
if (!unwrapped || typeof unwrapped !== "object") return unwrapped;
|
|
1526
|
+
return Object.fromEntries(Object.entries(unwrapped).map(([key, entry]) => [key, resolveHeadReactiveValue(entry)]));
|
|
1527
|
+
}
|
|
1528
|
+
function resolveHeadEntry(input) {
|
|
1529
|
+
return resolveHeadReactiveValue(input);
|
|
1530
|
+
}
|
|
1515
1531
|
function createServerSetupContext(route, props, stateRefs, asyncDataRefs, headEntries, resuxApp, runtimeConfig, globalStateRefs = Object.create(null), globalStateKeys = /* @__PURE__ */ new Set()) {
|
|
1516
1532
|
const apiURL = (url) => resolveServerApiURL(url, route, runtimeConfig);
|
|
1517
1533
|
const fetchJson = async (url, init) => {
|
|
@@ -1585,7 +1601,7 @@ function createServerSetupContext(route, props, stateRefs, asyncDataRefs, headEn
|
|
|
1585
1601
|
return createServerRouter();
|
|
1586
1602
|
},
|
|
1587
1603
|
useHead(input) {
|
|
1588
|
-
headEntries.push(input);
|
|
1604
|
+
headEntries.push(resolveHeadEntry(input));
|
|
1589
1605
|
},
|
|
1590
1606
|
useSeoMeta(input) {
|
|
1591
1607
|
headEntries.push(seoMetaToHead(input));
|
|
@@ -4094,7 +4110,8 @@ function mergeHead(entries) {
|
|
|
4094
4110
|
meta: [],
|
|
4095
4111
|
link: [],
|
|
4096
4112
|
style: [],
|
|
4097
|
-
htmlAttrs: {}
|
|
4113
|
+
htmlAttrs: {},
|
|
4114
|
+
bodyAttrs: {}
|
|
4098
4115
|
};
|
|
4099
4116
|
for (const entry of entries) {
|
|
4100
4117
|
if (entry.title) merged.title = entry.title;
|
|
@@ -4105,6 +4122,10 @@ function mergeHead(entries) {
|
|
|
4105
4122
|
...merged.htmlAttrs ?? {},
|
|
4106
4123
|
...entry.htmlAttrs
|
|
4107
4124
|
};
|
|
4125
|
+
if (entry.bodyAttrs) merged.bodyAttrs = {
|
|
4126
|
+
...merged.bodyAttrs ?? {},
|
|
4127
|
+
...entry.bodyAttrs
|
|
4128
|
+
};
|
|
4108
4129
|
}
|
|
4109
4130
|
merged.link = sortHeadLinksForPriority(merged.link ?? []);
|
|
4110
4131
|
return merged;
|