okno 1.0.0-beta.21 → 1.0.0-beta.22
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/{dispatch-CmTJLIKc.js → dispatch-CENEluBI.js} +6 -6
- package/dist/editor/index.js +11072 -11101
- package/dist/encode-BfJY0Xy5.js +20 -0
- package/dist/engine/index.js +14 -13
- package/dist/engine/parse.d.ts +5 -3
- package/dist/engine/parse.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.js +14 -13
- package/dist/next/index.js +1 -1
- package/dist/{acorn-CZBJD705.js → parse-tlTHgSSs.js} +253 -195
- package/dist/{plugin-DcdYJY8n.js → plugin-C6e1HX1x.js} +2 -2
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/dist/encode-DoojdsVU.js +0 -80
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { extname as z, join as h, dirname as T, relative as N, sep as D, resolve as g } from "node:path";
|
|
2
2
|
import { existsSync as O, readFileSync as U, mkdirSync as M, writeFileSync as B, cpSync as Y } from "node:fs";
|
|
3
3
|
import { fileURLToPath as Q } from "node:url";
|
|
4
|
-
import { k as Z, g as x, s as E, b as q, a as tt, c as et, e as ot, d as nt, f as it, j as P, l as $, m as rt, h as st, i as at } from "./dispatch-
|
|
4
|
+
import { k as Z, g as x, s as E, b as q, a as tt, c as et, e as ot, d as nt, f as it, j as P, l as $, m as rt, h as st, i as at } from "./dispatch-CENEluBI.js";
|
|
5
5
|
import { simpleGit as R } from "simple-git";
|
|
6
6
|
import "node:child_process";
|
|
7
|
-
import "./
|
|
7
|
+
import "./parse-tlTHgSSs.js";
|
|
8
8
|
function F(n, r, e) {
|
|
9
9
|
n.statusCode = r, n.setHeader("Content-Type", "application/json"), n.setHeader("Cache-Control", "no-store"), n.end(JSON.stringify(e));
|
|
10
10
|
}
|
package/dist/vite/index.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "okno",
|
|
3
3
|
"description": "Git-backed CMS with live editing for any Vite framework",
|
|
4
4
|
"author": "Gabriel Uhlíř",
|
|
5
|
-
"version": "1.0.0-beta.
|
|
5
|
+
"version": "1.0.0-beta.22",
|
|
6
6
|
"homepage": "https://okno.build",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
package/dist/encode-DoojdsVU.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { p as s } from "./acorn-CZBJD705.js";
|
|
2
|
-
function a(o) {
|
|
3
|
-
const e = o;
|
|
4
|
-
switch (e.type) {
|
|
5
|
-
case "Literal": {
|
|
6
|
-
if (e.regex) throw new Error("regex literals are not allowed");
|
|
7
|
-
return e.value;
|
|
8
|
-
}
|
|
9
|
-
case "TemplateLiteral": {
|
|
10
|
-
if (e.expressions.length > 0) throw new Error("template expressions are not allowed");
|
|
11
|
-
return e.quasis.map((r) => r.value.cooked).join("");
|
|
12
|
-
}
|
|
13
|
-
case "UnaryExpression": {
|
|
14
|
-
if ((e.operator === "-" || e.operator === "+") && e.argument?.type === "Literal" && typeof e.argument.value == "number")
|
|
15
|
-
return e.operator === "-" ? -e.argument.value : +e.argument.value;
|
|
16
|
-
throw new Error(`unary operator ${e.operator} is not allowed`);
|
|
17
|
-
}
|
|
18
|
-
case "Identifier": {
|
|
19
|
-
if (e.name === "undefined") return;
|
|
20
|
-
throw new Error(`identifier ${e.name} is not allowed`);
|
|
21
|
-
}
|
|
22
|
-
case "ArrayExpression":
|
|
23
|
-
return e.elements.map((r) => {
|
|
24
|
-
if (r === null) throw new Error("array holes are not allowed");
|
|
25
|
-
if (r.type === "SpreadElement") throw new Error("spread is not allowed");
|
|
26
|
-
return a(r);
|
|
27
|
-
});
|
|
28
|
-
case "ObjectExpression": {
|
|
29
|
-
const r = {};
|
|
30
|
-
for (const t of e.properties) {
|
|
31
|
-
if (t.type !== "Property") throw new Error("spread is not allowed");
|
|
32
|
-
if (t.computed) throw new Error("computed keys are not allowed");
|
|
33
|
-
if (t.kind !== "init") throw new Error("getters/setters are not allowed");
|
|
34
|
-
if (t.method) throw new Error("methods are not allowed");
|
|
35
|
-
let n;
|
|
36
|
-
if (t.key.type === "Identifier") n = t.key.name;
|
|
37
|
-
else if (t.key.type === "Literal") n = String(t.key.value);
|
|
38
|
-
else throw new Error("unsupported object key");
|
|
39
|
-
r[n] = a(t.value);
|
|
40
|
-
}
|
|
41
|
-
return r;
|
|
42
|
-
}
|
|
43
|
-
default:
|
|
44
|
-
throw new Error(`unsupported node: ${e.type}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function l(o) {
|
|
48
|
-
try {
|
|
49
|
-
let e = o.trim();
|
|
50
|
-
const r = e.match(/export\s+default\s+([\s\S]+)/);
|
|
51
|
-
if (!r)
|
|
52
|
-
return console.warn("Could not find export default"), {};
|
|
53
|
-
e = r[1].trim(), e.endsWith(";") && (e = e.slice(0, -1)), e = e.replace(/\s+satisfies\s+\w+\s*$/, ""), e = e.replace(/\s+as\s+\w+\s*$/, "");
|
|
54
|
-
const t = s(`(${e})`, 0, { ecmaVersion: "latest" });
|
|
55
|
-
return a(t);
|
|
56
|
-
} catch (e) {
|
|
57
|
-
return console.error("Failed to parse TypeScript export:", e), {};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function p(o, e) {
|
|
61
|
-
const r = { date: e.now, author: e.author }, t = { ...o, created: e.created ?? r, updated: r };
|
|
62
|
-
return `export default ${JSON.stringify(t, null, " ")}
|
|
63
|
-
`;
|
|
64
|
-
}
|
|
65
|
-
function u(o, e = `import type { Schema } from "okno"
|
|
66
|
-
|
|
67
|
-
`) {
|
|
68
|
-
return `${e}export default ${JSON.stringify(o, null, " ")} satisfies Schema
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
function d(o) {
|
|
72
|
-
return `export default ${JSON.stringify(o, null, " ")}
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
|
-
export {
|
|
76
|
-
u as a,
|
|
77
|
-
d as b,
|
|
78
|
-
p as e,
|
|
79
|
-
l as p
|
|
80
|
-
};
|