Skip to content

Commit 9b831aa

Browse files
committed
feat(cli): standardize tsc as primary CLI, add port auto-fallback, and enhance website template
1 parent 6a9e48f commit 9b831aa

15 files changed

Lines changed: 600 additions & 342 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ graphify-out/
8080
*.bin
8181
*.out
8282
*.app
83-
bin/
83+
/bin/
84+
!**/src/bin/**
8485
build/
8586
dist/
8687
site/

‎cli/Cargo.toml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ version = "2.0.0"
44
license = "Apache-2.0"
55
edition = "2021"
66
description = "TechScript 2.0 compiler driver — the official tsc executable"
7-
default-run = "webforge"
7+
default-run = "tsc"
8+
9+
[[bin]]
10+
name = "tsc"
11+
path = "src/bin/tsc.rs"
812

913
[[bin]]
1014
name = "webforge"
@@ -14,10 +18,6 @@ path = "src/bin/webforge.rs"
1418
name = "techscript"
1519
path = "src/bin/techscript.rs"
1620

17-
[[bin]]
18-
name = "tsc"
19-
path = "src/bin/tsc.rs"
20-
2121
[[bin]]
2222
name = "tech"
2323
path = "src/bin/tech.rs"

‎cli/src/bin/tech.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
techscript_cli::entrypoint::run();
3+
}

‎cli/src/bin/techscript.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
techscript_cli::entrypoint::run();
3+
}

‎cli/src/bin/tsc.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
techscript_cli::entrypoint::run();
3+
}

‎cli/src/bin/webforge.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
techscript_cli::entrypoint::run();
3+
}

‎cli/src/commands/new_cmd.rs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,17 @@ pub fn execute(
120120
println!("\n{}", "✓ Project created successfully.".green().bold());
121121
println!("\nNext steps:");
122122
println!(" cd {}", name.cyan());
123-
println!(" tsc run");
123+
if matches!(
124+
template,
125+
ProjectTemplate::Website
126+
| ProjectTemplate::FullStack
127+
| ProjectTemplate::Api
128+
| ProjectTemplate::Scene3D
129+
) {
130+
println!(" tsc dev");
131+
} else {
132+
println!(" tsc run");
133+
}
124134
println!(" code .");
125135
ExitCode::Success
126136
}

‎cli/src/entrypoint.rs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,21 +419,21 @@ fn show_welcome_screen() {
419419
);
420420
println!("Version: v{}", techscript_common::TECHSCRIPT_VERSION);
421421
println!("\nUsage:");
422+
println!(" tsc <command> [options]");
422423
println!(" webforge <command> [options]");
423424
println!(" techscript <command> [options]");
424-
println!(" tsc <command> [options]");
425425
println!("\nQuick Start:");
426-
println!(" webforge new my-site Create a new WebForge project");
426+
println!(" tsc new website my-site Create a new WebForge project");
427427
println!(" cd my-site");
428-
println!(" webforge dev Start live development server");
428+
println!(" tsc dev Start live development server");
429429
println!("\nPopular Commands:");
430430
println!(" new Scaffold a new project or template");
431431
println!(" dev Start live development server");
432432
println!(" build Compile project (web/server/vm)");
433433
println!(" test Run project test suites");
434434
println!(" add Add package dependency");
435435
println!(" doctor Evaluate environment health");
436-
println!("\nFor a complete list of commands, try: webforge --help");
436+
println!("\nFor a complete list of commands, try: tsc --help");
437437
println!(
438438
"{}",
439439
"========================================================"
@@ -469,13 +469,13 @@ fn show_custom_help() {
469469
);
470470
println!("Version: v{}", techscript_common::TECHSCRIPT_VERSION);
471471
println!("\nUsage:");
472+
println!(" tsc <command> [options]");
472473
println!(" webforge <command> [options]");
473474
println!(" techscript <command> [options]");
474-
println!(" tsc <command> [options]");
475475
println!("\nQuick Start:");
476-
println!(" webforge new my-site");
476+
println!(" tsc new website my-site");
477477
println!(" cd my-site");
478-
println!(" webforge dev");
478+
println!(" tsc dev");
479479
println!("\nCommon Commands:");
480480
println!(" {}", "Project & Framework".bold().yellow());
481481
println!(" new Scaffold a new project directory");

‎cli/src/templates.rs‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,10 @@ impl ProjectTemplate {
255255
created_paths.push(toml_path);
256256

257257
let app_path = dir.join("app.txs");
258-
let app_content = format!("site \"{}\"\n", name);
258+
let app_content = format!(
259+
"make a website called {}\n\nheader:\n title is \"{}\"\n nav:\n link:\n label is \"Home\"\n url is \"/\"\n link:\n label is \"About\"\n url is \"/about\"\n link:\n label is \"Docs\"\n url is \"https://is-a.dev/techscript/\"\n\nfooter:\n section:\n title is \"{}\"\n link:\n label is \"Home\"\n url is \"/\"\n link:\n label is \"About\"\n url is \"/about\"\n section:\n title is \"TechScript\"\n link:\n label is \"Documentation\"\n url is \"https://is-a.dev/techscript/\"\n link:\n label is \"GitHub Repository\"\n url is \"https://github.com/Tcode-Motion/techscript\"\n\nstart website\n",
260+
name, name, name
261+
);
259262
std::fs::write(&app_path, app_content)?;
260263
created_paths.push(app_path);
261264

@@ -264,14 +267,17 @@ impl ProjectTemplate {
264267

265268
let home_path = pages_dir.join("home.txs");
266269
let home_content = format!(
267-
"page Home \"/\":\n title \"Welcome to {}\"\n text \"Crafted with TechScript and WebForge.\"\n button \"Get Started\" -> open About\n",
270+
"page Home \"/\":\n title \"Welcome to {}\"\n text \"A clean, modern website built with TechScript & WebForge.\"\n text \"Edit pages/home.txs or app.txs to start customizing your application.\"\n button \"Explore Documentation\" -> open \"https://is-a.dev/techscript/\"\n button \"About This Site\" -> open About\n",
268271
name
269272
);
270273
std::fs::write(&home_path, home_content)?;
271274
created_paths.push(home_path);
272275

273276
let about_path = pages_dir.join("about.txs");
274-
let about_content = "page About \"/about\":\n title \"About This Site\"\n text \"TechScript + WebForge delivers beginner-friendly, concise web development.\"\n button \"Back to Home\" -> open Home\n";
277+
let about_content = format!(
278+
"page About \"/about\":\n title \"About {}\"\n text \"This project is powered by TechScript 2.0 and WebForge.\"\n text \"TechScript provides a readable, full-stack programming experience with native compilation and zero-config servers.\"\n button \"Back to Home\" -> open Home\n",
279+
name
280+
);
275281
std::fs::write(&about_path, about_content)?;
276282
created_paths.push(about_path);
277283

@@ -281,7 +287,7 @@ impl ProjectTemplate {
281287

282288
let readme_path = dir.join("README.md");
283289
let readme_content = format!(
284-
"# {}\n\nWebsite built with **TechScript + WebForge**.\n\n## Project Structure\n```text\n├── webforge.toml # Project configuration\n├── app.txs # Application entry\n├── pages/\n│ ├── home.txs # Home page\n│ └── about.txs # About page\n├── assets/\n│ ├── images/ # Images\n│ └── models/ # 3D models\n└── README.md\n```\n\n## Getting Started\n\nStart development server:\n```bash\nwebforge dev\n```\nVisit `http://localhost:3000` in your browser.\n\n## Production Build\n```bash\nwebforge build web --release\n```\n",
290+
"# {}\n\nA clean, modern website built with **TechScript & WebForge**.\n\n## Project Structure\n```text\n├── webforge.toml # Project configuration\n├── app.txs # Application entry (header, navigation bar, footer)\n├── pages/\n│ ├── home.txs # Welcome / home page\n│ └── about.txs # About page\n├── assets/\n│ ├── images/ # Images\n│ └── models/ # 3D models\n└── README.md\n```\n\n## Getting Started\n\nStart live development server:\n```bash\ntsc dev\n```\nVisit `http://localhost:3000` in your browser.\n\n## Production Build\n```bash\ntsc build --target web\n```\n",
285291
name
286292
);
287293
std::fs::write(&readme_path, readme_content)?;

‎graphify-out/.graphify_labels.json‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,5 @@
468468
"466": "Community 466",
469469
"467": "Community 467",
470470
"468": "Community 468",
471-
"469": "Community 469",
472-
"470": "Community 470",
473-
"471": "Community 471",
474-
"472": "Community 472",
475-
"473": "Community 473",
476-
"474": "Community 474",
477-
"475": "Community 475",
478-
"476": "Community 476",
479-
"477": "Community 477"
471+
"469": "Community 469"
480472
}

0 commit comments

Comments
 (0)