@timber-js/app 0.1.40 → 0.1.42

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.
@@ -1 +1 @@
1
- {"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/plugins/chunks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAmGnC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4B1D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,GAAG,SAAS,CAarB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAoBrC"}
1
+ {"version":3,"file":"chunks.d.ts","sourceRoot":"","sources":["../../src/plugins/chunks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAwGnC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA4B1D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,GAAG,SAAS,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAoBrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "Vite-native React framework for Cloudflare Workers — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -288,10 +288,15 @@ export function generateNitroEntry(
288
288
  : await handler(webRequest)`
289
289
  : ` const webResponse = await handler(webRequest)`;
290
290
 
291
+ // Build manifest init must be imported before the handler so that
292
+ // globalThis.__TIMBER_BUILD_MANIFEST__ is set when the virtual module evaluates.
293
+ // ESM guarantees imports are evaluated in order.
294
+ const manifestImport = hasManifestInit ? "import './_timber-manifest-init.js'\n" : '';
295
+
291
296
  return `// Generated by @timber-js/app/adapters/nitro
292
297
  // Do not edit — this file is regenerated on each build.
293
298
 
294
- import { defineEventHandler } from 'nitro/h3'
299
+ ${manifestImport}import { defineEventHandler } from 'nitro/h3'
295
300
  import handler, { runWithEarlyHintsSender } from '${serverEntryRelative}'
296
301
  import { compressResponse } from './_compress.mjs'
297
302
 
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /**
2
4
  * NavigationContext — React context for navigation state.
3
5
  *
@@ -97,10 +97,15 @@ function isReactVendor(id: string): boolean {
97
97
 
98
98
  /**
99
99
  * Check if a module is part of the timber framework runtime (tier 2).
100
+ *
101
+ * Matches both monorepo paths (packages/timber-app/...) and consumer
102
+ * project paths (node_modules/@timber-js/app/...) so the chunk
103
+ * assignment is consistent regardless of how timber is installed.
100
104
  */
101
105
  function isTimberRuntime(id: string): boolean {
102
106
  return (
103
107
  id.includes('/timber-app/') ||
108
+ id.includes('/@timber-js/app/') ||
104
109
  id.includes('react-server-dom') ||
105
110
  id.includes('@vitejs/plugin-rsc')
106
111
  );
@@ -175,7 +180,8 @@ export function assignClientChunk(meta: {
175
180
  serverChunk: string;
176
181
  }): string | undefined {
177
182
  // Timber framework client modules → vendor-timber
178
- if (meta.id.includes('/timber-app/')) return 'vendor-timber';
183
+ // Match both monorepo paths (/timber-app/) and consumer paths (/@timber-js/app/)
184
+ if (meta.id.includes('/timber-app/') || meta.id.includes('/@timber-js/app/')) return 'vendor-timber';
179
185
 
180
186
  // Small user client components → shared-client (prevents facade micro-chunks)
181
187
  if (!meta.id.includes('\0') && meta.id.startsWith('/')) {