Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/create-rstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ npx create-rstack -d my-project -t app-vanilla-ts
- `app-react-ts` - TypeScript React application
- `app-vue-js` - JavaScript Vue application
- `app-vue-ts` - TypeScript Vue application
- `app-solid-js` - JavaScript Solid application
- `app-solid-ts` - TypeScript Solid application
- `lib-node-js` - JavaScript Node.js library
- `lib-node-ts` - TypeScript Node.js library
- `lib-react-js` - JavaScript React library
Expand Down
3 changes: 3 additions & 0 deletions packages/create-rstack/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
{ value: 'vanilla', label: 'Vanilla' },
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' },
{ value: 'solid', label: 'Solid' },
]
: [
{ value: 'node', label: 'Node.js' },
Expand Down Expand Up @@ -78,6 +79,8 @@ await create({
'app-react-ts',
'app-vue-js',
'app-vue-ts',
'app-solid-js',
'app-solid-ts',
'lib-node-js',
'lib-node-ts',
'lib-react-js',
Expand Down
12 changes: 12 additions & 0 deletions packages/create-rstack/template-app-solid-js/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AGENTS.md

## Commands

- `{{ packageManager }} run dev` - Start the development server
- `{{ packageManager }} run build` - Build the app for production
- `{{ packageManager }} run preview` - Preview the production build locally

## Docs

- Rsbuild: https://rsbuild.rs/llms.txt
- Rspack: https://rspack.rs/llms.txt
22 changes: 22 additions & 0 deletions packages/create-rstack/template-app-solid-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "rstack-app-solid-js",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "rs build",
"dev": "rs dev",
"format": "rs fmt",
"lint": "rs lint",
"preview": "rs preview",
"test": "rs test"
},
"dependencies": {
"solid-js": "^1.9.14"
},
"devDependencies": {
"@rsbuild/plugin-babel": "^2.0.1",
"@rsbuild/plugin-solid": "^1.2.2",
"rstack": "^0.3.5"
}
}
27 changes: 27 additions & 0 deletions packages/create-rstack/template-app-solid-js/rstack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// @ts-check
// Rstack configuration guide: https://rstack.rs/config
import { define } from 'rstack';

define.app(async () => {
const { pluginBabel } = await import('@rsbuild/plugin-babel');
const { pluginSolid } = await import('@rsbuild/plugin-solid');

return {
plugins: [
pluginBabel({
include: /\.(?:jsx|tsx)$/,
}),
pluginSolid(),
],
};
});

define.test({
// Configure Rstest
});

define.lint(async () => {
const { js } = await import('rstack/lint');

return [js.configs.recommended];
});
26 changes: 26 additions & 0 deletions packages/create-rstack/template-app-solid-js/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
body {
margin: 0;
color: #fff;
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
background-image: linear-gradient(to bottom, #020917, #101725);
}

.content {
display: flex;
min-height: 100vh;
line-height: 1.1;
text-align: center;
flex-direction: column;
justify-content: center;
}

.content h1 {
font-size: 3.6rem;
font-weight: 700;
}

.content p {
font-size: 1.2rem;
font-weight: 400;
opacity: 0.5;
}
12 changes: 12 additions & 0 deletions packages/create-rstack/template-app-solid-js/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import './App.css';

const App = () => {
return (
<div class="content">
<h1>Rstack with Solid</h1>
<p>Start building amazing things with Rstack.</p>
</div>
);
};

export default App;
4 changes: 4 additions & 0 deletions packages/create-rstack/template-app-solid-js/src/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { render } from 'solid-js/web';
import App from './App';

render(() => <App />, document.getElementById('root'));
12 changes: 12 additions & 0 deletions packages/create-rstack/template-app-solid-ts/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AGENTS.md

## Commands

- `{{ packageManager }} run dev` - Start the development server
- `{{ packageManager }} run build` - Build the app for production
- `{{ packageManager }} run preview` - Preview the production build locally

## Docs

- Rsbuild: https://rsbuild.rs/llms.txt
- Rspack: https://rspack.rs/llms.txt
24 changes: 24 additions & 0 deletions packages/create-rstack/template-app-solid-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "rstack-app-solid-ts",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "rs build",
"dev": "rs dev",
"format": "rs fmt",
"lint": "rs lint",
"preview": "rs preview",
"test": "rs test"
},
"dependencies": {
"solid-js": "^1.9.14"
},
"devDependencies": {
"@rsbuild/plugin-babel": "^2.0.1",
"@rsbuild/plugin-solid": "^1.2.2",
"@types/node": "^24.13.3",
"rstack": "^0.3.5",
"typescript": "^7.0.2"
}
}
26 changes: 26 additions & 0 deletions packages/create-rstack/template-app-solid-ts/rstack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Rstack configuration guide: https://rstack.rs/config
import { define } from 'rstack';

define.app(async () => {
const { pluginBabel } = await import('@rsbuild/plugin-babel');
const { pluginSolid } = await import('@rsbuild/plugin-solid');

return {
plugins: [
pluginBabel({
include: /\.(?:jsx|tsx)$/,
}),
pluginSolid(),
],
};
});

define.test({
// Configure Rstest
});

define.lint(async () => {
const { js, ts } = await import('rstack/lint');

return [js.configs.recommended, ts.configs.recommended];
});
26 changes: 26 additions & 0 deletions packages/create-rstack/template-app-solid-ts/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
body {
margin: 0;
color: #fff;
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
background-image: linear-gradient(to bottom, #020917, #101725);
}

.content {
display: flex;
min-height: 100vh;
line-height: 1.1;
text-align: center;
flex-direction: column;
justify-content: center;
}

.content h1 {
font-size: 3.6rem;
font-weight: 700;
}

.content p {
font-size: 1.2rem;
font-weight: 400;
opacity: 0.5;
}
12 changes: 12 additions & 0 deletions packages/create-rstack/template-app-solid-ts/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import './App.css';

const App = () => {
return (
<div class="content">
<h1>Rstack with Solid</h1>
<p>Start building amazing things with Rstack.</p>
</div>
);
};

export default App;
7 changes: 7 additions & 0 deletions packages/create-rstack/template-app-solid-ts/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { render } from 'solid-js/web';
import App from './App';

const root = document.getElementById('root');
if (root) {
render(() => <App />, root);
}
24 changes: 24 additions & 0 deletions packages/create-rstack/template-app-solid-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"lib": ["DOM", "ES2020"],
"jsx": "preserve",
"target": "ES2020",
"noEmit": true,
"skipLibCheck": true,
"types": ["rstack/types", "node"],
"jsxImportSource": "solid-js",
"useDefineForClassFields": true,

/* modules */
"moduleDetection": "force",
"moduleResolution": "bundler",
"verbatimModuleSyntax": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
}
12 changes: 12 additions & 0 deletions packages/create-rstack/tests/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ test.each([
sourceExtension: 'ts',
hasTypeScript: true,
},
{
template: 'app-solid-js',
configExtension: 'js',
sourceExtension: 'jsx',
hasTypeScript: false,
},
{
template: 'app-solid-ts',
configExtension: 'ts',
sourceExtension: 'tsx',
hasTypeScript: true,
},
])(
'creates the $template template',
async ({ template, configExtension, sourceExtension, hasTypeScript }) => {
Expand Down