bosia 0.6.19 → 0.6.20

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/core/build.ts +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bosia",
3
- "version": "0.6.19",
3
+ "version": "0.6.20",
4
4
  "type": "module",
5
5
  "description": "A fast, batteries-included fullstack framework — SSR · Svelte 5 Runes · Bun · ElysiaJS. File-based routing inspired by SvelteKit. No Node.js, no Vite, no adapters.",
6
6
  "keywords": [
package/src/core/build.ts CHANGED
@@ -222,10 +222,19 @@ if (!isProduction && svelteMapCache.size > 0) {
222
222
  // 6. Collect output files for dist/manifest.json
223
223
  const jsFiles: string[] = [];
224
224
  const cssFiles: string[] = [];
225
+ // 0.6.19 hashed the entry filename; the old `f === "hydrate.js"` exact-match
226
+ // no longer hits, and the fallback `startsWith("hydrate")` picks the first
227
+ // hydrate-* chunk by array order — which can be a small leaf module (e.g.
228
+ // `src/lib/version.ts`) that sorts before the real entry. Use Bun's
229
+ // `output.kind === "entry-point"` instead so we pin the actual entry.
230
+ let clientEntry: string | null = null;
225
231
  for (const output of clientResult.outputs) {
226
232
  const rel = relative(`${OUT_DIR}/client`, output.path);
227
233
  if (output.path.endsWith(".js")) jsFiles.push(rel);
228
234
  if (output.path.endsWith(".css")) cssFiles.push(rel);
235
+ if ((output as { kind?: string }).kind === "entry-point" && output.path.endsWith(".js")) {
236
+ clientEntry = rel;
237
+ }
229
238
  }
230
239
 
231
240
  // Entry is always "index.js" due to naming: { entry: "index.[ext]" }
@@ -241,6 +250,7 @@ const distManifest = {
241
250
  js: jsFiles,
242
251
  css: cssFiles,
243
252
  entry:
253
+ clientEntry ??
244
254
  jsFiles.find((f) => f === "hydrate.js") ??
245
255
  jsFiles.find((f) => f.startsWith("hydrate")) ??
246
256
  "hydrate.js",