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