Skip to content

Commit ee14cae

Browse files
authored
feat(create-rstack): add Vue app templates (#246)
1 parent 6bc5d47 commit ee14cae

16 files changed

Lines changed: 229 additions & 0 deletions

File tree

packages/create-rstack/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ npx create-rstack -d my-project -t app-vanilla-ts
2525
- `app-vanilla-ts` - TypeScript Vanilla application
2626
- `app-react-js` - JavaScript React application
2727
- `app-react-ts` - TypeScript React application
28+
- `app-vue-js` - JavaScript Vue application
29+
- `app-vue-ts` - TypeScript Vue application
2830
- `lib-node-js` - JavaScript Node.js library
2931
- `lib-node-ts` - TypeScript Node.js library
3032
- `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
@@ -45,6 +45,7 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
4545
? [
4646
{ value: 'vanilla', label: 'Vanilla' },
4747
{ value: 'react', label: 'React' },
48+
{ value: 'vue', label: 'Vue' },
4849
]
4950
: [
5051
{ value: 'node', label: 'Node.js' },
@@ -74,6 +75,8 @@ await create({
7475
'app-vanilla-ts',
7576
'app-react-js',
7677
'app-react-ts',
78+
'app-vue-js',
79+
'app-vue-ts',
7780
'lib-node-js',
7881
'lib-node-ts',
7982
'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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "rstack-app-vue-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+
"vue": "^3.5.40"
16+
},
17+
"devDependencies": {
18+
"@rsbuild/plugin-vue": "^2.0.1",
19+
"rstack": "^0.3.5"
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// @ts-check
2+
// Rstack configuration guide: https://rstack.rs/config
3+
import { define } from 'rstack';
4+
5+
define.app(async () => {
6+
const { pluginVue } = await import('@rsbuild/plugin-vue');
7+
8+
return {
9+
plugins: [pluginVue()],
10+
};
11+
});
12+
13+
define.test({
14+
// Configure Rstest
15+
});
16+
17+
define.lint(async () => {
18+
const { js } = await import('rstack/lint');
19+
20+
return [js.configs.recommended];
21+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<template>
2+
<div class="content">
3+
<h1>Rstack with Vue</h1>
4+
<p>Start building amazing things with Rstack.</p>
5+
</div>
6+
</template>
7+
8+
<style scoped>
9+
.content {
10+
display: flex;
11+
min-height: 100vh;
12+
line-height: 1.1;
13+
text-align: center;
14+
flex-direction: column;
15+
justify-content: center;
16+
}
17+
18+
.content h1 {
19+
font-size: 3.6rem;
20+
font-weight: 700;
21+
}
22+
23+
.content p {
24+
font-size: 1.2rem;
25+
font-weight: 400;
26+
opacity: 0.5;
27+
}
28+
</style>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createApp } from 'vue';
2+
import App from './App.vue';
3+
import './index.css';
4+
5+
createApp(App).mount('#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-vue-ts",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "vue-tsc && 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+
"vue": "^3.5.40"
16+
},
17+
"devDependencies": {
18+
"@rsbuild/plugin-vue": "^2.0.1",
19+
"@types/node": "^24.13.3",
20+
"rstack": "^0.3.5",
21+
"typescript": "^6.0.3",
22+
"vue-tsc": "^3.3.9"
23+
}
24+
}

0 commit comments

Comments
 (0)