@stacksjs/stx 0.2.418 → 0.2.419
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/{chunk-wweasgq9.js → chunk-09hhrjk9.js} +6 -6
- package/dist/chunk-0bsjrj8s.js +2 -0
- package/dist/chunk-0n76c3g8.js +2 -0
- package/dist/{chunk-w5zmvn7b.js → chunk-0varh725.js} +3 -3
- package/dist/chunk-0xpgfvrn.js +4 -0
- package/dist/{chunk-9r5ycpdg.js → chunk-10967rws.js} +3 -3
- package/dist/chunk-10fh9qhe.js +2 -0
- package/dist/{chunk-xvn3sv3v.js → chunk-11ra3sbc.js} +3 -3
- package/dist/{chunk-e83j8xe9.js → chunk-12b8akfg.js} +4 -4
- package/dist/chunk-18awnp9d.js +2 -0
- package/dist/{chunk-hm2k9a04.js → chunk-20tdz0zs.js} +7 -7
- package/dist/{chunk-mj9yv1vb.js → chunk-21a7p956.js} +1 -1
- package/dist/{chunk-5fwy3xap.js → chunk-2ewa2sg5.js} +3 -3
- package/dist/chunk-2hswgxpb.js +2 -0
- package/dist/{chunk-g947brd0.js → chunk-2tfe2g58.js} +6 -6
- package/dist/{chunk-0xgf3xgy.js → chunk-32y3767j.js} +7 -7
- package/dist/{chunk-3wmxb126.js → chunk-34gy5zjm.js} +2 -2
- package/dist/chunk-37eyawdr.js +2 -0
- package/dist/chunk-3cp46g4f.js +2 -0
- package/dist/{chunk-kds79hq3.js → chunk-3xdqvrxa.js} +10 -10
- package/dist/chunk-4amznxaq.js +2 -0
- package/dist/{chunk-865xvpp2.js → chunk-4n6c5rp5.js} +2 -2
- package/dist/chunk-55yja0xs.js +2 -0
- package/dist/{chunk-dw961rvn.js → chunk-5vfyxxrp.js} +2 -2
- package/dist/{chunk-ka8x4sw6.js → chunk-60bes9yt.js} +5 -5
- package/dist/chunk-61kz487h.js +2 -0
- package/dist/{chunk-7q1yy18q.js → chunk-62r4fa4q.js} +2 -2
- package/dist/{chunk-76japd6k.js → chunk-66k7yxnr.js} +4 -4
- package/dist/{chunk-68rq2fqt.js → chunk-68dkgdhq.js} +1 -1
- package/dist/{chunk-bk5ndwv3.js → chunk-757ec865.js} +2 -2
- package/dist/{chunk-d6h9rpm4.js → chunk-7n8ns8sr.js} +5 -5
- package/dist/{chunk-xwkdv585.js → chunk-802pr252.js} +2 -2
- package/dist/{chunk-ev8bhsc0.js → chunk-8drvzsk1.js} +2 -2
- package/dist/chunk-8j3f789a.js +2 -0
- package/dist/{chunk-y9t55tv7.js → chunk-8j8k27xb.js} +6 -6
- package/dist/{chunk-q8swb7na.js → chunk-8jqy69td.js} +3 -3
- package/dist/chunk-8nsqac4z.js +2 -0
- package/dist/chunk-8ttvazck.js +2 -0
- package/dist/{chunk-sjjc670z.js → chunk-8vq0qjq9.js} +9 -9
- package/dist/chunk-8y4bqsxz.js +2 -0
- package/dist/{chunk-072mzamc.js → chunk-963skd21.js} +5 -5
- package/dist/{chunk-3senpdjt.js → chunk-9d5eab03.js} +2 -2
- package/dist/chunk-9qx66tpp.js +2 -0
- package/dist/chunk-ac033b93.js +2 -0
- package/dist/chunk-aj43359g.js +2 -0
- package/dist/chunk-aj8yq228.js +2 -0
- package/dist/{chunk-vyfg2qd2.js → chunk-ap6fehea.js} +5 -5
- package/dist/chunk-as72dvvm.js +2 -0
- package/dist/chunk-ax58cds3.js +5 -0
- package/dist/{chunk-qmzwhtr2.js → chunk-aync8qmk.js} +2 -2
- package/dist/chunk-b01jqb5f.js +2 -0
- package/dist/{chunk-3aqe7wy7.js → chunk-b1fg9vg7.js} +2 -2
- package/dist/chunk-bfvaxrq0.js +2 -0
- package/dist/chunk-bkaw7sgz.js +2 -0
- package/dist/chunk-bvae0b17.js +2 -0
- package/dist/chunk-byvbdmb2.js +2 -0
- package/dist/chunk-c4s2pe49.js +2 -0
- package/dist/{chunk-bt11a8z4.js → chunk-csjw5esc.js} +3 -3
- package/dist/chunk-d2c5727w.js +2 -0
- package/dist/chunk-d5amzers.js +2 -0
- package/dist/chunk-d9yq3tyx.js +2 -0
- package/dist/chunk-dfchrqw5.js +2 -0
- package/dist/{chunk-94ky725r.js → chunk-dg4q9qw2.js} +2 -2
- package/dist/{chunk-47h689h6.js → chunk-dhxbjw6k.js} +2 -2
- package/dist/{chunk-1680nbq4.js → chunk-dxb1bbtr.js} +301 -301
- package/dist/{chunk-9yt899e7.js → chunk-ep5jnqdb.js} +6 -6
- package/dist/{chunk-yrbzsrde.js → chunk-f6z33aa6.js} +2 -2
- package/dist/{chunk-e2m674vf.js → chunk-g1fxmp9z.js} +4 -4
- package/dist/chunk-g43wvf4g.js +2 -0
- package/dist/chunk-ga83rmz6.js +2 -0
- package/dist/chunk-gk56fgfz.js +2 -0
- package/dist/{chunk-h8f18cc5.js → chunk-h1h6xe1k.js} +5 -5
- package/dist/chunk-hahzjyxc.js +2 -0
- package/dist/{chunk-5vzamjf6.js → chunk-hdx8x2z1.js} +3 -3
- package/dist/chunk-hgqcqg1h.js +2 -0
- package/dist/chunk-hjdwf9gp.js +2 -0
- package/dist/chunk-hr7rmyv7.js +2 -0
- package/dist/{chunk-d0ynfema.js → chunk-hy9e3ny6.js} +1 -1
- package/dist/{chunk-9bq4w4d6.js → chunk-hyak4dzg.js} +3 -3
- package/dist/chunk-j0twxvjf.js +2 -0
- package/dist/chunk-j9aberz0.js +2 -0
- package/dist/chunk-jjm0ekw8.js +2 -0
- package/dist/chunk-jjnfj9nf.js +3 -0
- package/dist/chunk-jjtzm6dn.js +3 -0
- package/dist/{chunk-c8p4v1rd.js → chunk-k31fwm2w.js} +5 -5
- package/dist/{chunk-pb0fgdvn.js → chunk-kjkwycce.js} +4 -4
- package/dist/{chunk-85bm5xrm.js → chunk-krr2vb0s.js} +3 -3
- package/dist/{chunk-3f5td68v.js → chunk-m16h8ea0.js} +2 -2
- package/dist/chunk-m2jphkdv.js +2 -0
- package/dist/{chunk-vepc9rbt.js → chunk-mbbx3w32.js} +2 -2
- package/dist/{chunk-25n4gmek.js → chunk-mg13q1kd.js} +2 -2
- package/dist/chunk-p083sckk.js +2 -0
- package/dist/{chunk-hg3tyzn5.js → chunk-p828w2b8.js} +11 -11
- package/dist/chunk-pc178389.js +2 -0
- package/dist/chunk-q0mbgq3n.js +2 -0
- package/dist/chunk-q1v0jwr4.js +2 -0
- package/dist/{chunk-v15g9jjh.js → chunk-qbq6652q.js} +6 -6
- package/dist/{chunk-fr8jq2ys.js → chunk-qby6wxat.js} +2 -2
- package/dist/chunk-qtz161z6.js +2 -0
- package/dist/{chunk-dym1eteb.js → chunk-qx3js9tk.js} +1 -1
- package/dist/{chunk-ayd5r3se.js → chunk-qxre7vw6.js} +2 -2
- package/dist/chunk-r5gjb55x.js +2 -0
- package/dist/{chunk-vfdwvt23.js → chunk-r8wze9ym.js} +2 -2
- package/dist/chunk-ra1rcn3g.js +2 -0
- package/dist/chunk-rjd08g2t.js +2 -0
- package/dist/{chunk-wgzxmh7w.js → chunk-rsxvbnp4.js} +3 -3
- package/dist/chunk-s3ktxdbd.js +2 -0
- package/dist/chunk-se1b9b6m.js +2 -0
- package/dist/{chunk-vdqa5gt7.js → chunk-tafebmtg.js} +2 -2
- package/dist/chunk-tf44jyrh.js +2 -0
- package/dist/chunk-tfypkw4y.js +3 -0
- package/dist/{chunk-hkxxfzfd.js → chunk-th9s15es.js} +2 -2
- package/dist/{chunk-xt6d3zws.js → chunk-tqnysw0k.js} +4 -4
- package/dist/{chunk-5f3k2mke.js → chunk-tspmynvh.js} +1 -1
- package/dist/chunk-vcx4bxj3.js +2 -0
- package/dist/{chunk-jfjym18d.js → chunk-w7a4mjsm.js} +3 -3
- package/dist/{chunk-psmdbcbc.js → chunk-wbm2yq5d.js} +3 -3
- package/dist/{chunk-08p07eq7.js → chunk-wg1ttvs5.js} +2 -2
- package/dist/chunk-wgqjjhx5.js +2 -0
- package/dist/{chunk-fxhvkenf.js → chunk-x5ks23vx.js} +2 -2
- package/dist/chunk-x8rckpyz.js +2 -0
- package/dist/{chunk-mj6fme15.js → chunk-xbragnsq.js} +5 -5
- package/dist/{chunk-9af8qbwb.js → chunk-xvzxrt9a.js} +5 -5
- package/dist/{chunk-wpkxbggq.js → chunk-xwfjhz0h.js} +1 -1
- package/dist/chunk-ya9c8nec.js +2 -0
- package/dist/chunk-ycp9r4qn.js +2 -0
- package/dist/{chunk-jgsgd6rt.js → chunk-ynkc9t68.js} +5 -5
- package/dist/chunk-yqm74xyg.js +2 -0
- package/dist/chunk-zpcz2kh6.js +2 -0
- package/dist/{chunk-kkj5x9rp.js → chunk-zvh2nnzr.js} +1 -1
- package/dist/chunk-zynzw92k.js +2 -0
- package/dist/{chunk-gfm7g98y.js → chunk-zz6ad4p5.js} +39 -39
- package/dist/cli.js +21 -21
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/head-keys.d.ts +41 -0
- package/dist/head-keys.js +78 -0
- package/dist/head.js +2 -1
- package/dist/process.js +2 -1
- package/dist/production-builder.js +2 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +15 -15
- package/dist/variable-extractor.js +2 -1
- package/package.json +5 -5
- package/dist/chunk-072f6hnz.js +0 -2
- package/dist/chunk-0x076wz1.js +0 -2
- package/dist/chunk-2gfj59pt.js +0 -2
- package/dist/chunk-2gntnw7e.js +0 -2
- package/dist/chunk-2hvvwhmv.js +0 -2
- package/dist/chunk-31a8eh0j.js +0 -5
- package/dist/chunk-4bhertga.js +0 -2
- package/dist/chunk-4s9dypby.js +0 -2
- package/dist/chunk-5z56g0n4.js +0 -2
- package/dist/chunk-6ad0nseq.js +0 -2
- package/dist/chunk-7eazcxzf.js +0 -2
- package/dist/chunk-7hy29tcy.js +0 -2
- package/dist/chunk-8fyqbq14.js +0 -2
- package/dist/chunk-92xzpt6p.js +0 -2
- package/dist/chunk-9kmmafp4.js +0 -2
- package/dist/chunk-atgwc7r7.js +0 -2
- package/dist/chunk-bs6y5wy2.js +0 -2
- package/dist/chunk-ccg6xjr1.js +0 -2
- package/dist/chunk-ckv4aty5.js +0 -2
- package/dist/chunk-dbh7h0kt.js +0 -2
- package/dist/chunk-dhqkg0ph.js +0 -2
- package/dist/chunk-ettat5ah.js +0 -2
- package/dist/chunk-f4ws0qcd.js +0 -2
- package/dist/chunk-f97v10zr.js +0 -2
- package/dist/chunk-fe5st320.js +0 -2
- package/dist/chunk-fet3hce8.js +0 -2
- package/dist/chunk-fq7128p1.js +0 -2
- package/dist/chunk-fwy2h1ms.js +0 -2
- package/dist/chunk-gtkhykc4.js +0 -2
- package/dist/chunk-h8pkm7c5.js +0 -2
- package/dist/chunk-hneg0155.js +0 -2
- package/dist/chunk-hs90en70.js +0 -2
- package/dist/chunk-jn3njpxs.js +0 -2
- package/dist/chunk-mcqn70v8.js +0 -3
- package/dist/chunk-mcs7p3fy.js +0 -2
- package/dist/chunk-mmtg0jxd.js +0 -2
- package/dist/chunk-mrsxwd0h.js +0 -2
- package/dist/chunk-mscky0ww.js +0 -2
- package/dist/chunk-mtphm33a.js +0 -2
- package/dist/chunk-p2jbc71s.js +0 -2
- package/dist/chunk-pvd9k3kx.js +0 -2
- package/dist/chunk-pz1jc3db.js +0 -2
- package/dist/chunk-qvr6e2ve.js +0 -3
- package/dist/chunk-ra0pkkvd.js +0 -2
- package/dist/chunk-rcbtd4w3.js +0 -2
- package/dist/chunk-rd2r9jvn.js +0 -2
- package/dist/chunk-s8srb8bg.js +0 -2
- package/dist/chunk-snf2b68p.js +0 -2
- package/dist/chunk-t2bfwr9v.js +0 -2
- package/dist/chunk-tbmwdahm.js +0 -2
- package/dist/chunk-vpv896zx.js +0 -2
- package/dist/chunk-w6h63b48.js +0 -2
- package/dist/chunk-wrk3gkgg.js +0 -2
- package/dist/chunk-wtd71jsa.js +0 -2
- package/dist/chunk-wymf1ek6.js +0 -2
- package/dist/chunk-wz8hyh8h.js +0 -4
- package/dist/chunk-x32wpjs0.js +0 -2
- package/dist/chunk-x4q2eyt0.js +0 -2
- package/dist/chunk-x95ejws0.js +0 -2
- package/dist/chunk-xket8ejt.js +0 -2
- package/dist/chunk-ypfzy1mq.js +0 -2
- package/dist/chunk-zg68pwy8.js +0 -2
- package/dist/chunk-zs58fnme.js +0 -2
- package/dist/chunk-zy3p0vmx.js +0 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const APP_HEAD_KEYS = ["title", "lang", "meta", "link", "script", "headRaw", "htmlAttrs", "bodyClass", "bodyAttrs"], USE_HEAD_KEYS = ["title", "titleTemplate", "base", "meta", "link", "script", "style", "htmlAttrs", "bodyAttrs"];
|
|
2
|
+
const PLURAL_ALIASES = {
|
|
3
|
+
links: "link",
|
|
4
|
+
metas: "meta",
|
|
5
|
+
scripts: "script",
|
|
6
|
+
styles: "style"
|
|
7
|
+
}, warned = new Set, normalized = new WeakMap;
|
|
8
|
+
export function resetHeadKeyWarnings() {
|
|
9
|
+
warned.clear();
|
|
10
|
+
}
|
|
11
|
+
function warnOnce(message) {
|
|
12
|
+
if (warned.has(message))
|
|
13
|
+
return;
|
|
14
|
+
warned.add(message);
|
|
15
|
+
console.warn(message);
|
|
16
|
+
}
|
|
17
|
+
function distance(a, b) {
|
|
18
|
+
const row = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
19
|
+
for (let i = 1;i <= a.length; i++) {
|
|
20
|
+
let previous = row[0];
|
|
21
|
+
row[0] = i;
|
|
22
|
+
for (let j = 1;j <= b.length; j++) {
|
|
23
|
+
const current = row[j];
|
|
24
|
+
row[j] = Math.min(row[j] + 1, row[j - 1] + 1, previous + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
25
|
+
previous = current;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return row[b.length];
|
|
29
|
+
}
|
|
30
|
+
export function nearestHeadKey(key, known) {
|
|
31
|
+
const lower = key.toLowerCase(), caseOnly = known.find((k) => k.toLowerCase() === lower);
|
|
32
|
+
if (caseOnly)
|
|
33
|
+
return caseOnly;
|
|
34
|
+
const plural = PLURAL_ALIASES[lower];
|
|
35
|
+
if (plural && known.includes(plural))
|
|
36
|
+
return plural;
|
|
37
|
+
let best, bestDistance = 1 / 0;
|
|
38
|
+
for (const candidate of known) {
|
|
39
|
+
const d = distance(lower, candidate.toLowerCase());
|
|
40
|
+
if (d < bestDistance) {
|
|
41
|
+
best = candidate;
|
|
42
|
+
bestDistance = d;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const allowed = Math.min(key.length, best?.length ?? 0) <= 4 ? 1 : 2;
|
|
46
|
+
return bestDistance <= allowed ? best : void 0;
|
|
47
|
+
}
|
|
48
|
+
export function normalizeHeadKeys(head, options) {
|
|
49
|
+
if (!head || typeof head !== "object" || Array.isArray(head))
|
|
50
|
+
return head || {};
|
|
51
|
+
const cached = normalized.get(head);
|
|
52
|
+
if (cached)
|
|
53
|
+
return cached;
|
|
54
|
+
const { known, source } = options;
|
|
55
|
+
let result = head;
|
|
56
|
+
for (const key of Object.keys(head)) {
|
|
57
|
+
if (known.includes(key))
|
|
58
|
+
continue;
|
|
59
|
+
const alias = PLURAL_ALIASES[key];
|
|
60
|
+
if (alias && known.includes(alias) && Array.isArray(head[key])) {
|
|
61
|
+
if (result === head)
|
|
62
|
+
result = { ...head };
|
|
63
|
+
const singular = Array.isArray(result[alias]) ? result[alias] : [];
|
|
64
|
+
result[alias] = [...singular, ...head[key]];
|
|
65
|
+
delete result[key];
|
|
66
|
+
warnOnce(`[stx] ${source}.${key} is not a head key; reading it as ${source}.${alias}. Rename it to \`${alias}\`.`);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (/^styles?$/.test(key) && !known.includes("style")) {
|
|
70
|
+
warnOnce(`[stx] ${source}.${key} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const suggestion = nearestHeadKey(key, known);
|
|
74
|
+
warnOnce(suggestion ? `[stx] ${source}.${key} is not a head key and is ignored. Did you mean \`${suggestion}\`?` : `[stx] ${source}.${key} is not a head key and is ignored. Known keys: ${known.join(", ")}.`);
|
|
75
|
+
}
|
|
76
|
+
normalized.set(head, result);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
package/dist/head.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { replaceDirectiveCalls, reportDirectiveFailure, splitTopLevelArgs } from "./directive-arguments.js";
|
|
2
2
|
import { ErrorCodes } from "./error-handling.js";
|
|
3
3
|
import { resolveMetaArguments } from "./meta-arguments.js";
|
|
4
|
+
import { normalizeHeadKeys, USE_HEAD_KEYS } from "./head-keys.js";
|
|
4
5
|
let currentHead = {};
|
|
5
6
|
const headStack = [];
|
|
6
7
|
let currentPageMeta = {};
|
|
@@ -16,7 +17,7 @@ export function resetHead() {
|
|
|
16
17
|
currentPageMeta = {};
|
|
17
18
|
}
|
|
18
19
|
export function useHead(config) {
|
|
19
|
-
currentHead = mergeHeadConfigs(currentHead, config);
|
|
20
|
+
currentHead = mergeHeadConfigs(currentHead, normalizeHeadKeys(config, { known: USE_HEAD_KEYS, source: "useHead()" }));
|
|
20
21
|
}
|
|
21
22
|
export function mergeHeadConfigs(base, override) {
|
|
22
23
|
return {
|
package/dist/process.js
CHANGED
|
@@ -48,6 +48,7 @@ import { applyHeadInjections, createHeadInjections } from "./head-injection.js";
|
|
|
48
48
|
import { serverDataScope, serverDataTag } from "./server-data.js";
|
|
49
49
|
import { prepareRuntimeConfig } from "./runtime-config-loader.js";
|
|
50
50
|
import { injectRuntimeConfig } from "./runtime-config-server.js";
|
|
51
|
+
import { APP_HEAD_KEYS, normalizeHeadKeys } from "./head-keys.js";
|
|
51
52
|
import { applyHtmlAttrs, cloakStyleFragment, ensureDocumentShell, hasDocumentShell, injectConfigHeadTags, mergeHtmlAttrs, metaDedupKey, startsDocument } from "./document-shell.js";
|
|
52
53
|
import { hasSignalsSyntax, convertSignalDirectivesToAttributes, convertSignalLoopsToAttributes, convertServerLoopAttributesToDirectives, preEvalLiteralReactiveIfs, processSignals } from "./signal-processing.js";
|
|
53
54
|
import { processComponents } from "./component-renderer.js";
|
|
@@ -300,7 +301,7 @@ export async function processDirectives(template, context, filePath, options, de
|
|
|
300
301
|
if (isTopLevel)
|
|
301
302
|
result = processRefAttributes(result);
|
|
302
303
|
if (isTopLevel && options.autoShell && options.buildMode !== "compile") {
|
|
303
|
-
const baseHeadConfig = options.app?.head
|
|
304
|
+
const baseHeadConfig = normalizeHeadKeys(options.app?.head, { known: APP_HEAD_KEYS, source: "app.head" }), runtimeHead = (context.__stx_runtime_head || null) ?? getHeadStatic();
|
|
304
305
|
let pageHeadRaw = (context.__stx_head_raw || "").trim(), pageHeadTitle;
|
|
305
306
|
const rawTitleMatch = pageHeadRaw.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
306
307
|
if (rawTitleMatch) {
|
|
@@ -13,6 +13,7 @@ import { loadStxConfig } from "./config.js";
|
|
|
13
13
|
import { createRouteRuleResolver } from "./route-rules.js";
|
|
14
14
|
import { hydrateTemplateStream } from "./template-hydrator.js";
|
|
15
15
|
import { buildServerApi, discoverServerApi } from "./server-api.js";
|
|
16
|
+
import { APP_HEAD_KEYS, normalizeHeadKeys } from "./head-keys.js";
|
|
16
17
|
import { resolveRuntimeConfig } from "./runtime-config-server.js";
|
|
17
18
|
import { generateRuntimeConfigTypes } from "./runtime-config-loader.js";
|
|
18
19
|
import { layerManifest } from "./application-layers.js";
|
|
@@ -52,7 +53,7 @@ function copyPublicAssets(srcDir, destDir) {
|
|
|
52
53
|
export async function buildForProduction(options = {}) {
|
|
53
54
|
const startTime = Date.now(), root = path.resolve(options.root || process.cwd()), outputDir = path.resolve(root, options.outputDir || ".output");
|
|
54
55
|
console.log("[stx build] Starting production build...");
|
|
55
|
-
const projectConfig = await loadStxConfig(root), componentsDir = path.resolve(root, options.componentsDir ?? projectConfig.componentsDir ?? "components"), partialsDir = path.resolve(root, options.partialsDir ?? projectConfig.partialsDir ?? "partials"), layoutsDir = path.resolve(root, options.layoutsDir ?? projectConfig.layoutsDir ?? "layouts"), publicDir = options.publicDir ?? projectConfig.publicDir ?? "public", headConfigDefault = projectConfig.app?.head
|
|
56
|
+
const projectConfig = await loadStxConfig(root), componentsDir = path.resolve(root, options.componentsDir ?? projectConfig.componentsDir ?? "components"), partialsDir = path.resolve(root, options.partialsDir ?? projectConfig.partialsDir ?? "partials"), layoutsDir = path.resolve(root, options.layoutsDir ?? projectConfig.layoutsDir ?? "layouts"), publicDir = options.publicDir ?? projectConfig.publicDir ?? "public", headConfigDefault = normalizeHeadKeys(projectConfig.app?.head, { known: APP_HEAD_KEYS, source: "app.head" }), colorModeConfig = projectConfig.app?.colorMode, routerContainer = projectConfig.router?.container || "main", routeRules = options.routeRules ?? projectConfig.routeRules ?? {}, resolveRule = createRouteRuleResolver(routeRules), serverApi = options.serverApi ?? projectConfig.serverApi, apiOptions = typeof serverApi === "object" ? serverApi : {};
|
|
56
57
|
if (serverApi)
|
|
57
58
|
discoverServerApi(root, apiOptions);
|
|
58
59
|
if (projectConfig.runtimeConfig)
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{An,Pe,Ti,Ra}from"./chunk-kjkwycce.js";import{Rn,Nr,Ea,Ta,_a}from"./chunk-20tdz0zs.js";import{Ci,$i,Ei,Ca,$a}from"./chunk-wg1ttvs5.js";import{ie,dt,Lr}from"./chunk-krr2vb0s.js";import{Ic,Dc,Oc,Mc,or,Qu}from"./chunk-dhxbjw6k.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-3cp46g4f.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ie(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ie(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=An(n,t);if(a){let s=Pe(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Nr(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,$i as auditBuildOutput,Ci as auditConfig,re as buildPwaAssets,Ei as calculateAuditResult,$a as formatAuditResult,Lr as formatSize,j as generateManifest,_ as generateManifestJson,Ta as generateManifestLink,F as generateOfflinePage,ie as generatePrecacheManifest,dt as generatePrecacheManifestJs,M as generatePwaIcons,Rn as generatePwaTags,An as generateServiceWorker,Ra as generateServiceWorkerAuto,Ea as generateSwRegistrationScript,_a as generateThemeColorMeta,N as getExpectedIconPaths,Pe as getServiceWorkerFileName,Nr as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Ti as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,or as pwaDirectives,Ic as pwaInstallDirective,Oc as pwaOfflineDirective,Mc as pwaPushDirective,Dc as pwaUpdateDirective,Qu as registerPwaDirectives,Ca as runPwaAudit,D as validateManifest};
|
package/dist/ssg.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
3
|
-
`)}class
|
|
2
|
+
import"./chunk-09hhrjk9.js";import"./chunk-x5ks23vx.js";import{Ze,Qe,et,tt,nt,rt}from"./chunk-66k7yxnr.js";import"./chunk-757ec865.js";import"./chunk-tafebmtg.js";import{f,Le,M,q,r,i}from"./chunk-dxb1bbtr.js";import"./chunk-ax58cds3.js";import{Jn}from"./chunk-32y3767j.js";import"./chunk-62r4fa4q.js";import"./chunk-mbbx3w32.js";import"./chunk-4n6c5rp5.js";import"./chunk-g1fxmp9z.js";import"./chunk-xbragnsq.js";import{oe,pt,ft}from"./chunk-ynkc9t68.js";import{xi,Si,ki}from"./chunk-2ewa2sg5.js";import{ut,Kt,Xt}from"./chunk-jjtzm6dn.js";import"./chunk-11ra3sbc.js";import{a}from"./chunk-tfypkw4y.js";import x from"fs";import g from"path";import{createHash as Pt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Rt(t){return Bun.hash(t).toString(16)}function ct(t,s={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let o=new Map,n=t.replace(Dt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(s.minify)h=$t(h);let S=Rt(h);if(!o.has(S))o.set(S,h);let P=s.integrity?` data-stx-integrity="sha384-${Pt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(o,([e,l])=>({hash:e,code:l}));return{html:n,chunks:c}}var kt=new Set(["visible","idle"]);function lt(t){if(!t.includes("data-stx-src="))return t;let s=new Map,o=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,n;while((n=o.exec(t))!==null)s.set(n[1],n[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(kt.has(s.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var Ct=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function J(t){let s=t.trim();if(!s)return null;let o=/^https?:\/\//i.test(s)?s:`https://${s}`;try{return new URL(o).origin+new URL(o).pathname.replace(/\/$/,"")}catch{return null}}function Et(t){for(let s of Ct){let o=t[s];if(!o)continue;let n=J(o);if(n)return{url:n,source:"env",via:s}}return null}function dt(t){if(!t||typeof t!=="object")return null;let s=t,o=s.site?.url??s.url??s.app?.url;return typeof o==="string"?J(o):null}async function It(t){let{existsSync:s}=await import("fs"),o=await import("path");for(let n of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=o.resolve(t,n);if(!s(c))continue;try{let e=await import(c),l=dt(e.default??e);if(l)return l}catch{}}return null}async function gt(t={}){let s=t.cwd??process.cwd(),o=t.env??process.env;if(t.explicit){let l=J(t.explicit);if(l)return{url:l,source:"option"}}let n=dt(t.stxConfig);if(n)return{url:n,source:"stx.config",via:"site.url"};let c=await It(s);if(c)return{url:c,source:"site.config",via:"url"};let e=Et(o);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ht(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
|
+
`)}class mt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,s=""){this.cacheDir=t,this.salt=s}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let s=JSON.parse(await Bun.file(t).text());for(let[o,n]of Object.entries(s))this.cache.set(o,n)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),s={};for(let[o,n]of this.cache)s[o]=n;await Bun.write(t,JSON.stringify(s))}getHash(t,s){let o=x.statSync(t),n=`${this.salt}|${t}:${o.mtimeMs}`;for(let e of s)if(x.existsSync(e)){let l=x.statSync(e);n+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<n.length;e++){let l=n.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,s){let o=this.cache.get(t);if(!o)return null;let n=this.getHash(s,o.dependencies??[]);if(o.hash!==n)return this.cache.delete(t),null;return o.html}set(t,s,o,n){let c=this.getHash(s,o);this.cache.set(t,{hash:c,html:n,generatedAt:Date.now(),dependencies:o})}}class wt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let s=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",s)}async get(t){let s=this.getFilePath(t);if(!await Bun.file(s).exists())return null;try{return JSON.parse(await Bun.file(s).text())}catch{return null}}async set(t,s){let o=this.getFilePath(t);await x.promises.mkdir(g.dirname(o),{recursive:!0}),await Bun.write(o,JSON.stringify(s))}async invalidate(t){let s=this.getFilePath(t);if(await Bun.file(s).exists())await x.promises.unlink(s)}async invalidatePattern(t){let s=g.join(this.cacheDir,"isr");if(!x.existsSync(s))return;let o=await x.promises.readdir(s);for(let n of o){let c=n.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(s,n))}}async needsRevalidation(t){let s=await this.get(t);if(!s)return!0;return Date.now()>s.revalidateAfter}}async function Bt(t){try{let o=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let n=o[1];if(!n.includes("getStaticPaths"))return null;let c=n.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${c[1]}
|
|
6
6
|
})()
|
|
7
|
-
`)()}catch(s){return console.error(`Error extracting static paths from ${t}:`,s),null}}async function
|
|
7
|
+
`)()}catch(s){return console.error(`Error extracting static paths from ${t}:`,s),null}}async function jt(t){let s=[];if(!t.isDynamic)s.push({url:t.pattern,params:{}});else{let o=await Bt(t.filePath);if(!o||o.paths.length===0)return console.warn(`Warning: Dynamic route ${t.pattern} has no getStaticPaths or returned empty paths`),s;for(let n of o.paths){let c=t.pattern;for(let[e,l]of Object.entries(n.params))c=c.replace(`:${e}`,l).replace(`:${e}*`,l);s.push({url:c,params:n.params,props:n.props,revalidate:n.revalidate})}}return s}async function Ft(t){let s=[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"];for(let o of s)if(await Bun.file(o).exists())try{let n=await import(o);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:c,...e}=n;return e}}catch(n){console.error(`Error loading data file ${o}:`,n)}return null}async function Ot(t,s,o){let n=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!n)return null;let c=n[1];if(!c.includes("getStaticProps"))return null;try{let e=c.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
|
|
8
8
|
return (async function getStaticProps() {
|
|
9
9
|
${e[1]}
|
|
10
10
|
})()
|
|
11
|
-
`)(s)}catch(e){return console.error(`Error executing getStaticProps in ${o}:`,e),null}}function
|
|
12
|
-
resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(
|
|
11
|
+
`)(s)}catch(e){return console.error(`Error executing getStaticProps in ${o}:`,e),null}}function Tt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function yt(t,s,o={},n,c){let e=await Bun.file(t.filePath).text(),l=await Ft(t.filePath),w=await Ot(e,s,t.filePath),y={...l||{},...w||{},...o,params:s,$route:{path:t.pattern,params:s}},h=new Set,S=[],P=[],D={...c,...n.partialsDir?{partialsDir:n.partialsDir}:{},...n.componentsDir?{componentsDir:n.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(b)=>{S.push(`${g.relative(process.cwd(),b.templatePath)}: ${b.message}
|
|
12
|
+
resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Tt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let p=await r(e,y,t.filePath,D,h);for(let b of[t.filePath,...h])for(let B of oe(b))h.add(B);if(Object.keys(s).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(s)};else window.__stx_rp=${JSON.stringify(s)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
|
|
13
13
|
</head>`);else p=`${b}
|
|
14
|
-
${p}`}if(p=await q(p,{router:n.router}),p=await f(p),n.minify!==!1)return{html:
|
|
14
|
+
${p}`}if(p=await q(p,{router:n.router}),p=await f(p),n.minify!==!1)return{html:At(p),dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P};return{html:p,dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P}}function At(t){let s=[],o=0,n=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=n.exec(t))!==null){let l=t.slice(o,c.index);s.push(l.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=c[1],y=c[2],h=c[3];y=y.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),s.push(w+y+h),o=c.index+c[0].length}let e=t.slice(o);return s.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),s.join("").trim()}function Lt(t){let s=0;for(let o=0;o<t.length;o++){let n=t.charCodeAt(o);s=(s<<5)-s+n,s=s&s}return`"${Math.abs(s).toString(36)}"`}function Mt(t,s,o,n){if(o?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(s))return!0;return n.some((c)=>{if(c instanceof RegExp)return c.test(t);return c.endsWith("/")?t===c.slice(0,-1)||t.startsWith(c):t===c})}function Ut(t,s){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
15
15
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
16
16
|
${t.map((n)=>{let c=new URL(n.loc,s).href,e=` <url>
|
|
17
17
|
<loc>${I(c)}</loc>`;if(n.lastmod)e+=`
|
|
@@ -20,7 +20,7 @@ ${t.map((n)=>{let c=new URL(n.loc,s).href,e=` <url>
|
|
|
20
20
|
<priority>${n.priority}</priority>`;return e+=`
|
|
21
21
|
</url>`,e}).join(`
|
|
22
22
|
`)}
|
|
23
|
-
</urlset>`}function I(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function
|
|
23
|
+
</urlset>`}function I(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function _t(t,s){let o=s.map((n)=>{let c=" <item>";if(c+=`
|
|
24
24
|
<title>${I(n.title)}</title>`,c+=`
|
|
25
25
|
<link>${I(n.link)}</link>`,n.description)c+=`
|
|
26
26
|
<description>${I(n.description)}</description>`;if(n.pubDate)c+=`
|
|
@@ -41,16 +41,16 @@ ${t.map((n)=>{let c=new URL(n.loc,s).href,e=` <url>
|
|
|
41
41
|
${o.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function
|
|
45
|
-
const validate = ${
|
|
44
|
+
</rss>`}async function Gt(t={}){let s=Date.now();ft();let o=await i(process.cwd()),n=o.build||{},c=await gt({explicit:t.domain||n.domain,stxConfig:o});if(c.source==="fallback"&&(t.sitemap??n.sitemap??!0))console.warn(ht());let e={router:t.router??o?.router??{},pagesDir:t.pagesDir||n.pagesDir||"pages",outputDir:t.outputDir||n.outputDir||"dist",baseUrl:t.baseUrl||n.baseUrl||"/",domain:c.url,revalidate:t.revalidate??n.revalidate??!1,sitemap:t.sitemap??n.sitemap??!0,sitemapExclude:t.sitemapExclude||n.sitemapExclude||[],robots:t.robots??n.robots??!0,rss:t.rss??n.rss??!1,concurrency:t.concurrency||n.concurrency||10,cache:t.cache??n.cache??!0,cacheDir:t.cacheDir||n.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??n.minify??!0,generate404:t.generate404??n.generate404??!0,publicDir:t.publicDir||n.publicDir||"public",trailingSlash:t.trailingSlash??n.trailingSlash??!1,cleanOutput:t.cleanOutput??n.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||o?.partialsDir||"",componentsDir:t.componentsDir||o?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-bvae0b17.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-0bsjrj8s.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new mt(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-bvae0b17.js");await u('<div class="bg-black"></div>')}catch{}Ze();let St=o?.routeMiddleware?.dir||"middleware";await et(process.cwd(),St);let H=Qe();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let xt=o?.routeMiddleware?.global||[];ki(o?.layoutsDir,a(process.cwd()));let K=M(".",{pagesDir:e.pagesDir,pagesDirs:o?._layerPageDirs});console.log(`Found ${K.length} routes`);let G=[];for(let u of K){let m=await jt(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<G.length;u+=e.concurrency)X.push(G.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:vt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Wt(j),bt=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],it=[...xt,...bt];if(it.length>0){let C=tt(d,L,F||{}),O=nt(C,null,void 0,{isServer:!0}),E=await rt(it,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=qt(String(R),d),T=Jt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let st=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(st)try{if(!await Function("route",`
|
|
45
|
+
const validate = ${st[1]};
|
|
46
46
|
return validate(route);
|
|
47
|
-
`)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,
|
|
47
|
+
`)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,at=!1;if(e.cache){if(k=B.get(d,v.filePath),k)at=!0,l.cachedCount++}if(!k){let C=await yt(v,L,vt,e,o);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
48
48
|
${C.includeFailures.join(`
|
|
49
49
|
`)}
|
|
50
50
|
Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&C.serverScriptFailures.length>0)throw Error(`${C.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
|
51
51
|
${C.serverScriptFailures.join(`
|
|
52
52
|
`)}
|
|
53
|
-
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let U;if(e.trailingSlash)U=g.join(e.outputDir,d,"index.html");else U=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=
|
|
53
|
+
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let U;if(e.trailingSlash)U=g.join(e.outputDir,d,"index.html");else U=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=ct(k,{integrity:e.integrityIslands,minify:e.minify});if(O.length>0){let E=g.join(e.outputDir,"_stx","islands");await x.promises.mkdir(E,{recursive:!0});for(let R of O){let _=g.join(E,`${R.hash}.js`);if(!await Bun.file(_).exists())await Bun.write(_,R.code);if(!w.has(R.hash)){w.add(R.hash);let T=Buffer.byteLength(R.code,"utf8");y+=T,h[R.hash]={bytes:T,file:`/_stx/islands/${R.hash}.js`}}}if(S[d]=O.map((R)=>R.hash),k=C,e.prefetchIslands)k=lt(k)}}if(await x.promises.mkdir(g.dirname(U),{recursive:!0}),await Bun.write(U,k),!Mt(d,k,F,e.sitemapExclude))A.push({loc:d,lastmod:new Date().toISOString().split("T")[0],priority:d==="/"?1:0.8});let ot={route:d,outputPath:U,size:Buffer.byteLength(k,"utf8"),cached:at};if(Q!==!1)ot.revalidateAt=Date.now()+Q*1000;l.pages.push(ot),l.successCount++,await e.hooks.onPageEnd?.(d,k)}catch(j){l.failedCount++,l.errors.push({route:d,error:j}),await e.hooks.onError?.(j,d),console.error(`Error generating ${d}:`,j)}}));let Y=pt();if(Y.length>0){let u=Y.map((m)=>`${m.filePath}: ${m.message}`).join(`
|
|
54
54
|
`);throw Error(`Client script bundling failed:
|
|
55
55
|
${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.stx");if(await Bun.file(u).exists()){let m=new Set,v={...o,debug:!1,cache:!1},d=await r(await Bun.file(u).text(),{},u,v,m);await Bun.write(g.join(e.outputDir,"404.html"),d)}else await Bun.write(g.join(e.outputDir,"404.html"),`<!DOCTYPE html>
|
|
56
56
|
<html lang="en">
|
|
@@ -73,7 +73,7 @@ ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.
|
|
|
73
73
|
<a href="/">Go home</a>
|
|
74
74
|
</div>
|
|
75
75
|
</body>
|
|
76
|
-
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...o,debug:!1,cache:!1},L=await r(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...o,debug:!1,cache:!1},v=await r(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=
|
|
76
|
+
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...o,debug:!1,cache:!1},L=await r(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...o,debug:!1,cache:!1},v=await r(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Ut(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=Jn({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=_t(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let N=xi(e.outputDir);if(N.assets>0)console.log(`Externalized ${N.assets} asset(s) from ${N.pages} page(s) (${(N.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Si(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} repeated asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&x.existsSync(e.publicDir))await V(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let Z=Xt();if(Z)await V(Z,g.join(e.outputDir,Kt)),console.log(`Copied assets from ${ut}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-s,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:h,pages:S};await Bun.write(g.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(D,null,2))}await e.hooks.onBuildEnd?.(l);let P=l.islandChunks?`
|
|
77
77
|
Island chunks: ${l.islandChunks.count} (${(l.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
78
78
|
Build complete!
|
|
79
79
|
Total: ${l.totalPages} pages
|
|
@@ -81,8 +81,8 @@ Build complete!
|
|
|
81
81
|
Cached: ${l.cachedCount}
|
|
82
82
|
Failed: ${l.failedCount}
|
|
83
83
|
Time: ${l.buildTime}ms${P}
|
|
84
|
-
`),l}async function V(t,s){await x.promises.mkdir(s,{recursive:!0});let o=await x.promises.readdir(t,{withFileTypes:!0});for(let n of o){let c=g.join(t,n.name),e=g.join(s,n.name);if(n.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await V(c,e);else await x.promises.copyFile(c,e)}}function
|
|
85
|
-
`)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));n[D]=p}}}let e=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let h=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:h})}return{content:e,data:n,toc:l}}}}function
|
|
84
|
+
`),l}async function V(t,s){await x.promises.mkdir(s,{recursive:!0});let o=await x.promises.readdir(t,{withFileTypes:!0});for(let n of o){let c=g.join(t,n.name),e=g.join(s,n.name);if(n.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await V(c,e);else await x.promises.copyFile(c,e)}}function Nt(t={}){let s=t.cacheDir||a(process.cwd(),"ssg-cache"),o=new wt(s),n=t.revalidate||3600;return{async get(c){let e=await o.get(c);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(c).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${n}, stale-while-revalidate=${n*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(c){let l=M(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>c.match(P.regex)!==null);if(!l){console.warn(`Route not found for revalidation: ${c}`);return}let w=c.match(l.regex),y={};if(w)l.params.forEach((P,D)=>{y[P]=w[D+1]});let h=await i(),{html:S}=await yt(l,y,{},t,h);await o.set(c,{html:S,generatedAt:Date.now(),revalidateAfter:Date.now()+n*1000,etag:Lt(S)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await o.invalidate(c);else await o.invalidatePattern(c)}}}function zt(t){return async()=>({paths:await t(),fallback:!1})}function Ht(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let s=await Bun.file(t).text(),o=s.match(/^---\n([\s\S]*?)\n---/),n={},c=s;if(o){let h=o[1];c=s.slice(o[0].length).trim();for(let S of h.split(`
|
|
85
|
+
`)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));n[D]=p}}}let e=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let h=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:h})}return{content:e,data:n,toc:l}}}}function Wt(t){return Le(t)}function qt(t,s){return`<!DOCTYPE html>
|
|
86
86
|
<html>
|
|
87
87
|
<head>
|
|
88
88
|
<meta charset="utf-8">
|
|
@@ -94,4 +94,4 @@ Build complete!
|
|
|
94
94
|
<p>Redirecting to <a href="${t}">${t}</a>...</p>
|
|
95
95
|
<script>window.location.replace('${t}')</script>
|
|
96
96
|
</body>
|
|
97
|
-
</html>`}function Jt(t,s){if(t==="/"||t==="")return g.join(s.outputDir,"index.html");let o=t.replace(/^\/|\/$/g,"");if(s.trailingSlash)return g.join(s.outputDir,o,"index.html");return g.join(s.outputDir,`${o}.html`)}var
|
|
97
|
+
</html>`}function Jt(t,s){if(t==="/"||t==="")return g.join(s.outputDir,"index.html");let o=t.replace(/^\/|\/$/g,"");if(s.trailingSlash)return g.join(s.outputDir,o,"index.html");return g.join(s.outputDir,`${o}.html`)}var ye={generateStaticSite:Gt,createISRHandler:Nt,defineStaticPaths:zt,createMarkdownLoader:Ht};export{Nt as createISRHandler,Ht as createMarkdownLoader,Tt as declaresPageAction,ye as default,zt as defineStaticPaths,Gt as generateStaticSite,Mt as isExcludedFromSitemap};
|
|
@@ -10,6 +10,7 @@ export { STX_ENGINE_BINDING_NAMES };
|
|
|
10
10
|
const ENGINE_BINDINGS = new Set(STX_ENGINE_BINDING_NAMES), CONTEXT_RESERVED_BINDINGS = new Set(["props", "$props", "defineProps"]), STX_RUNTIME_SPECIFIERS = new Set(["stx", "@stacksjs/stx"]);
|
|
11
11
|
import { findMatchingDelimiter } from "./parser/tokenizer.js";
|
|
12
12
|
import { mergeHeadConfigs, seoMetaToHeadConfig } from "./head.js";
|
|
13
|
+
import { normalizeHeadKeys, USE_HEAD_KEYS } from "./head-keys.js";
|
|
13
14
|
import { getPublicEnvDefine } from "./public-env.js";
|
|
14
15
|
import { isUsableParamName, safeEvaluate } from "./safe-evaluator.js";
|
|
15
16
|
import { responseBindings } from "./page-response.js";
|
|
@@ -398,7 +399,7 @@ export async function extractVariables(scriptContent, context, filePath, options
|
|
|
398
399
|
};
|
|
399
400
|
}, useRouter = () => ({ push: (_to) => {}, replace: (_to) => {}, back: () => {}, forward: () => {}, go: (_n) => {} }), useHead = (head) => {
|
|
400
401
|
const existing = context.__stx_runtime_head || {};
|
|
401
|
-
context.__stx_runtime_head = mergeHeadConfigs(existing, head || {});
|
|
402
|
+
context.__stx_runtime_head = mergeHeadConfigs(existing, normalizeHeadKeys(head || {}, { known: USE_HEAD_KEYS, source: "useHead()" }));
|
|
402
403
|
}, useSeoMeta = (meta) => {
|
|
403
404
|
useHead(seoMetaToHeadConfig(meta || {}));
|
|
404
405
|
}, ref = (val) => ({ value: val }), reactive = (obj) => obj, computed = (fn) => ({ value: typeof fn === "function" ? fn() : fn }), watch = (_source, _cb) => {}, onMounted = (_fn) => {}, onUnmounted = (_fn) => {}, nextTick = (fn) => fn ? fn() : Promise.resolve(), defineEmits = (_events) => (_event, ..._args) => {}, defineExpose = (_exposed) => {}, provide = (_key, _value) => {}, inject = (_key, defaultValue) => defaultValue, useColorMode = () => ({ value: "light" }), useDark = () => state(!1), useMediaQuery = (_query) => state(!1), useScrollLock = () => state(!1), usePreferredDark = () => useMediaQuery("(prefers-color-scheme: dark)"), usePreferredLight = () => useMediaQuery("(prefers-color-scheme: light)"), usePreferredReducedMotion = () => useMediaQuery("(prefers-reduced-motion: reduce)"), usePreferredContrast = () => useMediaQuery("(prefers-contrast: more)"), mockWindow = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.419",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"dependencies": {
|
|
123
123
|
"@stacksjs/ts-css": "^0.3.2",
|
|
124
124
|
"@stacksjs/clapp": "^0.2.16",
|
|
125
|
-
"@stacksjs/desktop": "0.2.
|
|
126
|
-
"@stacksjs/sanitizer": "0.2.
|
|
125
|
+
"@stacksjs/desktop": "0.2.419",
|
|
126
|
+
"@stacksjs/sanitizer": "0.2.419",
|
|
127
127
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
128
|
-
"bun-plugin-stx": "0.2.
|
|
128
|
+
"bun-plugin-stx": "0.2.419",
|
|
129
129
|
"bunfig": "^0.15.19",
|
|
130
|
-
"stx-router": "0.2.
|
|
130
|
+
"stx-router": "0.2.419",
|
|
131
131
|
"ts-broadcasting": "^0.0.11",
|
|
132
132
|
"ts-images": "^0.2.22",
|
|
133
133
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-072f6hnz.js
DELETED
package/dist/chunk-0x076wz1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{wr,xr,Sr,Jo,kr,Cr,Yo,$r,Er,ri,Zo}from"./chunk-wgzxmh7w.js";export{wr as VideoProcessorCache,ri as analyzeVideo,Jo as clearVideoCache,Er as generateDASHManifest,$r as generateHLSManifest,kr as generatePoster,Yo as generateSpriteSheet,Cr as generateThumbnails,xr as getCachedVideoResult,Zo as processVideo,Sr as setCachedVideoResult};
|
package/dist/chunk-2gfj59pt.js
DELETED
package/dist/chunk-2gntnw7e.js
DELETED
package/dist/chunk-2hvvwhmv.js
DELETED
package/dist/chunk-31a8eh0j.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{t,o,cn,ks,ve,l}from"./chunk-wweasgq9.js";import T from"path";function w(e,r,n,s=0){let a=0,i=s,u=null,c=0,p=!1;while(i<e.length){let h=e[i];if(u&&p){p=!1,i++;continue}if(u&&h==="\\"){p=!0,i++;continue}if(p=!1,(h==='"'||h==="'"||h==="`")&&!u){u=h,i++;continue}if(h===u&&u!=="`"){u=null,i++;continue}if(u==="`"&&h==="$"&&e[i+1]==="{"){c++,i+=2;continue}if(c>0&&h==="}"){c--,i++;continue}if(h==="`"&&u==="`"&&c===0){u=null,i++;continue}if(u){i++;continue}if(h===r)a++;else if(h===n){if(a--,a===0)return i}i++}return-1}function vs(e,r){let n=[];r.lastIndex=0;let s;while((s=r.exec(e))!==null){let a=s.index,i=a+s[0].length-1,u=w(e,"(",")",i);if(u===-1){n.push({start:a,end:-1,args:"",call:e.slice(a,Math.min(e.length,a+80))}),r.lastIndex=i+1;continue}n.push({start:a,end:u+1,args:e.slice(i+1,u),call:e.slice(a,u+1)}),r.lastIndex=u+1}return n}function qe(e,r,n,s){let a="",i=0;for(let u of vs(e,r)){if(a+=e.slice(i,u.start),u.end===-1){a+=s(u.call),i=u.start;continue}a+=n(u.args,u.call),i=u.end}return a+e.slice(i)}function Xe(e){let r=[],n=0,s=null,a="";for(let i=0;i<e.length;i++){let u=e[i];if(s){if(a+=u,u==="\\"&&i+1<e.length){a+=e[++i];continue}if(u===s)s=null;continue}if(u==="'"||u==='"'||u==="`")s=u;else if(u==="("||u==="["||u==="{")n++;else if(u===")"||u==="]"||u==="}")n--;else if(u===","&&n===0){r.push(a.trim()),a="";continue}a+=u}if(a.trim())r.push(a.trim());return r}function y(e){let r=e.trim(),n=r[0];if(n!=="'"&&n!=='"'&&n!=="`"||r.length<2||r.at(-1)!==n)return null;let s="";for(let a=1;a<r.length-1;a++){let i=r[a];if(i==="\\"&&a+1<r.length-1){let u=r[++a];s+=u==="n"?`
|
|
3
|
-
`:u==="t"?"\t":u;continue}if(i===n)return null;if(n==="`"&&i==="$"&&r[a+1]==="{")return null;s+=i}return s}var b=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Ke(e,r){let n=e.trim();if(!n)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let s=cn(n);if(s)return{ok:!1,message:`the expression is not allowed (${s})`,code:t.UNSAFE_EXPRESSION};let a=ks(r),i;try{i=l(n,Object.keys(a))(...Object.values(a))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(i!==void 0&&i!==null)return{ok:!0,value:i};let u=[...new Set(ve(n))].filter((c)=>!b.has(c)&&!(c in a)&&!(c in globalThis));if(u.length>0)return{ok:!1,message:`${u.map((p)=>`"${p}"`).join(", ")} ${u.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(i===void 0&&(n.startsWith("{")||n.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:i}}function ue(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function be(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function v(e){if(!e)return"";return T.isAbsolute(e)?T.relative(process.cwd(),e)||e:e}function f(e){let r=e.replace(/\s+/g," ").trim();return r.length>80?`${r.slice(0,77)}...`:r}function k(e,r,n,s,a=t.EVALUATION_ERROR){let i=s?` in ${v(s)}`:"";return console.warn(`[stx] ${f(r)}${i}: ${n}`),o(e,`${f(r)}: ${n}`,a)}function Gn(e,r,n){let s=n?` in ${v(n)}`:"";console.warn(`[stx] ${f(e)}${s}: ${r}`)}var A=["og:","article:","book:","profile:","fb:","music:","video:"],E=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function on(e,r){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let n=I(e[0],r);if(typeof n!=="string")return n;let s;if(e.length===2){let i=S(e[1],r);if(typeof i!=="string")return i;s=i}else{let i=n.includes(":")?n.slice(n.indexOf(":")+1):n,u=r.openGraph,c=r[i]??(be(u)?u[i]:void 0);s=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!s)return{kind:"empty"};return{kind:"tag",tag:A.some((i)=>n.startsWith(i))?{property:n,content:s}:{name:n,content:s}}}function I(e,r){let n=y(e);if(n!==null)return n.trim()?n:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(E.test(e.trim()))return e.trim();let s=Ke(e,r);if(!s.ok)return{kind:"error",message:`meta name: ${s.message}`,code:s.code};if(typeof s.value!=="string"||!s.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${ue(s.value)}`,code:t.TYPE_ERROR};return s.value}function S(e,r){let n=y(e);if(n!==null)return n;let s=Ke(e,r);if(!s.ok)return{kind:"error",message:s.message,code:s.code};let a=s.value;if(a===void 0||a===null||a===!1)return"";if(Array.isArray(a))return a.filter((i)=>i!==void 0&&i!==null&&i!=="").map(String).join(", ");if(typeof a==="object"&&!(a instanceof Date))return{kind:"error",message:`the content must be text, got ${ue(a)}`,code:t.TYPE_ERROR};return String(a)}var d={},R=[],g={};function ws(){return d}function Bu(){return g}function Fu(){d={},R.length=0,g={}}function po(e){d=de(d,e)}function de(e,r){return{title:r.title??e.title,titleTemplate:r.titleTemplate??e.titleTemplate,base:r.base??e.base,meta:[...e.meta||[],...r.meta||[]],link:[...e.link||[],...r.link||[]],script:[...e.script||[],...r.script||[]],style:[...e.style||[],...r.style||[]],htmlAttrs:{...e.htmlAttrs,...r.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...r.bodyAttrs}}}function vc(e){po(Jn(e))}function Jn(e){let r=[];if(e.description)r.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;r.push({name:"keywords",content:p})}if(e.author)r.push({name:"author",content:e.author});if(e.robots)r.push({name:"robots",content:e.robots});let n=e.ogTitle??e.title,s=e.ogDescription??e.description;if(n)r.push({property:"og:title",content:n});if(s)r.push({property:"og:description",content:s});if(e.ogImage){if(r.push({property:"og:image",content:e.ogImage}),e.ogImageType)r.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)r.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)r.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)r.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)r.push({property:"og:url",content:e.ogUrl});if(e.ogType)r.push({property:"og:type",content:e.ogType});if(e.ogSiteName)r.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)r.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)r.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)r.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)r.push({property:"profile:username",content:e.profileUsername});let a=e.twitterTitle??e.title,i=e.twitterDescription??e.description,u=e.twitterImage??e.ogImage;if(e.twitterCard)r.push({name:"twitter:card",content:e.twitterCard});if(a)r.push({name:"twitter:title",content:a});if(i)r.push({name:"twitter:description",content:i});if(u){r.push({name:"twitter:image",content:u});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)r.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)r.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)r.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)r.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)r.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)r.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)r.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)r.push({property:"article:tag",content:p});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:r,link:c}}function zu(e){if(g={...g,...e},e.title||e.description)vc({title:e.title,description:e.description})}function Hu(e){let r=typeof e==="function"?e():e;po({title:r})}function Vu(e=d){let r=[];if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);r.push(`<title>${m(n)}</title>`)}if(e.base){let n=Object.entries(e.base).map(([s,a])=>`${s}="${m(a)}"`).join(" ");r.push(`<base ${n}>`)}for(let n of e.meta||[]){let s=Object.entries(n).filter(([a,i])=>i!==void 0).map(([a,i])=>`${a==="httpEquiv"?"http-equiv":a}="${m(String(i))}"`).join(" ");r.push(`<meta ${s}>`)}for(let n of e.link||[]){let s=Object.entries(n).filter(([a,i])=>i!==void 0).map(([a,i])=>`${a}="${m(String(i))}"`).join(" ");r.push(`<link ${s}>`)}for(let n of e.script||[]){let{content:s,...a}=n,i=Object.entries(a).filter(([u,c])=>c!==void 0).map(([u,c])=>{if(typeof c==="boolean")return c?u:"";return`${u}="${m(String(c))}"`}).filter(Boolean).join(" ");if(s)r.push(`<script ${i}>${s}</script>`);else r.push(`<script ${i}></script>`)}for(let n of e.style||[]){let s=n.type?` type="${n.type}"`:"";r.push(`<style${s}>${n.content}</style>`)}return r.join(`
|
|
4
|
-
`)}function Uu(e=d){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([r,n])=>`${r}="${m(n)}"`).join(" ")}function Wu(e=d){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([r,n])=>`${r}="${m(n)}"`).join(" ")}function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qu(e=d){if(typeof document>"u")return;if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);document.title=r}for(let r of e.meta||[]){let n=r.name?`meta[name="${r.name}"]`:r.property?`meta[property="${r.property}"]`:null;if(n){let s=document.querySelector(n);if(!s){if(s=document.createElement("meta"),r.name)s.setAttribute("name",r.name);if(r.property)s.setAttribute("property",r.property);document.head.appendChild(s)}s.setAttribute("content",r.content)}}for(let r of e.link||[]){let n=`link[rel="${r.rel}"]${r.href?`[href="${r.href}"]`:""}`,s=document.querySelector(n);if(!s)s=document.createElement("link"),document.head.appendChild(s);for(let[a,i]of Object.entries(r))if(i!==void 0)s.setAttribute(a,String(i))}if(e.htmlAttrs)for(let[r,n]of Object.entries(e.htmlAttrs))if(r==="class")for(let s of String(n).split(/\s+/).filter(Boolean))document.documentElement.classList.add(s);else document.documentElement.setAttribute(r,n);if(e.bodyAttrs)for(let[r,n]of Object.entries(e.bodyAttrs))document.body.setAttribute(r,n)}function Xu(e){let r="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(s,a)=>(r+=a.trim()+`
|
|
5
|
-
`,"")),headContent:r.trim()}}function Ku(e,r){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(n,s,a,i)=>{let u=s?a:r[(i||"").trim()]??i,c=r.__stx_runtime_head??{};return r.__stx_runtime_head=de(c,{title:u}),""})}function Gu(e,r,n=""){if(!e.includes("@meta"))return e;return qe(e,/(?<![\w$@])@meta\s*\(/g,(s,a)=>{let i=on(Xe(s),r);if(i.kind==="error")return k("Meta",a,i.message,n,i.code);if(i.kind==="tag"){let u=r.__stx_runtime_head??{};r.__stx_runtime_head=de(u,{meta:[i.tag]})}return""},(s)=>k("Meta",s,"the call has no closing parenthesis",n,t.INVALID_DIRECTIVE_SYNTAX))}export{w,vs,qe,Xe,Ke,ue,be,k,Gn,on,ws,Bu,Fu,po,de,vc,Jn,zu,Hu,Vu,Uu,Wu,qu,Xu,Ku,Gu};
|
package/dist/chunk-4bhertga.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ms,hs,ys,bs,qn,Xn,Ou,Mu,Nu,Lu,Kn,ju}from"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";export{ju as generateDefaultRobotsTxt,Kn as generateRobotsTxt,Mu as generateSitemap,Nu as generateSitemapIndex,bs as injectSeoTags,qn as metaDirective,ms as processMetaDirectives,ys as processSeoDirective,hs as processStructuredData,Ou as registerSeoDirectives,Lu as scanForSitemapEntries,Xn as structuredDataDirective};
|
package/dist/chunk-4s9dypby.js
DELETED
package/dist/chunk-5z56g0n4.js
DELETED
package/dist/chunk-6ad0nseq.js
DELETED
package/dist/chunk-7eazcxzf.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Qt,Ka,Xr}from"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import{ve}from"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{ve as freeIdentifiers,Xr as processComponents,Ka as processESImports,Qt as rendersAsElement};
|
package/dist/chunk-7hy29tcy.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ho,nl,Vo,Uo,rl,sl}from"./chunk-94ky725r.js";import"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{sl as applySlots,rl as extractSlotContent,nl as parseSlotElement,Ho as parseSlots,Uo as processSlots,Vo as renderSlot};
|
package/dist/chunk-8fyqbq14.js
DELETED
package/dist/chunk-92xzpt6p.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xt,Qr,Vi,oc}from"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{oc as declareBareLoopHead,xt as parseLoopBinding,Vi as processLoops,Qr as reportDeferredLoopWarnings};
|
package/dist/chunk-9kmmafp4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{L,j,B,Pt,G,se,xn,zo,_e,ct,It,Dt,Ot,F,Mt,Nt,Sn}from"./chunk-vfdwvt23.js";export{j as DEFAULT_FORMATS,B as DEFAULT_QUALITY,L as DEFAULT_WIDTHS,Sn as ImageProcessingError,Nt as formatSize,ct as generateSizes,_e as generateSrcSet,It as getFallbackVariant,xn as getImageMetadata,F as getMimeType,Mt as getTotalSize,Dt as groupVariantsByFormat,G as isImageBackendAvailable,Ot as isImageFile,Pt as isSharpAvailable,se as processImage,zo as resizeAndConvert};
|
package/dist/chunk-atgwc7r7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ws,Bu,Fu,po,de,vc,Jn,zu,Hu,Vu,Uu,Wu,qu,Xu,Ku,Gu}from"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";export{qu as applyHead,zu as definePageMeta,ws as getHead,Bu as getPageMeta,de as mergeHeadConfigs,Xu as processHeadDirective,Gu as processMetaDirective,Ku as processTitleDirective,Wu as renderBodyAttrs,Vu as renderHead,Uu as renderHtmlAttrs,Fu as resetHead,Jn as seoMetaToHeadConfig,po as useHead,Hu as usePageTitle,vc as useSeoMeta,Hu as useTitle};
|
package/dist/chunk-bs6y5wy2.js
DELETED
package/dist/chunk-ccg6xjr1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{kn,Ht,Bl}from"./chunk-y9t55tv7.js";import{z,Cn,Vt,_r,Rr,$n,Fl,zl,Hl,Ut,Wt,Ar,En,Vl}from"./chunk-ev8bhsc0.js";import"./chunk-bk5ndwv3.js";export{_r as batch,Bl as default,Cn as derived,Vt as effect,kn as generateSignalsRuntime,Ht as generateSignalsRuntimeDev,Wt as isDerived,Ut as isSignal,$n as onDestroy,Rr as onMount,En as peek,Hl as pendingLifecycleCounts,zl as runDestroyCallbacks,Fl as runMountCallbacks,z as state,Ar as untrack,Vl as useOptimistic};
|
package/dist/chunk-ckv4aty5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{wt,Qa,ec,tc,nc,rc,d,sc,Zr,ic,zi,Hi}from"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{wt as STX_ENGINE_BINDING_NAMES,Zr as convertToCommonJS,zi as extractScriptFromTemplate,d as extractVariables,Hi as hasVariables,sc as isCompleteImport,rc as isMissingBindingFailure,tc as isModuleResolutionFailure,nc as isSyntaxFailure,ic as splitDeclaration,Qa as stripTypeScript,ec as withoutStxReferrer};
|
package/dist/chunk-dbh7h0kt.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{mt,Mr,Nr,Lr,lu,jr}from"./chunk-mj6fme15.js";import"./chunk-e2m674vf.js";import"./chunk-7q1yy18q.js";import"./chunk-76japd6k.js";export{Nr as buildServerApi,lu as createServerApi,mt as discoverServerApi,Mr as generateApiTypes,jr as isServerApiSource,Lr as productionApiDispatcher};
|
package/dist/chunk-dhqkg0ph.js
DELETED
package/dist/chunk-ettat5ah.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ru,he,Ui,Au,es,ts,ns}from"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{Au as clearOnceStore,Ui as onceStore,he as partialsCache,es as processIncludes,ts as processStackPushDirectives,ns as processStackReplacements,Ru as resetUnscopedSignalWarnings};
|
package/dist/chunk-f4ws0qcd.js
DELETED
package/dist/chunk-f97v10zr.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$o,Eo}from"./chunk-gfm7g98y.js";import"./chunk-sjjc670z.js";import"./chunk-h8f18cc5.js";import"./chunk-kds79hq3.js";import"./chunk-qmzwhtr2.js";import"./chunk-jfjym18d.js";import"./chunk-wz8hyh8h.js";import"./chunk-fr8jq2ys.js";import"./chunk-3f5td68v.js";import"./chunk-yrbzsrde.js";import"./chunk-3senpdjt.js";import{Xs}from"./chunk-d6h9rpm4.js";import"./chunk-dym1eteb.js";import"./chunk-vfdwvt23.js";import"./chunk-94ky725r.js";import"./chunk-d0ynfema.js";import"./chunk-wgzxmh7w.js";import"./chunk-9yt899e7.js";import"./chunk-g947brd0.js";import"./chunk-9r5ycpdg.js";import"./chunk-3aqe7wy7.js";import"./chunk-5vzamjf6.js";import"./chunk-3wmxb126.js";import"./chunk-w5zmvn7b.js";import"./chunk-vyfg2qd2.js";import"./chunk-9af8qbwb.js";import"./chunk-xt6d3zws.js";import"./chunk-c8p4v1rd.js";import"./chunk-psmdbcbc.js";import"./chunk-y9t55tv7.js";import"./chunk-v15g9jjh.js";import"./chunk-ka8x4sw6.js";import"./chunk-5fwy3xap.js";import"./chunk-jgsgd6rt.js";import"./chunk-mj6fme15.js";import{ge,Jt,Yt,q,d,r,Hn,A,i,ce}from"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{Hn as buildWebComponents,Yt as cacheTemplate,Jt as checkCache,Xs as classifyAllScripts,$o as createMiddleware,Eo as createRoute,A as defaultConfig,d as extractVariables,q as injectRouterScript,i as loadStxConfig,ge as processClientScript,r as processDirectives,ce as readMarkdownFile};
|
package/dist/chunk-fe5st320.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ul,ai,ba,Wl,ql,Xl,Kl,Gl,va,wa,Jl,Yl,Zl,Ql}from"./chunk-v15g9jjh.js";import"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{ba as SUSPENSE_RESOLVER_RUNTIME,ai as buildSuspenseResolveScript,Gl as createStreamRenderer,Xl as extractStreamBoundaries,Ql as generateHydrationRuntime,wa as islandDirective,Yl as processSectionDirectives,ql as processStreamDirectives,Jl as registerStreamingDirectives,Wl as renderStreamingPage,Ul as streamTemplate,Kl as streamTemplateSimple,Zl as streamToResponse,va as streamingSuspenseDirective};
|
package/dist/chunk-fet3hce8.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tr,ll,ul}from"./chunk-5vzamjf6.js";import"./chunk-jgsgd6rt.js";import"./chunk-mj6fme15.js";import"./chunk-1680nbq4.js";import"./chunk-xvn3sv3v.js";import"./chunk-fxhvkenf.js";import"./chunk-e2m674vf.js";import"./chunk-vepc9rbt.js";import"./chunk-7q1yy18q.js";import"./chunk-0xgf3xgy.js";import"./chunk-31a8eh0j.js";import"./chunk-wweasgq9.js";import"./chunk-vdqa5gt7.js";import"./chunk-bk5ndwv3.js";import"./chunk-76japd6k.js";import"./chunk-865xvpp2.js";export{ul as clearComposableCache,ll as getComposableScript,Tr as listComposableModules};
|
package/dist/chunk-fq7128p1.js
DELETED