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 @@ -25,6 +25,8 @@ npx create-rstack -d my-project -t app-vanilla-ts
- `app-vanilla-ts` - TypeScript Vanilla application
- `app-react-js` - JavaScript React application
- `app-react-ts` - TypeScript React application
- `app-vue-js` - JavaScript Vue application
- `app-vue-ts` - TypeScript Vue 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 @@ -45,6 +45,7 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
? [
{ value: 'vanilla', label: 'Vanilla' },
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' },
]
: [
{ value: 'node', label: 'Node.js' },
Expand Down Expand Up @@ -74,6 +75,8 @@ await create({
'app-vanilla-ts',
'app-react-js',
'app-react-ts',
'app-vue-js',
'app-vue-ts',
'lib-node-js',
'lib-node-ts',
'lib-react-js',
Expand Down
12 changes: 12 additions & 0 deletions packages/create-rstack/template-app-vue-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
21 changes: 21 additions & 0 deletions packages/create-rstack/template-app-vue-js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "rstack-app-vue-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": {
"vue": "^3.5.40"
},
"devDependencies": {
"@rsbuild/plugin-vue": "^2.0.1",
"rstack": "^0.3.5"
}
}
21 changes: 21 additions & 0 deletions packages/create-rstack/template-app-vue-js/rstack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-check
// Rstack configuration guide: https://rstack.rs/config
import { define } from 'rstack';

define.app(async () => {
const { pluginVue } = await import('@rsbuild/plugin-vue');

return {
plugins: [pluginVue()],
};
});

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

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

return [js.configs.recommended];
});
28 changes: 28 additions & 0 deletions packages/create-rstack/template-app-vue-js/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div class="content">
<h1>Rstack with Vue</h1>
<p>Start building amazing things with Rstack.</p>
</div>
</template>

<style scoped>
.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;
}
</style>
6 changes: 6 additions & 0 deletions packages/create-rstack/template-app-vue-js/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
body {
margin: 0;
color: #fff;
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
background-image: linear-gradient(to bottom, #020917, #101725);
}
5 changes: 5 additions & 0 deletions packages/create-rstack/template-app-vue-js/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createApp } from 'vue';
import App from './App.vue';
import './index.css';

createApp(App).mount('#root');
12 changes: 12 additions & 0 deletions packages/create-rstack/template-app-vue-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-vue-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "rstack-app-vue-ts",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "vue-tsc && rs build",
"dev": "rs dev",
"format": "rs fmt",
"lint": "rs lint",
"preview": "rs preview",
"test": "rs test"
},
"dependencies": {
"vue": "^3.5.40"
},
"devDependencies": {
"@rsbuild/plugin-vue": "^2.0.1",
"@types/node": "^24.13.3",
"rstack": "^0.3.5",
"typescript": "^6.0.3",
"vue-tsc": "^3.3.9"
}
}
20 changes: 20 additions & 0 deletions packages/create-rstack/template-app-vue-ts/rstack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Rstack configuration guide: https://rstack.rs/config
import { define } from 'rstack';

define.app(async () => {
const { pluginVue } = await import('@rsbuild/plugin-vue');

return {
plugins: [pluginVue()],
};
});

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

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

return [js.configs.recommended, ts.configs.recommended];
});
28 changes: 28 additions & 0 deletions packages/create-rstack/template-app-vue-ts/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div class="content">
<h1>Rstack with Vue</h1>
<p>Start building amazing things with Rstack.</p>
</div>
</template>

<style scoped>
.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;
}
</style>
6 changes: 6 additions & 0 deletions packages/create-rstack/template-app-vue-ts/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
body {
margin: 0;
color: #fff;
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
background-image: linear-gradient(to bottom, #020917, #101725);
}
5 changes: 5 additions & 0 deletions packages/create-rstack/template-app-vue-ts/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createApp } from 'vue';
import App from './App.vue';
import './index.css';

createApp(App).mount('#root');
24 changes: 24 additions & 0 deletions packages/create-rstack/template-app-vue-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": "vue",
"useDefineForClassFields": true,

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

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}
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 @@ -57,6 +57,18 @@ test.each([
sourceExtension: 'tsx',
hasTypeScript: true,
},
{
template: 'app-vue-js',
configExtension: 'js',
sourceExtension: 'js',
hasTypeScript: false,
},
{
template: 'app-vue-ts',
configExtension: 'ts',
sourceExtension: 'ts',
hasTypeScript: true,
},
])(
'creates the $template template',
async ({ template, configExtension, sourceExtension, hasTypeScript }) => {
Expand Down