@valbuild/next 0.146.4 → 0.147.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 +38 -0
- package/client/dist/valbuild-next-client.cjs.dev.js +1 -1
- package/client/dist/valbuild-next-client.cjs.prod.js +1 -1
- package/client/dist/valbuild-next-client.esm.js +1 -1
- package/dist/{routeFromVal-52811ee4.cjs.dev.js → routeFromVal-1cdcfed4.cjs.dev.js} +5 -1
- package/dist/{routeFromVal-fe1264b3.esm.js → routeFromVal-3e1c7e8b.esm.js} +5 -1
- package/dist/{routeFromVal-6fc9f240.cjs.prod.js → routeFromVal-e447aa07.cjs.prod.js} +5 -1
- package/dist/valbuild-next.cjs.dev.js +1 -1
- package/dist/valbuild-next.cjs.prod.js +1 -1
- package/dist/valbuild-next.esm.js +1 -1
- package/dist/{version-c44f56b0.cjs.dev.js → version-87786441.cjs.prod.js} +1 -1
- package/dist/{version-f6abce64.cjs.prod.js → version-b99064f0.cjs.dev.js} +1 -1
- package/dist/{version-3032da1e.esm.js → version-eb5887b0.esm.js} +1 -1
- package/package.json +8 -8
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +2 -2
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +2 -2
- package/rsc/dist/valbuild-next-rsc.esm.js +2 -2
- package/server/dist/valbuild-next-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-next-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-next-server.esm.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @valbuild/next
|
|
2
2
|
|
|
3
|
+
## 0.147.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#816](https://github.com/valbuild/val/pull/816) [`2f09cd5`](https://github.com/valbuild/val/commit/2f09cd5e2f4fc37f06917899f24f9ad2ee8d3a8b) Thanks [@freekh](https://github.com/freekh)! - Routers can give each route parameter a schema, and a URL can say which language a page is in.
|
|
8
|
+
|
|
9
|
+
- **`s.router(router, params, item)`** takes a schema per route parameter, by the name the route file gives it (`$slug`, `[slug]`, `{-$locale}`). Each key's parameters are validated against them, and a name the route does not have is a schema error.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
s.router(tanstackRouter, { locale: urlLocale, slug: s.string() }, item);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- **`s.enum(...).locales({ ... })`** says which of the project's languages each value means, so `/nb/…` can mean `nb-NO`. The tags are checked against `locales.available` in the settings module, like `s.locale()`. On a nullable enum, a second argument names the language of a URL that leaves the segment out, which only a router parameter may use:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
const urlLocale = s
|
|
19
|
+
.enum("nb")
|
|
20
|
+
.nullable()
|
|
21
|
+
.locales({ nb: "nb-NO" }, { null: "en-US" });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
A router with a locale parameter makes each page a locale scope, so the Studio and validation know which language every page is in.
|
|
25
|
+
|
|
26
|
+
- **A route's language segment can no longer be forgotten.** In a project that declares `locales.available`, a page route with a `locale` or `lang` segment (`{-$locale}`, `[lang]`) whose module gives that parameter no schema is reported, saying what to add. Any schema answers it, so a `$lang` that is not a language is silenced with its own, e.g. `{ lang: s.enum("typescript", "python") }`. It is an ordinary validation error: the Studio still opens and `val validate` lists it, but a project that already has such a route will see it after upgrading, and it blocks publishing until the parameter has a schema.
|
|
27
|
+
- **The Studio's new-page form offers a language as a list.** A route parameter whose schema is a locale is picked from the project's languages, each named in its own language, with "no prefix" where the URL may leave the segment out. Other enum parameters get a list of their values, and every parameter's description is shown under it. The URL row previews what the choice puts there.
|
|
28
|
+
- **TanStack optional segments (`{-$param}`)** are now understood: route validation, `useValRoute` and the Studio's new-page form accept keys with and without the segment.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [[`2f09cd5`](https://github.com/valbuild/val/commit/2f09cd5e2f4fc37f06917899f24f9ad2ee8d3a8b), [`cb04e58`](https://github.com/valbuild/val/commit/cb04e586db1e3ffd20ec1fee744561b1c8f8cffd), [`cb04e58`](https://github.com/valbuild/val/commit/cb04e586db1e3ffd20ec1fee744561b1c8f8cffd)]:
|
|
33
|
+
- @valbuild/core@0.147.0
|
|
34
|
+
- @valbuild/shared@0.147.0
|
|
35
|
+
- @valbuild/ui@0.147.0
|
|
36
|
+
- @valbuild/server@0.147.0
|
|
37
|
+
- @valbuild/language-server@0.147.0
|
|
38
|
+
- @valbuild/mcp@0.147.0
|
|
39
|
+
- @valbuild/react@0.147.0
|
|
40
|
+
|
|
3
41
|
## 0.146.4
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('client-only');
|
|
6
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
6
|
+
var routeFromVal = require('../../dist/routeFromVal-1cdcfed4.cjs.dev.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
9
|
var React = require('react');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('client-only');
|
|
6
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
6
|
+
var routeFromVal = require('../../dist/routeFromVal-e447aa07.cjs.prod.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
9
|
var React = require('react');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'client-only';
|
|
2
|
-
import { j as jsonValuesRecordToFill, f as fillJsonValuesRecord, g as getJsonEntryStegaRoot, _ as _typeof, c as bundledJsonEntryImport, a as isJsonValuesRecordSchema, b as getValRouteUrlFromVal, i as initValRouteFromVal } from '../../dist/routeFromVal-
|
|
2
|
+
import { j as jsonValuesRecordToFill, f as fillJsonValuesRecord, g as getJsonEntryStegaRoot, _ as _typeof, c as bundledJsonEntryImport, a as isJsonValuesRecordSchema, b as getValRouteUrlFromVal, i as initValRouteFromVal } from '../../dist/routeFromVal-3e1c7e8b.esm.js';
|
|
3
3
|
import { Internal } from '@valbuild/core';
|
|
4
4
|
import { getModuleIds, stegaEncode } from '@valbuild/react/stega';
|
|
5
5
|
import React from 'react';
|
|
@@ -231,7 +231,11 @@ val) {
|
|
|
231
231
|
} else if (part.type === "array-param" || part.type === "string-param") {
|
|
232
232
|
var key = part.paramName;
|
|
233
233
|
var value = resolvedParams === null || resolvedParams === void 0 ? void 0 : resolvedParams[key];
|
|
234
|
-
if (
|
|
234
|
+
if (part.type === "string-param" && part.optional && (value === undefined || value === null)) {
|
|
235
|
+
// An optional segment the URL left out (`{-$locale}`): it contributes
|
|
236
|
+
// nothing to the key, so `/about` is the key for `{ locale: undefined }`.
|
|
237
|
+
delete missingParamKeys[key];
|
|
238
|
+
} else if (typeof value !== "string" && !Array.isArray(value)) {
|
|
235
239
|
missingPatterns.push(part);
|
|
236
240
|
} else if (Array.isArray(value)) {
|
|
237
241
|
if (missingParamKeys !== null && missingParamKeys !== void 0 && missingParamKeys[key]) {
|
|
@@ -229,7 +229,11 @@ val) {
|
|
|
229
229
|
} else if (part.type === "array-param" || part.type === "string-param") {
|
|
230
230
|
var key = part.paramName;
|
|
231
231
|
var value = resolvedParams === null || resolvedParams === void 0 ? void 0 : resolvedParams[key];
|
|
232
|
-
if (
|
|
232
|
+
if (part.type === "string-param" && part.optional && (value === undefined || value === null)) {
|
|
233
|
+
// An optional segment the URL left out (`{-$locale}`): it contributes
|
|
234
|
+
// nothing to the key, so `/about` is the key for `{ locale: undefined }`.
|
|
235
|
+
delete missingParamKeys[key];
|
|
236
|
+
} else if (typeof value !== "string" && !Array.isArray(value)) {
|
|
233
237
|
missingPatterns.push(part);
|
|
234
238
|
} else if (Array.isArray(value)) {
|
|
235
239
|
if (missingParamKeys !== null && missingParamKeys !== void 0 && missingParamKeys[key]) {
|
|
@@ -231,7 +231,11 @@ val) {
|
|
|
231
231
|
} else if (part.type === "array-param" || part.type === "string-param") {
|
|
232
232
|
var key = part.paramName;
|
|
233
233
|
var value = resolvedParams === null || resolvedParams === void 0 ? void 0 : resolvedParams[key];
|
|
234
|
-
if (
|
|
234
|
+
if (part.type === "string-param" && part.optional && (value === undefined || value === null)) {
|
|
235
|
+
// An optional segment the URL left out (`{-$locale}`): it contributes
|
|
236
|
+
// nothing to the key, so `/about` is the key for `{ locale: undefined }`.
|
|
237
|
+
delete missingParamKeys[key];
|
|
238
|
+
} else if (typeof value !== "string" && !Array.isArray(value)) {
|
|
235
239
|
missingPatterns.push(part);
|
|
236
240
|
} else if (Array.isArray(value)) {
|
|
237
241
|
if (missingParamKeys !== null && missingParamKeys !== void 0 && missingParamKeys[key]) {
|
|
@@ -14,7 +14,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
14
14
|
var ValVideo = require('./ValVideo-b8130c1b.cjs.dev.js');
|
|
15
15
|
var ValApp = require('./ValApp-cd14230d.cjs.dev.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-4ecabf99.cjs.dev.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-b99064f0.cjs.dev.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
19
19
|
require('./defineProperty-f90345d7.cjs.dev.js');
|
|
20
20
|
require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
@@ -14,7 +14,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
14
14
|
var ValVideo = require('./ValVideo-94e5aa28.cjs.prod.js');
|
|
15
15
|
var ValApp = require('./ValApp-b17ac306.cjs.prod.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-10c0721c.cjs.prod.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-87786441.cjs.prod.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
19
19
|
require('./defineProperty-8951f469.cjs.prod.js');
|
|
20
20
|
require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
@@ -13,7 +13,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
13
13
|
export { ValVideo } from './ValVideo-19f2ab05.esm.js';
|
|
14
14
|
export { ValApp } from './ValApp-821536aa.esm.js';
|
|
15
15
|
export { ValModulesClient, useRegisterValModules } from './ValModulesClient-0dd601a1.esm.js';
|
|
16
|
-
import { V as VERSION } from './version-
|
|
16
|
+
import { V as VERSION } from './version-eb5887b0.esm.js';
|
|
17
17
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
18
18
|
import './defineProperty-cca5affa.esm.js';
|
|
19
19
|
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"next",
|
|
13
13
|
"react"
|
|
14
14
|
],
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.147.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.
|
|
51
|
-
"@valbuild/language-server": "0.
|
|
52
|
-
"@valbuild/
|
|
53
|
-
"@valbuild/
|
|
54
|
-
"@valbuild/
|
|
55
|
-
"@valbuild/
|
|
56
|
-
"@valbuild/ui": "0.
|
|
50
|
+
"@valbuild/core": "0.147.0",
|
|
51
|
+
"@valbuild/language-server": "0.147.0",
|
|
52
|
+
"@valbuild/react": "0.147.0",
|
|
53
|
+
"@valbuild/mcp": "0.147.0",
|
|
54
|
+
"@valbuild/shared": "0.147.0",
|
|
55
|
+
"@valbuild/server": "0.147.0",
|
|
56
|
+
"@valbuild/ui": "0.147.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@testing-library/react": "^16.3.3",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('server-only');
|
|
6
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
6
|
+
var routeFromVal = require('../../dist/routeFromVal-1cdcfed4.cjs.dev.js');
|
|
7
7
|
var defineProperty = require('../../dist/defineProperty-f90345d7.cjs.dev.js');
|
|
8
8
|
var objectSpread2 = require('../../dist/objectSpread2-58024783.cjs.dev.js');
|
|
9
9
|
var asyncToGenerator = require('../../dist/asyncToGenerator-c3823d62.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-
|
|
15
|
+
var version = require('../../dist/version-b99064f0.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');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('server-only');
|
|
6
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
6
|
+
var routeFromVal = require('../../dist/routeFromVal-e447aa07.cjs.prod.js');
|
|
7
7
|
var defineProperty = require('../../dist/defineProperty-8951f469.cjs.prod.js');
|
|
8
8
|
var objectSpread2 = require('../../dist/objectSpread2-13f847a9.cjs.prod.js');
|
|
9
9
|
var asyncToGenerator = require('../../dist/asyncToGenerator-8e5c36c8.cjs.prod.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-
|
|
15
|
+
var version = require('../../dist/version-87786441.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');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
-
import { f as fillJsonValuesRecord, j as jsonValuesRecordToFill, i as initValRouteFromVal, g as getJsonEntryStegaRoot, a as isJsonValuesRecordSchema, b as getValRouteUrlFromVal, c as bundledJsonEntryImport, _ as _typeof } from '../../dist/routeFromVal-
|
|
2
|
+
import { f as fillJsonValuesRecord, j as jsonValuesRecordToFill, i as initValRouteFromVal, g as getJsonEntryStegaRoot, a as isJsonValuesRecordSchema, b as getValRouteUrlFromVal, c as bundledJsonEntryImport, _ as _typeof } from '../../dist/routeFromVal-3e1c7e8b.esm.js';
|
|
3
3
|
import { _ as _defineProperty } from '../../dist/defineProperty-cca5affa.esm.js';
|
|
4
4
|
import { _ as _objectSpread2 } from '../../dist/objectSpread2-60d1bd93.esm.js';
|
|
5
5
|
import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.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-
|
|
11
|
+
import { V as VERSION } from '../../dist/version-eb5887b0.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-
|
|
12
|
+
var version = require('../../dist/version-b99064f0.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-
|
|
12
|
+
var version = require('../../dist/version-87786441.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-
|
|
9
|
+
import { V as VERSION } from '../../dist/version-eb5887b0.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';
|