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