@valbuild/server 0.147.0 → 0.148.1

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