@shop-on/theme-dev-host 0.6.0 → 0.7.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/dist/editor-app.mjs +3 -3
- package/package.json +2 -2
package/dist/editor-app.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import "hono";
|
|
|
9
9
|
import { readFile, readdir, stat } from "node:fs/promises";
|
|
10
10
|
import { currentPresetHandle } from "@shop-on/theme-contract/preset-listing";
|
|
11
11
|
import { bodyLimit } from "hono/body-limit";
|
|
12
|
-
import { MAX_BATCH_BYTES, OpBatchBodySchema, chunkOps, touchedEntries } from "@shop-on/theme-contract/ops";
|
|
12
|
+
import { MAX_BATCH_BYTES, OpBatchBodySchema, TabOpBatchBodySchema, agentClientId, chunkOps, touchedEntries } from "@shop-on/theme-contract/ops";
|
|
13
13
|
import { applyEditorTool, isEditorToolName } from "@shop-on/theme-contract/editor-tools";
|
|
14
14
|
import { readThemeAiDir } from "@shop-on/theme-contract/ai-files";
|
|
15
15
|
import { invalidTemplateId } from "@shop-on/theme-contract/store-path";
|
|
@@ -155,7 +155,7 @@ function registerEditorRoutes(app, configDir, auth, store, opts) {
|
|
|
155
155
|
app.post(`${PREFIX}/draft/ops`, opsBodyLimit, editorAuth, async (c) => {
|
|
156
156
|
const raw = await c.req.json().catch(() => void 0);
|
|
157
157
|
if (raw === void 0) return c.json({ error: "invalid JSON body" }, 400);
|
|
158
|
-
const parsed =
|
|
158
|
+
const parsed = TabOpBatchBodySchema.safeParse(raw);
|
|
159
159
|
if (!parsed.success) return c.json({
|
|
160
160
|
error: "invalid batch",
|
|
161
161
|
issues: parsed.error.issues.slice(0, 5)
|
|
@@ -250,7 +250,7 @@ function registerEditorRoutes(app, configDir, auth, store, opts) {
|
|
|
250
250
|
ops = out.ops;
|
|
251
251
|
result = out.result;
|
|
252
252
|
}
|
|
253
|
-
const clientId =
|
|
253
|
+
const clientId = agentClientId(c.get("sid"), body.callId);
|
|
254
254
|
const batches = [];
|
|
255
255
|
for (const [n, chunk] of chunkOps(ops).entries()) {
|
|
256
256
|
const batch = OpBatchBodySchema.safeParse({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shop-on/theme-dev-host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Local theme-editor dev server: serves the editor contract + proxies a theme's dev server behind one origin, so a theme runs locally and previews in a real admin theme-editor. Nucleus of the future theme CLI.",
|
|
5
5
|
"license": "SEE LICENSE IN dist/LICENSE.md",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"hono": "^4.13.13",
|
|
17
17
|
"isomorphic-dompurify": "4.6.0",
|
|
18
18
|
"jose": "^6.2.13",
|
|
19
|
-
"@shop-on/theme-contract": "0.
|
|
19
|
+
"@shop-on/theme-contract": "0.7.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "26.6.5",
|