Skip to content

Commit

Permalink
Load template by tag (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerioageno authored Jan 3, 2025
1 parent 592f402 commit cf56b3a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/tuono/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tuono"
version = "0.16.9"
version = "0.17.0"
edition = "2021"
authors = ["V. Ageno <[email protected]>"]
description = "Superfast React fullstack framework"
Expand Down
5 changes: 3 additions & 2 deletions crates/tuono/src/scaffold_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const GITHUB_TUONO_TAGS_URL: &str = "https://api.github.com/repos/tuono-labs/tuo
const GITHUB_TUONO_TAG_COMMIT_TREES_URL: &str =
"https://api.github.com/repos/tuono-labs/tuono/git/trees/";

const GITHUB_RAW_CONTENT_URL: &str = "https://raw.githubusercontent.com/tuono-labs/tuono/main/";
const GITHUB_RAW_CONTENT_URL: &str = "https://raw.githubusercontent.com/tuono-labs/tuono";

#[derive(Deserialize, Debug)]
enum GithubFileType {
Expand Down Expand Up @@ -61,6 +61,7 @@ pub fn create_new_project(folder_name: Option<String>, template: Option<String>)
.build()
.expect("Failed to build reqwest client");

// This string does not include the "v" version prefix
let cli_version: &str = crate_version!();

let res_tag = client
Expand Down Expand Up @@ -119,7 +120,7 @@ pub fn create_new_project(folder_name: Option<String>, template: Option<String>)
{
if let GithubFileType::Blob = element_type {
let file_content = client
.get(format!("{GITHUB_RAW_CONTENT_URL}{path}"))
.get(format!("{GITHUB_RAW_CONTENT_URL}/v{cli_version}/{path}"))
.send()
.expect("Failed to call the folder github API")
.text()
Expand Down
4 changes: 2 additions & 2 deletions crates/tuono_lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tuono_lib"
version = "0.16.9"
version = "0.17.0"
edition = "2021"
authors = ["V. Ageno <[email protected]>"]
description = "Superfast React fullstack framework"
Expand Down Expand Up @@ -32,7 +32,7 @@ either = "1.13.0"
tower-http = {version = "0.6.0", features = ["fs"]}
colored = "2.1.0"

tuono_lib_macros = {path = "../tuono_lib_macros", version = "0.16.9"}
tuono_lib_macros = {path = "../tuono_lib_macros", version = "0.17.0"}
# Match the same version used by axum
tokio-tungstenite = "0.24.0"
futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/tuono_lib_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tuono_lib_macros"
version = "0.16.9"
version = "0.17.0"
edition = "2021"
description = "Superfast React fullstack framework"
homepage = "https://tuono.dev"
Expand Down
2 changes: 1 addition & 1 deletion packages/tuono-fs-router-vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuono-fs-router-vite-plugin",
"version": "0.16.9",
"version": "0.17.0",
"description": "Plugin for the tuono's file system router. Tuono is the react/rust fullstack framework",
"homepage": "https://tuono.dev",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tuono-lazy-fn-vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuono-lazy-fn-vite-plugin",
"version": "0.16.9",
"version": "0.17.0",
"description": "Plugin for the tuono's lazy fn. Tuono is the react/rust fullstack framework",
"homepage": "https://tuono.dev",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tuono-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuono-router",
"version": "0.16.9",
"version": "0.17.0",
"description": "React routing component for the framework tuono. Tuono is the react/rust fullstack framework",
"homepage": "https://tuono.dev",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tuono/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuono",
"version": "0.16.9",
"version": "0.17.0",
"description": "Superfast React fullstack framework",
"homepage": "https://tuono.dev",
"scripts": {
Expand Down

0 comments on commit cf56b3a

Please sign in to comment.