@valbuild/server 0.150.9 → 0.150.11
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/browser/dist/valbuild-server-browser.cjs.dev.js +1 -1
- package/browser/dist/valbuild-server-browser.cjs.prod.js +1 -1
- package/browser/dist/valbuild-server-browser.esm.js +1 -1
- package/dist/{ValRouterCore-97c47cec.cjs.prod.js → ValRouterCore-89be7c3e.cjs.prod.js} +35 -4
- package/dist/{ValRouterCore-2f7ad9b9.esm.js → ValRouterCore-9a04a007.esm.js} +36 -5
- package/dist/{ValRouterCore-946e45df.cjs.dev.js → ValRouterCore-e0824c6c.cjs.dev.js} +35 -4
- package/dist/{getJsonEntryAtCommit-757fec21.cjs.dev.js → getJsonEntryAtCommit-067eaced.cjs.dev.js} +1 -1
- package/dist/{getJsonEntryAtCommit-8a6adc22.esm.js → getJsonEntryAtCommit-a0304334.esm.js} +1 -1
- package/dist/{getJsonEntryAtCommit-e519549a.cjs.prod.js → getJsonEntryAtCommit-f6ae1e72.cjs.prod.js} +1 -1
- package/dist/valbuild-server.cjs.dev.js +1 -1
- package/dist/valbuild-server.cjs.prod.js +1 -1
- package/dist/valbuild-server.esm.js +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @valbuild/server
|
|
2
2
|
|
|
3
|
+
## 0.150.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#976](https://github.com/valbuild/val/pull/976) [`9abd5ef`](https://github.com/valbuild/val/commit/9abd5efea0c1adc7e7ff2d05b2ea38b76af73b38) Thanks [@freekh](https://github.com/freekh)! - Images the assistant adds now show up in remote storage, which is where every image in a hosted project lives: in a remote gallery (`s.imagedir(...).remote()`), in a remote image field (`s.image().remote()`) and inline in rich text whose images are remote. They used to be saved under a plain `/public/...` path while their bytes were stored as a remote file, so the Studio looked for a local file that did not exist and showed a broken image, and a published site would have named a file nothing serves. They are now saved under a remote ref, the same as an image uploaded with the Studio's own Upload button.
|
|
8
|
+
|
|
9
|
+
The image is still moved from the chat to the change rather than copied: the content service points the change at the image it already holds, and nothing is downloaded or uploaded again. The content service now says what the image's bytes hash to, which is what a remote ref is named by; against one that does not yet, the Studio downloads the image once to hash it.
|
|
10
|
+
|
|
11
|
+
The assistant can also now put an image into an empty rich text by writing the whole value; that used to be refused.
|
|
12
|
+
|
|
13
|
+
- [#974](https://github.com/valbuild/val/pull/974) [`9c6bc8d`](https://github.com/valbuild/val/commit/9c6bc8d25f40427a6fb9eec6ff5506996b718a78) Thanks [@freekh](https://github.com/freekh)! - The design tab no longer makes you wait.
|
|
14
|
+
|
|
15
|
+
- **Quick preview.** A change to components, layout or styles is shown in seconds, without a build: the proposal's browser code is bundled in the tab and the page in the preview runs it. What runs on the server (loaders, server functions, the page's first render) stays the last build's, and the tab says so, with a button to build. The assistant has it too (`quick_preview`).
|
|
16
|
+
- **Cancel and Try again.** A build can be cancelled from the tab, and a build that stops making progress for three minutes is stopped, saying at which step, so it never spins until a reload. The assistant waits for a build with `wait` instead of holding its turn, and has `build_status` and `cancel_build`.
|
|
17
|
+
- **Each step of a build is timed**, and the Build check lists where the time went.
|
|
18
|
+
- **A new build fades in where you were**, at the same page and scroll, instead of the preview going blank and starting over at the top.
|
|
19
|
+
- **`read_page`** lets the assistant check its change on the page: the headings, text, links, images and inputs in order, and one element's computed styles and how many lines it wraps to, at desktop, tablet or phone width.
|
|
20
|
+
- **On a phone**, the design tab shows the preview, the assistant and the changes one at a time, as tabs. Picking is Select, then a tap, and a pick takes you to the assistant with it. On Safari and on an iPhone, where the tab cannot bundle code itself, the quick preview is prepared in a builder tab, as a build already is.
|
|
21
|
+
- **Queue messages in the assistant's chat.** Write while it answers: what you write waits and is sent when the answer is done, one at a time. A queued message can be taken back to edit, moved up or removed, and Stop or a failed answer holds the queue until you go on.
|
|
22
|
+
|
|
23
|
+
The quick preview and `read_page` run in the proposal's own page, through the canvas bridge in `@valbuild/next` and `@valbuild/tanstack`, so a site needs those packages at this version for them. The quick preview is served by a service worker on the proposal's address (`/api/val/quick-preview-sw.js`), which takes code only from the site's own design tab.
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`9abd5ef`](https://github.com/valbuild/val/commit/9abd5efea0c1adc7e7ff2d05b2ea38b76af73b38), [`9c6bc8d`](https://github.com/valbuild/val/commit/9c6bc8d25f40427a6fb9eec6ff5506996b718a78)]:
|
|
26
|
+
- @valbuild/ui@0.150.11
|
|
27
|
+
- @valbuild/shared@0.150.11
|
|
28
|
+
|
|
29
|
+
## 0.150.10
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [#970](https://github.com/valbuild/val/pull/970) [`bc39500`](https://github.com/valbuild/val/commit/bc395000866ae9cbde8825f53d1bb606e1093c94) Thanks [@freekh](https://github.com/freekh)! - A proposal's shared AI chat now shows other people's turns live: their question appears as they send it, each tool the turn runs shows as a step, and the answer streams in as it is written, instead of turning up a few seconds later. Who is asking is what the content server says rather than a guess. Against a content server that does not relay chats yet, the Studio falls back to reading the chat again every few seconds, as before.
|
|
34
|
+
|
|
35
|
+
An answer's tool steps are now also shown when a chat is opened again or the page is reloaded, for every chat on a content server that keeps them.
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [[`bc39500`](https://github.com/valbuild/val/commit/bc395000866ae9cbde8825f53d1bb606e1093c94)]:
|
|
38
|
+
- @valbuild/ui@0.150.10
|
|
39
|
+
- @valbuild/shared@0.150.10
|
|
40
|
+
|
|
3
41
|
## 0.150.9
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -3,7 +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-
|
|
6
|
+
var ValRouterCore = require('../../dist/ValRouterCore-e0824c6c.cjs.dev.js');
|
|
7
7
|
require('@valbuild/shared/internal');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('zod-validation-error');
|
|
@@ -3,7 +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-
|
|
6
|
+
var ValRouterCore = require('../../dist/ValRouterCore-89be7c3e.cjs.prod.js');
|
|
7
7
|
require('@valbuild/shared/internal');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('zod-validation-error');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
2
|
-
import { j as ValOpsMemory, E as bytesToBase64, y as ValServer, z as createValRequestHandler } from '../../dist/ValRouterCore-
|
|
2
|
+
import { j as ValOpsMemory, E as bytesToBase64, y as ValServer, z as createValRequestHandler } from '../../dist/ValRouterCore-9a04a007.esm.js';
|
|
3
3
|
import '@valbuild/shared/internal';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'zod-validation-error';
|
|
@@ -8649,7 +8649,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8649
8649
|
role: z.z.string(),
|
|
8650
8650
|
content: AIMessageContent,
|
|
8651
8651
|
// Who asked, on a user message (Flow H).
|
|
8652
|
-
authorId: z.z.string().nullable().optional()
|
|
8652
|
+
authorId: z.z.string().nullable().optional(),
|
|
8653
|
+
// The tools that question's turn called (Flow H).
|
|
8654
|
+
toolCalls: internal.AIToolCallSummaries
|
|
8653
8655
|
})),
|
|
8654
8656
|
nextCursor: z.z.object({
|
|
8655
8657
|
updatedAt: z.z.string(),
|
|
@@ -8810,7 +8812,8 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8810
8812
|
width: z.z.number(),
|
|
8811
8813
|
height: z.z.number(),
|
|
8812
8814
|
mimeType: z.z.string()
|
|
8813
|
-
})
|
|
8815
|
+
}),
|
|
8816
|
+
sha256: z.z.string().optional()
|
|
8814
8817
|
}))
|
|
8815
8818
|
});
|
|
8816
8819
|
const json = UpstreamResponse.safeParse(rawUpstreamJson);
|
|
@@ -8835,6 +8838,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8835
8838
|
// has. A local store without local binary files (ValOpsMemory, which
|
|
8836
8839
|
// uses Val's remote files) skips it, and the draft image is served
|
|
8837
8840
|
// from the content host rather than mirrored.
|
|
8841
|
+
// The hash a remote ref names, where the content service did not
|
|
8842
|
+
// say: the fs branch below has the bytes in hand, so it is free.
|
|
8843
|
+
const sha256ByFilePath = new Map();
|
|
8838
8844
|
if (isFsOps(serverOps)) {
|
|
8839
8845
|
// Mirror the binaries from the content host into local patch
|
|
8840
8846
|
// storage so /files?patch_id=... can serve them. Match upstream
|
|
@@ -8877,6 +8883,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8877
8883
|
// act was to unwrap it again - ceremony to satisfy a convention
|
|
8878
8884
|
// that no longer exists.
|
|
8879
8885
|
const bytes = new Uint8Array(await binaryRes.arrayBuffer());
|
|
8886
|
+
sha256ByFilePath.set(file.filePath, core.Internal.getSHA256Hash(bytes));
|
|
8880
8887
|
const type = file.metadata.mimeType.startsWith("image/") ? "image" : "file";
|
|
8881
8888
|
const saveRes = await serverOps.saveBinaryFileFromPatch(file.filePath, req.body.parentRef, req.body.patchId, bytes, file.metadata.mimeType, type, file.metadata);
|
|
8882
8889
|
if (saveRes.error) {
|
|
@@ -8893,7 +8900,13 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8893
8900
|
status: 200,
|
|
8894
8901
|
json: {
|
|
8895
8902
|
patchId: req.body.patchId,
|
|
8896
|
-
files: json.data.files
|
|
8903
|
+
files: json.data.files.map(file => {
|
|
8904
|
+
const sha256 = file.sha256 ?? sha256ByFilePath.get(file.filePath);
|
|
8905
|
+
return sha256 !== undefined ? {
|
|
8906
|
+
...file,
|
|
8907
|
+
sha256
|
|
8908
|
+
} : file;
|
|
8909
|
+
})
|
|
8897
8910
|
}
|
|
8898
8911
|
};
|
|
8899
8912
|
} catch (err) {
|
|
@@ -9122,7 +9135,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9122
9135
|
// TypeScript compiler. See `patch/ts/publishKit.ts`.
|
|
9123
9136
|
const {
|
|
9124
9137
|
getJsonEntryAtCommit
|
|
9125
|
-
} = await Promise.resolve().then(function () { return require('./getJsonEntryAtCommit-
|
|
9138
|
+
} = await Promise.resolve().then(function () { return require('./getJsonEntryAtCommit-f6ae1e72.cjs.prod.js'); });
|
|
9126
9139
|
const res = await getJsonEntryAtCommit(serverOps, req.query.commit_sha, req.query.path, req.query.key);
|
|
9127
9140
|
if (fp.result.isErr(res)) {
|
|
9128
9141
|
return historyErrorResponse(res.error);
|
|
@@ -10538,6 +10551,24 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
|
|
|
10538
10551
|
});
|
|
10539
10552
|
}
|
|
10540
10553
|
const path = url.pathname.slice(route.length);
|
|
10554
|
+
if (path === internal.QUICK_PREVIEW_SERVICE_WORKER_PATH) {
|
|
10555
|
+
/*
|
|
10556
|
+
* The design tab's quick preview worker (`quickPreview.ts` in
|
|
10557
|
+
* `@valbuild/shared`). `Service-Worker-Allowed: /` lets a script at
|
|
10558
|
+
* this path control the whole origin, which it needs: it serves the
|
|
10559
|
+
* page's `/_app/` files. It serves them only to a page opened as a
|
|
10560
|
+
* quick preview, and the bridge stores them only for the site.
|
|
10561
|
+
*/
|
|
10562
|
+
return convert({
|
|
10563
|
+
status: 200,
|
|
10564
|
+
headers: {
|
|
10565
|
+
"Content-Type": "text/javascript; charset=utf-8",
|
|
10566
|
+
"Service-Worker-Allowed": "/",
|
|
10567
|
+
"Cache-Control": "no-cache"
|
|
10568
|
+
},
|
|
10569
|
+
body: internal.QUICK_PREVIEW_SERVICE_WORKER_SOURCE
|
|
10570
|
+
});
|
|
10571
|
+
}
|
|
10541
10572
|
const groupQueryParams = arr => {
|
|
10542
10573
|
const map = {};
|
|
10543
10574
|
for (const [key, value] of arr) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Internal, VAL_EXTENSION, extractValModules, computeValModuleShas, ImageSchema, DEFAULT_CONTENT_HOST, hasRemoteFileSchema } from '@valbuild/core';
|
|
2
|
-
import { isSchemaSourceFixError, resolveSchemaSourceFixForError, SerializedSchema, AnalyticsBeacon, VAL_ENABLE_COOKIE_NAME, VAL_STATE_COOKIE, VAL_SESSION_COOKIE, newestCommitSha, parseJob, VAL_STUDIO_HEADER, getErrorMessageFromUnknownJson, Api } from '@valbuild/shared/internal';
|
|
2
|
+
import { isSchemaSourceFixError, resolveSchemaSourceFixForError, SerializedSchema, AnalyticsBeacon, VAL_ENABLE_COOKIE_NAME, VAL_STATE_COOKIE, VAL_SESSION_COOKIE, newestCommitSha, parseJob, VAL_STUDIO_HEADER, AIToolCallSummaries, getErrorMessageFromUnknownJson, QUICK_PREVIEW_SERVICE_WORKER_PATH, QUICK_PREVIEW_SERVICE_WORKER_SOURCE, Api } from '@valbuild/shared/internal';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { fromError } from 'zod-validation-error';
|
|
5
5
|
import { result, array } from '@valbuild/core/fp';
|
|
@@ -8643,7 +8643,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8643
8643
|
role: z.string(),
|
|
8644
8644
|
content: AIMessageContent,
|
|
8645
8645
|
// Who asked, on a user message (Flow H).
|
|
8646
|
-
authorId: z.string().nullable().optional()
|
|
8646
|
+
authorId: z.string().nullable().optional(),
|
|
8647
|
+
// The tools that question's turn called (Flow H).
|
|
8648
|
+
toolCalls: AIToolCallSummaries
|
|
8647
8649
|
})),
|
|
8648
8650
|
nextCursor: z.object({
|
|
8649
8651
|
updatedAt: z.string(),
|
|
@@ -8804,7 +8806,8 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8804
8806
|
width: z.number(),
|
|
8805
8807
|
height: z.number(),
|
|
8806
8808
|
mimeType: z.string()
|
|
8807
|
-
})
|
|
8809
|
+
}),
|
|
8810
|
+
sha256: z.string().optional()
|
|
8808
8811
|
}))
|
|
8809
8812
|
});
|
|
8810
8813
|
const json = UpstreamResponse.safeParse(rawUpstreamJson);
|
|
@@ -8829,6 +8832,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8829
8832
|
// has. A local store without local binary files (ValOpsMemory, which
|
|
8830
8833
|
// uses Val's remote files) skips it, and the draft image is served
|
|
8831
8834
|
// from the content host rather than mirrored.
|
|
8835
|
+
// The hash a remote ref names, where the content service did not
|
|
8836
|
+
// say: the fs branch below has the bytes in hand, so it is free.
|
|
8837
|
+
const sha256ByFilePath = new Map();
|
|
8832
8838
|
if (isFsOps(serverOps)) {
|
|
8833
8839
|
// Mirror the binaries from the content host into local patch
|
|
8834
8840
|
// storage so /files?patch_id=... can serve them. Match upstream
|
|
@@ -8871,6 +8877,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8871
8877
|
// act was to unwrap it again - ceremony to satisfy a convention
|
|
8872
8878
|
// that no longer exists.
|
|
8873
8879
|
const bytes = new Uint8Array(await binaryRes.arrayBuffer());
|
|
8880
|
+
sha256ByFilePath.set(file.filePath, Internal.getSHA256Hash(bytes));
|
|
8874
8881
|
const type = file.metadata.mimeType.startsWith("image/") ? "image" : "file";
|
|
8875
8882
|
const saveRes = await serverOps.saveBinaryFileFromPatch(file.filePath, req.body.parentRef, req.body.patchId, bytes, file.metadata.mimeType, type, file.metadata);
|
|
8876
8883
|
if (saveRes.error) {
|
|
@@ -8887,7 +8894,13 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8887
8894
|
status: 200,
|
|
8888
8895
|
json: {
|
|
8889
8896
|
patchId: req.body.patchId,
|
|
8890
|
-
files: json.data.files
|
|
8897
|
+
files: json.data.files.map(file => {
|
|
8898
|
+
const sha256 = file.sha256 ?? sha256ByFilePath.get(file.filePath);
|
|
8899
|
+
return sha256 !== undefined ? {
|
|
8900
|
+
...file,
|
|
8901
|
+
sha256
|
|
8902
|
+
} : file;
|
|
8903
|
+
})
|
|
8891
8904
|
}
|
|
8892
8905
|
};
|
|
8893
8906
|
} catch (err) {
|
|
@@ -9116,7 +9129,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9116
9129
|
// TypeScript compiler. See `patch/ts/publishKit.ts`.
|
|
9117
9130
|
const {
|
|
9118
9131
|
getJsonEntryAtCommit
|
|
9119
|
-
} = await import('./getJsonEntryAtCommit-
|
|
9132
|
+
} = await import('./getJsonEntryAtCommit-a0304334.esm.js');
|
|
9120
9133
|
const res = await getJsonEntryAtCommit(serverOps, req.query.commit_sha, req.query.path, req.query.key);
|
|
9121
9134
|
if (result.isErr(res)) {
|
|
9122
9135
|
return historyErrorResponse(res.error);
|
|
@@ -10532,6 +10545,24 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
|
|
|
10532
10545
|
});
|
|
10533
10546
|
}
|
|
10534
10547
|
const path = url.pathname.slice(route.length);
|
|
10548
|
+
if (path === QUICK_PREVIEW_SERVICE_WORKER_PATH) {
|
|
10549
|
+
/*
|
|
10550
|
+
* The design tab's quick preview worker (`quickPreview.ts` in
|
|
10551
|
+
* `@valbuild/shared`). `Service-Worker-Allowed: /` lets a script at
|
|
10552
|
+
* this path control the whole origin, which it needs: it serves the
|
|
10553
|
+
* page's `/_app/` files. It serves them only to a page opened as a
|
|
10554
|
+
* quick preview, and the bridge stores them only for the site.
|
|
10555
|
+
*/
|
|
10556
|
+
return convert({
|
|
10557
|
+
status: 200,
|
|
10558
|
+
headers: {
|
|
10559
|
+
"Content-Type": "text/javascript; charset=utf-8",
|
|
10560
|
+
"Service-Worker-Allowed": "/",
|
|
10561
|
+
"Cache-Control": "no-cache"
|
|
10562
|
+
},
|
|
10563
|
+
body: QUICK_PREVIEW_SERVICE_WORKER_SOURCE
|
|
10564
|
+
});
|
|
10565
|
+
}
|
|
10535
10566
|
const groupQueryParams = arr => {
|
|
10536
10567
|
const map = {};
|
|
10537
10568
|
for (const [key, value] of arr) {
|
|
@@ -8649,7 +8649,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8649
8649
|
role: z.z.string(),
|
|
8650
8650
|
content: AIMessageContent,
|
|
8651
8651
|
// Who asked, on a user message (Flow H).
|
|
8652
|
-
authorId: z.z.string().nullable().optional()
|
|
8652
|
+
authorId: z.z.string().nullable().optional(),
|
|
8653
|
+
// The tools that question's turn called (Flow H).
|
|
8654
|
+
toolCalls: internal.AIToolCallSummaries
|
|
8653
8655
|
})),
|
|
8654
8656
|
nextCursor: z.z.object({
|
|
8655
8657
|
updatedAt: z.z.string(),
|
|
@@ -8810,7 +8812,8 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8810
8812
|
width: z.z.number(),
|
|
8811
8813
|
height: z.z.number(),
|
|
8812
8814
|
mimeType: z.z.string()
|
|
8813
|
-
})
|
|
8815
|
+
}),
|
|
8816
|
+
sha256: z.z.string().optional()
|
|
8814
8817
|
}))
|
|
8815
8818
|
});
|
|
8816
8819
|
const json = UpstreamResponse.safeParse(rawUpstreamJson);
|
|
@@ -8835,6 +8838,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8835
8838
|
// has. A local store without local binary files (ValOpsMemory, which
|
|
8836
8839
|
// uses Val's remote files) skips it, and the draft image is served
|
|
8837
8840
|
// from the content host rather than mirrored.
|
|
8841
|
+
// The hash a remote ref names, where the content service did not
|
|
8842
|
+
// say: the fs branch below has the bytes in hand, so it is free.
|
|
8843
|
+
const sha256ByFilePath = new Map();
|
|
8838
8844
|
if (isFsOps(serverOps)) {
|
|
8839
8845
|
// Mirror the binaries from the content host into local patch
|
|
8840
8846
|
// storage so /files?patch_id=... can serve them. Match upstream
|
|
@@ -8877,6 +8883,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8877
8883
|
// act was to unwrap it again - ceremony to satisfy a convention
|
|
8878
8884
|
// that no longer exists.
|
|
8879
8885
|
const bytes = new Uint8Array(await binaryRes.arrayBuffer());
|
|
8886
|
+
sha256ByFilePath.set(file.filePath, core.Internal.getSHA256Hash(bytes));
|
|
8880
8887
|
const type = file.metadata.mimeType.startsWith("image/") ? "image" : "file";
|
|
8881
8888
|
const saveRes = await serverOps.saveBinaryFileFromPatch(file.filePath, req.body.parentRef, req.body.patchId, bytes, file.metadata.mimeType, type, file.metadata);
|
|
8882
8889
|
if (saveRes.error) {
|
|
@@ -8893,7 +8900,13 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
8893
8900
|
status: 200,
|
|
8894
8901
|
json: {
|
|
8895
8902
|
patchId: req.body.patchId,
|
|
8896
|
-
files: json.data.files
|
|
8903
|
+
files: json.data.files.map(file => {
|
|
8904
|
+
const sha256 = file.sha256 ?? sha256ByFilePath.get(file.filePath);
|
|
8905
|
+
return sha256 !== undefined ? {
|
|
8906
|
+
...file,
|
|
8907
|
+
sha256
|
|
8908
|
+
} : file;
|
|
8909
|
+
})
|
|
8897
8910
|
}
|
|
8898
8911
|
};
|
|
8899
8912
|
} catch (err) {
|
|
@@ -9122,7 +9135,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
|
|
|
9122
9135
|
// TypeScript compiler. See `patch/ts/publishKit.ts`.
|
|
9123
9136
|
const {
|
|
9124
9137
|
getJsonEntryAtCommit
|
|
9125
|
-
} = await Promise.resolve().then(function () { return require('./getJsonEntryAtCommit-
|
|
9138
|
+
} = await Promise.resolve().then(function () { return require('./getJsonEntryAtCommit-067eaced.cjs.dev.js'); });
|
|
9126
9139
|
const res = await getJsonEntryAtCommit(serverOps, req.query.commit_sha, req.query.path, req.query.key);
|
|
9127
9140
|
if (fp.result.isErr(res)) {
|
|
9128
9141
|
return historyErrorResponse(res.error);
|
|
@@ -10538,6 +10551,24 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
|
|
|
10538
10551
|
});
|
|
10539
10552
|
}
|
|
10540
10553
|
const path = url.pathname.slice(route.length);
|
|
10554
|
+
if (path === internal.QUICK_PREVIEW_SERVICE_WORKER_PATH) {
|
|
10555
|
+
/*
|
|
10556
|
+
* The design tab's quick preview worker (`quickPreview.ts` in
|
|
10557
|
+
* `@valbuild/shared`). `Service-Worker-Allowed: /` lets a script at
|
|
10558
|
+
* this path control the whole origin, which it needs: it serves the
|
|
10559
|
+
* page's `/_app/` files. It serves them only to a page opened as a
|
|
10560
|
+
* quick preview, and the bridge stores them only for the site.
|
|
10561
|
+
*/
|
|
10562
|
+
return convert({
|
|
10563
|
+
status: 200,
|
|
10564
|
+
headers: {
|
|
10565
|
+
"Content-Type": "text/javascript; charset=utf-8",
|
|
10566
|
+
"Service-Worker-Allowed": "/",
|
|
10567
|
+
"Cache-Control": "no-cache"
|
|
10568
|
+
},
|
|
10569
|
+
body: internal.QUICK_PREVIEW_SERVICE_WORKER_SOURCE
|
|
10570
|
+
});
|
|
10571
|
+
}
|
|
10541
10572
|
const groupQueryParams = arr => {
|
|
10542
10573
|
const map = {};
|
|
10543
10574
|
for (const [key, value] of arr) {
|
package/dist/{getJsonEntryAtCommit-757fec21.cjs.dev.js → getJsonEntryAtCommit-067eaced.cjs.dev.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var ts = require('typescript');
|
|
4
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
4
|
+
var ValRouterCore = require('./ValRouterCore-e0824c6c.cjs.dev.js');
|
|
5
5
|
var fp = require('@valbuild/core/fp');
|
|
6
6
|
var jsonValuesModule = require('./jsonValuesModule-8ae503a8.cjs.dev.js');
|
|
7
7
|
require('@valbuild/core');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import { F as bytesToUtf8, G as posixPath } from './ValRouterCore-
|
|
2
|
+
import { F as bytesToUtf8, G as posixPath } from './ValRouterCore-9a04a007.esm.js';
|
|
3
3
|
import { result } from '@valbuild/core/fp';
|
|
4
4
|
import { a as analyzeValModule, c as analyzeJsonValuesEntries } from './jsonValuesModule-427d68c8.esm.js';
|
|
5
5
|
import '@valbuild/core';
|
package/dist/{getJsonEntryAtCommit-e519549a.cjs.prod.js → getJsonEntryAtCommit-f6ae1e72.cjs.prod.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var ts = require('typescript');
|
|
4
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
4
|
+
var ValRouterCore = require('./ValRouterCore-89be7c3e.cjs.prod.js');
|
|
5
5
|
var fp = require('@valbuild/core/fp');
|
|
6
6
|
var jsonValuesModule = require('./jsonValuesModule-d1bb8d8f.cjs.prod.js');
|
|
7
7
|
require('@valbuild/core');
|
|
@@ -12,7 +12,7 @@ var path = require('path');
|
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var vm = require('node:vm');
|
|
14
14
|
var node_module = require('node:module');
|
|
15
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
15
|
+
var ValRouterCore = require('./ValRouterCore-e0824c6c.cjs.dev.js');
|
|
16
16
|
var server = require('@valbuild/ui/server');
|
|
17
17
|
var z = require('zod');
|
|
18
18
|
var zodValidationError = require('zod-validation-error');
|
|
@@ -12,7 +12,7 @@ var path = require('path');
|
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var vm = require('node:vm');
|
|
14
14
|
var node_module = require('node:module');
|
|
15
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
15
|
+
var ValRouterCore = require('./ValRouterCore-89be7c3e.cjs.prod.js');
|
|
16
16
|
var server = require('@valbuild/ui/server');
|
|
17
17
|
var z = require('zod');
|
|
18
18
|
var zodValidationError = require('zod-validation-error');
|
|
@@ -10,8 +10,8 @@ import path from 'path';
|
|
|
10
10
|
import fs from 'fs';
|
|
11
11
|
import vm from 'node:vm';
|
|
12
12
|
import { Module } from 'node:module';
|
|
13
|
-
import { r as resolveExistingJsonPath, f as findNestedJsonValuesRecords, v as validateJsonValuesEntries, i as isJsonValuesRootOp, a as rebaseContentOp, c as classifyJsonValuesOp, V as ValOps, b as bufferFromDataUrl, g as getFieldsForType, u as uploadRemoteFile, d as getFileExt, e as guessMimeTypeFromPath, h as createMetadataFromBuffer, j as ValOpsMemory, k as isHlsMasterPlaylist, s as sumHlsSegmentDurations, p as parseHlsMasterVariants, l as largestHlsVariant, m as fallbackRefOf, n as mapHlsUris, o as movedRemoteHost, q as needsHostCheck, t as rewriteRefHost, w as fallbackRemoteHost, x as checkRemoteFiles, y as ValServer, z as createValRequestHandler, A as getNewJsonEntryPaths, B as formatPatchSourceError } from './ValRouterCore-
|
|
14
|
-
export { I as InMemoryPatchStore, j as ValOpsMemory, C as askOncePerHost, c as classifyJsonValuesOp, B as formatPatchSourceError, d as getFileExt, D as getSettings, a as rebaseContentOp, u as uploadRemoteFile } from './ValRouterCore-
|
|
13
|
+
import { r as resolveExistingJsonPath, f as findNestedJsonValuesRecords, v as validateJsonValuesEntries, i as isJsonValuesRootOp, a as rebaseContentOp, c as classifyJsonValuesOp, V as ValOps, b as bufferFromDataUrl, g as getFieldsForType, u as uploadRemoteFile, d as getFileExt, e as guessMimeTypeFromPath, h as createMetadataFromBuffer, j as ValOpsMemory, k as isHlsMasterPlaylist, s as sumHlsSegmentDurations, p as parseHlsMasterVariants, l as largestHlsVariant, m as fallbackRefOf, n as mapHlsUris, o as movedRemoteHost, q as needsHostCheck, t as rewriteRefHost, w as fallbackRemoteHost, x as checkRemoteFiles, y as ValServer, z as createValRequestHandler, A as getNewJsonEntryPaths, B as formatPatchSourceError } from './ValRouterCore-9a04a007.esm.js';
|
|
14
|
+
export { I as InMemoryPatchStore, j as ValOpsMemory, C as askOncePerHost, c as classifyJsonValuesOp, B as formatPatchSourceError, d as getFileExt, D as getSettings, a as rebaseContentOp, u as uploadRemoteFile } from './ValRouterCore-9a04a007.esm.js';
|
|
15
15
|
import { createUIRequestHandler } from '@valbuild/ui/server';
|
|
16
16
|
import z$1, { z } from 'zod';
|
|
17
17
|
import { fromError } from 'zod-validation-error';
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"exports": true
|
|
29
29
|
},
|
|
30
|
-
"version": "0.150.
|
|
30
|
+
"version": "0.150.11",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@prettier/sync": "^0.6.1",
|
|
33
33
|
"@types/jest": "^30.0.0",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"typescript": "^6.0.3",
|
|
42
42
|
"zod": "^4.4.3",
|
|
43
43
|
"zod-validation-error": "^5.0.0",
|
|
44
|
+
"@valbuild/shared": "0.150.11",
|
|
44
45
|
"@valbuild/core": "0.150.3",
|
|
45
|
-
"@valbuild/
|
|
46
|
-
"@valbuild/ui": "0.150.9"
|
|
46
|
+
"@valbuild/ui": "0.150.11"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": "^20.19.0 || >=22"
|