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 DEV_FLAG: &str = "--dev";
63
64pub const PROFILING_FLAG: &str = "--profiling";
66
67pub const CRATE_PATH_ARG: &str = "--crate-path";
69
70pub const CRATE_PATH_ARG_SHORT: &str = "-c";
72
73pub const PORT_ARG: &str = "--port";
75
76pub const PORT_ARG_SHORT: &str = "-p";
78
79pub const WWW_DIR_ARG: &str = "--www-dir";
81
82pub const INDEX_HTML_ARG: &str = "--index-html";
84
85pub const NO_GITIGNORE_ARG: &str = "--no-gitignore";
87
88pub const EUV_ARGS: &[&str] = &[
90 CRATE_PATH_ARG,
91 CRATE_PATH_ARG_SHORT,
92 PORT_ARG,
93 PORT_ARG_SHORT,
94 WWW_DIR_ARG,
95 INDEX_HTML_ARG,
96 NO_GITIGNORE_ARG,
97];
98
99pub const DOUBLE_DASH: &str = "--";
101
102pub const ACTION_RUN: &str = "run";
104
105pub const ACTION_BUILD: &str = "build";
107
108pub const RUST_MIN_STACK_ENV: &str = "RUST_MIN_STACK";
110
111pub const RUST_MIN_STACK_VALUE: &str = "16777216";
113
114pub const INDEX_HTML_DEV: &str = r#"<!doctype html>
124<html lang="en">
125 <head>
126 <meta charset="utf-8" />
127 <meta
128 name="viewport"
129 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-visual"
130 />
131 <meta name="mobile-web-app-capable" content="yes" />
132 <meta name="apple-mobile-web-app-capable" content="yes" />
133 <meta
134 name="apple-mobile-web-app-status-bar-style"
135 content="black-translucent"
136 />
137 <meta
138 name="description"
139 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
140 />
141 <meta
142 name="keywords"
143 content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
144 />
145 <meta property="og:title" content="euv" />
146 <meta
147 property="og:description"
148 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
149 />
150 <meta property="og:type" content="website" />
151 <title>Euv</title>
152 <style>
153 * {
154 -webkit-font-smoothing: antialiased;
155 -moz-osx-font-smoothing: grayscale;
156 text-rendering: optimizeLegibility;
157 }
158 canvas {
159 image-rendering: auto;
160 }
161 </style>
162 </head>
163 <body>
164 <div id="app"></div>
165 </body>
166 <script type="module">
167 import init, { main } from './pkg/euv.js';
168 await init();
169 main();
170 </script>
171 <script>
172 (function () {
173 async function connect() {
174 try {
175 const res = await fetch('/__euv_reload');
176 const data = await res.json();
177 if (data.type === 'Reload') {
178 location.reload();
179 } else if (data.type === 'Error') {
180 console.error('[euv] build error:', data.message);
181 setTimeout(connect, 1000);
182 } else {
183 setTimeout(connect, 1000);
184 }
185 } catch (_) {
186 setTimeout(connect, 2000);
187 }
188 }
189 connect();
190 })();
191 </script>
192</html>
193"#;
194
195pub const INDEX_HTML_RELEASE: &str = r#"<!doctype html>
201<html lang="en">
202 <head>
203 <meta charset="utf-8" />
204 <meta
205 name="viewport"
206 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-visual"
207 />
208 <meta name="mobile-web-app-capable" content="yes" />
209 <meta name="apple-mobile-web-app-capable" content="yes" />
210 <meta
211 name="apple-mobile-web-app-status-bar-style"
212 content="black-translucent"
213 />
214 <meta
215 name="description"
216 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
217 />
218 <meta
219 name="keywords"
220 content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
221 />
222 <meta property="og:title" content="euv" />
223 <meta
224 property="og:description"
225 content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
226 />
227 <meta property="og:type" content="website" />
228 <title>Euv</title>
229 <style>
230 * {
231 -webkit-font-smoothing: antialiased;
232 -moz-osx-font-smoothing: grayscale;
233 text-rendering: optimizeLegibility;
234 }
235 canvas {
236 image-rendering: auto;
237 }
238 </style>
239 </head>
240 <body>
241 <div id="app"></div>
242 </body>
243 <script type="module">
244 import init, { main } from './pkg/euv.js';
245 await init();
246 main();
247 </script>
248</html>
249"#;