1pub const IMPORT_PATH_PLACEHOLDER: &str = "__IMPORT_PATH__";
5
6pub const RELOAD_ROUTE_PLACEHOLDER: &str = "__RELOAD_ROUTE__";
10
11pub const RELOAD_ROUTE: &str = "/__euv_reload";
15
16pub const RELEASE_FLAG: &str = "--release";
18
19pub const WASM_PACK_COMMAND: &str = "wasm-pack";
21
22pub const WASM_PACK_BUILD_SUBCOMMAND: &str = "build";
24
25pub const OUT_DIR_ARG: &str = "--out-dir";
27
28pub const OUT_NAME_ARG: &str = "--out-name";
30
31pub const TARGET_ARG: &str = "--target";
33
34pub const TARGET_WEB: &str = "web";
36
37pub const PKG_DIR_NAME: &str = "pkg";
39
40pub const JS_EXTENSION: &str = ".js";
42
43pub const SRC_DIR_NAME: &str = "src";
45
46pub const GITIGNORE_FILE_NAME: &str = ".gitignore";
48
49pub const CARGO_TOML_FILE_NAME: &str = "Cargo.toml";
51
52pub const INDEX_HTML_FILE_NAME: &str = "index.html";
54
55pub const RELATIVE_PATH_PREFIX: &str = "./";
57
58pub const PATH_SEPARATOR: &str = "/";
60
61pub const PARENT_DIR: &str = "..";
63
64pub const DEV_FLAG: &str = "--dev";
66
67pub const PROFILING_FLAG: &str = "--profiling";
69
70pub const CRATE_PATH_ARG: &str = "--crate-path";
72
73pub const CRATE_PATH_ARG_SHORT: &str = "-c";
75
76pub const PORT_ARG: &str = "--port";
78
79pub const PORT_ARG_SHORT: &str = "-p";
81
82pub const WWW_DIR_ARG: &str = "--www-dir";
84
85pub const INDEX_HTML_ARG: &str = "--index-html";
87
88pub const NO_GITIGNORE_ARG: &str = "--no-gitignore";
90
91pub const EUV_ARGS: &[&str] = &[
93 CRATE_PATH_ARG,
94 CRATE_PATH_ARG_SHORT,
95 PORT_ARG,
96 PORT_ARG_SHORT,
97 WWW_DIR_ARG,
98 INDEX_HTML_ARG,
99 NO_GITIGNORE_ARG,
100];
101
102pub const DOUBLE_DASH: &str = "--";
104
105pub const ACTION_RUN: &str = "run";
107
108pub const ACTION_BUILD: &str = "build";
110
111pub const RUST_MIN_STACK_ENV: &str = "RUST_MIN_STACK";
113
114pub const RUST_MIN_STACK_VALUE: &str = "16777216";
116
117pub const INDEX_HTML_DEV: &str = r#"<!doctype html>
127<html lang="en">
128 <head>
129 <meta charset="utf-8" />
130 <meta
131 name="viewport"
132 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-visual"
133 />
134 <meta name="mobile-web-app-capable" content="yes" />
135 <meta name="apple-mobile-web-app-capable" content="yes" />
136 <meta
137 name="apple-mobile-web-app-status-bar-style"
138 content="black-translucent"
139 />
140 <meta
141 name="description"
142 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
143 />
144 <meta
145 name="keywords"
146 content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
147 />
148 <meta property="og:title" content="euv" />
149 <meta
150 property="og:description"
151 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
152 />
153 <meta property="og:type" content="website" />
154 <title>Euv</title>
155 <style>
156 * {
157 -webkit-font-smoothing: antialiased;
158 -moz-osx-font-smoothing: grayscale;
159 text-rendering: optimizeLegibility;
160 }
161 canvas {
162 image-rendering: auto;
163 }
164 </style>
165 </head>
166 <body>
167 <div id="app"></div>
168 </body>
169 <script type="module">
170 import init, { main } from '__IMPORT_PATH__';
171 await init();
172 main();
173 </script>
174 <script>
175 (function () {
176 async function connect() {
177 try {
178 const res = await fetch('/__euv_reload');
179 const data = await res.json();
180 if (data.type === 'Reload') {
181 location.reload();
182 } else if (data.type === 'Error') {
183 console.error('[euv] build error:', data.message);
184 setTimeout(connect, 1000);
185 } else {
186 setTimeout(connect, 1000);
187 }
188 } catch (_) {
189 setTimeout(connect, 2000);
190 }
191 }
192 connect();
193 })();
194 </script>
195</html>
196"#;
197
198pub const INDEX_HTML_RELEASE: &str = r#"<!doctype html>
204<html lang="en">
205 <head>
206 <meta charset="utf-8" />
207 <meta
208 name="viewport"
209 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-visual"
210 />
211 <meta name="mobile-web-app-capable" content="yes" />
212 <meta name="apple-mobile-web-app-capable" content="yes" />
213 <meta
214 name="apple-mobile-web-app-status-bar-style"
215 content="black-translucent"
216 />
217 <meta
218 name="description"
219 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
220 />
221 <meta
222 name="keywords"
223 content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
224 />
225 <meta property="og:title" content="euv" />
226 <meta
227 property="og:description"
228 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
229 />
230 <meta property="og:type" content="website" />
231 <title>Euv</title>
232 <style>
233 * {
234 -webkit-font-smoothing: antialiased;
235 -moz-osx-font-smoothing: grayscale;
236 text-rendering: optimizeLegibility;
237 }
238 canvas {
239 image-rendering: auto;
240 }
241 </style>
242 </head>
243 <body>
244 <div id="app"></div>
245 </body>
246 <script type="module">
247 import init, { main } from '__IMPORT_PATH__';
248 await init();
249 main();
250 </script>
251</html>
252"#;