@qds.dev/code 0.8.2 → 0.9.1
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/README.md +102 -0
- package/lib/preview/bundler/repl-bundler-worker.qwik.mjs +2747 -378
- package/lib/preview/bundler/wasi-worker-browser.mjs +2962 -1632
- package/lib/vite/repl-plugin.qwik.mjs +31 -0
- package/lib-types/src/vite/repl-plugin.d.ts +7 -0
- package/lib-types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/lib-types/src/debug.d.ts +0 -1
- package/lib-types/src/preview/bundler/index.d.ts +0 -34
- package/lib-types/src/preview/bundler/repl-ssr-worker.d.ts +0 -27
- package/lib-types/src/preview/index.d.ts +0 -19
- package/lib-types/src/preview/preview-sw.d.ts +0 -20
- package/lib-types/src/preview/preview-sw.unit.d.ts +0 -1
- package/lib-types/src/preview/repl-helpers-node.d.ts +0 -4
- package/lib-types/src/preview/repl-helpers.unit.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qds.dev/code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Code playground and preview components for Qwik Design System",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@qwik.dev/core": "2.0.0-beta.
|
|
30
|
+
"@qwik.dev/core": "2.0.0-beta.23",
|
|
31
31
|
"msw": "^2.12.7",
|
|
32
32
|
"rolldown": "1.0.0-beta.59",
|
|
33
33
|
"typescript": "5.4.5",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@tybys/wasm-util": "^0.10.1",
|
|
43
43
|
"magic-regexp": "^0.10.0"
|
|
44
44
|
},
|
|
45
|
+
"sideEffects": false,
|
|
45
46
|
"scripts": {
|
|
46
47
|
"build": "pnpm run build.lib & pnpm run build.types",
|
|
47
48
|
"build.lib": "rolldown -c rolldown.config.ts",
|
package/lib-types/src/debug.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function debug(...args: unknown[]): void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** Bundler that manages WebWorkers */
|
|
2
|
-
import type { PkgUrls, PreviewInputOptions, PreviewResult } from "../types";
|
|
3
|
-
import type { OutgoingMessage } from "./repl-bundler-worker";
|
|
4
|
-
declare class Bundler {
|
|
5
|
-
worker: Worker | null;
|
|
6
|
-
private initP;
|
|
7
|
-
private ready;
|
|
8
|
-
private deps;
|
|
9
|
-
private qwikWasm?;
|
|
10
|
-
private timer;
|
|
11
|
-
buildPromises: Map<number, {
|
|
12
|
-
resolve: (value: PreviewResult) => void;
|
|
13
|
-
reject: (reason?: any) => void;
|
|
14
|
-
}>;
|
|
15
|
-
nextBuildId: number;
|
|
16
|
-
constructor(deps: PkgUrls, qwikWasm?: WebAssembly.Module);
|
|
17
|
-
initWorker(): void;
|
|
18
|
-
messageHandler: (e: MessageEvent<OutgoingMessage>) => void;
|
|
19
|
-
keepAlive(): void;
|
|
20
|
-
bundle(options: Omit<PreviewInputOptions, "version" | "serverUrl">): Promise<PreviewResult>;
|
|
21
|
-
terminateWorker(): void;
|
|
22
|
-
private _ssrWorker;
|
|
23
|
-
private _ssrWorkerP;
|
|
24
|
-
private _ssrKey;
|
|
25
|
-
private _resultResolver;
|
|
26
|
-
private getSsrWorker;
|
|
27
|
-
executeSSR(result: PreviewResult): Promise<{
|
|
28
|
-
html: string;
|
|
29
|
-
events?: any[];
|
|
30
|
-
}>;
|
|
31
|
-
hasQwikWasm(): boolean;
|
|
32
|
-
}
|
|
33
|
-
export declare const getBundler: (deps?: PkgUrls, qwikWasm?: WebAssembly.Module) => Bundler;
|
|
34
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { QwikManifest } from "@qwik.dev/core/optimizer";
|
|
2
|
-
import type { PreviewEvent } from "../types";
|
|
3
|
-
interface MessageBase {
|
|
4
|
-
type: string;
|
|
5
|
-
}
|
|
6
|
-
export interface InitSSRMessage extends MessageBase {
|
|
7
|
-
type: "run-ssr";
|
|
8
|
-
replId: string;
|
|
9
|
-
entry: string;
|
|
10
|
-
baseUrl: string;
|
|
11
|
-
manifest: QwikManifest | undefined;
|
|
12
|
-
}
|
|
13
|
-
export interface SSRReadyMessage extends MessageBase {
|
|
14
|
-
type: "ready";
|
|
15
|
-
}
|
|
16
|
-
export interface SSRResultMessage extends MessageBase {
|
|
17
|
-
type: "ssr-result";
|
|
18
|
-
html: string;
|
|
19
|
-
events: PreviewEvent[];
|
|
20
|
-
}
|
|
21
|
-
export interface SSRErrorMessage extends MessageBase {
|
|
22
|
-
type: "ssr-error";
|
|
23
|
-
error: string;
|
|
24
|
-
stack?: string;
|
|
25
|
-
}
|
|
26
|
-
export type OutgoingMessage = SSRReadyMessage | SSRResultMessage | SSRErrorMessage;
|
|
27
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { PkgUrls, PreviewInputOptions, PreviewResult } from "./types";
|
|
2
|
-
export * from "./bundler";
|
|
3
|
-
export { BUNDLED_FILE_PATHS, createBundledConfig, FILE_PATH_ALIASES, getImportPath, QWIK_PKG_NAME } from "./bundler/bundled-config";
|
|
4
|
-
export * from "./constants";
|
|
5
|
-
export * from "./repl-helpers";
|
|
6
|
-
export * from "./register-preview-sw";
|
|
7
|
-
export type { PkgUrls, PreviewInputOptions, PreviewInputOptions as ReplInputOptions, PreviewModuleInput, PreviewModuleInput as ReplModuleInput, PreviewModuleOutput, PreviewModuleOutput as ReplModuleOutput, PreviewResult, PreviewResult as ReplResult } from "./types";
|
|
8
|
-
export * from "./types";
|
|
9
|
-
export interface PreviewCompilerOptions extends Partial<PreviewInputOptions> {
|
|
10
|
-
/** Qwik dependency URLs - must be provided by consuming app */
|
|
11
|
-
deps: PkgUrls;
|
|
12
|
-
}
|
|
13
|
-
export declare class PreviewCompiler {
|
|
14
|
-
options: PreviewCompilerOptions;
|
|
15
|
-
private bundler;
|
|
16
|
-
constructor(options: PreviewCompilerOptions);
|
|
17
|
-
compile(input: Partial<PreviewInputOptions>): Promise<PreviewResult>;
|
|
18
|
-
}
|
|
19
|
-
export { PreviewCompiler as ReplCompiler };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type RequestMessage = {
|
|
2
|
-
type: "preview-request";
|
|
3
|
-
requestId: number;
|
|
4
|
-
previewId: string;
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
7
|
-
export type ResponseMessage = {
|
|
8
|
-
type: "preview-response";
|
|
9
|
-
requestId: number;
|
|
10
|
-
response: {
|
|
11
|
-
status: number;
|
|
12
|
-
statusText: string;
|
|
13
|
-
headers: Record<string, string>;
|
|
14
|
-
body: string;
|
|
15
|
-
} | null;
|
|
16
|
-
};
|
|
17
|
-
type SendPreviewMessage = (msg: RequestMessage) => void;
|
|
18
|
-
/** Intercept requests for `/repl/[id]/*` and request them over the broadcast channel */
|
|
19
|
-
export declare const handleFetch: (ev: FetchEvent, selfOrigin: string, sendMessage: SendPreviewMessage) => void;
|
|
20
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|