@stacksjs/stx 0.2.332 → 0.2.334
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/builtins/image-worker.d.ts +17 -0
- package/dist/builtins/image-worker.js +12 -1
- package/dist/caching.d.ts +17 -0
- package/dist/caching.js +24 -0
- package/dist/chunk-046dp691.js +2 -0
- package/dist/{chunk-kx30cykj.js → chunk-08w4gtyf.js} +3 -3
- package/dist/{chunk-be5es9s3.js → chunk-09jdvqhg.js} +2 -2
- package/dist/{chunk-7ds14xsn.js → chunk-0vv5s039.js} +1 -1
- package/dist/chunk-1brnvyhv.js +2 -0
- package/dist/{chunk-3n9rvrk1.js → chunk-1ebyt1ba.js} +1 -1
- package/dist/{chunk-wx3kf6tm.js → chunk-1hzgxk2m.js} +1 -1
- package/dist/chunk-1jzdpvvx.js +2 -0
- package/dist/{chunk-mnsaf11z.js → chunk-1tva0f8f.js} +1 -1
- package/dist/{chunk-bsa8pxtc.js → chunk-24b4711v.js} +1 -1
- package/dist/{chunk-wv9v9mj9.js → chunk-27xfkzks.js} +1 -1
- package/dist/{chunk-mywrt0dp.js → chunk-2cm03y4y.js} +1 -1
- package/dist/{chunk-tp6wkx7g.js → chunk-2tjk867y.js} +1 -1
- package/dist/{chunk-am42axf7.js → chunk-2vgkc0kg.js} +1 -1
- package/dist/{chunk-w4ckece4.js → chunk-2ye35vms.js} +10 -10
- package/dist/{chunk-ys8sm556.js → chunk-3ntf8f5e.js} +1 -1
- package/dist/{chunk-33rznhw1.js → chunk-42en0cxm.js} +1 -1
- package/dist/{chunk-09zjty4k.js → chunk-4jdj52c5.js} +1 -1
- package/dist/{chunk-424e1tyj.js → chunk-4k0ce745.js} +1 -1
- package/dist/chunk-4tnxnzja.js +2 -0
- package/dist/{chunk-peqad61h.js → chunk-4ty8j3xn.js} +1 -1
- package/dist/{chunk-gwrrs1qh.js → chunk-5swem3qy.js} +1 -1
- package/dist/chunk-63yfp05p.js +2 -0
- package/dist/{chunk-afsy9158.js → chunk-67bh5vrj.js} +1 -1
- package/dist/{chunk-kptkb3j4.js → chunk-6k8h1fj1.js} +1 -1
- package/dist/{chunk-289vztwy.js → chunk-71y3bhcw.js} +1 -1
- package/dist/{chunk-yjkaqxtc.js → chunk-7r80apc5.js} +1 -1
- package/dist/chunk-7y4eqkv4.js +2 -0
- package/dist/chunk-7ywnkv1f.js +2 -0
- package/dist/{chunk-77sa9wz4.js → chunk-80zj5516.js} +1 -1
- package/dist/chunk-8730k51r.js +2 -0
- package/dist/chunk-907qxn09.js +2 -0
- package/dist/{chunk-mv6dw7dn.js → chunk-9fcq5x2r.js} +1 -1
- package/dist/{chunk-2jfneptq.js → chunk-9kxfz708.js} +1 -1
- package/dist/{chunk-97yd8erh.js → chunk-9v0fsdsf.js} +1 -1
- package/dist/chunk-a97tp43x.js +2 -0
- package/dist/{chunk-1czvb2wx.js → chunk-amxtypkp.js} +1 -1
- package/dist/chunk-atw841yx.js +2 -0
- package/dist/chunk-c1c2a5es.js +2 -0
- package/dist/{chunk-70nkn5te.js → chunk-c1m1gng4.js} +1 -1
- package/dist/chunk-c2ta859c.js +3 -0
- package/dist/{chunk-cqp01pgs.js → chunk-caaenc3w.js} +2 -2
- package/dist/{chunk-kcn1ay55.js → chunk-cdqx2c2h.js} +1 -1
- package/dist/{chunk-pcvayb2f.js → chunk-cdsbxghb.js} +1 -1
- package/dist/{chunk-mbaew5a8.js → chunk-cmtjq1db.js} +2 -2
- package/dist/{chunk-7kfp7jde.js → chunk-crj19mqr.js} +1 -1
- package/dist/chunk-cvphepjb.js +2 -0
- package/dist/{chunk-xgj1jw4p.js → chunk-d4etph79.js} +1 -1
- package/dist/{chunk-tjhzxbxa.js → chunk-deqnt1w5.js} +1 -1
- package/dist/{chunk-meqcxfpr.js → chunk-dfejgnny.js} +1 -1
- package/dist/chunk-dnesmvvb.js +2 -0
- package/dist/{chunk-qcf4506g.js → chunk-drqdc0mh.js} +1 -1
- package/dist/{chunk-g5e5kja6.js → chunk-e1sxe3q4.js} +2 -2
- package/dist/{chunk-6t9xcjag.js → chunk-ef0ra05n.js} +1 -1
- package/dist/{chunk-dwjcmxez.js → chunk-eth22r93.js} +1 -1
- package/dist/chunk-ewsx2qxm.js +2 -0
- package/dist/{chunk-sj3k3jwt.js → chunk-farwrdr2.js} +1 -1
- package/dist/chunk-fcenm8n1.js +2 -0
- package/dist/chunk-fkdnfjc2.js +3 -0
- package/dist/chunk-gbz6pfs8.js +2 -0
- package/dist/chunk-gd2d52kn.js +2 -0
- package/dist/{chunk-2h6pmz31.js → chunk-gdbkqatx.js} +1 -1
- package/dist/{chunk-gne68nyp.js → chunk-gptwwv3c.js} +1 -1
- package/dist/{chunk-5ep11kvc.js → chunk-hyfjnn7g.js} +1 -1
- package/dist/{chunk-2jzntvfr.js → chunk-hzfd8cz0.js} +13 -2
- package/dist/{chunk-zyb5gfr0.js → chunk-j2dj21ay.js} +1 -1
- package/dist/chunk-jnahcd4d.js +2 -0
- package/dist/{chunk-kbv4km5j.js → chunk-k6ky5et7.js} +1 -1
- package/dist/{chunk-4zwjqcw4.js → chunk-kffndzch.js} +3 -3
- package/dist/{chunk-n2y2941z.js → chunk-kk7p8ekz.js} +1 -1
- package/dist/{chunk-dfymexrx.js → chunk-kpeqn5tx.js} +1 -1
- package/dist/{chunk-2t8jekek.js → chunk-krpkfndf.js} +1 -1
- package/dist/{chunk-m3a20mmb.js → chunk-kw98dfza.js} +1 -1
- package/dist/{chunk-r6g1n649.js → chunk-kxtqbrfr.js} +22 -22
- package/dist/chunk-m1yrakpk.js +2 -0
- package/dist/{chunk-mkk731dy.js → chunk-m8kezfrt.js} +1 -1
- package/dist/{chunk-z6xtb8fj.js → chunk-mm59b0gg.js} +1 -1
- package/dist/{chunk-7ymv9pd6.js → chunk-n66k2v2q.js} +2 -2
- package/dist/chunk-n9c975db.js +2 -0
- package/dist/{chunk-fc1g65e0.js → chunk-nat3actx.js} +1 -1
- package/dist/{chunk-kxtfmwy0.js → chunk-p1hy2bwn.js} +3 -3
- package/dist/{chunk-tz7t6ybm.js → chunk-pbexz0d4.js} +2 -2
- package/dist/{chunk-ms2kjpdt.js → chunk-pbzdjhp8.js} +1 -1
- package/dist/{chunk-d9ajsetq.js → chunk-q05eh1n4.js} +1 -1
- package/dist/{chunk-3wvdm033.js → chunk-q0g5c39d.js} +1 -1
- package/dist/chunk-q2hvne0v.js +2 -0
- package/dist/{chunk-cvedh4a7.js → chunk-q4p1h741.js} +1 -1
- package/dist/{chunk-qnx0eb8x.js → chunk-q569zmrr.js} +1 -1
- package/dist/{chunk-0w8t922h.js → chunk-q85qp5we.js} +1 -1
- package/dist/chunk-qpbk50xd.js +2 -0
- package/dist/{chunk-bsm13y1j.js → chunk-r8rbf28v.js} +1 -1
- package/dist/chunk-rxdd3k6n.js +2 -0
- package/dist/chunk-ssd10kje.js +2 -0
- package/dist/chunk-szx6pxh3.js +2 -0
- package/dist/{chunk-557n2zx7.js → chunk-t8ctvjqe.js} +1 -1
- package/dist/{chunk-wbtamqdk.js → chunk-te6qym2g.js} +2 -2
- package/dist/{chunk-xzkc36wt.js → chunk-tjag2cmm.js} +1 -1
- package/dist/{chunk-fw4nxafz.js → chunk-tpmgq2dx.js} +1 -1
- package/dist/chunk-tte4m2s9.js +2 -0
- package/dist/chunk-v0v1pxwh.js +2 -0
- package/dist/chunk-vv289x82.js +2 -0
- package/dist/{chunk-7080py5f.js → chunk-vvd659y4.js} +1 -1
- package/dist/chunk-vx6mxybh.js +2 -0
- package/dist/{chunk-3cba0xw5.js → chunk-wx5zf66r.js} +1 -1
- package/dist/chunk-x510wr8z.js +2 -0
- package/dist/{chunk-xt7bsyj7.js → chunk-x7yc7e9v.js} +1 -1
- package/dist/chunk-x95sxapm.js +2 -0
- package/dist/{chunk-rkna71t2.js → chunk-xdmb578h.js} +1 -1
- package/dist/chunk-y1x2ebhv.js +2 -0
- package/dist/{chunk-jwkmc175.js → chunk-yk6446kr.js} +1 -1
- package/dist/{chunk-0tyw6va3.js → chunk-ymrxpwr8.js} +1 -1
- package/dist/{chunk-g3cyygvf.js → chunk-yxppshfd.js} +1 -1
- package/dist/chunk-yzxm75jp.js +2 -0
- package/dist/{chunk-33az7v0k.js → chunk-zsnrcbw1.js} +2 -2
- package/dist/{chunk-qjh40e31.js → chunk-zz8qgqa1.js} +2 -2
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-0ck064qf.js +0 -2
- package/dist/chunk-1f43h46q.js +0 -2
- package/dist/chunk-20e4pcq1.js +0 -2
- package/dist/chunk-2evvkp6k.js +0 -2
- package/dist/chunk-2gfjp8q1.js +0 -2
- package/dist/chunk-41fhbhbn.js +0 -2
- package/dist/chunk-476dmgkd.js +0 -2
- package/dist/chunk-73sq0e73.js +0 -2
- package/dist/chunk-793gxvjv.js +0 -2
- package/dist/chunk-7f16ymjn.js +0 -2
- package/dist/chunk-85e05tzn.js +0 -2
- package/dist/chunk-94c8we2y.js +0 -2
- package/dist/chunk-axe4hgv2.js +0 -2
- package/dist/chunk-b9jknz2y.js +0 -2
- package/dist/chunk-c2mvx2m8.js +0 -3
- package/dist/chunk-cn74d92v.js +0 -2
- package/dist/chunk-d9gk60kk.js +0 -2
- package/dist/chunk-epm72mma.js +0 -2
- package/dist/chunk-gcjr4mwg.js +0 -2
- package/dist/chunk-h3w1y4q7.js +0 -2
- package/dist/chunk-htsetvt7.js +0 -2
- package/dist/chunk-j762mz1x.js +0 -2
- package/dist/chunk-jhhp2d7n.js +0 -2
- package/dist/chunk-k14sz6cz.js +0 -2
- package/dist/chunk-kgxbad5v.js +0 -2
- package/dist/chunk-m3ya2dvf.js +0 -3
- package/dist/chunk-nxbje85a.js +0 -2
- package/dist/chunk-rsp59c5x.js +0 -2
- package/dist/chunk-tbsgchrd.js +0 -2
- package/dist/chunk-v82r1j02.js +0 -2
- package/dist/chunk-x3evfp7c.js +0 -2
- package/dist/chunk-x7qbgqps.js +0 -2
- package/dist/chunk-xgeps3fn.js +0 -2
- package/dist/chunk-zgnk8tpp.js +0 -2
- package/dist/chunk-zhtttwz2.js +0 -2
- package/dist/chunk-znn3ngey.js +0 -2
|
@@ -51,6 +51,23 @@ export declare function imageWorkerSlots(cores?: number): number;
|
|
|
51
51
|
* resolved from the app's root.
|
|
52
52
|
*/
|
|
53
53
|
export declare function imageWorkerEntry(root?: string): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Whether a resolved entry is the app's own install rather than a copy in
|
|
56
|
+
* Bun's global package cache.
|
|
57
|
+
*
|
|
58
|
+
* With no `node_modules` to look in, Bun's resolver falls back to
|
|
59
|
+
* auto-install and answers with a copy in `~/.bun/install/cache` - whatever
|
|
60
|
+
* version of stx happens to be there, not the one the server was built from,
|
|
61
|
+
* and without its dependencies installed. A worker started from it dies
|
|
62
|
+
* before it is ready (`Cannot find package 'ts-images'`), after the server
|
|
63
|
+
* has already waited on it. Having no entry is the honest answer there, and
|
|
64
|
+
* the pass runs on the serving thread with a warning that says so.
|
|
65
|
+
*
|
|
66
|
+
* Refuses the cache rather than requiring `node_modules` in the path: Bun
|
|
67
|
+
* resolves symlinks, so a linked install (a workspace, `bun link`) answers
|
|
68
|
+
* with its real path, which need not contain `node_modules` at all.
|
|
69
|
+
*/
|
|
70
|
+
export declare function isInstalledEntry(path: string, env?: Record<string, string | undefined>): boolean;
|
|
54
71
|
/** Forget that the fallback warning was printed. For tests. */
|
|
55
72
|
export declare function resetImageWorkerWarning(): void;
|
|
56
73
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import os from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
5
|
import { Worker as ThreadWorker } from "node:worker_threads";
|
|
5
6
|
export const WORKER_UNAVAILABLE = Symbol("stx.image-worker.unavailable");
|
|
@@ -29,11 +30,21 @@ export function imageWorkerEntry(root = process.cwd()) {
|
|
|
29
30
|
return fileURLToPath(sibling);
|
|
30
31
|
} catch {}
|
|
31
32
|
try {
|
|
32
|
-
|
|
33
|
+
const resolved = typeof Bun < "u" ? Bun.resolveSync(INSTALLED_WORKER_ENTRY, root) : void 0;
|
|
34
|
+
return resolved && isInstalledEntry(resolved) ? resolved : void 0;
|
|
33
35
|
} catch {
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
39
|
+
export function isInstalledEntry(path, env = process.env) {
|
|
40
|
+
const normalized = path.replace(/\\/g, "/");
|
|
41
|
+
if (normalized.split("/").some((segment) => /@\d[^/]*@@@\d+$/.test(segment)))
|
|
42
|
+
return !1;
|
|
43
|
+
return ![
|
|
44
|
+
env.BUN_INSTALL_CACHE_DIR,
|
|
45
|
+
join(env.BUN_INSTALL || join(os.homedir(), ".bun"), "install", "cache")
|
|
46
|
+
].filter((dir) => !!dir).map((dir) => `${dir.replace(/\\/g, "/").replace(/\/$/, "")}/`).some((cache) => normalized.startsWith(cache));
|
|
47
|
+
}
|
|
37
48
|
let warnedUnavailable = !1;
|
|
38
49
|
function unavailable(reason) {
|
|
39
50
|
if (!warnedUnavailable) {
|
package/dist/caching.d.ts
CHANGED
|
@@ -72,6 +72,23 @@ export declare function getServeClientAsset(kind: ServeClientAssetKind, debug?:
|
|
|
72
72
|
* Clear all dev caches. Called during full rebuild or HMR reset.
|
|
73
73
|
*/
|
|
74
74
|
export declare function clearDevCaches(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Which stx rendered a cached template.
|
|
77
|
+
*
|
|
78
|
+
* The cache used to be checked against the template, its dependencies, the
|
|
79
|
+
* options and a `cacheVersion` that never changes - never against stx itself.
|
|
80
|
+
* So a render survived an upgrade: a project kept serving pages produced by
|
|
81
|
+
* the previous release's directives until something touched the template.
|
|
82
|
+
* That is how a stale `.stx/cache` made this repo's own suite assert against
|
|
83
|
+
* SEO output two releases old, while CI, starting clean, passed.
|
|
84
|
+
*
|
|
85
|
+
* The published package is identified by its version. Running from source,
|
|
86
|
+
* the code changes between releases without one, so the newest file time
|
|
87
|
+
* under src/ is added. Worked out once per process. Inlined into a bundle,
|
|
88
|
+
* where there is no package.json beside it, it is 'unknown' - no worse than
|
|
89
|
+
* before, and such a server renders ahead of time anyway.
|
|
90
|
+
*/
|
|
91
|
+
export declare function cacheEngineFingerprint(): string;
|
|
75
92
|
/**
|
|
76
93
|
* Check if a cached version of the template is available and valid
|
|
77
94
|
*/
|
package/dist/caching.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { clearComponentCache, fileExists } from "./utils.js";
|
|
4
5
|
import { clearRenderMemos } from "./render-memo.js";
|
|
5
6
|
export const templateCache = new Map;
|
|
@@ -86,6 +87,26 @@ function createCacheOptionsSignature(options) {
|
|
|
86
87
|
};
|
|
87
88
|
return new Bun.CryptoHasher("sha1").update(JSON.stringify(signature)).digest("hex");
|
|
88
89
|
}
|
|
90
|
+
let engineFingerprint;
|
|
91
|
+
export function cacheEngineFingerprint() {
|
|
92
|
+
if (engineFingerprint)
|
|
93
|
+
return engineFingerprint;
|
|
94
|
+
let fingerprint = "unknown";
|
|
95
|
+
try {
|
|
96
|
+
fingerprint = String(JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8")).version);
|
|
97
|
+
} catch {}
|
|
98
|
+
if (import.meta.url.endsWith(".ts"))
|
|
99
|
+
try {
|
|
100
|
+
const src = path.dirname(fileURLToPath(import.meta.url));
|
|
101
|
+
let newest = 0;
|
|
102
|
+
for (const entry of fs.readdirSync(src, { recursive: !0, withFileTypes: !0 }))
|
|
103
|
+
if (entry.isFile() && entry.name.endsWith(".ts"))
|
|
104
|
+
newest = Math.max(newest, fs.statSync(path.join(entry.parentPath, entry.name)).mtimeMs);
|
|
105
|
+
fingerprint += `+src.${Math.trunc(newest)}`;
|
|
106
|
+
} catch {}
|
|
107
|
+
engineFingerprint = fingerprint;
|
|
108
|
+
return fingerprint;
|
|
109
|
+
}
|
|
89
110
|
export async function checkCache(filePath, options) {
|
|
90
111
|
try {
|
|
91
112
|
if (!options.cachePath)
|
|
@@ -96,6 +117,8 @@ export async function checkCache(filePath, options) {
|
|
|
96
117
|
const metaContent = await Bun.file(metaFile).text(), meta = JSON.parse(metaContent);
|
|
97
118
|
if (meta.cacheVersion !== options.cacheVersion)
|
|
98
119
|
return null;
|
|
120
|
+
if (meta.engine !== cacheEngineFingerprint())
|
|
121
|
+
return null;
|
|
99
122
|
if (meta.optionsSignature !== createCacheOptionsSignature(options))
|
|
100
123
|
return null;
|
|
101
124
|
if ((await fs.promises.stat(filePath)).mtime.getTime() > meta.mtime)
|
|
@@ -125,6 +148,7 @@ export async function cacheTemplate(filePath, output, dependencies, options) {
|
|
|
125
148
|
mtime: stats.mtime.getTime(),
|
|
126
149
|
dependencies: Array.from(dependencies),
|
|
127
150
|
cacheVersion: options.cacheVersion,
|
|
151
|
+
engine: cacheEngineFingerprint(),
|
|
128
152
|
optionsSignature: createCacheOptionsSignature(options),
|
|
129
153
|
generatedAt: Date.now()
|
|
130
154
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hl as a,il as b,jl as c,kl as d,ll as e,ml as f,nl as g,ol as h,pl as i,ql as j,rl as k,sl as l,tl as m,ul as n,vl as o}from"./chunk-zz8qgqa1.js";import"./chunk-p1hy2bwn.js";import"./chunk-kxtqbrfr.js";import"./chunk-caaenc3w.js";import"./chunk-amxtypkp.js";import"./chunk-nat3actx.js";import"./chunk-q0g5c39d.js";import"./chunk-kffndzch.js";import"./chunk-c2ta859c.js";import"./chunk-r8rbf28v.js";import"./chunk-gptwwv3c.js";import"./chunk-n66k2v2q.js";import"./chunk-vvd659y4.js";import"./chunk-7r80apc5.js";import"./chunk-2tjk867y.js";import"./chunk-t8ctvjqe.js";import"./chunk-deqnt1w5.js";import"./chunk-hzfd8cz0.js";import"./chunk-q569zmrr.js";import"./chunk-hyfjnn7g.js";export{o as tempBuildName,b as shouldLogBundlerDiagnostics,f as setBundlerFallbackMode,l as rewriteRegistryImports,g as resolveBundlerFallback,j as registryIdForPath,c as recordBundleFailure,m as queueClientBundleBuild,k as normalizeRegistrySpecifiers,h as hasUserImports,d as getBundleFailures,a as clientBundleDependencies,e as clearBundleFailures,n as bundleClientScript,i as MODULE_SPECIFIER_PREFIX};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$l as
|
|
2
|
+
import{$l as A,Br as P,Mo as x,To as k,am as b,en as T,eq as w,fn as y,go as M,rm as B,tm as F,yo as R}from"./chunk-kxtqbrfr.js";import{sw as v}from"./chunk-hyfjnn7g.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -14,5 +14,5 @@ ${Q.join(`
|
|
|
14
14
|
`)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,filePath:z})}))).join(`
|
|
15
15
|
`);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
|
|
16
16
|
$1`);else q+=`
|
|
17
|
-
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-
|
|
18
|
-
export{j as
|
|
17
|
+
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-k6ky5et7.js");q=await N(q)}catch{}return q}
|
|
18
|
+
export{j as yk,C as zk,D as Ak,o as Bk,r as Ck,V as Dk};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`),B;try{let{bundleClientScript:j}=await import("./chunk-
|
|
2
|
+
import{sw as H}from"./chunk-hyfjnn7g.js";import P from"path";var $=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function G(...v){let w=new Set;for(let q of v){if(!q||!q.includes("__stxModules["))continue;for(let z of q.matchAll($))try{w.add(JSON.parse(`"${z[1]}"`))}catch{}}return[...w].sort()}async function T(v,w={}){if(v.length===0)return null;let q=process.cwd(),z=[],J=[];v.forEach((j,X)=>{let Z=j.startsWith("npm:")?j.slice(4):P.resolve(q,j),N=`__stxRegistered${X}`,O=JSON.stringify(j);z.push(`import * as ${N} from ${JSON.stringify(Z)};`),J.push(`if (!globalThis.__stxModules[${O}]) globalThis.__stxModules[${O}] = ${N};`)});let L=[...z,"globalThis.__stxModules = globalThis.__stxModules || {};",...J].join(`
|
|
3
|
+
`),B;try{let{bundleClientScript:j}=await import("./chunk-046dp691.js");B=await j(L,P.join(q,".stx-module-registry.ts"),{projectRoot:q,minify:w.minify,externalizeUserModules:!1})}catch(j){return console.warn("[stx] could not build the page module registry (#1957):",j),null}let{transformAutoImports:Q,generateAutoImportDestructuring:U}=await import("./chunk-m1yrakpk.js"),F=Q(B),V=U(F.stxImports,F.browserImports),{transformStoreImports:W}=await import("./chunk-cvphepjb.js");B=W(F.code);let M=JSON.stringify(new Bun.CryptoHasher("md5").update(L).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${M}]) return;`,` __stxBundles[${M}] = true;`,V,B,"})();"].join(`
|
|
4
4
|
`)}export{G as registeredModuleIdsIn,T as buildModuleRegistryScript};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bi as a,Ci as b,Di as c,Ei as d,Fi as e,Gi as f,Hi as g}from"./chunk-ej8mv2k6.js";import"./chunk-
|
|
2
|
+
import{Bi as a,Ci as b,Di as c,Ei as d,Fi as e,Gi as f,Hi as g}from"./chunk-ej8mv2k6.js";import"./chunk-hyfjnn7g.js";export{c as shouldCacheComponent,a as processKeepAliveDirectives,g as onDeactivated,f as onActivated,e as generateKeepAliveRuntime,d as generateKeepAliveCSS,b as createKeepAliveCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{To as a,Vo as b,Xo as c,Yo as d,fq as e,gq as f,hq as g,iq as h,jq as i,kq as j,lq as k,mq as l,nq as m,oq as n,pq as o,qq as p,rq as q,sq as r,tq as s,uq as t,vq as u,wq as v,xq as w,yq as x}from"./chunk-kxtqbrfr.js";import"./chunk-caaenc3w.js";import"./chunk-amxtypkp.js";import"./chunk-nat3actx.js";import"./chunk-q0g5c39d.js";import"./chunk-kffndzch.js";import"./chunk-c2ta859c.js";import"./chunk-r8rbf28v.js";import"./chunk-gptwwv3c.js";import"./chunk-n66k2v2q.js";import"./chunk-vvd659y4.js";import"./chunk-7r80apc5.js";import"./chunk-2tjk867y.js";import"./chunk-t8ctvjqe.js";import"./chunk-deqnt1w5.js";import"./chunk-hzfd8cz0.js";import"./chunk-q569zmrr.js";import"./chunk-hyfjnn7g.js";export{e as validateTemplate,g as validateDirective,n as userComponentFileExists,m as transpileTypeScript,p as slotContentHasExpressions,k as shouldTranspileTypeScript,t as resolveTemplatePath,r as renderComponentWithSlot,j as isJavaScriptScript,o as isHydrateTrigger,d as hasVariables,h as hasDirectives,u as getSourceLineInfo,l as getSharedTranspiler,f as getPositionInfo,x as getComponentCacheStats,s as fileExists,a as extractVariables,c as extractScriptFromTemplate,i as extractDirectiveNames,v as createDetailedErrorMessage,b as convertToCommonJS,q as componentClientSignalNames,w as clearComponentCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-hyfjnn7g.js";var Y=null,S=[],F=new WeakMap;function I(z){let K=z,B=new Set,G={get value(){if(Y){let H=F.get(G);if(!H)H=new Set,F.set(G,H);H.add(Y)}return K},set value(H){if(!Object.is(K,H)){K=H,B.forEach((J)=>J(H));let L=F.get(G);if(L)L.forEach((J)=>J())}},subscribe(H){return B.add(H),()=>B.delete(H)},peek(){return K}};return G}function W(z){return z!==null&&typeof z==="object"&&"value"in z&&"subscribe"in z&&"peek"in z}function P(z){return W(z)?z.value:z}function j(z){let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=I(z[B]);return K}function D(z){return I(z)}function U(z){let K=typeof z==="function",B=K?z:z.get,G=K?void 0:z.set,H=K?Object.is:z.equals||Object.is,L,J=!0,Q=new Set,X=new Set,_=()=>{if(J=!0,X.size>0){let N=T.value;X.forEach(($)=>$(N))}};function Z(){Q.clear();let N=Y;Y=_,S.push(_);try{return B()}finally{S.pop(),Y=N}}let T={get value(){if(Y){let N=F.get(T);if(!N)N=new Set,F.set(T,N);N.add(Y)}if(J){let N=Z();if(!H(L,N))L=N;J=!1}return L},set value(N){if(G)G(N);else console.warn("Computed property is readonly")},subscribe(N){return X.add(N),()=>X.delete(N)},peek(){if(J)L=B(),J=!1;return L},invalidate(){J=!0},get dirty(){return J},get deps(){return Q}};return T}function x(z,K,B={}){let{immediate:G=!1,deep:H=!1,flush:L="pre",once:J=!1}=B,Q,X=!0,_=!1,Z=()=>{if(W(z))return H?q(z.value):z.value;return z()},T=()=>{if(!X||_)return;let M=Z();if(Q!==void 0&&Object.is(Q,M)&&!H)return;let A=()=>{if(K(M,Q),Q=H?q(M):M,J)$()};if(L==="sync")A();else if(L==="post")queueMicrotask(A);else Promise.resolve().then(A)},N=null;if(W(z))N=z.subscribe(()=>T());else N=U(z).subscribe(()=>T());if(G)Q=void 0,T();else Q=Z();let $=()=>{if(X=!1,N)N(),N=null};return $.pause=()=>{_=!0},$.resume=()=>{_=!1},$}function E(z,K,B={}){let{immediate:G=!1,once:H=!1}=B,L=z.map((T)=>W(T)?T.value:void 0),J=!0,Q=!1,X=()=>{if(!J||Q)return;let T=z.map((N)=>W(N)?N.value:void 0);if(K(T,L),L=[...T],H)Z()},_=z.map((T)=>{if(W(T))return T.subscribe(()=>X());return()=>{}});if(G)X();let Z=()=>{J=!1,_.forEach((T)=>T())};return Z.pause=()=>{Q=!0},Z.resume=()=>{Q=!1},Z}function y(z,K={}){let{flush:B="pre"}=K,G,H=!0,L=!1,J=()=>{if(!H||L)return;if(G)G();let X=Y;Y=J,S.push(J);try{G=z()}finally{S.pop(),Y=X}};if(B==="sync")J();else if(B==="post")queueMicrotask(J);else Promise.resolve().then(J);let Q=()=>{if(H=!1,G)G()};return Q.pause=()=>{L=!0},Q.resume=()=>{L=!1},Q}function C(z,K={},B){let G=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return z.replace(G,(H,L,J)=>{try{let X=Function(...Object.keys(K),`return ${J}`)(...Object.values(K));return K[L]=X,`<!-- computed: ${L} = ${X} -->`}catch(Q){return`<!-- computed error: ${L} - ${Q} -->`}})}function R(z,K={},B){let G=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return z.replace(G,(H,L,J)=>{return`
|
|
3
3
|
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
4
|
(function() {
|
|
5
5
|
// Watch implementation for ${L}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-hyfjnn7g.js";import E from"fs";import K from"path";var V=[];function _(U){V=[];for(let A of U.storyFiles)if(V.push({text:A.fileName.toLowerCase(),original:A.fileName,type:"story",storyId:A.id}),V.push({text:A.relativePath.toLowerCase(),original:A.relativePath,type:"story",storyId:A.id}),A.story)for(let z of A.story.variants)V.push({text:z.title.toLowerCase(),original:z.title,type:"story",storyId:A.id,variantId:z.id})}function $(){return JSON.stringify(V)}async function O(U={}){let A=Date.now();N();let z=await k({mode:"build"});if(!z.config.enabled){W("Story feature is disabled in config.");return}let P=await H(z);w(z,P);let Y=J(z.config,P);B(z,Y),R(P.length);let X=U.outDir??z.config.outDir,Q=K.resolve(z.root,X);await E.promises.mkdir(Q,{recursive:!0}),console.log(` Building to ${X}...`);let M=F(z);await E.promises.writeFile(K.join(Q,"index.html"),M);let v={files:P.map((G)=>({id:G.id,fileName:G.fileName,relativePath:G.relativePath,treePath:G.treePath})),tree:Y};await E.promises.writeFile(K.join(Q,"stories.json"),JSON.stringify(v,null,2));let L={theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets};await E.promises.writeFile(K.join(Q,"config.json"),JSON.stringify(L,null,2));let Z=K.join(Q,"stories");await E.promises.mkdir(Z,{recursive:!0});for(let G of P){let g=await E.promises.readFile(G.path,"utf-8");await E.promises.writeFile(K.join(Z,`${G.id}.stx`),g)}_(z);let T=$();await E.promises.writeFile(K.join(Q,"search-index.json"),T);let C=Date.now()-A;j(P.length,X,C)}function F(U){let{theme:A}=U.config,z=A.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ye as a}from"./chunk-q4p1h741.js";import"./chunk-cmtjq1db.js";import"./chunk-dvvx1wny.js";import"./chunk-p1hy2bwn.js";import"./chunk-kxtqbrfr.js";import"./chunk-caaenc3w.js";import"./chunk-amxtypkp.js";import"./chunk-nat3actx.js";import"./chunk-q0g5c39d.js";import"./chunk-kffndzch.js";import"./chunk-c2ta859c.js";import"./chunk-r8rbf28v.js";import"./chunk-gptwwv3c.js";import"./chunk-n66k2v2q.js";import"./chunk-vvd659y4.js";import"./chunk-7r80apc5.js";import"./chunk-2tjk867y.js";import"./chunk-t8ctvjqe.js";import"./chunk-deqnt1w5.js";import"./chunk-hzfd8cz0.js";import"./chunk-q569zmrr.js";import"./chunk-hyfjnn7g.js";export{a as startProductionServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Aj as q,yj as o,zj as p}from"./chunk-
|
|
2
|
+
import{Aj as q,yj as o,zj as p}from"./chunk-71y3bhcw.js";import{Gj as a,Hj as b,Ij as c,Jj as d,Kj as e,Lj as f,Mj as g,Nj as h,Oj as i,Pj as j,Qj as k,Rj as l,Sj as m,Tj as n}from"./chunk-t41aaehf.js";import"./chunk-deqnt1w5.js";import"./chunk-hyfjnn7g.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Gu as a,Hu as b,Iu as c,Ju as d,Ku as e,Lu as f,Mu as g}from"./chunk-vvd659y4.js";import"./chunk-hyfjnn7g.js";export{a as withRuntimeConfig,c as useServerRuntimeConfig,d as useRuntimeConfig,f as runtimeConfigTag,e as resolveRuntimeConfig,g as injectRuntimeConfig,b as currentRuntimeConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Re as a,Se as b}from"./chunk-2ver2s2y.js";import"./chunk-
|
|
2
|
+
import{Re as a,Se as b}from"./chunk-2ver2s2y.js";import"./chunk-hyfjnn7g.js";export{b as captureScreenshots,a as captureScreenshot};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ot as _}from"./chunk-nat3actx.js";import"./chunk-hyfjnn7g.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
|
|
3
3
|
`)H++;return H}function P(j,G){let H=j.lastIndexOf(`
|
|
4
4
|
`,G)+1,Q=j.indexOf(`
|
|
5
5
|
`,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
function A(h){let q=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;h=h.replace(q,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
|
|
3
3
|
`});let v=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return h=h.replace(v,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__composables
|
|
4
4
|
`}),h}function B(h){return h.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
|
|
5
|
-
export{A as
|
|
5
|
+
export{A as bv,B as cv};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mf as t,nf as u,of as v,pf as w,qf as x,rf as y,sf as z,tf as A,uf as B,vf as C,wf as D,xf as E}from"./chunk-
|
|
2
|
+
import{mf as t,nf as u,of as v,pf as w,qf as x,rf as y,sf as z,tf as A,uf as B,vf as C,wf as D,xf as E}from"./chunk-crj19mqr.js";import{yf as r,zf as s}from"./chunk-x7yc7e9v.js";import{Af as b,Bf as c,Cf as d,Df as e,Ef as f,Ff as g,Gf as h,If as i,Jf as j,Kf as k,Lf as l,Mf as m,Nf as n,Of as o,Pf as p,Qf as q}from"./chunk-j2dj21ay.js";import{hi as a}from"./chunk-mwh3ymwc.js";import"./chunk-q0g5c39d.js";import"./chunk-hyfjnn7g.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
|