@timber-js/app 0.2.0-alpha.140 → 0.2.0-alpha.141

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.140",
3
+ "version": "0.2.0-alpha.141",
4
4
  "description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -114,6 +114,11 @@
114
114
  "publishConfig": {
115
115
  "access": "public"
116
116
  },
117
+ "scripts": {
118
+ "build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
119
+ "typecheck": "tsgo --noEmit",
120
+ "prepublishOnly": "pnpm run build"
121
+ },
117
122
  "dependencies": {
118
123
  "@opentelemetry/api": "^1.9.1",
119
124
  "@opentelemetry/context-async-hooks": "^2.7.1",
@@ -157,9 +162,5 @@
157
162
  },
158
163
  "engines": {
159
164
  "node": ">=22.12.0"
160
- },
161
- "scripts": {
162
- "build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
163
- "typecheck": "tsgo --noEmit"
164
165
  }
165
- }
166
+ }
@@ -364,6 +364,7 @@ export function generateNitroConfig(
364
364
  // See design/25-production-deployments.md §"CDN / Edge Cache"
365
365
  routeRules: {
366
366
  '/assets/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
367
+ '/_timber/fonts/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
367
368
  },
368
369
  ...presetConfig.extraConfig,
369
370
  ...userConfig,
@@ -483,7 +484,9 @@ const server = createServer(async (req, res) => {
483
484
  const contentType = MIME_TYPES[ext] || 'application/octet-stream';
484
485
  const body = await readFile(filePath);
485
486
  // Hashed assets get immutable cache, others get short cache.
486
- const cacheControl = url.pathname.startsWith('/assets/')
487
+ const isImmutable =
488
+ url.pathname.startsWith('/assets/') || url.pathname.startsWith('/_timber/fonts/');
489
+ const cacheControl = isImmutable
487
490
  ? 'public, max-age=31536000, immutable'
488
491
  : 'public, max-age=3600, must-revalidate';
489
492
  res.writeHead(200, {
@@ -711,6 +714,7 @@ async function runNitroBuild(
711
714
  output: { dir: join(nitroDir, presetConfig.outputDir) },
712
715
  routeRules: {
713
716
  '/assets/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
717
+ '/_timber/fonts/**': { headers: { 'Cache-Control': IMMUTABLE_CACHE } },
714
718
  },
715
719
  // Don't bundle the timber RSC/SSR build output — it has its own
716
720
  // internal file references that nitro's bundler can't follow.
package/src/cli.ts CHANGED
File without changes
@@ -51,7 +51,7 @@ export function installFontDevMiddleware(server: ViteDevServer, pipeline: FontPi
51
51
  if (font.provider !== 'local' || !font.localSources) continue;
52
52
  for (const src of font.localSources) {
53
53
  const basename = src.path.split('/').pop() ?? '';
54
- if (basename !== requestedFilename) continue;
54
+ if (basename !== requestedFilename && src.hashedBasename !== requestedFilename) continue;
55
55
 
56
56
  const absolutePath = normalize(resolve(src.path));
57
57
  if (!existsSync(absolutePath)) {
package/LICENSE DELETED
@@ -1,8 +0,0 @@
1
- DONTFUCKINGUSE LICENSE
2
-
3
- Copyright (c) 2025 Daniel Saewitz
4
-
5
- This software may not be used, copied, modified, merged, published,
6
- distributed, sublicensed, or sold by anyone other than the copyright holder.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.