@timber-js/app 0.2.0-alpha.230 → 0.2.0-alpha.232
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/agent-skill.md +13 -0
- package/dist/_chunks/{actions-DHum77eH.js → actions-CYjRMpZI.js} +3 -2
- package/dist/_chunks/{actions-DHum77eH.js.map → actions-CYjRMpZI.js.map} +1 -1
- package/dist/_chunks/{cli-check-B-JZkpBD.js → cli-check-BAKOSTkg.js} +2 -2
- package/dist/_chunks/{cli-check-B-JZkpBD.js.map → cli-check-BAKOSTkg.js.map} +1 -1
- package/dist/_chunks/codec-registry-C8hOGmZo.js +13 -0
- package/dist/_chunks/codec-registry-C8hOGmZo.js.map +1 -0
- package/dist/_chunks/{codegen-B9oWkWGf.js → codegen-vaCyFyVN.js} +67 -17
- package/dist/_chunks/codegen-vaCyFyVN.js.map +1 -0
- package/dist/_chunks/{convention-lint-CrDKERHg.js → convention-lint-D54k6uUM.js} +2 -2
- package/dist/_chunks/{convention-lint-CrDKERHg.js.map → convention-lint-D54k6uUM.js.map} +1 -1
- package/dist/_chunks/href-BtspoNc9.js +164 -0
- package/dist/_chunks/href-BtspoNc9.js.map +1 -0
- package/dist/_chunks/href-validation-DNg-zV7u.js +102 -0
- package/dist/_chunks/href-validation-DNg-zV7u.js.map +1 -0
- package/dist/_chunks/merge-search-params-7o_5yX0L.js +111 -0
- package/dist/_chunks/merge-search-params-7o_5yX0L.js.map +1 -0
- package/dist/_chunks/{use-query-states-pkDV-jSg.js → use-query-states-D3MMl-KM.js} +12 -12
- package/dist/_chunks/use-query-states-D3MMl-KM.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +4 -122
- package/dist/client/index.js.map +1 -1
- package/dist/client/internal.js +1 -1
- package/dist/client/link.d.ts +4 -25
- package/dist/client/link.d.ts.map +1 -1
- package/dist/client/nuqs-adapter.d.ts.map +1 -1
- package/dist/client/use-query-states.d.ts +1 -1
- package/dist/client/use-query-states.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -1
- package/dist/index.js.map +1 -1
- package/dist/params/codec-registry.d.ts +21 -11
- package/dist/params/codec-registry.d.ts.map +1 -1
- package/dist/params/index.d.ts +0 -1
- package/dist/params/index.d.ts.map +1 -1
- package/dist/params/index.js +1 -2
- package/dist/params/index.js.map +1 -1
- package/dist/plugins/node-flight-builds.d.ts +38 -0
- package/dist/plugins/node-flight-builds.d.ts.map +1 -0
- package/dist/plugins/shims.d.ts.map +1 -1
- package/dist/routes/href.d.ts +124 -0
- package/dist/routes/href.d.ts.map +1 -0
- package/dist/routes/index.d.ts +4 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +8 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routing/codegen.d.ts.map +1 -1
- package/dist/routing/index.js +1 -1
- package/dist/routing/link-codegen.d.ts +39 -8
- package/dist/routing/link-codegen.d.ts.map +1 -1
- package/dist/search-params/define.d.ts +37 -17
- package/dist/search-params/define.d.ts.map +1 -1
- package/dist/search-params/index.d.ts +1 -0
- package/dist/search-params/index.d.ts.map +1 -1
- package/dist/search-params/index.js +3 -2
- package/dist/search-params/index.js.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/internal.js +4 -6
- package/dist/server/internal.js.map +1 -1
- package/dist/server/param-coercion.d.ts +0 -7
- package/dist/server/param-coercion.d.ts.map +1 -1
- package/dist/server/rsc-entry/index.d.ts.map +1 -1
- package/dist/shared/href.d.ts +88 -0
- package/dist/shared/href.d.ts.map +1 -0
- package/docs/api/31-api-client.mdx +1 -1
- package/docs/api/35-api-typescript.mdx +47 -15
- package/docs/learn/06-typed-params.mdx +33 -0
- package/docs/learn/07-typed-routes.mdx +75 -10
- package/package.json +6 -2
- package/src/client/browser-entry/index.ts +4 -4
- package/src/client/index.ts +3 -1
- package/src/client/link.tsx +5 -238
- package/src/client/nuqs-adapter.tsx +45 -2
- package/src/client/use-query-states.ts +27 -23
- package/src/index.ts +5 -0
- package/src/params/codec-registry.ts +24 -11
- package/src/params/index.ts +0 -1
- package/src/plugins/node-flight-builds.ts +94 -0
- package/src/plugins/shims.ts +10 -0
- package/src/routes/href.ts +171 -0
- package/src/routes/index.ts +10 -0
- package/src/routing/codegen.ts +8 -1
- package/src/routing/link-codegen.ts +103 -37
- package/src/search-params/define.ts +37 -17
- package/src/search-params/index.ts +10 -0
- package/src/server/param-coercion.ts +5 -23
- package/src/server/rsc-entry/index.ts +6 -3
- package/src/server/ssr-entry.ts +2 -2
- package/src/shared/href.ts +257 -0
- package/dist/_chunks/codec-registry-CPc6bjVl.js +0 -20
- package/dist/_chunks/codec-registry-CPc6bjVl.js.map +0 -1
- package/dist/_chunks/codegen-B9oWkWGf.js.map +0 -1
- package/dist/_chunks/href-validation-CEZy1V-k.js +0 -210
- package/dist/_chunks/href-validation-CEZy1V-k.js.map +0 -1
- package/dist/_chunks/use-query-states-pkDV-jSg.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { i as resolveRenderTimeoutMs } from "./_chunks/render-timeout-MrrqD1wd.j
|
|
|
3
3
|
import { t as writeFileAtomic } from "./_chunks/write-file-atomic-DW8m_Atv.js";
|
|
4
4
|
import { d as collectInterceptionRewrites, l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-BNQ4qnLX.js";
|
|
5
5
|
import { b as swallow } from "./_chunks/logger-YtMSKfft.js";
|
|
6
|
-
import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-
|
|
6
|
+
import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-D54k6uUM.js";
|
|
7
7
|
import { a as contextAdapter, c as loadTimberConfigFile, d as resolveBuildDir, f as resolveClientJavascript, l as mergeFileConfig, m as createNoopTimer, o as createPluginContext, r as adapterConfig, u as resolveAppDir } from "./_chunks/plugin-context-FCkaNLUB.js";
|
|
8
8
|
import { i as withBasePath, n as normalizeBasePath, t as isRelativeBase } from "./_chunks/base-path-DDIx0FXe.js";
|
|
9
9
|
import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-D_QHR_nf.js";
|
|
@@ -1020,6 +1020,7 @@ var SUBPATH_SRC_MAP = {
|
|
|
1020
1020
|
"codec": "codec.ts",
|
|
1021
1021
|
"cookies": "cookies/index.ts",
|
|
1022
1022
|
"params": "params/index.ts",
|
|
1023
|
+
"routes": "routes/index.ts",
|
|
1023
1024
|
"search-params": "search-params/index.ts",
|
|
1024
1025
|
"cache/stores/memory": "cache/stores/memory.ts",
|
|
1025
1026
|
"cache/stores/redis": "cache/stores/redis.ts",
|
|
@@ -1150,6 +1151,7 @@ function timberShims(_ctx) {
|
|
|
1150
1151
|
}
|
|
1151
1152
|
if (cleanId === "#client-internal") return resolve(PKG_ROOT, "src", "client", "internal.ts");
|
|
1152
1153
|
if (cleanId === "#routing") return resolve(PKG_ROOT, "src", "routing", "index.ts");
|
|
1154
|
+
if (cleanId === "@timber-js/app/routes") return resolve(PKG_ROOT, "src", "routes", "index.ts");
|
|
1153
1155
|
if (cleanId === "@timber-js/app/server/internal") {
|
|
1154
1156
|
if (envName(this) === "client") return "\0timber:server-empty";
|
|
1155
1157
|
return resolve(PKG_ROOT, "src", "server", "internal.ts");
|
|
@@ -8132,6 +8134,58 @@ function timberClientInServerPackageDeps(rscEnvironmentName = "rsc") {
|
|
|
8132
8134
|
}
|
|
8133
8135
|
};
|
|
8134
8136
|
}
|
|
8137
|
+
// src/plugins/node-flight-builds.ts
|
|
8138
|
+
var SERVER_ENVIRONMENTS = /* @__PURE__ */ new Set(["rsc", "ssr"]);
|
|
8139
|
+
var VENDOR = "@vitejs/plugin-rsc/vendor/react-server-dom";
|
|
8140
|
+
var VENDOR_EDGE_RE = /^@vitejs\/plugin-rsc\/vendor\/react-server-dom\/(server|client|static)\.edge$/;
|
|
8141
|
+
var REACT_DOM_SERVER_RE = /^react-dom\/(server|static)(?:\.edge)?$/;
|
|
8142
|
+
/**
|
|
8143
|
+
* A server renderer specifier → its Node build; null for anything else.
|
|
8144
|
+
*
|
|
8145
|
+
* react-dom's bare `react-dom/server` already resolves to the Node build on
|
|
8146
|
+
* Node, but as a raw file: once `react-dom/server.node` is pre-bundled it
|
|
8147
|
+
* would be a second instance, so it is redirected too. SSR only: in RSC,
|
|
8148
|
+
* plugin-rsc rejects `react-dom/server`, and that error must stay.
|
|
8149
|
+
*/
|
|
8150
|
+
function nodeBuildOf(specifier, environmentName) {
|
|
8151
|
+
const vendor = VENDOR_EDGE_RE.exec(specifier);
|
|
8152
|
+
if (vendor) return `${VENDOR}/${vendor[1]}.node`;
|
|
8153
|
+
if (environmentName !== "ssr") return null;
|
|
8154
|
+
const reactDom = REACT_DOM_SERVER_RE.exec(specifier);
|
|
8155
|
+
if (reactDom) return `react-dom/${reactDom[1]}.node`;
|
|
8156
|
+
return null;
|
|
8157
|
+
}
|
|
8158
|
+
/**
|
|
8159
|
+
* The pre-bundle list with each edge build replaced by its Node build. A Node
|
|
8160
|
+
* build already listed is not listed twice.
|
|
8161
|
+
*/
|
|
8162
|
+
function withNodeFlightBuilds(include, environmentName) {
|
|
8163
|
+
return [...new Set(include.map((entry) => nodeBuildOf(entry, environmentName) ?? entry))];
|
|
8164
|
+
}
|
|
8165
|
+
function timberNodeFlightBuilds() {
|
|
8166
|
+
return {
|
|
8167
|
+
name: "timber-node-flight-builds",
|
|
8168
|
+
apply: "serve",
|
|
8169
|
+
enforce: "pre",
|
|
8170
|
+
configEnvironment: {
|
|
8171
|
+
order: "post",
|
|
8172
|
+
handler(name, config) {
|
|
8173
|
+
if (!SERVER_ENVIRONMENTS.has(name)) return;
|
|
8174
|
+
const deps = config.optimizeDeps;
|
|
8175
|
+
if (deps?.include) deps.include = withNodeFlightBuilds(deps.include, name);
|
|
8176
|
+
}
|
|
8177
|
+
},
|
|
8178
|
+
resolveId(source, importer, options) {
|
|
8179
|
+
if (!SERVER_ENVIRONMENTS.has(this.environment.name)) return;
|
|
8180
|
+
const nodeBuild = nodeBuildOf(source, this.environment.name);
|
|
8181
|
+
if (!nodeBuild) return;
|
|
8182
|
+
return this.resolve(nodeBuild, importer, {
|
|
8183
|
+
...options,
|
|
8184
|
+
skipSelf: true
|
|
8185
|
+
});
|
|
8186
|
+
}
|
|
8187
|
+
};
|
|
8188
|
+
}
|
|
8135
8189
|
// src/plugins/callsite-jsx.ts
|
|
8136
8190
|
/**
|
|
8137
8191
|
* Try to extract a static JSON-safe value from an AST expression node.
|
|
@@ -10663,6 +10717,7 @@ function timber(config) {
|
|
|
10663
10717
|
"@timber-js/app/cache",
|
|
10664
10718
|
"@timber-js/app/search-params",
|
|
10665
10719
|
"@timber-js/app/params",
|
|
10720
|
+
"@timber-js/app/routes",
|
|
10666
10721
|
"@timber-js/app/codec"
|
|
10667
10722
|
];
|
|
10668
10723
|
if (command === "build") return {
|
|
@@ -10724,6 +10779,7 @@ function timber(config) {
|
|
|
10724
10779
|
return [
|
|
10725
10780
|
rootSync,
|
|
10726
10781
|
timberReactResolve(),
|
|
10782
|
+
timberNodeFlightBuilds(),
|
|
10727
10783
|
timberReactProd(),
|
|
10728
10784
|
...patchReactCompilerForProdJsx(react({ compiler: effectiveReactCompiler || false })),
|
|
10729
10785
|
vitePluginRsc(createRscOptions(ctx, encryptionKeyExpr)),
|