@valbuild/next 0.136.10 → 0.138.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,63 @@
1
1
  # @valbuild/next
2
2
 
3
+ ## 0.138.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`57af895`](https://github.com/valbuild/val/commit/57af8959cc46519a405b1ed7441623f8bf2e6d27), [`c523506`](https://github.com/valbuild/val/commit/c523506c8b5e148864f401c005b913330e436499), [`6216172`](https://github.com/valbuild/val/commit/62161729aa40f737590b0a8093c0394385fffd8d), [`40e933d`](https://github.com/valbuild/val/commit/40e933da7fe01cfe1c3f4a43c156f0b2f8a11f62), [`5876fe0`](https://github.com/valbuild/val/commit/5876fe075fdee1f76f1cdaa2488ac52c58c894a8), [`c523506`](https://github.com/valbuild/val/commit/c523506c8b5e148864f401c005b913330e436499)]:
8
+ - @valbuild/core@0.138.0
9
+ - @valbuild/ui@0.138.0
10
+ - @valbuild/server@0.138.0
11
+ - @valbuild/shared@0.138.0
12
+ - @valbuild/language-server@0.138.0
13
+ - @valbuild/mcp@0.138.0
14
+ - @valbuild/react@0.138.0
15
+
16
+ ## 0.137.0
17
+
18
+ ### Patch Changes
19
+
20
+ - [#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.
21
+
22
+ `externalPageRouter` documented a rule — a key must start with `https://` or
23
+ `http://` — and never enforced it: the validator collected the errors and then
24
+ returned an empty list, so a key like `discord.gg/val` or `/about` was accepted
25
+ in silence and behaved as a relative link on the site.
26
+
27
+ Fixing that made the rule itself worth looking at, because it was a rule about
28
+ the protocol standing in for a rule about links. A contact page's email address
29
+ and phone number are external pages to whoever maintains the list, and they
30
+ were refused. So the rule that is now enforced is a deny list rather than an
31
+ allow list: a key must have a scheme, and the scheme must not be one of
32
+ `javascript:`, `data:`, `vbscript:`, `file:` or `blob:` — which are not links
33
+ at all. An external page key ends up in an `href` in your site's own markup, so
34
+ those stay refused however the router is configured.
35
+
36
+ A project that wants to be stricter says so:
37
+
38
+ ```ts
39
+ s.record(item).router(externalPageRouter({ schemes: ["https", "mailto"] }));
40
+ ```
41
+
42
+ `initVal()` from `@valbuild/next` and `@valbuild/tanstack` hands you the
43
+ callable form, so the narrowed version typechecks in an app.
44
+
45
+ Val Studio applies the same rule while you type — it calls the same function —
46
+ and shows a narrowed project's own list in the message.
47
+
48
+ If your project has a key with no scheme at all, it will start showing a
49
+ validation error on that entry. Give it one, or move it out of the external
50
+ router.
51
+
52
+ - 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)]:
53
+ - @valbuild/ui@0.137.0
54
+ - @valbuild/server@0.137.0
55
+ - @valbuild/shared@0.137.0
56
+ - @valbuild/core@0.137.0
57
+ - @valbuild/react@0.137.0
58
+ - @valbuild/language-server@0.137.0
59
+ - @valbuild/mcp@0.137.0
60
+
3
61
  ## 0.136.10
4
62
 
5
63
  ### 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";
@@ -114,6 +114,11 @@ export declare const initVal: (config?: ValConfig) => InitVal & {
114
114
  * It is what `s.route()` links to when the destination is somewhere else -
115
115
  * a campaign site, a docs host, a social profile.
116
116
  *
117
+ * By default a key may use any scheme except the handful that are not links
118
+ * at all (`javascript:`, `data:`), so `mailto:` and `tel:` are ordinary
119
+ * keys. Call it - `externalPageRouter({ schemes: ["https", "mailto"] })` -
120
+ * to narrow that.
121
+ *
117
122
  * @example
118
123
  * const links = s.record(s.object({ title: s.string() }));
119
124
  * export default c.define(
@@ -122,6 +127,6 @@ export declare const initVal: (config?: ValConfig) => InitVal & {
122
127
  * { "https://val.build": { title: "Val" } },
123
128
  * );
124
129
  */
125
- externalPageRouter: ValRouter;
130
+ externalPageRouter: ExternalPageRouter;
126
131
  };
127
132
  export {};
@@ -12,7 +12,7 @@ var NextImage = require('next/image');
12
12
  var jsxRuntime = require('react/jsx-runtime');
13
13
  var ValApp = require('./ValApp-294e5b53.cjs.dev.js');
14
14
  var ValModulesClient = require('./ValModulesClient-4ecabf99.cjs.dev.js');
15
- var version = require('./version-9431e957.cjs.dev.js');
15
+ var version = require('./version-dd474cec.cjs.dev.js');
16
16
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
17
17
  require('./defineProperty-f90345d7.cjs.dev.js');
18
18
  require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
@@ -12,7 +12,7 @@ var NextImage = require('next/image');
12
12
  var jsxRuntime = require('react/jsx-runtime');
13
13
  var ValApp = require('./ValApp-ab8a96fd.cjs.prod.js');
14
14
  var ValModulesClient = require('./ValModulesClient-10c0721c.cjs.prod.js');
15
- var version = require('./version-2ec73b93.cjs.prod.js');
15
+ var version = require('./version-9b241040.cjs.prod.js');
16
16
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
17
17
  require('./defineProperty-8951f469.cjs.prod.js');
18
18
  require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
@@ -11,7 +11,7 @@ import NextImage from 'next/image';
11
11
  import { jsx } from 'react/jsx-runtime';
12
12
  export { ValApp } from './ValApp-3a70afe1.esm.js';
13
13
  export { ValModulesClient, useRegisterValModules } from './ValModulesClient-0dd601a1.esm.js';
14
- import { V as VERSION } from './version-70a32c2a.esm.js';
14
+ import { V as VERSION } from './version-fa8db436.esm.js';
15
15
  import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
16
16
  import './defineProperty-cca5affa.esm.js';
17
17
  import './unsupportedIterableToArray-5baabfdc.esm.js';
@@ -14,7 +14,7 @@ var packageJson = {
14
14
  "next",
15
15
  "react"
16
16
  ],
17
- version: "0.136.10",
17
+ version: "0.138.0",
18
18
  scripts: {
19
19
  typecheck: "tsc --noEmit",
20
20
  test: "jest"
@@ -14,7 +14,7 @@ var packageJson = {
14
14
  "next",
15
15
  "react"
16
16
  ],
17
- version: "0.136.10",
17
+ version: "0.138.0",
18
18
  scripts: {
19
19
  typecheck: "tsc --noEmit",
20
20
  test: "jest"
@@ -12,7 +12,7 @@ var packageJson = {
12
12
  "next",
13
13
  "react"
14
14
  ],
15
- version: "0.136.10",
15
+ version: "0.138.0",
16
16
  scripts: {
17
17
  typecheck: "tsc --noEmit",
18
18
  test: "jest"
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "next",
13
13
  "react"
14
14
  ],
15
- "version": "0.136.10",
15
+ "version": "0.138.0",
16
16
  "main": "dist/valbuild-next.cjs.js",
17
17
  "module": "dist/valbuild-next.esm.js",
18
18
  "exports": {
@@ -47,13 +47,13 @@
47
47
  "dependencies": {
48
48
  "client-only": "^0.0.1",
49
49
  "server-only": "^0.0.1",
50
- "@valbuild/core": "0.136.8",
51
- "@valbuild/language-server": "0.136.10",
52
- "@valbuild/server": "0.136.10",
53
- "@valbuild/mcp": "0.136.10",
54
- "@valbuild/ui": "0.136.10",
55
- "@valbuild/shared": "0.136.10",
56
- "@valbuild/react": "0.136.10"
50
+ "@valbuild/core": "0.138.0",
51
+ "@valbuild/language-server": "0.138.0",
52
+ "@valbuild/mcp": "0.138.0",
53
+ "@valbuild/react": "0.138.0",
54
+ "@valbuild/server": "0.138.0",
55
+ "@valbuild/shared": "0.138.0",
56
+ "@valbuild/ui": "0.138.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@testing-library/react": "^16.3.3",
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
12
12
  var React = require('react');
13
13
  var internal = require('@valbuild/shared/internal');
14
14
  var server = require('@valbuild/server');
15
- var version = require('../../dist/version-9431e957.cjs.dev.js');
15
+ var version = require('../../dist/version-dd474cec.cjs.dev.js');
16
16
  require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
17
17
  require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
18
18
  require('../../dist/slicedToArray-44036a76.cjs.dev.js');
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
12
12
  var React = require('react');
13
13
  var internal = require('@valbuild/shared/internal');
14
14
  var server = require('@valbuild/server');
15
- var version = require('../../dist/version-2ec73b93.cjs.prod.js');
15
+ var version = require('../../dist/version-9b241040.cjs.prod.js');
16
16
  require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
17
17
  require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
18
18
  require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
@@ -8,7 +8,7 @@ import { Internal } from '@valbuild/core';
8
8
  import { cache } from 'react';
9
9
  import { VAL_SESSION_COOKIE, memoizePerRequest } from '@valbuild/shared/internal';
10
10
  import { createValServer } from '@valbuild/server';
11
- import { V as VERSION } from '../../dist/version-70a32c2a.esm.js';
11
+ import { V as VERSION } from '../../dist/version-fa8db436.esm.js';
12
12
  import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
13
13
  import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
14
14
  import '../../dist/slicedToArray-aa291011.esm.js';
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-58024783.cjs.dev.js');
9
9
  var core = require('@valbuild/core');
10
10
  var server = require('@valbuild/server');
11
11
  var server$1 = require('next/server');
12
- var version = require('../../dist/version-9431e957.cjs.dev.js');
12
+ var version = require('../../dist/version-dd474cec.cjs.dev.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
15
15
  require('../../dist/defineProperty-f90345d7.cjs.dev.js');
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-13f847a9.cjs.prod.js');
9
9
  var core = require('@valbuild/core');
10
10
  var server = require('@valbuild/server');
11
11
  var server$1 = require('next/server');
12
- var version = require('../../dist/version-2ec73b93.cjs.prod.js');
12
+ var version = require('../../dist/version-9b241040.cjs.prod.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
15
15
  require('../../dist/defineProperty-8951f469.cjs.prod.js');
@@ -6,7 +6,7 @@ import { Internal } from '@valbuild/core';
6
6
  import { createValApiRouter, createValServer } from '@valbuild/server';
7
7
  export { createPrettierFormatter } from '@valbuild/server';
8
8
  import { NextResponse } from 'next/server';
9
- import { V as VERSION } from '../../dist/version-70a32c2a.esm.js';
9
+ import { V as VERSION } from '../../dist/version-fa8db436.esm.js';
10
10
  import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
11
11
  import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
12
12
  import '../../dist/defineProperty-cca5affa.esm.js';