Skip to content

Commit 3fcf1b7

Browse files
authored
feat(create-rstack): add Solid app templates (#249)
1 parent 9983f1a commit 3fcf1b7

16 files changed

Lines changed: 251 additions & 0 deletions

File tree

packages/create-rstack/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ npx create-rstack -d my-project -t app-vanilla-ts
2727
- `app-react-ts` - TypeScript React application
2828
- `app-vue-js` - JavaScript Vue application
2929
- `app-vue-ts` - TypeScript Vue application
30+
- `app-solid-js` - JavaScript Solid application
31+
- `app-solid-ts` - TypeScript Solid application
3032
- `lib-node-js` - JavaScript Node.js library
3133
- `lib-node-ts` - TypeScript Node.js library
3234
- `lib-react-js` - JavaScript React library

packages/create-rstack/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
4646
{ value: 'vanilla', label: 'Vanilla' },
4747
{ value: 'react', label: 'React' },
4848
{ value: 'vue', label: 'Vue' },
49+
{ value: 'solid', label: 'Solid' },
4950
]
5051
: [
5152
{ value: 'node', label: 'Node.js' },
@@ -78,6 +79,8 @@ await create({
7879
'app-react-ts',
7980
'app-vue-js',
8081
'app-vue-ts',
82+
'app-solid-js',
83+
'app-solid-ts',
8184
'lib-node-js',
8285
'lib-node-ts',
8386
'lib-react-js',
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# AGENTS.md
2+
3+
## Commands
4+
5+
- `{{ packageManager }} run dev` - Start the development server
6+
- `{{ packageManager }} run build` - Build the app for production
7+
- `{{ packageManager }} run preview` - Preview the production build locally
8+
9+
## Docs
10+
11+
- Rsbuild: https://rsbuild.rs/llms.txt
12+
- Rspack: https://rspack.rs/llms.txt
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "rstack-app-solid-js",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "rs build",
8+
"dev": "rs dev",
9+
"format": "rs fmt",
10+
"lint": "rs lint",
11+
"preview": "rs preview",
12+
"test": "rs test"
13+
},
14+
"dependencies": {
15+
"solid-js": "^1.9.14"
16+
},
17+
"devDependencies": {
18+
"@rsbuild/plugin-babel": "^2.0.1",
19+
"@rsbuild/plugin-solid": "^1.2.2",
20+
"rstack": "^0.3.5"
21+
}
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @ts-check
2+
// Rstack configuration guide: https://rstack.rs/config
3+
import { define } from 'rstack';
4+
5+
define.app(async () => {
6+
const { pluginBabel } = await import('@rsbuild/plugin-babel');
7+
const { pluginSolid } = await import('@rsbuild/plugin-solid');
8+
9+
return {
10+
plugins: [
11+
pluginBabel({
12+
include: /\.(?:jsx|tsx)$/,
13+
}),
14+
pluginSolid(),
15+
],
16+
};
17+
});
18+
19+
define.test({
20+
// Configure Rstest
21+
});
22+
23+
define.lint(async () => {
24+
const { js } = await import('rstack/lint');
25+
26+
return [js.configs.recommended];
27+
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
body {
2+
margin: 0;
3+
color: #fff;
4+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5+
background-image: linear-gradient(to bottom, #020917, #101725);
6+
}
7+
8+
.content {
9+
display: flex;
10+
min-height: 100vh;
11+
line-height: 1.1;
12+
text-align: center;
13+
flex-direction: column;
14+
justify-content: center;
15+
}
16+
17+
.content h1 {
18+
font-size: 3.6rem;
19+
font-weight: 700;
20+
}
21+
22+
.content p {
23+
font-size: 1.2rem;
24+
font-weight: 400;
25+
opacity: 0.5;
26+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import './App.css';
2+
3+
const App = () => {
4+
return (
5+
<div class="content">
6+
<h1>Rstack with Solid</h1>
7+
<p>Start building amazing things with Rstack.</p>
8+
</div>
9+
);
10+
};
11+
12+
export default App;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { render } from 'solid-js/web';
2+
import App from './App';
3+
4+
render(() => <App />, document.getElementById('root'));
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# AGENTS.md
2+
3+
## Commands
4+
5+
- `{{ packageManager }} run dev` - Start the development server
6+
- `{{ packageManager }} run build` - Build the app for production
7+
- `{{ packageManager }} run preview` - Preview the production build locally
8+
9+
## Docs
10+
11+
- Rsbuild: https://rsbuild.rs/llms.txt
12+
- Rspack: https://rspack.rs/llms.txt
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "rstack-app-solid-ts",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "rs build",
8+
"dev": "rs dev",
9+
"format": "rs fmt",
10+
"lint": "rs lint",
11+
"preview": "rs preview",
12+
"test": "rs test"
13+
},
14+
"dependencies": {
15+
"solid-js": "^1.9.14"
16+
},
17+
"devDependencies": {
18+
"@rsbuild/plugin-babel": "^2.0.1",
19+
"@rsbuild/plugin-solid": "^1.2.2",
20+
"@types/node": "^24.13.3",
21+
"rstack": "^0.3.5",
22+
"typescript": "^7.0.2"
23+
}
24+
}

0 commit comments

Comments
 (0)