@stencil/dev-server 0.0.19-1 → 5.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Stencil Dev Server Connector 5.0.0</title>
6
+ <style>
7
+ body {
8
+ background: black;
9
+ color: white;
10
+ font: 18px monospace;
11
+ text-align: center;
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ Stencil Dev Server Connector 5.0.0
17
+
18
+ <script type="module">
19
+ import { initDevClient } from '/~dev-server/client/index.js';
20
+
21
+ const appWindow = window.parent;
22
+ const config = window.__DEV_CLIENT_CONFIG__;
23
+
24
+ const defaultConfig = {
25
+ basePath: appWindow.location.pathname,
26
+ editors: [],
27
+ reloadStrategy: 'hmr',
28
+ socketUrl: `${location.protocol === 'https:' ? 'wss:' : 'ws:'}//${location.hostname}${location.port !== '' ? ':' + location.port : ''}/`,
29
+ };
30
+
31
+ initDevClient(appWindow, { ...defaultConfig, ...appWindow.devServerConfig, ...config });
32
+ </script>
33
+ </body>
34
+ </html>
@@ -0,0 +1,52 @@
1
+ import { CompilerBuildResults, CompilerRequestResponse, CompilerWatcher, DevServer, DevServerConfig, DevServerConfig as DevServerConfig$1, Logger, StencilDevServerConfig } from "@stencil/core/compiler";
2
+
3
+ //#region src/server/types.d.ts
4
+ /**
5
+ * Internal dev server message protocol for communication between
6
+ * main process and browser clients.
7
+ */
8
+ interface DevServerMessage {
9
+ startServer?: DevServerConfig$1;
10
+ closeServer?: boolean;
11
+ serverStarted?: DevServerConfig$1;
12
+ serverClosed?: boolean;
13
+ buildStart?: boolean;
14
+ buildLog?: BuildLog;
15
+ buildResults?: CompilerBuildResults;
16
+ requestBuildResults?: boolean;
17
+ error?: {
18
+ message?: string;
19
+ type?: string;
20
+ stack?: string | null;
21
+ };
22
+ isActivelyBuilding?: boolean;
23
+ compilerRequestPath?: string;
24
+ compilerRequestResults?: CompilerRequestResponse;
25
+ requestLog?: {
26
+ method: string;
27
+ url: string;
28
+ status: number;
29
+ };
30
+ }
31
+ interface BuildLog {
32
+ buildId?: number;
33
+ messages?: string[];
34
+ progress?: number;
35
+ }
36
+ type DevServerSendMessage = (msg: DevServerMessage) => void;
37
+ //#endregion
38
+ //#region src/server/server.d.ts
39
+ declare function initServerProcess(sendMsg: DevServerSendMessage): (msg: DevServerMessage) => void;
40
+ //#endregion
41
+ //#region src/server/index.d.ts
42
+ /**
43
+ * Start the Stencil development server.
44
+ *
45
+ * @param stencilDevServerConfig - Configuration for the dev server
46
+ * @param logger - Logger instance for output
47
+ * @param watcher - Optional compiler watcher for build events
48
+ * @returns Promise resolving to the DevServer instance
49
+ */
50
+ declare function start(stencilDevServerConfig: StencilDevServerConfig, logger: Logger, watcher?: CompilerWatcher): Promise<DevServer>;
51
+ //#endregion
52
+ export { type CompilerWatcher, type DevServer, type DevServerConfig, type Logger, type StencilDevServerConfig, initServerProcess, start };