@valbuild/tanstack 0.136.9 → 0.137.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 CHANGED
@@ -1,5 +1,62 @@
1
1
  # @valbuild/tanstack
2
2
 
3
+ ## 0.137.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#676](https://github.com/valbuild/val/pull/676) [`43b58f2`](https://github.com/valbuild/val/commit/43b58f2962840883badf91950da2c51b89d1c7cb) Thanks [@freekh](https://github.com/freekh)! - External page keys are now validated, and `mailto:` and `tel:` are allowed.
8
+
9
+ `externalPageRouter` documented a rule — a key must start with `https://` or
10
+ `http://` — and never enforced it: the validator collected the errors and then
11
+ returned an empty list, so a key like `discord.gg/val` or `/about` was accepted
12
+ in silence and behaved as a relative link on the site.
13
+
14
+ Fixing that made the rule itself worth looking at, because it was a rule about
15
+ the protocol standing in for a rule about links. A contact page's email address
16
+ and phone number are external pages to whoever maintains the list, and they
17
+ were refused. So the rule that is now enforced is a deny list rather than an
18
+ allow list: a key must have a scheme, and the scheme must not be one of
19
+ `javascript:`, `data:`, `vbscript:`, `file:` or `blob:` — which are not links
20
+ at all. An external page key ends up in an `href` in your site's own markup, so
21
+ those stay refused however the router is configured.
22
+
23
+ A project that wants to be stricter says so:
24
+
25
+ ```ts
26
+ s.record(item).router(externalPageRouter({ schemes: ["https", "mailto"] }));
27
+ ```
28
+
29
+ `initVal()` from `@valbuild/next` and `@valbuild/tanstack` hands you the
30
+ callable form, so the narrowed version typechecks in an app.
31
+
32
+ Val Studio applies the same rule while you type — it calls the same function —
33
+ and shows a narrowed project's own list in the message.
34
+
35
+ If your project has a key with no scheme at all, it will start showing a
36
+ validation error on that entry. Give it one, or move it out of the external
37
+ router.
38
+
39
+ - Updated dependencies [[`8f60073`](https://github.com/valbuild/val/commit/8f60073e5490971a615cebbe8ea1243c67e43530), [`af7a4ba`](https://github.com/valbuild/val/commit/af7a4baa63da5d8a226166377a354cf2fc0c1d77), [`48ac9f0`](https://github.com/valbuild/val/commit/48ac9f06dd59a5b4ca60232b1ef198cf42f23aa6), [`daecf41`](https://github.com/valbuild/val/commit/daecf416f51990569a47a6a9ee9174b1a57f98c2), [`43b58f2`](https://github.com/valbuild/val/commit/43b58f2962840883badf91950da2c51b89d1c7cb), [`9b09bf3`](https://github.com/valbuild/val/commit/9b09bf38c9d5912f41fec1c18aa87455fd32f616), [`e2bfc0e`](https://github.com/valbuild/val/commit/e2bfc0e40383fe25d3ec0473d1032f6264a8939f), [`9b09bf3`](https://github.com/valbuild/val/commit/9b09bf38c9d5912f41fec1c18aa87455fd32f616), [`8e49bf4`](https://github.com/valbuild/val/commit/8e49bf41ad6a8ad3b01e502fb7ce0369baa316db), [`370d0df`](https://github.com/valbuild/val/commit/370d0df7ea45aeeafb4520318018d7c4e1c040d6), [`14877a8`](https://github.com/valbuild/val/commit/14877a85c5add4daa16836470b8739180a9fe8c6), [`beda04b`](https://github.com/valbuild/val/commit/beda04bd326cbab18ed103e8d43917b16f43bd8c)]:
40
+ - @valbuild/ui@0.137.0
41
+ - @valbuild/server@0.137.0
42
+ - @valbuild/shared@0.137.0
43
+ - @valbuild/core@0.137.0
44
+ - @valbuild/react@0.137.0
45
+ - @valbuild/language-server@0.137.0
46
+ - @valbuild/mcp@0.137.0
47
+
48
+ ## 0.136.10
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [[`fef29b0`](https://github.com/valbuild/val/commit/fef29b0d9e826e4e7e63a3ae61553137a3f9d280)]:
53
+ - @valbuild/ui@0.136.10
54
+ - @valbuild/server@0.136.10
55
+ - @valbuild/shared@0.136.10
56
+ - @valbuild/mcp@0.136.10
57
+ - @valbuild/react@0.136.10
58
+ - @valbuild/language-server@0.136.10
59
+
3
60
  ## 0.136.9
4
61
 
5
62
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { type ValConfig, type InitVal, type ValConstructor, ValRouter } from "@valbuild/core";
1
+ import { type ValConfig, type InitVal, type ValConstructor, ValRouter, ExternalPageRouter } from "@valbuild/core";
2
2
  import { raw } from "@valbuild/react/stega";
3
3
  import { getUnpatchedUnencodedVal } from "./getUnpatchedUnencodedVal.js";
4
4
  import { decodeValPathsOfString } from "./decodeValPathsOfString.js";
@@ -110,6 +110,11 @@ export declare const initVal: (config?: ValConfig) => InitVal & {
110
110
  * It is what `s.route()` links to when the destination is somewhere else -
111
111
  * a campaign site, a docs host, a social profile.
112
112
  *
113
+ * By default a key may use any scheme except the handful that are not links
114
+ * at all (`javascript:`, `data:`), so `mailto:` and `tel:` are ordinary
115
+ * keys. Call it - `externalPageRouter({ schemes: ["https", "mailto"] })` -
116
+ * to narrow that.
117
+ *
113
118
  * @example
114
119
  * const links = s.record(s.object({ title: s.string() }));
115
120
  * export default c.define(
@@ -118,6 +123,6 @@ export declare const initVal: (config?: ValConfig) => InitVal & {
118
123
  * { "https://val.build": { title: "Val" } },
119
124
  * );
120
125
  */
121
- externalPageRouter: ValRouter;
126
+ externalPageRouter: ExternalPageRouter;
122
127
  };
123
128
  export {};
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('./version-cc264956.cjs.dev.js');
5
+ var version = require('./version-be99b2ed.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-450148e3.cjs.prod.js');
5
+ var version = require('./version-3c9ea8b9.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, r as readValEnableCookie, V as VERSION$1 } from './version-a489c15a.esm.js';
1
+ import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-b24e6106.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';
@@ -212,7 +212,7 @@ var packageJson = {
212
212
  "tanstack-router",
213
213
  "react"
214
214
  ],
215
- version: "0.136.9",
215
+ version: "0.137.0",
216
216
  scripts: {
217
217
  typecheck: "tsc --noEmit",
218
218
  test: "jest"
@@ -210,7 +210,7 @@ var packageJson = {
210
210
  "tanstack-router",
211
211
  "react"
212
212
  ],
213
- version: "0.136.9",
213
+ version: "0.137.0",
214
214
  scripts: {
215
215
  typecheck: "tsc --noEmit",
216
216
  test: "jest"
@@ -212,7 +212,7 @@ var packageJson = {
212
212
  "tanstack-router",
213
213
  "react"
214
214
  ],
215
- version: "0.136.9",
215
+ version: "0.137.0",
216
216
  scripts: {
217
217
  typecheck: "tsc --noEmit",
218
218
  test: "jest"
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tanstack-router",
15
15
  "react"
16
16
  ],
17
- "version": "0.136.9",
17
+ "version": "0.137.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.136.8",
46
- "@valbuild/language-server": "0.136.9",
47
- "@valbuild/mcp": "0.136.9",
48
- "@valbuild/react": "0.136.9",
49
- "@valbuild/server": "0.136.9",
50
- "@valbuild/shared": "0.136.8",
51
- "@valbuild/ui": "0.136.9"
45
+ "@valbuild/core": "0.137.0",
46
+ "@valbuild/language-server": "0.137.0",
47
+ "@valbuild/mcp": "0.137.0",
48
+ "@valbuild/react": "0.137.0",
49
+ "@valbuild/server": "0.137.0",
50
+ "@valbuild/shared": "0.137.0",
51
+ "@valbuild/ui": "0.137.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@tanstack/react-router": "^1.170.33",
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-cc264956.cjs.dev.js');
5
+ var version = require('../../dist/version-be99b2ed.cjs.dev.js');
6
6
  var core = require('@valbuild/core');
7
7
  var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-e75681d7.cjs.dev.js');
8
8
  var server = require('@valbuild/server');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-450148e3.cjs.prod.js');
5
+ var version = require('../../dist/version-3c9ea8b9.cjs.prod.js');
6
6
  var core = require('@valbuild/core');
7
7
  var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-0324e063.cjs.prod.js');
8
8
  var server = require('@valbuild/server');
@@ -1,4 +1,4 @@
1
- import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-a489c15a.esm.js';
1
+ import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-b24e6106.esm.js';
2
2
  import { Internal } from '@valbuild/core';
3
3
  import { _ as _objectSpread2, a as _slicedToArray, d as _defineProperty } from '../../dist/createForOfIteratorHelper-485c2ce1.esm.js';
4
4
  import { createValApiRouter, createValServer } from '@valbuild/server';