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
This commit is contained in:
parent
5d1897a914
commit
d997675b7e
18 changed files with 74 additions and 108 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
|
@ -987,7 +987,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sabry"
|
name = "sabry"
|
||||||
version = "0.0.1"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sabry_build",
|
"sabry_build",
|
||||||
"sabry_intrnl",
|
"sabry_intrnl",
|
||||||
|
|
@ -996,7 +996,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sabry_build"
|
name = "sabry_build"
|
||||||
version = "0.0.1"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"sabry_intrnl",
|
"sabry_intrnl",
|
||||||
|
|
@ -1008,7 +1008,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sabry_intrnl"
|
name = "sabry_intrnl"
|
||||||
version = "0.0.1"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"blake3",
|
"blake3",
|
||||||
|
|
@ -1027,14 +1027,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sabry_procmacro"
|
name = "sabry_procmacro"
|
||||||
version = "0.0.1"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sabry_procmacro_impl",
|
"sabry_procmacro_impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sabry_procmacro_impl"
|
name = "sabry_procmacro_impl"
|
||||||
version = "0.0.1"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
||||||
15
Cargo.toml
15
Cargo.toml
|
|
@ -10,19 +10,17 @@ exclude = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
sabry_intrnl = {path = "sabry_intrnl", version = "0.0.1"}
|
sabry_intrnl = {path = "sabry_intrnl", version = "0.0.0"}
|
||||||
sabry_procmacro = {path = "sabry_procmacro", version = "0.0.1"}
|
sabry_procmacro = {path = "sabry_procmacro", version = "0.0.0"}
|
||||||
sabry_procmacro_impl = {path = "sabry_procmacro_impl", version = "0.0.1"}
|
sabry_procmacro_impl = {path = "sabry_procmacro_impl", version = "0.0.0"}
|
||||||
sabry_build = {path = "sabry_build", version = "0.0.1"}
|
sabry_build = {path = "sabry_build", version = "0.0.0"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.0.1"
|
version = "0.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.82"
|
rust-version = "1.82"
|
||||||
authors = ["Svyatoslav Pushkarev <yiffyrusdev@yandex.ru>"]
|
authors = ["Svyatoslav Pushkarev <yiffyrusdev@yandex.ru>"]
|
||||||
|
repository = "https://github.com/yiffyrusdev/sabry"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
publish = true
|
publish = true
|
||||||
|
|
||||||
|
|
@ -30,6 +28,7 @@ publish = true
|
||||||
name = "sabry"
|
name = "sabry"
|
||||||
description = "Syntactically Awesome But RustY - crate that brings SCSS/SASS into rust."
|
description = "Syntactically Awesome But RustY - crate that brings SCSS/SASS into rust."
|
||||||
keywords = ["web", "sass", "scss", "macro"]
|
keywords = ["web", "sass", "scss", "macro"]
|
||||||
|
repository.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -3,88 +3,4 @@
|
||||||
<img src="https://raw.githubusercontent.com/leptos-rs/leptos/main/docs/logos/Leptos_logo_RGB.svg" alt="Leptos Logo">
|
<img src="https://raw.githubusercontent.com/leptos-rs/leptos/main/docs/logos/Leptos_logo_RGB.svg" alt="Leptos Logo">
|
||||||
</picture>
|
</picture>
|
||||||
|
|
||||||
# Leptos Axum Starter Template
|
This is an example of sabry with leptos-axum, made with [leptos-axum sterter template](https://github.com/leptos-rs/start-axum)
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
|
||||||
8
release.toml
Normal file
8
release.toml
Normal file
|
|
@ -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\-\.]*"(?<rest>.*)\s?}', replace='sabry = { version = "{{version}}" $rest}'},
|
||||||
|
]
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
name = "sabry_build"
|
name = "sabry_build"
|
||||||
description = "Sabry build magic as a separate crate"
|
description = "Sabry build magic as a separate crate"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|
|
||||||
8
sabry_build/README.md
Normal file
8
sabry_build/README.md
Normal file
|
|
@ -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"}
|
||||||
|
```
|
||||||
|
|
@ -4,15 +4,13 @@ use std::{
|
||||||
fs::{self, OpenOptions},
|
fs::{self, OpenOptions},
|
||||||
io::{self, Write},
|
io::{self, Write},
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
str::FromStr, vec,
|
str::FromStr,
|
||||||
|
vec,
|
||||||
};
|
};
|
||||||
|
|
||||||
use sabry_intrnl::{
|
use sabry_intrnl::{
|
||||||
compiler::{CompilerAdapter, SabryCompilerError},
|
compiler::{CompilerAdapter, SabryCompilerError},
|
||||||
config::{
|
config::{manifest::ManifestError, BehavHashCollision, BehavSassModCollision, SabryConfig},
|
||||||
manifest::ManifestError,
|
|
||||||
BehavHashCollision, BehavSassModCollision, SabryConfig,
|
|
||||||
},
|
|
||||||
scoper::{hash::ScopeHash, ArbitraryScope, ScopeError},
|
scoper::{hash::ScopeHash, ArbitraryScope, ScopeError},
|
||||||
};
|
};
|
||||||
use sabry_procmacro_impl::impls::styly;
|
use sabry_procmacro_impl::impls::styly;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
pub mod buildmagic;
|
pub mod buildmagic;
|
||||||
pub mod filevisit;
|
pub mod filevisit;
|
||||||
pub use buildmagic::*;
|
pub use buildmagic::*;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
name = "sabry_intrnl"
|
name = "sabry_intrnl"
|
||||||
description = "Sabry internal, yet still public library"
|
description = "Sabry internal, yet still public library"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|
|
||||||
8
sabry_intrnl/README.md
Normal file
8
sabry_intrnl/README.md
Normal file
|
|
@ -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"}
|
||||||
|
```
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
pub mod compiler;
|
pub mod compiler;
|
||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod scoper;
|
pub mod scoper;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
name = "sabry_procmacro"
|
name = "sabry_procmacro"
|
||||||
description = "Sabry proc-macro declarations"
|
description = "Sabry proc-macro declarations"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|
|
||||||
8
sabry_procmacro/README.md
Normal file
8
sabry_procmacro/README.md
Normal file
|
|
@ -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"}
|
||||||
|
```
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use sabry_procmacro_impl::impls::{
|
use sabry_procmacro_impl::impls::{
|
||||||
sassy::sassy_macro_impl, styly::styly_macro_impl, usey::usey_macro_impl,
|
sassy::sassy_macro_impl, styly::styly_macro_impl, usey::usey_macro_impl,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
name = "sabry_procmacro_impl"
|
name = "sabry_procmacro_impl"
|
||||||
description = "Sabry proc-macro internals reusable outside of proc-macro context"
|
description = "Sabry proc-macro internals reusable outside of proc-macro context"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|
|
||||||
8
sabry_procmacro_impl/README.md
Normal file
8
sabry_procmacro_impl/README.md
Normal file
|
|
@ -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"}
|
||||||
|
```
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
use syn::{parse::Parse, Ident};
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
use syn::{parse::Parse, Ident};
|
||||||
|
|
||||||
use super::{ArbitraryStyleBlock, ArbitraryStyleSyntax};
|
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
|
// this is because of how parsing works. Need to find more elegant way though
|
||||||
// TODO: find a more elegant way
|
// 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 {
|
Ok(Self {
|
||||||
ident,
|
ident,
|
||||||
|
|
@ -61,6 +64,4 @@ impl Parse for MacroSyntax {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
// Moving this to separate crate, cuz I don't wanna to reimplement that parsing again for build magic
|
||||||
// Also, because I can.
|
// Also, because I can.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue