pub(crate) const IMPORT_PATH_PLACEHOLDER: &str = "__IMPORT_PATH__";
pub(crate) const RELOAD_ROUTE_PLACEHOLDER: &str = "__RELOAD_ROUTE__";
pub(crate) const RELOAD_ROUTE: &str = "/__euv_reload";
pub(crate) const RELEASE_FLAG: &str = "--release";
pub(crate) const WASM_PACK_COMMAND: &str = "wasm-pack";
pub(crate) const WASM_PACK_BUILD_SUBCOMMAND: &str = "build";
pub(crate) const OUT_DIR_ARG: &str = "--out-dir";
pub(crate) const OUT_NAME_ARG: &str = "--out-name";
pub(crate) const TARGET_ARG: &str = "--target";
pub(crate) const TARGET_WEB: &str = "web";
pub(crate) const PKG_DIR_NAME: &str = "pkg";
pub(crate) const JS_EXTENSION: &str = ".js";
pub(crate) const SRC_DIR_NAME: &str = "src";
pub(crate) const GITIGNORE_FILE_NAME: &str = ".gitignore";
pub(crate) const CARGO_TOML_FILE_NAME: &str = "Cargo.toml";
pub(crate) const INDEX_HTML_FILE_NAME: &str = "index.html";
pub(crate) const RELATIVE_PATH_PREFIX: &str = "./";
pub(crate) const PATH_SEPARATOR: &str = "/";
pub(crate) const DEV_FLAG: &str = "--dev";
pub(crate) const PROFILING_FLAG: &str = "--profiling";
pub(crate) const CRATE_PATH_ARG: &str = "--crate-path";
pub(crate) const CRATE_PATH_ARG_SHORT: &str = "-c";
pub(crate) const PORT_ARG: &str = "--port";
pub(crate) const PORT_ARG_SHORT: &str = "-p";
pub(crate) const WWW_DIR_ARG: &str = "--www-dir";
pub(crate) const INDEX_HTML_ARG: &str = "--index-html";
pub(crate) const NO_GITIGNORE_ARG: &str = "--no-gitignore";
pub(crate) const EUV_ARGS: &[&str] = &[
CRATE_PATH_ARG,
CRATE_PATH_ARG_SHORT,
PORT_ARG,
PORT_ARG_SHORT,
WWW_DIR_ARG,
INDEX_HTML_ARG,
NO_GITIGNORE_ARG,
];
pub(crate) const DOUBLE_DASH: &str = "--";
pub(crate) const ACTION_RUN: &str = "run";
pub(crate) const ACTION_BUILD: &str = "build";
pub(crate) const RUST_MIN_STACK_ENV: &str = "RUST_MIN_STACK";
pub(crate) const RUST_MIN_STACK_VALUE: &str = "16777216";
pub(crate) const INDEX_HTML_DEV: &str = r#"<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="description"
content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
/>
<meta
name="keywords"
content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
/>
<meta property="og:title" content="euv" />
<meta
property="og:description"
content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
/>
<meta property="og:type" content="website" />
<title>Euv</title>
<style>
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
canvas {
image-rendering: auto;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script type="module">
import init, { main } from './pkg/euv.js';
await init();
main();
</script>
<script>
(function () {
async function connect() {
try {
const res = await fetch('/__euv_reload');
const data = await res.json();
if (data.type === 'Reload') {
location.reload();
} else if (data.type === 'Error') {
console.error('[euv] build error:', data.message);
setTimeout(connect, 1000);
} else {
setTimeout(connect, 1000);
}
} catch (_) {
setTimeout(connect, 2000);
}
}
connect();
})();
</script>
</html>
"#;
pub(crate) const INDEX_HTML_RELEASE: &str = r#"<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="description"
content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
/>
<meta
name="keywords"
content="rust, webassembly, wasm, ui-framework, virtual-dom, reactive, declarative-ui, euv"
/>
<meta property="og:title" content="euv" />
<meta
property="og:description"
content="A declarative, cross-platform UI framework for Rust with virtual DOM, reactive signals, and HTML macros for WebAssembly."
/>
<meta property="og:type" content="website" />
<title>Euv</title>
<style>
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
canvas {
image-rendering: auto;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script type="module">
import init, { main } from './pkg/euv.js';
await init();
main();
</script>
</html>
"#;