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 BASE_HREF_PLACEHOLDER: &str = "__EUV_BASE_HREF_TAG__";
29
30pub const EUV_NO_INLINE_BRIDGE_ENV: &str = "EUV_NO_INLINE_BRIDGE";
35
36pub const RELOAD_ROUTE: &str = "/__euv_reload";
40
41pub const RELEASE_FLAG: &str = "--release";
43
44pub const WASM_PACK_COMMAND: &str = "wasm-pack";
46
47pub const WASM_PACK_BUILD_SUBCOMMAND: &str = "build";
49
50pub const CARGO_COMMAND: &str = "cargo";
52
53pub const FMT_SUBCOMMAND: &str = "fmt";
55
56pub const FMT_ERROR_MESSAGE: &str = "cargo fmt error";
58
59pub const OUT_DIR_ARG: &str = "--out-dir";
61
62pub const OUT_NAME_ARG: &str = "--out-name";
64
65pub const TARGET_ARG: &str = "--target";
67
68pub const TARGET_WEB: &str = "web";
70
71pub const PKG_DIR_NAME: &str = "pkg";
73
74pub const JS_EXTENSION: &str = ".js";
76
77pub const SRC_DIR_NAME: &str = "src";
79
80pub const GITIGNORE_FILE_NAME: &str = ".gitignore";
82
83pub const CARGO_TOML_FILE_NAME: &str = "Cargo.toml";
85
86pub const INDEX_HTML_FILE_NAME: &str = "index.html";
88
89pub const RELATIVE_PATH_PREFIX: &str = "./";
91
92pub const PATH_SEPARATOR: &str = "/";
94
95pub const PARENT_DIR: &str = "..";
97
98pub const STR_HYPHEN: &str = "-";
101
102pub const STR_UNDERSCORE: &str = "_";
105
106pub const DEV_FLAG: &str = "--dev";
108
109pub const PROFILING_FLAG: &str = "--profiling";
111
112pub const CRATE_PATH_ARG: &str = "--crate-path";
114
115pub const CRATE_PATH_ARG_SHORT: &str = "-c";
117
118pub const PORT_ARG: &str = "--port";
120
121pub const PORT_ARG_SHORT: &str = "-p";
123
124pub const WWW_DIR_ARG: &str = "--www-dir";
126
127pub const INDEX_HTML_ARG: &str = "--index-html";
129
130pub const NO_GITIGNORE_ARG: &str = "--no-gitignore";
132
133pub const EUV_ARGS: &[&str] = &[
135 CRATE_PATH_ARG,
136 CRATE_PATH_ARG_SHORT,
137 PORT_ARG,
138 PORT_ARG_SHORT,
139 WWW_DIR_ARG,
140 INDEX_HTML_ARG,
141 NO_GITIGNORE_ARG,
142];
143
144pub const DOUBLE_DASH: &str = "--";
146
147pub const ACTION_RUN: &str = "run";
149
150pub const ACTION_BUILD: &str = "build";
152
153pub const RUST_MIN_STACK_ENV: &str = "RUST_MIN_STACK";
155
156pub const RUST_MIN_STACK_VALUE: &str = "16777216";
158
159pub const INDEX_HTML_DEV: &str = r#"<!doctype html>
169<html lang="en">
170 <head>
171 <meta charset="utf-8" />
172 <meta
173 name="viewport"
174 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, interactive-widget=resizes-visual"
175 />
176 <meta name="mobile-web-app-capable" content="yes" />
177 <meta name="apple-mobile-web-app-capable" content="yes" />
178 <meta
179 name="description"
180 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
181 />
182 <meta
183 name="keywords"
184 content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
185 />
186 <meta property="og:title" content="euv" />
187 <meta
188 property="og:description"
189 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
190 />
191 <meta property="og:type" content="website" />
192 <title>Euv</title>
193 __EUV_BASE_HREF_TAG__
194 <style>
195 * {
196 -webkit-font-smoothing: antialiased;
197 -moz-osx-font-smoothing: grayscale;
198 text-rendering: optimizeLegibility;
199 }
200 canvas {
201 image-rendering: auto;
202 }
203 </style>
204 </head>
205 <body>
206 <div id="app"></div>
207 </body>
208 <script>
209__EUV_INLINE_JS__
210 </script>
211 <script>
212 (function () {
213 async function connect() {
214 try {
215 const res = await fetch('/__euv_reload');
216 const data = await res.json();
217 if (data.type === 'Reload') {
218 location.reload();
219 } else if (data.type === 'Error') {
220 console.error('[euv] build error:', data.message);
221 setTimeout(connect, 1000);
222 } else {
223 setTimeout(connect, 1000);
224 }
225 } catch (_) {
226 setTimeout(connect, 2000);
227 }
228 }
229 connect();
230 })();
231 </script>
232</html>
233"#;
234
235pub const INDEX_HTML_RELEASE: &str = r#"<!doctype html>
241<html lang="en">
242 <head>
243 <meta charset="utf-8" />
244 <meta
245 name="viewport"
246 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, interactive-widget=resizes-visual"
247 />
248 <meta name="mobile-web-app-capable" content="yes" />
249 <meta name="apple-mobile-web-app-capable" content="yes" />
250 <meta
251 name="description"
252 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
253 />
254 <meta
255 name="keywords"
256 content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
257 />
258 <meta property="og:title" content="euv" />
259 <meta
260 property="og:description"
261 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
262 />
263 <meta property="og:type" content="website" />
264 <title>Euv</title>
265 __EUV_BASE_HREF_TAG__
266 <style>
267 * {
268 -webkit-font-smoothing: antialiased;
269 -moz-osx-font-smoothing: grayscale;
270 text-rendering: optimizeLegibility;
271 }
272 canvas {
273 image-rendering: auto;
274 }
275 </style>
276 </head>
277 <body>
278 <div id="app"></div>
279 </body>
280 <script>
281__EUV_INLINE_JS__
282 </script>
283</html>
284"#;