Skip to content

Commit 9e7ce0a

Browse files
authored
feat(cli): detect SolidJS and SolidStart (#5758)
1 parent b293da3 commit 9e7ce0a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.changes/add-solid-js-framework.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Detect SolidJS and SolidStart for the init and info commands.

tooling/cli/src/helpers/framework.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use std::fmt;
66

77
#[derive(Debug, Clone)]
88
pub enum Framework {
9+
SolidJS,
10+
SolidStart,
911
Svelte,
1012
SvelteKit,
1113
Angular,
@@ -21,6 +23,8 @@ pub enum Framework {
2123
impl Framework {
2224
pub fn dev_path(&self) -> String {
2325
match self {
26+
Self::SolidJS => "http://localhost:3000",
27+
Self::SolidStart => "http://localhost:3000",
2428
Self::Svelte => "http://localhost:8080",
2529
Self::SvelteKit => "http://localhost:5173",
2630
Self::Angular => "http://localhost:4200",
@@ -37,6 +41,8 @@ impl Framework {
3741

3842
pub fn dist_dir(&self) -> String {
3943
match self {
44+
Self::SolidJS => "../dist",
45+
Self::SolidStart => "../dist/public",
4046
Self::Svelte => "../public",
4147
Self::SvelteKit => "../build",
4248
Self::Angular => "../dist",
@@ -55,6 +61,8 @@ impl Framework {
5561
impl fmt::Display for Framework {
5662
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5763
match self {
64+
Self::SolidJS => write!(f, "SolidJS"),
65+
Self::SolidStart => write!(f, "SolidStart"),
5866
Self::Svelte => write!(f, "Svelte"),
5967
Self::SvelteKit => write!(f, "SvelteKit"),
6068
Self::Angular => write!(f, "Angular"),
@@ -88,6 +96,8 @@ impl fmt::Display for Bundler {
8896

8997
pub fn infer_from_package_json(package_json: &str) -> (Option<Framework>, Option<Bundler>) {
9098
let framework_map = [
99+
("solid-start", Framework::SolidStart, Some(Bundler::Vite)),
100+
("solid-js", Framework::SolidJS, Some(Bundler::Vite)),
91101
("svelte", Framework::Svelte, Some(Bundler::Rollup)),
92102
("@sveltejs/kit", Framework::SvelteKit, Some(Bundler::Vite)),
93103
("@angular", Framework::Angular, Some(Bundler::Webpack)),

0 commit comments

Comments
 (0)