@qds.dev/code 0.8.5 → 0.9.7

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.
Files changed (43) hide show
  1. package/README.md +102 -0
  2. package/lib-types/src/debug.d.ts +1 -0
  3. package/lib-types/src/index.d.ts +2 -0
  4. package/lib-types/src/preview/bundler/bundled-config.d.ts +33 -0
  5. package/lib-types/src/preview/bundler/bundled.d.ts +3 -0
  6. package/lib-types/src/preview/bundler/bundled.unit.d.ts +1 -0
  7. package/lib-types/src/preview/bundler/client-events-listener.d.ts +1 -0
  8. package/lib-types/src/preview/bundler/index.d.ts +34 -0
  9. package/lib-types/src/preview/bundler/repl-bundler-worker.d.ts +30 -0
  10. package/lib-types/src/preview/bundler/repl-ssr-worker.d.ts +27 -0
  11. package/lib-types/src/preview/bundler/rollup-plugins.d.ts +5 -0
  12. package/lib-types/src/preview/bundler/rollup-plugins.unit.d.ts +1 -0
  13. package/lib-types/src/preview/constants.d.ts +5 -0
  14. package/lib-types/src/preview/index.d.ts +19 -0
  15. package/lib-types/src/preview/mocks/browser.d.ts +2 -0
  16. package/lib-types/src/preview/preview-sw.d.ts +20 -0
  17. package/lib-types/src/preview/preview-sw.unit.d.ts +1 -0
  18. package/lib-types/src/preview/register-preview-sw.d.ts +2 -0
  19. package/lib-types/src/preview/register-preview-sw.unit.d.ts +1 -0
  20. package/lib-types/src/preview/repl-editor.d.ts +1 -0
  21. package/lib-types/src/preview/repl-helpers-node.d.ts +4 -0
  22. package/lib-types/src/preview/repl-helpers.d.ts +16 -0
  23. package/lib-types/src/preview/repl-helpers.unit.d.ts +1 -0
  24. package/lib-types/src/preview/test-extend.d.ts +9 -0
  25. package/lib-types/src/preview/types.d.ts +70 -0
  26. package/lib-types/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +13 -8
  28. package/LICENSE +0 -21
  29. package/lib/node_modules/.pnpm/@emnapi_core@1.7.1/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.qwik.mjs +0 -5533
  30. package/lib/node_modules/.pnpm/@emnapi_runtime@1.8.1/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.qwik.mjs +0 -1225
  31. package/lib/node_modules/.pnpm/@emnapi_wasi-threads@1.1.0/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.qwik.mjs +0 -619
  32. package/lib/node_modules/.pnpm/@napi-rs_wasm-runtime@1.1.1/node_modules/@napi-rs/wasm-runtime/dist/fs.qwik.mjs +0 -14854
  33. package/lib/node_modules/.pnpm/@napi-rs_wasm-runtime@1.1.1/node_modules/@napi-rs/wasm-runtime/fs-proxy.qwik.mjs +0 -109
  34. package/lib/node_modules/.pnpm/@napi-rs_wasm-runtime@1.1.1/node_modules/@napi-rs/wasm-runtime/runtime.qwik.mjs +0 -4
  35. package/lib/node_modules/.pnpm/@qwik.dev_core@2.0.0-beta.15_vite@7.1.5_@types_node@24.9.0_jiti@2.6.1_lightningcss@1.30.1_ter_sl453hnfnrysgqsj6ikt4cdmnq/node_modules/@qwik.dev/core/dist/qwikloader.qwik.mjs +0 -152
  36. package/lib/node_modules/.pnpm/@rolldown_browser@1.0.0-beta.59/node_modules/@rolldown/browser/dist/index.browser.qwik.mjs +0 -13
  37. package/lib/node_modules/.pnpm/@rolldown_browser@1.0.0-beta.59/node_modules/@rolldown/browser/dist/normalize-string-or-regex-BB1FWNyl.qwik.mjs +0 -789
  38. package/lib/node_modules/.pnpm/@rolldown_browser@1.0.0-beta.59/node_modules/@rolldown/browser/dist/rolldown-binding.wasi-browser.qwik.mjs +0 -107
  39. package/lib/node_modules/.pnpm/@rolldown_browser@1.0.0-beta.59/node_modules/@rolldown/browser/dist/rolldown-build-Bfw5c2c3.qwik.mjs +0 -4157
  40. package/lib/node_modules/.pnpm/@tybys_wasm-util@0.10.1/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.qwik.mjs +0 -1968
  41. package/lib/node_modules/.pnpm/magic-regexp@0.10.0/node_modules/magic-regexp/dist/index.qwik.mjs +0 -10
  42. package/lib/node_modules/.pnpm/magic-regexp@0.10.0/node_modules/magic-regexp/dist/shared/magic-regexp.DKp_q_HX.qwik.mjs +0 -95
  43. package/lib/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.qwik.mjs +0 -34
@@ -1,109 +0,0 @@
1
- //#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.1/node_modules/@napi-rs/wasm-runtime/fs-proxy.js
2
- /**
3
- * @param {unknown} value
4
- */
5
- const getType = (value) => {
6
- if (value === void 0) return 0;
7
- if (value === null) return 1;
8
- const t = typeof value;
9
- if (t === "boolean") return 2;
10
- if (t === "number") return 3;
11
- if (t === "string") return 4;
12
- if (t === "object") return 6;
13
- if (t === "bigint") return 9;
14
- return -1;
15
- };
16
- /**
17
- * @param {import('memfs').IFs} memfs
18
- * @param {any} value
19
- * @param {ReturnType<typeof getType>} type
20
- * @returns {Uint8Array}
21
- */
22
- const encodeValue = (memfs, value, type) => {
23
- switch (type) {
24
- case 0:
25
- case 1: return new Uint8Array(0);
26
- case 2: {
27
- const view = new Int32Array(1);
28
- view[0] = value ? 1 : 0;
29
- return new Uint8Array(view.buffer);
30
- }
31
- case 3: {
32
- const view = new Float64Array(1);
33
- view[0] = value;
34
- return new Uint8Array(view.buffer);
35
- }
36
- case 4: return new TextEncoder().encode(value);
37
- case 6: {
38
- function storeConstructor(obj, memfs$1, processed = /* @__PURE__ */ new WeakSet()) {
39
- if (!obj || typeof obj !== "object") return;
40
- if (processed.has(obj)) return;
41
- processed.add(obj);
42
- const [entry] = Object.entries(memfs$1).filter(([_, v]) => v === obj.constructor)[0] ?? [];
43
- if (entry) Object.defineProperty(obj, "__constructor__", {
44
- configurable: true,
45
- writable: true,
46
- enumerable: true,
47
- value: entry
48
- });
49
- for (const value$1 of Object.values(obj)) storeConstructor(value$1, memfs$1, processed);
50
- }
51
- storeConstructor(value, memfs);
52
- const json = JSON.stringify(value, (_, value$1) => {
53
- if (typeof value$1 === "bigint") return `BigInt(${String(value$1)})`;
54
- if (value$1 instanceof Error) return {
55
- ...value$1,
56
- message: value$1.message,
57
- stack: value$1.stack,
58
- __error__: value$1.constructor.name
59
- };
60
- return value$1;
61
- });
62
- return new TextEncoder().encode(json);
63
- }
64
- case 9: {
65
- const view = new BigInt64Array(1);
66
- view[0] = value;
67
- return new Uint8Array(view.buffer);
68
- }
69
- case -1:
70
- default: throw new Error("unsupported data");
71
- }
72
- };
73
- /**
74
- * @param {import('memfs').IFs} fs
75
- * @returns {(e: { data: { __fs__: { sab: Int32Array, type: keyof import('memfs').IFs, payload: any[] } } }) => void}
76
- */
77
- const createOnMessage = (fs) => function onMessage(e) {
78
- if (e.data.__fs__) {
79
- /**
80
- * 0..4 status(int32_t): 21(waiting) 0(success) 1(error)
81
- * 5..8 type(napi_valuetype): 0(undefined) 1(null) 2(boolean) 3(number) 4(string) 6(jsonstring) 9(bigint) -1(unsupported)
82
- * 9..16 payload_size(uint32_t) <= 1024
83
- * 16..16 + payload_size payload_content
84
- */
85
- const { sab, type, payload } = e.data.__fs__;
86
- const fn = fs[type];
87
- try {
88
- const ret = fn.apply(fs, payload);
89
- const t = getType(ret);
90
- Atomics.store(sab, 1, t);
91
- const v = encodeValue(fs, ret, t);
92
- Atomics.store(sab, 2, v.length);
93
- new Uint8Array(sab.buffer).set(v, 16);
94
- Atomics.store(sab, 0, 0);
95
- } catch (err) {
96
- const t = getType(err);
97
- Atomics.store(sab, 1, t);
98
- const v = encodeValue(fs, err, t);
99
- Atomics.store(sab, 2, v.length);
100
- new Uint8Array(sab.buffer).set(v, 16);
101
- Atomics.store(sab, 0, 1);
102
- } finally {
103
- Atomics.notify(sab, 0);
104
- }
105
- }
106
- };
107
-
108
- //#endregion
109
- export { createOnMessage };
@@ -1,4 +0,0 @@
1
- import { instantiateNapiModule } from "../../../../@emnapi_core@1.7.1/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.qwik.mjs";
2
- import { getDefaultContext } from "../../../../@emnapi_runtime@1.8.1/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.qwik.mjs";
3
- import { Memory, WASI, WebAssemblyMemory, extendMemory, wrapAsyncImport } from "../../../../@tybys_wasm-util@0.10.1/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.qwik.mjs";
4
- import { createOnMessage } from "./fs-proxy.qwik.mjs";
@@ -1,152 +0,0 @@
1
- //#region ../../node_modules/.pnpm/@qwik.dev+core@2.0.0-beta.15_vite@7.1.5_@types+node@24.9.0_jiti@2.6.1_lightningcss@1.30.1_ter_sl453hnfnrysgqsj6ikt4cdmnq/node_modules/@qwik.dev/core/dist/qwikloader.js
2
- const t = document, e = window, n = /* @__PURE__ */ new Set(), o = new Set([t]), r = {}, s = "-window", i = "-document";
3
- let a;
4
- const c = (t$1, e$1) => Array.from(t$1.querySelectorAll(e$1)), l = (t$1) => {
5
- const e$1 = [];
6
- return o.forEach((n$1) => e$1.push(...c(n$1, t$1))), e$1;
7
- }, f = (t$1) => {
8
- A(t$1), c(t$1, "[q\\:shadowroot]").forEach((t$2) => {
9
- const e$1 = t$2.shadowRoot;
10
- e$1 && f(e$1);
11
- });
12
- }, p = (t$1) => t$1 && "function" == typeof t$1.then, u = (t$1, e$1, n$1 = e$1.type) => {
13
- l("[on" + t$1 + "\\:" + n$1 + "]").forEach((o$1) => {
14
- h(o$1, t$1, e$1, n$1);
15
- });
16
- }, b = (e$1) => {
17
- if (void 0 === e$1._qwikjson_) {
18
- let n$1 = (e$1 === t.documentElement ? t.body : e$1).lastElementChild;
19
- for (; n$1;) {
20
- if ("SCRIPT" === n$1.tagName && "qwik/json" === n$1.getAttribute("type")) {
21
- e$1._qwikjson_ = JSON.parse(n$1.textContent.replace(/\\x3C(\/?script)/gi, "<$1"));
22
- break;
23
- }
24
- n$1 = n$1.previousElementSibling;
25
- }
26
- }
27
- }, q = (t$1, e$1) => new CustomEvent(t$1, { detail: e$1 }), h = async (e$1, n$1, o$1, s$1 = o$1.type) => {
28
- const i$1 = "on" + n$1 + ":" + s$1;
29
- e$1.hasAttribute("preventdefault:" + s$1) && o$1.preventDefault(), e$1.hasAttribute("stoppropagation:" + s$1) && o$1.stopPropagation();
30
- const a$1 = e$1._qc_, c$1 = a$1 && a$1.li.filter((t$1) => t$1[0] === i$1);
31
- if (c$1 && c$1.length > 0) {
32
- for (const t$1 of c$1) {
33
- const n$2 = t$1[1].getFn([e$1, o$1], () => e$1.isConnected)(o$1, e$1), r$1 = o$1.cancelBubble;
34
- p(n$2) && await n$2, r$1 && o$1.stopPropagation();
35
- }
36
- return;
37
- }
38
- const l$1 = e$1.qDispatchEvent;
39
- if (l$1) return l$1(o$1, n$1);
40
- const f$1 = e$1.getAttribute(i$1);
41
- if (f$1) {
42
- const n$2 = e$1.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"), s$2 = n$2.getAttribute("q:base"), i$2 = n$2.getAttribute("q:version") || "unknown", a$2 = n$2.getAttribute("q:manifest-hash") || "dev", c$2 = new URL(s$2, t.baseURI);
43
- for (const l$2 of f$1.split("\n")) {
44
- const f$2 = new URL(l$2, c$2), u$1 = f$2.href, q$1 = f$2.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default", h$1 = performance.now();
45
- let d$1, m$1, g$1;
46
- const y$1 = l$2.startsWith("#"), v$1 = {
47
- qBase: s$2,
48
- qManifest: a$2,
49
- qVersion: i$2,
50
- href: u$1,
51
- symbol: q$1,
52
- element: e$1,
53
- reqTime: h$1
54
- };
55
- if (y$1) d$1 = (t["qFuncs_" + n$2.getAttribute("q:instance")] || [])[Number.parseInt(q$1)], d$1 || (m$1 = "sync", g$1 = Error("sym:" + q$1));
56
- else if (q$1 in r) d$1 = r[q$1];
57
- else {
58
- _("qsymbol", v$1);
59
- const t$1 = f$2.href.split("#")[0];
60
- try {
61
- const e$2 = import(t$1);
62
- b(n$2), d$1 = (await e$2)[q$1], d$1 ? r[q$1] = d$1 : (m$1 = "no-symbol", g$1 = Error(`${q$1} not in ${t$1}`));
63
- } catch (t$2) {
64
- m$1 || (m$1 = "async"), g$1 = t$2;
65
- }
66
- }
67
- if (!d$1) {
68
- _("qerror", {
69
- importError: m$1,
70
- error: g$1,
71
- ...v$1
72
- }), console.error(g$1);
73
- break;
74
- }
75
- const w$1 = t.__q_context__;
76
- if (e$1.isConnected) try {
77
- t.__q_context__ = [
78
- e$1,
79
- o$1,
80
- f$2
81
- ];
82
- const n$3 = d$1(o$1, e$1);
83
- p(n$3) && await n$3;
84
- } catch (t$1) {
85
- _("qerror", {
86
- error: t$1,
87
- ...v$1
88
- });
89
- } finally {
90
- t.__q_context__ = w$1;
91
- }
92
- }
93
- }
94
- }, _ = (e$1, n$1) => {
95
- t.dispatchEvent(q(e$1, n$1));
96
- }, d = (t$1) => t$1.replace(/([A-Z-])/g, (t$2) => "-" + t$2.toLowerCase()), m = async (t$1, e$1) => {
97
- let n$1 = d(t$1.type), o$1 = t$1.target;
98
- if (e$1 !== i) for (; o$1 && o$1.getAttribute;) {
99
- const e$2 = h(o$1, "", t$1, n$1);
100
- let r$1 = t$1.cancelBubble;
101
- p(e$2) && await e$2, r$1 || (r$1 = r$1 || t$1.cancelBubble || o$1.hasAttribute("stoppropagation:" + t$1.type)), o$1 = t$1.bubbles && !0 !== r$1 ? o$1.parentElement : null;
102
- }
103
- else u(i, t$1, n$1);
104
- }, g = (t$1) => {
105
- u(s, t$1, d(t$1.type));
106
- }, y = () => {
107
- const r$1 = t.readyState;
108
- if (!a && ("interactive" == r$1 || "complete" == r$1) && (o.forEach(f), a = 1, _("qinit"), (e.requestIdleCallback ?? e.setTimeout).bind(e)(() => _("qidle")), n.has(":qvisible"))) {
109
- const t$1 = l("[on\\:qvisible]"), e$1 = new IntersectionObserver((t$2) => {
110
- for (const n$1 of t$2) n$1.isIntersecting && (e$1.unobserve(n$1.target), h(n$1.target, "", q("qvisible", n$1)));
111
- });
112
- t$1.forEach((t$2) => e$1.observe(t$2));
113
- }
114
- }, v = (t$1, e$1, n$1, o$1 = !1) => {
115
- t$1.addEventListener(e$1, n$1, {
116
- capture: o$1,
117
- passive: !1
118
- });
119
- }, w = (t$1) => t$1.replace(/-./g, (t$2) => t$2[1].toUpperCase()), E = (t$1) => {
120
- const e$1 = t$1.indexOf(":");
121
- let n$1 = "", o$1 = t$1;
122
- if (e$1 >= 0) {
123
- const r$1 = t$1.substring(0, e$1);
124
- "" !== r$1 && r$1 !== s && r$1 !== i || (n$1 = r$1, o$1 = t$1.substring(e$1 + 1));
125
- }
126
- return {
127
- scope: n$1,
128
- eventName: w(o$1)
129
- };
130
- }, A = (...t$1) => {
131
- for (const r$1 of t$1) if ("string" == typeof r$1) {
132
- if (!n.has(r$1)) {
133
- n.add(r$1);
134
- const { scope: t$2, eventName: i$1 } = E(r$1);
135
- t$2 === s ? v(e, i$1, g, !0) : o.forEach((e$1) => v(e$1, i$1, (e$2) => m(e$2, t$2), !0));
136
- }
137
- } else o.has(r$1) || (n.forEach((t$2) => {
138
- const { scope: e$1, eventName: n$1 } = E(t$2);
139
- v(r$1, n$1, (t$3) => m(t$3, e$1), !0);
140
- }), o.add(r$1));
141
- };
142
- if (!("__q_context__" in t)) {
143
- t.__q_context__ = 0;
144
- const r$1 = e.qwikevents;
145
- r$1 && (Array.isArray(r$1) ? A(...r$1) : A("click", "input")), e.qwikevents = {
146
- events: n,
147
- roots: o,
148
- push: A
149
- }, v(t, "readystatechange", y), y();
150
- }
151
-
152
- //#endregion
@@ -1,13 +0,0 @@
1
- import { BindingMagicString } from "./rolldown-binding.wasi-browser.qwik.mjs";
2
- import { VERSION } from "./normalize-string-or-regex-BB1FWNyl.qwik.mjs";
3
- import { PluginDriver, RolldownBuild, validateOption } from "./rolldown-build-Bfw5c2c3.qwik.mjs";
4
-
5
- //#region ../../node_modules/.pnpm/@rolldown+browser@1.0.0-beta.59/node_modules/@rolldown/browser/dist/index.browser.mjs
6
- /** @category Programmatic APIs */
7
- const rolldown = async (input) => {
8
- validateOption("input", input);
9
- return new RolldownBuild(await PluginDriver.callOptionsHook(input));
10
- };
11
-
12
- //#endregion
13
- export { rolldown };