ines-core 0.0.2

Rust bundler/framework for website with WebComponent
Documentation
pub(super) static CARGO_TOML: &str = r#"[package]
name = "_"
edition = "2021"
[lib]
path = "empty.rs"

[build-dependencies]
ines-core = {path = "/home/alyrow/personal/projects/ines/ines-core"}"#;
pub(super) static BUILD_RS: &str = r#"use std::path::PathBuf;

fn main() {
    let project = ines_core::project::Project::load_from_path(PathBuf::from(".")).unwrap();
    project.build().unwrap();

    println!("cargo::rerun-if-changed=src");
    println!("cargo::rerun-if-changed=ines.toml");
}"#;
pub(super) static INDEX_HTML: &str = r#"<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="index.css">
    <script type="module" src="index.js"></script>
</head>
<body>
#![ROOT]
</body>
</html>"#;
pub(super) static COMPONENT_JS: &str = r#"export class Component extends HTMLElement {
    /** @type string */
    inesId

    /**
     * @param {string} id
     */
    constructor(id) {
        super();
        this.inesId = id

        let template = document.getElementById(this.inesId);
        let templateContent = template.content;

        const shadowRoot = this.attachShadow({ mode: "open" });
        shadowRoot.appendChild(templateContent.cloneNode(true));
    }
}"#;
pub(super) static REDIRECT_HTML: &str = r##"<script>
    sessionStorage.setItem("redirect", "#![PATH]");
    document.location.replace("/")
</script>"##;