diff --git a/.gitignore b/.gitignore index 61e2826a..14388e6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target *.db* /static_packages/node_modules +/static_packages/dist diff --git a/build.rs b/build.rs index 66111975..b2fd69f5 100644 --- a/build.rs +++ b/build.rs @@ -1,13 +1,20 @@ -use static_files::NpmBuild; -use std::path::Path; +use static_files::{resource_dir, NpmBuild}; +use std::{fs::{self, copy}, path::Path}; fn main() -> std::io::Result<()> { NpmBuild::new("./static_packages") - .install()? .change_detection() - .to_resource_dir() - .with_filter(|x: &Path| x.ends_with("feather-sprite.svg")) - .build()?; + .install()?; - Ok(()) + if fs::metadata(Path::new("./static_packages/dist")).is_err() { + fs::create_dir(Path::new("./static_packages/dist"))?; + } + + copy(Path::new("./static_packages/node_modules/feather-icons/dist/feather-sprite.svg"), Path::new("./static_packages/dist/feather-sprite.svg"))?; + copy(Path::new("./static_packages/node_modules/bulma/css/bulma.min.css"), Path::new("./static_packages/dist/bulma.min.css"))?; + copy(Path::new("./static_packages/node_modules/htmx.org/dist/htmx.min.js"), Path::new("./static_packages/dist/htmx.min.js"))?; + copy(Path::new("./static_packages/node_modules/htmx.org/dist/ext/response-targets.js"), Path::new("./static_packages/dist/response-targets.js"))?; + copy(Path::new("./static_packages/brass.jpeg"), Path::new("./static_packages/dist/brass.jpeg"))?; + + resource_dir("./static_packages/dist").build() } diff --git a/static_packages/brass.jpeg b/static_packages/brass.jpeg new file mode 100644 index 00000000..791ffb2a Binary files /dev/null and b/static_packages/brass.jpeg differ diff --git a/static_packages/package-lock.json b/static_packages/package-lock.json index 9f7c7e14..99b0456e 100644 --- a/static_packages/package-lock.json +++ b/static_packages/package-lock.json @@ -5,9 +5,18 @@ "packages": { "": { "devDependencies": { - "feather-icons": "^4.29.2" + "bulma": "^1.0.1", + "feather-icons": "^4.29.2", + "htmx.org": "^1.9.12" } }, + "node_modules/bulma": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bulma/-/bulma-1.0.1.tgz", + "integrity": "sha512-+xv/BIAEQakHkR0QVz+s+RjNqfC53Mx9ZYexyaFNFo9wx5i76HXArNdwW7bccyJxa5mgV/T5DcVGqsAB19nBJQ==", + "dev": true, + "license": "MIT" + }, "node_modules/classnames": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", @@ -37,6 +46,13 @@ "classnames": "^2.2.5", "core-js": "^3.1.3" } + }, + "node_modules/htmx.org": { + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-1.9.12.tgz", + "integrity": "sha512-VZAohXyF7xPGS52IM8d1T1283y+X4D+Owf3qY1NZ9RuBypyu9l8cGsxUMAG5fEAb/DhT7rDoJ9Hpu5/HxFD3cw==", + "dev": true, + "license": "0BSD" } } } diff --git a/static_packages/package.json b/static_packages/package.json index b54426c2..e57e64eb 100644 --- a/static_packages/package.json +++ b/static_packages/package.json @@ -1,5 +1,7 @@ { "devDependencies": { - "feather-icons": "^4.29.2" + "bulma": "^1.0.1", + "feather-icons": "^4.29.2", + "htmx.org": "^1.9.12" } }