@timber-js/app 0.2.0-alpha.103 → 0.2.0-alpha.106
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/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/server/internal.js +3 -1
- package/dist/server/internal.js.map +1 -1
- package/dist/server/pipeline-phases.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/cli.ts +0 -0
- package/src/index.ts +19 -0
- package/src/server/pipeline-phases.ts +10 -0
- package/LICENSE +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-phases.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmBH,OAAO,EAA2C,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEpG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"pipeline-phases.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmBH,OAAO,EAA2C,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEpG,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKrF,UAAU,aAAa;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAID;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,aAAa,EACvB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAavB;AAID;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,oBAAoB,EAAE,OAAO,EAC7B,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,YAAY,CAAC,CA6DvB;AAID;;;GAGG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,OAAO,EACxB,oBAAoB,EAAE,OAAO,EAC7B,EAAE,iBAAiB,EAAE,YAAY,EAAE,EAAE,aAAa,GACjD,OAAO,CAAC,YAAY,CAAC,CAkBvB;AAID;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,QAAQ,CAAC,CAyNnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timber-js/app",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.106",
|
|
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",
|
|
@@ -110,6 +110,11 @@
|
|
|
110
110
|
"publishConfig": {
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
113
|
+
"scripts": {
|
|
114
|
+
"build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
|
|
115
|
+
"typecheck": "tsgo --noEmit",
|
|
116
|
+
"prepublishOnly": "pnpm run build"
|
|
117
|
+
},
|
|
113
118
|
"dependencies": {
|
|
114
119
|
"@opentelemetry/api": "^1.9.1",
|
|
115
120
|
"@opentelemetry/context-async-hooks": "^2.6.1",
|
|
@@ -153,9 +158,5 @@
|
|
|
153
158
|
},
|
|
154
159
|
"engines": {
|
|
155
160
|
"node": ">=22.12.0"
|
|
156
|
-
},
|
|
157
|
-
"scripts": {
|
|
158
|
-
"build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
|
|
159
|
-
"typecheck": "tsgo --noEmit"
|
|
160
161
|
}
|
|
161
|
-
}
|
|
162
|
+
}
|
package/src/cli.ts
CHANGED
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -369,10 +369,28 @@ export function timber(config?: TimberUserConfig): PluginOption[] {
|
|
|
369
369
|
envOutDirs[envName] = { build: { outDir: join(buildOutDir, envName) } };
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
// Exclude @timber-js/app packages from the dep optimizer.
|
|
373
|
+
// The shims plugin intercepts @timber-js/app/* imports per-environment
|
|
374
|
+
// (e.g. replacing @timber-js/app/server with a stub in the client env).
|
|
375
|
+
// The dep optimizer runs before per-environment resolution, so it would
|
|
376
|
+
// pre-bundle @timber-js/app/cookies with the real server code inlined,
|
|
377
|
+
// pulling AsyncLocalStorage into the browser bundle.
|
|
378
|
+
const timberOptimizeDepsExclude = [
|
|
379
|
+
'@timber-js/app',
|
|
380
|
+
'@timber-js/app/server',
|
|
381
|
+
'@timber-js/app/client',
|
|
382
|
+
'@timber-js/app/cookies',
|
|
383
|
+
'@timber-js/app/cache',
|
|
384
|
+
'@timber-js/app/search-params',
|
|
385
|
+
'@timber-js/app/segment-params',
|
|
386
|
+
'@timber-js/app/codec',
|
|
387
|
+
];
|
|
388
|
+
|
|
372
389
|
if (command === 'build') {
|
|
373
390
|
return {
|
|
374
391
|
build: { outDir: buildOutDir },
|
|
375
392
|
environments: envOutDirs,
|
|
393
|
+
optimizeDeps: { exclude: timberOptimizeDepsExclude },
|
|
376
394
|
oxc: {
|
|
377
395
|
jsx: {
|
|
378
396
|
development: false,
|
|
@@ -408,6 +426,7 @@ export function timber(config?: TimberUserConfig): PluginOption[] {
|
|
|
408
426
|
return {
|
|
409
427
|
build: { outDir: buildOutDir },
|
|
410
428
|
environments: envOutDirs,
|
|
429
|
+
optimizeDeps: { exclude: timberOptimizeDepsExclude },
|
|
411
430
|
server: serverConfig,
|
|
412
431
|
preview: previewConfig,
|
|
413
432
|
};
|
|
@@ -35,6 +35,7 @@ import { outcomeToResponse, type PhaseOutcome } from './pipeline-outcome.js';
|
|
|
35
35
|
import type { InterceptionContext, PipelineConfig, RouteMatch } from './pipeline.js';
|
|
36
36
|
import type { MetadataHandler, MetadataRoute, MiddlewareContext } from './types.js';
|
|
37
37
|
import { swallow } from './logger.js';
|
|
38
|
+
import { isDebug } from './debug.js';
|
|
38
39
|
|
|
39
40
|
interface RenderContext {
|
|
40
41
|
canonicalPathname: string;
|
|
@@ -320,6 +321,15 @@ export async function handleRequest(
|
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
if (!match) {
|
|
324
|
+
// Dev-time diagnostic: log the unmatched pathname so developers can
|
|
325
|
+
// see why a request 404'd without needing to add breakpoints.
|
|
326
|
+
if (isDebug()) {
|
|
327
|
+
console.warn(
|
|
328
|
+
`[timber] No route matched for pathname: ${canonicalPathname}\n` +
|
|
329
|
+
` Raw URL: ${url.pathname}\n` +
|
|
330
|
+
` Method: ${method}`
|
|
331
|
+
);
|
|
332
|
+
}
|
|
323
333
|
// No route matched — render 404.tsx in root layout if available,
|
|
324
334
|
// otherwise fall back to a bare 404 Response.
|
|
325
335
|
if (config.renderNoMatch) {
|
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.
|