vasp-cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# vasp-cli
|
|
2
|
+
|
|
3
|
+
The official CLI for [Vasp](https://github.com/amirreza-alibeigi/vasp) — a declarative full-stack framework for Vue developers powered by Bun + Elysia.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Bun (recommended)
|
|
9
|
+
bun install -g vasp-cli
|
|
10
|
+
|
|
11
|
+
# npm
|
|
12
|
+
npm install -g vasp-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
> **Requires [Bun](https://bun.sh) ≥ 1.0**
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
vasp <command> [options]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
### `vasp new <project-name>`
|
|
26
|
+
|
|
27
|
+
Scaffold a new Vasp project from your `main.vasp` config.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
vasp new my-app # JavaScript + SPA (default)
|
|
31
|
+
vasp new my-app --typescript # TypeScript
|
|
32
|
+
vasp new my-app --ssr # SSR via Nuxt 4
|
|
33
|
+
vasp new my-app --ssg # Static Site Generation via Nuxt 4
|
|
34
|
+
vasp new my-app --ssr --typescript # SSR + TypeScript
|
|
35
|
+
vasp new my-app --no-install # Skip bun install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Options:**
|
|
39
|
+
|
|
40
|
+
| Flag | Alias | Description |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `--typescript` | `--ts` | Enable TypeScript (default: JavaScript) |
|
|
43
|
+
| `--ssr` | | Enable SSR mode via Nuxt 4 (default: SPA) |
|
|
44
|
+
| `--ssg` | | Enable Static Site Generation via Nuxt 4 |
|
|
45
|
+
| `--no-install` | | Skip running `bun install` after scaffolding |
|
|
46
|
+
|
|
47
|
+
### `vasp migrate-to-ts`
|
|
48
|
+
|
|
49
|
+
Migrate an existing JavaScript Vasp project to TypeScript in place.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cd my-app
|
|
53
|
+
vasp migrate-to-ts
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Sets `typescript: true` in `main.vasp`
|
|
57
|
+
- Renames `.js` → `.ts` in `src/` and `server/`
|
|
58
|
+
- Regenerates TypeScript scaffold files
|
|
59
|
+
|
|
60
|
+
### `vasp enable-ssr`
|
|
61
|
+
|
|
62
|
+
Enable SSR on an existing SPA project.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
cd my-app
|
|
66
|
+
vasp enable-ssr
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- Patches `ssr: false` → `ssr: true` in `main.vasp`
|
|
70
|
+
- Regenerates the project with Nuxt 4 SSR files
|
|
71
|
+
|
|
72
|
+
### `vasp start` *(coming soon)*
|
|
73
|
+
|
|
74
|
+
Start the development server.
|
|
75
|
+
|
|
76
|
+
### `vasp build` *(coming soon)*
|
|
77
|
+
|
|
78
|
+
Build the project for production.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Example `main.vasp`
|
|
83
|
+
|
|
84
|
+
```vasp
|
|
85
|
+
app MyApp {
|
|
86
|
+
database: postgres
|
|
87
|
+
auth: true
|
|
88
|
+
typescript: false
|
|
89
|
+
ssr: false
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
model User {
|
|
93
|
+
id: Int @id @default(autoincrement())
|
|
94
|
+
email: String @unique
|
|
95
|
+
createdAt: DateTime @default(now())
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
crud User {
|
|
99
|
+
operations: [create, read, update, delete]
|
|
100
|
+
auth: true
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Generated Project Structure
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
my-app/
|
|
108
|
+
├── main.vasp # Single source of truth
|
|
109
|
+
├── server/
|
|
110
|
+
│ ├── index.ts # Elysia + Bun HTTP server
|
|
111
|
+
│ ├── db/ # Drizzle ORM setup
|
|
112
|
+
│ └── routes/ # Auto-generated CRUD routes
|
|
113
|
+
├── src/ # Vue 3 frontend (SPA) or Nuxt 4 (SSR)
|
|
114
|
+
│ ├── components/
|
|
115
|
+
│ ├── pages/
|
|
116
|
+
│ └── composables/
|
|
117
|
+
├── package.json
|
|
118
|
+
└── bunfig.toml
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
[Apache 2.0](../../LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vasp-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The Vasp CLI — declarative full-stack framework for Vue developers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
".": "./src/index.ts"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"dist"
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "bun build ./bin/vasp.ts --target=bun --outfile=dist/vasp --minify --banner='#!/usr/bin/env bun' && chmod +x dist/vasp",
|