@valbuild/server 0.147.0 → 0.148.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 +108 -0
- package/browser/dist/valbuild-server-browser.cjs.dev.js +2 -2
- package/browser/dist/valbuild-server-browser.cjs.prod.js +2 -2
- package/browser/dist/valbuild-server-browser.esm.js +2 -2
- package/dist/{ValRouterCore-7ffcc08c.cjs.prod.js → ValRouterCore-42772c21.cjs.prod.js} +980 -53
- package/dist/{ValRouterCore-f5004f8f.esm.js → ValRouterCore-7ca3dc68.esm.js} +972 -54
- package/dist/{ValRouterCore-3fd3d444.cjs.dev.js → ValRouterCore-9bdaaf89.cjs.dev.js} +980 -53
- package/dist/declarations/src/ValOps.d.ts +32 -11
- package/dist/declarations/src/ValOpsMemory.d.ts +4 -4
- package/dist/declarations/src/ValServer.d.ts +1 -2
- package/dist/declarations/src/checkRemoteRef.d.ts +40 -2
- package/dist/declarations/src/createFixPatch.d.ts +25 -3
- package/dist/declarations/src/fixFiles.d.ts +42 -0
- package/dist/declarations/src/fixHandlers.d.ts +14 -0
- package/dist/declarations/src/getSettings.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/platform.d.ts +16 -0
- package/dist/declarations/src/remoteFileCheck.d.ts +116 -0
- package/dist/declarations/src/remoteHostCheck.d.ts +101 -0
- package/dist/declarations/src/studioValidation.d.ts +84 -0
- package/dist/declarations/src/uploadRemoteFile.d.ts +1 -1
- package/dist/declarations/src/videosetFixes.d.ts +3 -2
- package/dist/{getJsonEntryAtCommit-df65d861.cjs.prod.js → getJsonEntryAtCommit-2e36e805.cjs.prod.js} +3 -4
- package/dist/{getJsonEntryAtCommit-1e08d724.esm.js → getJsonEntryAtCommit-40b6d9c1.esm.js} +3 -4
- package/dist/{getJsonEntryAtCommit-e96beb9e.cjs.dev.js → getJsonEntryAtCommit-64f67a50.cjs.dev.js} +3 -4
- package/dist/valbuild-server.cjs.dev.js +1352 -695
- package/dist/valbuild-server.cjs.prod.js +1352 -695
- package/dist/valbuild-server.esm.js +1352 -696
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,113 @@
|
|
|
1
1
|
# @valbuild/server
|
|
2
2
|
|
|
3
|
+
## 0.148.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#885](https://github.com/valbuild/val/pull/885) [`df5544c`](https://github.com/valbuild/val/commit/df5544c6e92a4c3a52765630c9de191e854ee723) Thanks [@freekh](https://github.com/freekh)! - Demo mode (`<ValApp demo>`) now starts under `vite dev`. It used to stop at
|
|
8
|
+
"The demo could not start: part of it did not load", with
|
|
9
|
+
`does not provide an export named 'Buffer'` in the console, because the server
|
|
10
|
+
that runs in the tab imported the CommonJS `buffer` package, and Vite's dev
|
|
11
|
+
server does not convert a dependency it only meets in a chunk loaded on demand.
|
|
12
|
+
That server now handles bytes without `buffer`, so an app needs no Vite
|
|
13
|
+
configuration for it, and `@valbuild/server` no longer depends on the package.
|
|
14
|
+
If you added `buffer` to `optimizeDeps.include` to work around this, you can
|
|
15
|
+
remove it.
|
|
16
|
+
|
|
17
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - `createFixPatch` reads a file's bytes, and saves a downloaded remote file,
|
|
18
|
+
through an optional `files` reader instead of directly from disk. The default
|
|
19
|
+
reads the disk under `projectRoot` exactly as before, so `val validate --fix`
|
|
20
|
+
and the VS Code extension behave the same.
|
|
21
|
+
|
|
22
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - Remote files are now addressed on the host the project's settings name. For a
|
|
23
|
+
project hosted by Val, that is the project's own address, and its remote images
|
|
24
|
+
and files are served from there rather than from `remote.val.build`. Every other
|
|
25
|
+
project is unchanged.
|
|
26
|
+
|
|
27
|
+
- The Studio, `val validate --fix` and the MCP image tool all take the host from
|
|
28
|
+
the project's settings, falling back to `remote.val.build` as before.
|
|
29
|
+
- Re-reading a remote file whose recorded size or type is out of date keeps it
|
|
30
|
+
on the host it was on.
|
|
31
|
+
- When a remote file's host cannot be reached, tooling downloads it from the
|
|
32
|
+
project's permanent `<id>.valstart.dev` address instead, and keeps it only if
|
|
33
|
+
its bytes match the file the address names.
|
|
34
|
+
|
|
35
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - Remote files served from a project's own site (addresses like
|
|
36
|
+
`https://www.acme.no/_val/file/…`) are now checked for whether that address
|
|
37
|
+
still serves the project. When a custom domain has been removed or moved to
|
|
38
|
+
another project, the image or file is reported, and **Fix** on the Studio's
|
|
39
|
+
Validate page — or `val validate --fix` — points it at the project's permanent
|
|
40
|
+
`<id>.valstart.dev` address. Nothing is uploaded or downloaded: only the address
|
|
41
|
+
changes.
|
|
42
|
+
|
|
43
|
+
Remote file addresses with a `/_val` prefix after the host are now recognised.
|
|
44
|
+
|
|
45
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - **Check everything** on the Studio's Validate page now checks media directories
|
|
46
|
+
(`s.imagedir()`, `s.filedir()`, `s.fontdir()` and `s.videodir()`) by the files
|
|
47
|
+
they list:
|
|
48
|
+
|
|
49
|
+
- An entry whose file is gone has a **Fix** that removes it from the directory.
|
|
50
|
+
- An image or file entry whose recorded size or type does not match its file has
|
|
51
|
+
a **Fix** that corrects it from the file, keeping its alt text.
|
|
52
|
+
- A video entry whose file is gone is reported, and is removed by hand: its
|
|
53
|
+
posters and captions may still be in use.
|
|
54
|
+
- A remote entry is checked with its host, like any remote file.
|
|
55
|
+
|
|
56
|
+
`val validate --fix` fixes media directories exactly as before.
|
|
57
|
+
|
|
58
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - The Studio has a **Validate** page, at `/val/validate`, and a button for it in
|
|
59
|
+
the top bar with the number of errors left.
|
|
60
|
+
|
|
61
|
+
It lists the errors the Studio already shows, as the errors page did, and adds
|
|
62
|
+
**Check everything**: a check of every module on the server, including whether
|
|
63
|
+
each image's and file's recorded size and type match the file itself. It runs
|
|
64
|
+
only when you press it, can be stopped, and its results stay for the session.
|
|
65
|
+
|
|
66
|
+
Where the Studio can make the fix itself — a missing or wrong width, height or
|
|
67
|
+
mime type on an image, file or video — the row has a **Fix** button. A fix is an
|
|
68
|
+
ordinary change: it shows up in Review, is published with everything else, and
|
|
69
|
+
can be undone from the row. Fixes that need a terminal show the
|
|
70
|
+
`val validate --fix` command to copy.
|
|
71
|
+
|
|
72
|
+
`/val/errors` still works and opens the same page.
|
|
73
|
+
|
|
74
|
+
Also fixed: `.jsonValues()` entries no longer report every image in them as
|
|
75
|
+
"not checked against the file" when validated on the server.
|
|
76
|
+
|
|
77
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - **Check everything** on the Studio's Validate page now checks remote images and
|
|
78
|
+
files too.
|
|
79
|
+
|
|
80
|
+
- A remote image or file whose address no longer matches what is recorded about
|
|
81
|
+
it (its size, type or the schema's options changed since it was uploaded) has
|
|
82
|
+
a **Fix**, which re-reads the file and corrects it, as `val validate --fix`
|
|
83
|
+
does.
|
|
84
|
+
- A remote host that does not answer is shown once, at the top of the page, with
|
|
85
|
+
how many files it holds and a **Try again**, rather than as an error on every
|
|
86
|
+
image.
|
|
87
|
+
- A file its host no longer has is shown at the image or file that uses it.
|
|
88
|
+
|
|
89
|
+
Images and files in your unpublished changes are not asked about until they are
|
|
90
|
+
published; the check makes sure the change still has them.
|
|
91
|
+
|
|
92
|
+
- [#818](https://github.com/valbuild/val/pull/818) [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1) Thanks [@freekh](https://github.com/freekh)! - Two new Studio API routes for the full content check, not yet used by the
|
|
93
|
+
Studio's UI:
|
|
94
|
+
|
|
95
|
+
- `POST /api/val/validate` checks one module — its content against its schema,
|
|
96
|
+
and its local images and files against their bytes — on the content the
|
|
97
|
+
Studio is showing.
|
|
98
|
+
- `POST /api/val/validate/fix` returns the patch that fixes one of those errors,
|
|
99
|
+
for the Studio to add as a pending change. It builds only the fixes that need
|
|
100
|
+
no disk or remote host: image, file and video metadata, and a view pointing at
|
|
101
|
+
the wrong module.
|
|
102
|
+
|
|
103
|
+
Also fixed: an API route whose name started with another route's name could be
|
|
104
|
+
answered by the other route.
|
|
105
|
+
|
|
106
|
+
- Updated dependencies [[`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1), [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1), [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1), [`4176757`](https://github.com/valbuild/val/commit/41767579b01849473a94779122fd39c07dd99234), [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1), [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1), [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1), [`562d032`](https://github.com/valbuild/val/commit/562d03280c3fcf97a80562e8b017dd2125ac4ad1)]:
|
|
107
|
+
- @valbuild/shared@0.148.0
|
|
108
|
+
- @valbuild/ui@0.148.0
|
|
109
|
+
- @valbuild/core@0.148.0
|
|
110
|
+
|
|
3
111
|
## 0.147.0
|
|
4
112
|
|
|
5
113
|
### Minor Changes
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@valbuild/core');
|
|
6
|
-
var ValRouterCore = require('../../dist/ValRouterCore-
|
|
7
|
-
require('buffer');
|
|
6
|
+
var ValRouterCore = require('../../dist/ValRouterCore-9bdaaf89.cjs.dev.js');
|
|
8
7
|
require('@valbuild/shared/internal');
|
|
9
8
|
require('zod');
|
|
10
9
|
require('zod-validation-error');
|
|
@@ -60,6 +59,7 @@ const browserPlatform = {
|
|
|
60
59
|
},
|
|
61
60
|
getExpire: () => Math.floor(Date.now() / 1000) + 60 * 60
|
|
62
61
|
},
|
|
62
|
+
bytesToBase64: ValRouterCore.bytesToBase64,
|
|
63
63
|
readValLoginToken: async () => null,
|
|
64
64
|
resolveRemoteFileAuth: async () => ({
|
|
65
65
|
status: "error",
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@valbuild/core');
|
|
6
|
-
var ValRouterCore = require('../../dist/ValRouterCore-
|
|
7
|
-
require('buffer');
|
|
6
|
+
var ValRouterCore = require('../../dist/ValRouterCore-42772c21.cjs.prod.js');
|
|
8
7
|
require('@valbuild/shared/internal');
|
|
9
8
|
require('zod');
|
|
10
9
|
require('zod-validation-error');
|
|
@@ -60,6 +59,7 @@ const browserPlatform = {
|
|
|
60
59
|
},
|
|
61
60
|
getExpire: () => Math.floor(Date.now() / 1000) + 60 * 60
|
|
62
61
|
},
|
|
62
|
+
bytesToBase64: ValRouterCore.bytesToBase64,
|
|
63
63
|
readValLoginToken: async () => null,
|
|
64
64
|
resolveRemoteFileAuth: async () => ({
|
|
65
65
|
status: "error",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
2
|
-
import { j as ValOpsMemory,
|
|
3
|
-
import 'buffer';
|
|
2
|
+
import { j as ValOpsMemory, E as bytesToBase64, y as ValServer, z as createValRequestHandler } from '../../dist/ValRouterCore-7ca3dc68.esm.js';
|
|
4
3
|
import '@valbuild/shared/internal';
|
|
5
4
|
import 'zod';
|
|
6
5
|
import 'zod-validation-error';
|
|
@@ -56,6 +55,7 @@ const browserPlatform = {
|
|
|
56
55
|
},
|
|
57
56
|
getExpire: () => Math.floor(Date.now() / 1000) + 60 * 60
|
|
58
57
|
},
|
|
58
|
+
bytesToBase64,
|
|
59
59
|
readValLoginToken: async () => null,
|
|
60
60
|
resolveRemoteFileAuth: async () => ({
|
|
61
61
|
status: "error",
|