okno 1.0.0-alpha.1 → 1.0.0-alpha.2
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/index.js
CHANGED
|
@@ -30,7 +30,7 @@ async function E(a) {
|
|
|
30
30
|
n.push('declare module "okno:pages" {');
|
|
31
31
|
for (const r of e) {
|
|
32
32
|
const t = `./pages/${r}`;
|
|
33
|
-
n.push(` import _${
|
|
33
|
+
n.push(` import _${b(r)} from "${t}"`), n.push(` export const ${r}: OknoWrapped<typeof _${b(r)}>`);
|
|
34
34
|
}
|
|
35
35
|
n.push("}"), n.push("");
|
|
36
36
|
}
|
|
@@ -44,8 +44,8 @@ async function E(a) {
|
|
|
44
44
|
if (i.length === 0) continue;
|
|
45
45
|
const p = i[0];
|
|
46
46
|
n.push(
|
|
47
|
-
` import _${
|
|
48
|
-
), n.push(` export const ${t.name}: OknoWrapped<typeof _${
|
|
47
|
+
` import _${b(t.name)}_item from "./collections/${t.name}/${p}"`
|
|
48
|
+
), n.push(` export const ${t.name}: OknoWrapped<typeof _${b(t.name)}_item>[]`);
|
|
49
49
|
}
|
|
50
50
|
n.push("}"), n.push("");
|
|
51
51
|
}
|
|
@@ -55,7 +55,7 @@ async function E(a) {
|
|
|
55
55
|
n.push('declare module "okno:globals" {');
|
|
56
56
|
for (const r of c) {
|
|
57
57
|
const t = `./globals/${r}`;
|
|
58
|
-
n.push(` import _${
|
|
58
|
+
n.push(` import _${b(r)} from "${t}"`), n.push(` export const ${r}: OknoWrapped<typeof _${b(r)}>`);
|
|
59
59
|
}
|
|
60
60
|
n.push("}"), n.push("");
|
|
61
61
|
}
|
|
@@ -65,7 +65,7 @@ async function E(a) {
|
|
|
65
65
|
async function W(a) {
|
|
66
66
|
return $(a) ? (await v(a)).filter((o) => o.endsWith(".ts") && o !== "index.ts" && o !== "modules.d.ts").map((o) => o.replace(".ts", "")) : [];
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function b(a) {
|
|
69
69
|
return a.replace(/-/g, "_");
|
|
70
70
|
}
|
|
71
71
|
const K = {
|
|
@@ -185,7 +185,7 @@ function ct(a = {}) {
|
|
|
185
185
|
config() {
|
|
186
186
|
return {
|
|
187
187
|
define: {
|
|
188
|
-
__OKNO_API_URL__: JSON.stringify(a.apiUrl ?? "")
|
|
188
|
+
__OKNO_API_URL__: JSON.stringify(a.apiUrl ?? "https://api.conte.build")
|
|
189
189
|
},
|
|
190
190
|
server: {
|
|
191
191
|
watch: {
|
|
@@ -263,7 +263,7 @@ function ct(a = {}) {
|
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
async function
|
|
266
|
+
async function N(a) {
|
|
267
267
|
return $(a) ? (await v(a)).filter((o) => o.endsWith(".ts") && o !== "index.ts") : [];
|
|
268
268
|
}
|
|
269
269
|
const q = /* @__PURE__ */ new Set([".astro", ".svelte", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".vue"]), tt = /* @__PURE__ */ new Set([
|
|
@@ -333,7 +333,7 @@ async function et(a, n = /* @__PURE__ */ new Set()) {
|
|
|
333
333
|
if ($(o)) {
|
|
334
334
|
const c = (await v(o, { withFileTypes: !0 })).filter((t) => t.isDirectory()).map((t) => t.name);
|
|
335
335
|
if (c.length > 0) {
|
|
336
|
-
const t = c[0], i = await
|
|
336
|
+
const t = c[0], i = await N(u(o, t));
|
|
337
337
|
for (const p of i) {
|
|
338
338
|
const m = S(p), f = x(p), d = [], h = [];
|
|
339
339
|
for (const g of c) {
|
|
@@ -346,7 +346,7 @@ async function et(a, n = /* @__PURE__ */ new Set()) {
|
|
|
346
346
|
e.push(...d), e.push(`const _${m} = { ${h.join(", ")} }`), e.push(`export const ${f} = __oknoWrap(_${m}, "${f}")`), s.add(f);
|
|
347
347
|
}
|
|
348
348
|
} else {
|
|
349
|
-
const t = await
|
|
349
|
+
const t = await N(o);
|
|
350
350
|
for (const i of t) {
|
|
351
351
|
const p = S(i), m = x(i), f = C(i), d = u(o, i);
|
|
352
352
|
e.push(`import _${p} from "${d}"`), e.push(`export const ${m} = __oknoWrap(_${p}, "${f}")`), s.add(m);
|
|
@@ -377,7 +377,7 @@ async function ot(a, n = /* @__PURE__ */ new Set()) {
|
|
|
377
377
|
for (const i of l) {
|
|
378
378
|
const p = u(o, t, i);
|
|
379
379
|
if (!$(p)) continue;
|
|
380
|
-
const m = await
|
|
380
|
+
const m = await N(p), f = [];
|
|
381
381
|
for (const d of m) {
|
|
382
382
|
const h = `_${i}_${S(d)}`, g = x(d), w = [], _ = [];
|
|
383
383
|
for (const P of s) {
|
|
@@ -393,7 +393,7 @@ async function ot(a, n = /* @__PURE__ */ new Set()) {
|
|
|
393
393
|
}
|
|
394
394
|
} else
|
|
395
395
|
for (const t of l) {
|
|
396
|
-
const i = u(o, t), p = await
|
|
396
|
+
const i = u(o, t), p = await N(i), m = [], f = t.replace(/-/g, "_");
|
|
397
397
|
for (const d of p) {
|
|
398
398
|
const h = `_${f}_${S(d)}`, g = C(d);
|
|
399
399
|
r.push(`import ${h} from "${u(i, d)}"`), m.push(`__oknoWrap(${h}, "${t}.${g}")`);
|
|
@@ -410,7 +410,7 @@ async function nt(a, n = /* @__PURE__ */ new Set()) {
|
|
|
410
410
|
if ($(o)) {
|
|
411
411
|
const c = (await v(o, { withFileTypes: !0 })).filter((t) => t.isDirectory()).map((t) => t.name);
|
|
412
412
|
if (c.length > 0) {
|
|
413
|
-
const t = c[0], i = await
|
|
413
|
+
const t = c[0], i = await N(u(o, t));
|
|
414
414
|
for (const p of i) {
|
|
415
415
|
const m = S(p), f = x(p), d = [], h = [];
|
|
416
416
|
for (const g of c) {
|
|
@@ -423,7 +423,7 @@ async function nt(a, n = /* @__PURE__ */ new Set()) {
|
|
|
423
423
|
e.push(...d), e.push(`const _${m} = { ${h.join(", ")} }`), e.push(`export const ${f} = __oknoWrap(_${m}, "${f}")`), s.add(f);
|
|
424
424
|
}
|
|
425
425
|
} else {
|
|
426
|
-
const t = await
|
|
426
|
+
const t = await N(o);
|
|
427
427
|
for (const i of t) {
|
|
428
428
|
const p = S(i), m = x(i), f = C(i), d = u(o, i);
|
|
429
429
|
e.push(`import _${p} from "${d}"`), e.push(`export const ${m} = __oknoWrap(_${p}, "${f}")`), s.add(m);
|
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-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.2",
|
|
6
6
|
"homepage": "https://okno.build",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "./dist/index.d.ts",
|