@valbuild/tanstack 0.124.0 → 0.125.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,93 @@
1
+ # @valbuild/tanstack
2
+
3
+ ## 0.125.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#638](https://github.com/valbuild/val/pull/638) [`c390397`](https://github.com/valbuild/val/commit/c390397cb5e203eb1bedae3a6fab15726e850b90) Thanks [@freekh](https://github.com/freekh)! - Val now runs on TanStack Start.
8
+
9
+ `@valbuild/tanstack` is a new package with everything `@valbuild/next` has: Val
10
+ Studio at `/val`, the on-page overlay and canvas, draft mode, the client hooks,
11
+ server-side content reads, images, and the MCP tools.
12
+
13
+ ```sh
14
+ npm install @valbuild/tanstack
15
+ ```
16
+
17
+ ```ts
18
+ // val.config.ts
19
+ import { initVal } from "@valbuild/tanstack";
20
+ const { s, c, config, tanstackRouter } = initVal({ project: "org/project" });
21
+ ```
22
+
23
+ **Routes are first class.** A Val module for a route is named after the route
24
+ file it sits beside — `src/routes/posts.$postId.tsx` is served content by
25
+ `src/routes/posts.$postId.val.ts` — and its keys are the URLs that route serves:
26
+
27
+ ```ts
28
+ export default c.define(
29
+ "/src/routes/posts.$postId.val.ts",
30
+ s.router(tanstackRouter, s.object({ title: s.string() })),
31
+ { "/posts/hello-world": { title: "Hello world" } },
32
+ );
33
+ ```
34
+
35
+ `.` and `/` both separate segments, `$param` is a parameter, `$` is a splat, and
36
+ `index`, `route`, `(groups)` and `_pathless` layouts add no URL segment — the
37
+ same rules TanStack Router uses for the route file itself. Val validates every
38
+ key against that pattern, and Val Studio shows these modules as a sitemap under
39
+ **Pages**, where an editor can add a page.
40
+
41
+ Point the route generator away from your content files, in `vite.config.ts` and
42
+ `tsr.config.json`:
43
+
44
+ ```ts
45
+ tanstackStart({ router: { routeFileIgnorePattern: "\\.val\\.[tj]sx?$" } });
46
+ ```
47
+
48
+ See the [README](https://github.com/valbuild/val/blob/main/packages/tanstack/README.md)
49
+ for the full wiring, and `examples/tanstack` for a working app.
50
+
51
+ **Also fixed, for everyone:** `Internal.VERSION.core` was `null` in any ESM
52
+ bundle — it was read with `require("../package.json")` inside a `try`, so the
53
+ failure was silent. That version goes into every remote file ref and proxy mode
54
+ refuses to start without it. Every package now reads its version through a
55
+ static JSON import, which is inlined at build time.
56
+
57
+ Two smaller fixes that came out of running the whole toolchain against a
58
+ TanStack project:
59
+
60
+ - `val versions` reports `@valbuild/tanstack`, and `val debug` writes a snapshot
61
+ that names whichever framework package the captured project actually has.
62
+ - `@valbuild/eslint-plugin` reads a `tsconfig.json` that has comments in it. A
63
+ tsconfig is JSONC, and `JSON.parse` is not — so on any project whose tsconfig
64
+ carries a comment (the TanStack starter's does) the
65
+ `module-in-val-modules` rule threw `Expected double-quoted property name in
66
+ JSON` on the first file and took the whole lint run with it.
67
+
68
+ Three fixes found by driving the Studio against a real TanStack app:
69
+
70
+ - **A draft image now loads on the page.** The source the Studio pushes to the
71
+ host page carries `patch_id` for any file whose bytes are still in a patch, so
72
+ the page asks `/api/val/files/...?patch_id=` rather than a `/public` path that
73
+ nothing has written yet. This was silent — the image just did not appear — and
74
+ it affects any page that reads media through the hooks rather than on the
75
+ server, `@valbuild/next` included.
76
+ - **A splat route no longer logs an error on every render.** TanStack returns
77
+ both `_splat` and `*` for the same parameter; Val reported the second as a
78
+ parameter it could not place in the path.
79
+ - The TanStack example and starter render a 404 page instead of throwing
80
+ `notFound()` from a component, which escaped to the error boundary and logged
81
+ `Error in renderToReadableStream` (and, with no not-found component
82
+ configured, aborted the response) on every miss.
83
+
84
+ ### Patch Changes
85
+
86
+ - Updated dependencies [[`22f78b4`](https://github.com/valbuild/val/commit/22f78b471fd18e542f518f72b75bd472d7c3dc52), [`c390397`](https://github.com/valbuild/val/commit/c390397cb5e203eb1bedae3a6fab15726e850b90)]:
87
+ - @valbuild/language-server@0.125.0
88
+ - @valbuild/core@0.125.0
89
+ - @valbuild/shared@0.125.0
90
+ - @valbuild/ui@0.125.0
91
+ - @valbuild/mcp@0.125.0
92
+ - @valbuild/react@0.125.0
93
+ - @valbuild/server@0.125.0
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('./version-1a88fd21.cjs.dev.js');
5
+ var version = require('./version-6eeefb70.cjs.dev.js');
6
6
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-e75681d7.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('./version-5ac70ccf.cjs.prod.js');
5
+ var version = require('./version-803e9fd4.cjs.prod.js');
6
6
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-0324e063.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
@@ -1,4 +1,4 @@
1
- import { _ as _asyncToGenerator, a as _regenerator, V as VERSION$1 } from './version-ac8df696.esm.js';
1
+ import { _ as _asyncToGenerator, a as _regenerator, V as VERSION$1 } from './version-9b3ce6c3.esm.js';
2
2
  import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper } from './createForOfIteratorHelper-485c2ce1.esm.js';
3
3
  import { Internal as Internal$1, initVal as initVal$1, DEFAULT_CONTENT_HOST } from '@valbuild/core';
4
4
  import * as core from '@valbuild/core';
@@ -152,7 +152,7 @@ var packageJson = {
152
152
  "tanstack-router",
153
153
  "react"
154
154
  ],
155
- version: "0.124.0",
155
+ version: "0.125.0",
156
156
  scripts: {
157
157
  typecheck: "tsc --noEmit",
158
158
  test: "jest"
@@ -152,7 +152,7 @@ var packageJson = {
152
152
  "tanstack-router",
153
153
  "react"
154
154
  ],
155
- version: "0.124.0",
155
+ version: "0.125.0",
156
156
  scripts: {
157
157
  typecheck: "tsc --noEmit",
158
158
  test: "jest"
@@ -150,7 +150,7 @@ var packageJson = {
150
150
  "tanstack-router",
151
151
  "react"
152
152
  ],
153
- version: "0.124.0",
153
+ version: "0.125.0",
154
154
  scripts: {
155
155
  typecheck: "tsc --noEmit",
156
156
  test: "jest"
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tanstack-router",
15
15
  "react"
16
16
  ],
17
- "version": "0.124.0",
17
+ "version": "0.125.0",
18
18
  "main": "dist/valbuild-tanstack.cjs.js",
19
19
  "module": "dist/valbuild-tanstack.esm.js",
20
20
  "exports": {
@@ -42,13 +42,13 @@
42
42
  "exports": true
43
43
  },
44
44
  "dependencies": {
45
- "@valbuild/core": "0.124.0",
46
- "@valbuild/language-server": "0.124.0",
47
- "@valbuild/server": "0.124.0",
48
- "@valbuild/mcp": "0.124.0",
49
- "@valbuild/react": "0.124.0",
50
- "@valbuild/shared": "0.124.0",
51
- "@valbuild/ui": "0.124.0"
45
+ "@valbuild/core": "0.125.0",
46
+ "@valbuild/language-server": "0.125.0",
47
+ "@valbuild/mcp": "0.125.0",
48
+ "@valbuild/react": "0.125.0",
49
+ "@valbuild/server": "0.125.0",
50
+ "@valbuild/shared": "0.125.0",
51
+ "@valbuild/ui": "0.125.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@tanstack/react-router": "^1.170.33",
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-e75681d7.cjs.dev.js');
6
6
  var core = require('@valbuild/core');
7
7
  var server = require('@valbuild/server');
8
- var version = require('../../dist/version-1a88fd21.cjs.dev.js');
8
+ var version = require('../../dist/version-6eeefb70.cjs.dev.js');
9
9
  var routeFromVal = require('../../dist/routeFromVal-a9147ceb.cjs.dev.js');
10
10
  var stega = require('@valbuild/react/stega');
11
11
  var internal = require('@valbuild/shared/internal');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-0324e063.cjs.prod.js');
6
6
  var core = require('@valbuild/core');
7
7
  var server = require('@valbuild/server');
8
- var version = require('../../dist/version-5ac70ccf.cjs.prod.js');
8
+ var version = require('../../dist/version-803e9fd4.cjs.prod.js');
9
9
  var routeFromVal = require('../../dist/routeFromVal-6693e037.cjs.prod.js');
10
10
  var stega = require('@valbuild/react/stega');
11
11
  var internal = require('@valbuild/shared/internal');
@@ -1,7 +1,7 @@
1
1
  import { _ as _objectSpread2, a as _slicedToArray, d as _defineProperty } from '../../dist/createForOfIteratorHelper-485c2ce1.esm.js';
2
2
  import { Internal } from '@valbuild/core';
3
3
  import { createValApiRouter, createValServer } from '@valbuild/server';
4
- import { _ as _asyncToGenerator, a as _regenerator, V as VERSION } from '../../dist/version-ac8df696.esm.js';
4
+ import { _ as _asyncToGenerator, a as _regenerator, V as VERSION } from '../../dist/version-9b3ce6c3.esm.js';
5
5
  import { b as initValRouteFromVal, g as getJsonEntryStegaRoot, i as isJsonValuesRecordSchema, a as getValRouteUrlFromVal, _ as _typeof } from '../../dist/routeFromVal-728295a0.esm.js';
6
6
  import { stegaEncode, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
7
7
  import { VAL_SESSION_COOKIE } from '@valbuild/shared/internal';