From d997675b7e53d916b1e00814152a941a7cd64c5c Mon Sep 17 00:00:00 2001 From: Yiffy Dev Date: Wed, 30 Oct 2024 17:51:49 +0500 Subject: [PATCH] micro: set repistory for packages micro: fmt micro: set repistory for packages micro: release.toml micro: prepare for crates publish. Im crazy micro: prepare for crates publish. Im crazy micro: prepare for crates publish. Im crazy micro: prepare for crates publish. Im crazy micro: prepare for crates publish. Im crazy --- Cargo.lock | 10 +-- Cargo.toml | 15 ++--- examples/leptos-axum/README.md | 86 +------------------------ release.toml | 8 +++ sabry_build/Cargo.toml | 1 + sabry_build/README.md | 8 +++ sabry_build/src/buildmagic.rs | 8 +-- sabry_build/src/lib.rs | 2 + sabry_intrnl/Cargo.toml | 1 + sabry_intrnl/README.md | 8 +++ sabry_intrnl/src/lib.rs | 2 + sabry_procmacro/Cargo.toml | 1 + sabry_procmacro/README.md | 8 +++ sabry_procmacro/src/lib.rs | 2 + sabry_procmacro_impl/Cargo.toml | 1 + sabry_procmacro_impl/README.md | 8 +++ sabry_procmacro_impl/src/impls/sassy.rs | 11 ++-- sabry_procmacro_impl/src/lib.rs | 2 + 18 files changed, 74 insertions(+), 108 deletions(-) create mode 100644 release.toml create mode 100644 sabry_build/README.md create mode 100644 sabry_intrnl/README.md create mode 100644 sabry_procmacro/README.md create mode 100644 sabry_procmacro_impl/README.md diff --git a/Cargo.lock b/Cargo.lock index 1907822..74b0b99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -987,7 +987,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sabry" -version = "0.0.1" +version = "0.0.0" dependencies = [ "sabry_build", "sabry_intrnl", @@ -996,7 +996,7 @@ dependencies = [ [[package]] name = "sabry_build" -version = "0.0.1" +version = "0.0.0" dependencies = [ "proc-macro2", "sabry_intrnl", @@ -1008,7 +1008,7 @@ dependencies = [ [[package]] name = "sabry_intrnl" -version = "0.0.1" +version = "0.0.0" dependencies = [ "base64", "blake3", @@ -1027,14 +1027,14 @@ dependencies = [ [[package]] name = "sabry_procmacro" -version = "0.0.1" +version = "0.0.0" dependencies = [ "sabry_procmacro_impl", ] [[package]] name = "sabry_procmacro_impl" -version = "0.0.1" +version = "0.0.0" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 9bab5e4..7bce3ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,19 +10,17 @@ exclude = [ ] [workspace.dependencies] -sabry_intrnl = {path = "sabry_intrnl", version = "0.0.1"} -sabry_procmacro = {path = "sabry_procmacro", version = "0.0.1"} -sabry_procmacro_impl = {path = "sabry_procmacro_impl", version = "0.0.1"} -sabry_build = {path = "sabry_build", version = "0.0.1"} - - - +sabry_intrnl = {path = "sabry_intrnl", version = "0.0.0"} +sabry_procmacro = {path = "sabry_procmacro", version = "0.0.0"} +sabry_procmacro_impl = {path = "sabry_procmacro_impl", version = "0.0.0"} +sabry_build = {path = "sabry_build", version = "0.0.0"} [workspace.package] -version = "0.0.1" +version = "0.0.0" edition = "2021" rust-version = "1.82" authors = ["Svyatoslav Pushkarev "] +repository = "https://github.com/yiffyrusdev/sabry" license = "MIT" publish = true @@ -30,6 +28,7 @@ publish = true name = "sabry" description = "Syntactically Awesome But RustY - crate that brings SCSS/SASS into rust." keywords = ["web", "sass", "scss", "macro"] +repository.workspace = true version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/examples/leptos-axum/README.md b/examples/leptos-axum/README.md index e5d3c4a..bbfcf13 100644 --- a/examples/leptos-axum/README.md +++ b/examples/leptos-axum/README.md @@ -3,88 +3,4 @@ Leptos Logo -# Leptos Axum Starter Template - -This is a template for use with the [Leptos](https://github.com/leptos-rs/leptos) web framework and the [cargo-leptos](https://github.com/akesson/cargo-leptos) tool using [Axum](https://github.com/tokio-rs/axum). - -## Creating your template repo - -If you don't have `cargo-leptos` installed you can install it with - -```bash -cargo install cargo-leptos --locked -``` - -Then run -```bash -cargo leptos new --git https://github.com/leptos-rs/start-axum-0.7 -``` - -to generate a new project template. - -```bash -cd leptos-axum -``` - -to go to your newly created project. -Feel free to explore the project structure, but the best place to start with your application code is in `src/app.rs`. -Addtionally, Cargo.toml may need updating as new versions of the dependencies are released, especially if things are not working after a `cargo update`. - -## Running your project - -```bash -cargo leptos watch -``` - -## Installing Additional Tools - -By default, `cargo-leptos` uses `nightly` Rust, `cargo-generate`, and `sass`. If you run into any trouble, you may need to install one or more of these tools. - -1. `rustup toolchain install nightly --allow-downgrade` - make sure you have Rust nightly -2. `rustup target add wasm32-unknown-unknown` - add the ability to compile Rust to WebAssembly -3. `cargo install cargo-generate` - install `cargo-generate` binary (should be installed automatically in future) -4. `npm install -g sass` - install `dart-sass` (should be optional in future - -## Compiling for Release -```bash -cargo leptos build --release -``` - -Will generate your server binary in target/server/release and your site package in target/site - -## Testing Your Project -```bash -cargo leptos end-to-end -``` - -```bash -cargo leptos end-to-end --release -``` - -Cargo-leptos uses Playwright as the end-to-end test tool. -Tests are located in end2end/tests directory. - -## Executing a Server on a Remote Machine Without the Toolchain -After running a `cargo leptos build --release` the minimum files needed are: - -1. The server binary located in `target/server/release` -2. The `site` directory and all files within located in `target/site` - -Copy these files to your remote server. The directory structure should be: -```text -leptos-axum -site/ -``` -Set the following environment variables (updating for your project as needed): -```text -LEPTOS_OUTPUT_NAME="leptos-axum" -LEPTOS_SITE_ROOT="site" -LEPTOS_SITE_PKG_DIR="pkg" -LEPTOS_SITE_ADDR="127.0.0.1:3000" -LEPTOS_RELOAD_PORT="3001" -``` -Finally, run the server binary. - -## Licensing - -This template itself is released under the Unlicense. You should replace the LICENSE for your own application with an appropriate license if you plan to release it publicly. +This is an example of sabry with leptos-axum, made with [leptos-axum sterter template](https://github.com/leptos-rs/start-axum) diff --git a/release.toml b/release.toml new file mode 100644 index 0000000..d60c78b --- /dev/null +++ b/release.toml @@ -0,0 +1,8 @@ +allow-branch = ["master"] +sign-commit = true +sign-tag = true +target = "x86_64-unknown-linux-gnu" + +pre-release-replacements = [ + {file="README.md", search='sabry = {\s?version = "[0-9a-z\-\.]*"(?.*)\s?}', replace='sabry = { version = "{{version}}" $rest}'}, +] diff --git a/sabry_build/Cargo.toml b/sabry_build/Cargo.toml index c8f8a81..526a350 100644 --- a/sabry_build/Cargo.toml +++ b/sabry_build/Cargo.toml @@ -2,6 +2,7 @@ name = "sabry_build" description = "Sabry build magic as a separate crate" version.workspace = true +repository.workspace = true edition.workspace = true rust-version.workspace = true authors.workspace = true diff --git a/sabry_build/README.md b/sabry_build/README.md new file mode 100644 index 0000000..51da6c9 --- /dev/null +++ b/sabry_build/README.md @@ -0,0 +1,8 @@ +sabry_build is an internal-ish part of the sabry lib, you should probably start from [here](https://crates.io/crates/sabry) + +There is very low probability, that you should depend on this crate, instead do: + +```rust,ignore +[dependencies] +sabry = {version = "0.0.1"} +``` diff --git a/sabry_build/src/buildmagic.rs b/sabry_build/src/buildmagic.rs index c3e6439..f9abcf7 100644 --- a/sabry_build/src/buildmagic.rs +++ b/sabry_build/src/buildmagic.rs @@ -4,15 +4,13 @@ use std::{ fs::{self, OpenOptions}, io::{self, Write}, path::PathBuf, - str::FromStr, vec, + str::FromStr, + vec, }; use sabry_intrnl::{ compiler::{CompilerAdapter, SabryCompilerError}, - config::{ - manifest::ManifestError, - BehavHashCollision, BehavSassModCollision, SabryConfig, - }, + config::{manifest::ManifestError, BehavHashCollision, BehavSassModCollision, SabryConfig}, scoper::{hash::ScopeHash, ArbitraryScope, ScopeError}, }; use sabry_procmacro_impl::impls::styly; diff --git a/sabry_build/src/lib.rs b/sabry_build/src/lib.rs index 180dbd0..ecac97d 100644 --- a/sabry_build/src/lib.rs +++ b/sabry_build/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + pub mod buildmagic; pub mod filevisit; pub use buildmagic::*; diff --git a/sabry_intrnl/Cargo.toml b/sabry_intrnl/Cargo.toml index 457d28f..19d7f51 100644 --- a/sabry_intrnl/Cargo.toml +++ b/sabry_intrnl/Cargo.toml @@ -2,6 +2,7 @@ name = "sabry_intrnl" description = "Sabry internal, yet still public library" version.workspace = true +repository.workspace = true edition.workspace = true rust-version.workspace = true authors.workspace = true diff --git a/sabry_intrnl/README.md b/sabry_intrnl/README.md new file mode 100644 index 0000000..7c3e17d --- /dev/null +++ b/sabry_intrnl/README.md @@ -0,0 +1,8 @@ +sabry_intrnl is an internal-ish part of the sabry lib, you should probably start from [here](https://crates.io/crates/sabry) + +There is very low probability, that you should depend on this crate, instead do: + +```rust,ignore +[dependencies] +sabry = {version = "0.0.1"} +``` diff --git a/sabry_intrnl/src/lib.rs b/sabry_intrnl/src/lib.rs index ec12902..495a300 100644 --- a/sabry_intrnl/src/lib.rs +++ b/sabry_intrnl/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + pub mod compiler; pub mod config; pub mod scoper; diff --git a/sabry_procmacro/Cargo.toml b/sabry_procmacro/Cargo.toml index 70df668..932a3d2 100644 --- a/sabry_procmacro/Cargo.toml +++ b/sabry_procmacro/Cargo.toml @@ -2,6 +2,7 @@ name = "sabry_procmacro" description = "Sabry proc-macro declarations" version.workspace = true +repository.workspace = true edition.workspace = true rust-version.workspace = true authors.workspace = true diff --git a/sabry_procmacro/README.md b/sabry_procmacro/README.md new file mode 100644 index 0000000..6de0068 --- /dev/null +++ b/sabry_procmacro/README.md @@ -0,0 +1,8 @@ +sabry_procmacro is an internal-ish part of the sabry lib, you should probably start from [here](https://crates.io/crates/sabry) + +There is very low probability, that you should depend on this crate, instead do: + +```rust,ignore +[dependencies] +sabry = {version = "0.0.1"} +``` diff --git a/sabry_procmacro/src/lib.rs b/sabry_procmacro/src/lib.rs index d5ede42..b05f1d9 100644 --- a/sabry_procmacro/src/lib.rs +++ b/sabry_procmacro/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + use proc_macro::TokenStream; use sabry_procmacro_impl::impls::{ sassy::sassy_macro_impl, styly::styly_macro_impl, usey::usey_macro_impl, diff --git a/sabry_procmacro_impl/Cargo.toml b/sabry_procmacro_impl/Cargo.toml index 499f1ce..b170930 100644 --- a/sabry_procmacro_impl/Cargo.toml +++ b/sabry_procmacro_impl/Cargo.toml @@ -2,6 +2,7 @@ name = "sabry_procmacro_impl" description = "Sabry proc-macro internals reusable outside of proc-macro context" version.workspace = true +repository.workspace = true edition.workspace = true rust-version.workspace = true authors.workspace = true diff --git a/sabry_procmacro_impl/README.md b/sabry_procmacro_impl/README.md new file mode 100644 index 0000000..eb13d81 --- /dev/null +++ b/sabry_procmacro_impl/README.md @@ -0,0 +1,8 @@ +sabry_procmacro_impl is an internal-ish part of the sabry lib, you should probably start from [here](https://crates.io/crates/sabry) + +There is very low probability, that you should depend on this crate, instead do: + +```rust,ignore +[dependencies] +sabry = {version = "0.0.1"} +``` diff --git a/sabry_procmacro_impl/src/impls/sassy.rs b/sabry_procmacro_impl/src/impls/sassy.rs index 6e89732..16fe436 100644 --- a/sabry_procmacro_impl/src/impls/sassy.rs +++ b/sabry_procmacro_impl/src/impls/sassy.rs @@ -1,7 +1,7 @@ use proc_macro2::TokenStream; use quote::quote; -use syn::{parse::Parse, Ident}; use regex::Regex; +use syn::{parse::Parse, Ident}; use super::{ArbitraryStyleBlock, ArbitraryStyleSyntax}; @@ -50,7 +50,10 @@ impl Parse for MacroSyntax { // this is because of how parsing works. Need to find more elegant way though // TODO: find a more elegant way - code.code = Regex::new("\n ").expect("BUG: failed to build regex for indentation SASS").replace_all(&code.code, "\n").to_string(); + code.code = Regex::new("\n ") + .expect("BUG: failed to build regex for indentation SASS") + .replace_all(&code.code, "\n") + .to_string(); Ok(Self { ident, @@ -61,6 +64,4 @@ impl Parse for MacroSyntax { } #[cfg(test)] -mod test { - -} +mod test {} diff --git a/sabry_procmacro_impl/src/lib.rs b/sabry_procmacro_impl/src/lib.rs index daad739..8bc1266 100644 --- a/sabry_procmacro_impl/src/lib.rs +++ b/sabry_procmacro_impl/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + // Moving this to separate crate, cuz I don't wanna to reimplement that parsing again for build magic // Also, because I can.