vasp-cli 0.1.1 → 0.1.3

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.
Files changed (70) hide show
  1. package/README.md +59 -64
  2. package/dist/vasp +32 -22
  3. package/package.json +5 -9
  4. package/starters/minimal.vasp +15 -0
  5. package/starters/todo-auth-ssr.vasp +52 -0
  6. package/starters/todo.vasp +35 -0
  7. package/templates/shared/.env.example.hbs +14 -0
  8. package/templates/shared/.gitignore.hbs +8 -0
  9. package/templates/shared/auth/client/Login.vue.hbs +46 -0
  10. package/templates/shared/auth/client/Register.vue.hbs +42 -0
  11. package/templates/shared/auth/server/index.hbs +51 -0
  12. package/templates/shared/auth/server/middleware.hbs +33 -0
  13. package/templates/shared/auth/server/providers/github.hbs +48 -0
  14. package/templates/shared/auth/server/providers/google.hbs +53 -0
  15. package/templates/shared/auth/server/providers/usernameAndPassword.hbs +69 -0
  16. package/templates/shared/bunfig.toml.hbs +2 -0
  17. package/templates/shared/drizzle/schema.hbs +37 -0
  18. package/templates/shared/jobs/_job.hbs +24 -0
  19. package/templates/shared/jobs/boss.hbs +15 -0
  20. package/templates/shared/package.json.hbs +32 -0
  21. package/templates/shared/server/db/client.hbs +12 -0
  22. package/templates/shared/server/index.hbs +52 -0
  23. package/templates/shared/server/routes/actions/_action.hbs +20 -0
  24. package/templates/shared/server/routes/crud/_crud.hbs +42 -0
  25. package/templates/shared/server/routes/jobs/_schedule.hbs +12 -0
  26. package/templates/shared/server/routes/queries/_query.hbs +20 -0
  27. package/templates/shared/server/routes/realtime/_channel.hbs +30 -0
  28. package/templates/shared/server/routes/realtime/index.hbs +9 -0
  29. package/templates/shared/tsconfig.json.hbs +21 -0
  30. package/templates/spa/js/index.html.hbs +12 -0
  31. package/templates/spa/js/src/App.vue.hbs +3 -0
  32. package/templates/spa/js/src/main.js.hbs +9 -0
  33. package/templates/spa/js/src/router/index.js.hbs +41 -0
  34. package/templates/spa/js/src/vasp/auth.js.hbs +45 -0
  35. package/templates/spa/js/src/vasp/client/actions.js.hbs +15 -0
  36. package/templates/spa/js/src/vasp/client/crud.js.hbs +30 -0
  37. package/templates/spa/js/src/vasp/client/index.js.hbs +16 -0
  38. package/templates/spa/js/src/vasp/client/queries.js.hbs +15 -0
  39. package/templates/spa/js/src/vasp/client/realtime.js.hbs +51 -0
  40. package/templates/spa/js/src/vasp/plugin.js.hbs +11 -0
  41. package/templates/spa/js/vite.config.js.hbs +26 -0
  42. package/templates/spa/ts/index.html.hbs +12 -0
  43. package/templates/spa/ts/src/App.vue.hbs +3 -0
  44. package/templates/spa/ts/src/main.ts.hbs +9 -0
  45. package/templates/spa/ts/src/router/index.ts.hbs +41 -0
  46. package/templates/spa/ts/src/vasp/auth.ts.hbs +53 -0
  47. package/templates/spa/ts/src/vasp/client/actions.ts.hbs +19 -0
  48. package/templates/spa/ts/src/vasp/client/crud.ts.hbs +37 -0
  49. package/templates/spa/ts/src/vasp/client/index.ts.hbs +17 -0
  50. package/templates/spa/ts/src/vasp/client/queries.ts.hbs +19 -0
  51. package/templates/spa/ts/src/vasp/client/realtime.ts.hbs +56 -0
  52. package/templates/spa/ts/src/vasp/client/types.ts.hbs +33 -0
  53. package/templates/spa/ts/src/vasp/plugin.ts.hbs +12 -0
  54. package/templates/spa/ts/vite.config.ts.hbs +26 -0
  55. package/templates/ssr/js/_page.vue.hbs +10 -0
  56. package/templates/ssr/js/app.vue.hbs +3 -0
  57. package/templates/ssr/js/composables/useAuth.js.hbs +52 -0
  58. package/templates/ssr/js/composables/useVasp.js.hbs +6 -0
  59. package/templates/ssr/js/middleware/auth.js.hbs +8 -0
  60. package/templates/ssr/js/nuxt.config.js.hbs +15 -0
  61. package/templates/ssr/js/plugins/vasp.client.js.hbs +17 -0
  62. package/templates/ssr/js/plugins/vasp.server.js.hbs +33 -0
  63. package/templates/ssr/ts/_page.vue.hbs +10 -0
  64. package/templates/ssr/ts/app.vue.hbs +3 -0
  65. package/templates/ssr/ts/composables/useAuth.ts.hbs +56 -0
  66. package/templates/ssr/ts/composables/useVasp.ts.hbs +10 -0
  67. package/templates/ssr/ts/middleware/auth.ts.hbs +8 -0
  68. package/templates/ssr/ts/nuxt.config.ts.hbs +19 -0
  69. package/templates/ssr/ts/plugins/vasp.client.ts.hbs +17 -0
  70. package/templates/ssr/ts/plugins/vasp.server.ts.hbs +33 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # vasp-cli
2
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.
3
+ The official CLI for [Vasp](https://github.com/vasp-framework/vasp) — a declarative full-stack framework for Vue developers powered by Bun + Elysia.
4
4
 
5
5
  ## Installation
6
6
 
@@ -12,45 +12,48 @@ bun install -g vasp-cli
12
12
  npm install -g vasp-cli
13
13
  ```
14
14
 
15
- > **Requires [Bun](https://bun.sh) 1.0**
15
+ > **Requires [Bun](https://bun.sh) >= 1.0**
16
16
 
17
- ## Usage
17
+ ## Commands
18
18
 
19
- ```
20
- vasp <command> [options]
19
+ ### `vasp new <project-name>`
20
+
21
+ Scaffold a new Vasp project.
22
+
23
+ ```bash
24
+ vasp new my-app # JavaScript + SPA (default)
25
+ vasp new my-app --typescript # TypeScript
26
+ vasp new my-app --ssr # SSR via Nuxt 4
27
+ vasp new my-app --ssg # Static Site Generation via Nuxt 4
28
+ vasp new my-app --ssr --typescript # SSR + TypeScript
29
+ vasp new my-app --starter=todo # Use a starter template
30
+ vasp new my-app --no-install # Skip bun install
21
31
  ```
22
32
 
23
- ## Commands
33
+ **Starters:** `minimal`, `todo`, `todo-auth-ssr`
24
34
 
25
- ### `vasp new <project-name>`
35
+ ### `vasp start`
26
36
 
27
- Scaffold a new Vasp project from your `main.vasp` config.
37
+ Start the dev servers (backend + frontend) concurrently with color-prefixed output.
28
38
 
29
39
  ```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
40
+ cd my-app && vasp start
36
41
  ```
37
42
 
38
- **Options:**
43
+ ### `vasp build`
44
+
45
+ Build for production — compiles the Elysia backend with Bun and the frontend with Vite or Nuxt.
39
46
 
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 |
47
+ ```bash
48
+ cd my-app && vasp build
49
+ ```
46
50
 
47
51
  ### `vasp migrate-to-ts`
48
52
 
49
- Migrate an existing JavaScript Vasp project to TypeScript in place.
53
+ Convert an existing JavaScript Vasp project to TypeScript in-place.
50
54
 
51
55
  ```bash
52
- cd my-app
53
- vasp migrate-to-ts
56
+ cd my-app && vasp migrate-to-ts
54
57
  ```
55
58
 
56
59
  - Sets `typescript: true` in `main.vasp`
@@ -59,63 +62,55 @@ vasp migrate-to-ts
59
62
 
60
63
  ### `vasp enable-ssr`
61
64
 
62
- Enable SSR on an existing SPA project.
65
+ Switch an existing SPA project to SSR (Nuxt 4).
63
66
 
64
67
  ```bash
65
- cd my-app
66
- vasp enable-ssr
68
+ cd my-app && vasp enable-ssr
67
69
  ```
68
70
 
69
71
  - Patches `ssr: false` → `ssr: true` in `main.vasp`
70
- - Regenerates the project with Nuxt 4 SSR files
72
+ - Regenerates the Nuxt 4 frontend files
71
73
 
72
- ### `vasp start` *(coming soon)*
73
-
74
- Start the development server.
75
-
76
- ### `vasp build` *(coming soon)*
74
+ ## Example `main.vasp`
77
75
 
78
- Build the project for production.
76
+ ```
77
+ app TodoApp {
78
+ title: "Todo App"
79
+ db: Drizzle
80
+ ssr: false
81
+ typescript: true
82
+ }
79
83
 
80
- ---
84
+ auth UserAuth {
85
+ userEntity: User
86
+ methods: [usernameAndPassword]
87
+ }
81
88
 
82
- ## Example `main.vasp`
89
+ route HomeRoute {
90
+ path: "/"
91
+ to: HomePage
92
+ }
83
93
 
84
- ```vasp
85
- app MyApp {
86
- database: postgres
87
- auth: true
88
- typescript: false
89
- ssr: false
94
+ page HomePage {
95
+ component: import Home from "@src/pages/Home.vue"
90
96
  }
91
97
 
92
- model User {
93
- id: Int @id @default(autoincrement())
94
- email: String @unique
95
- createdAt: DateTime @default(now())
98
+ crud Todo {
99
+ entity: Todo
100
+ operations: [list, create, update, delete]
96
101
  }
97
102
 
98
- crud User {
99
- operations: [create, read, update, delete]
103
+ query getTodos {
104
+ fn: import { getTodos } from "@src/queries.ts"
105
+ entities: [Todo]
100
106
  auth: true
101
107
  }
102
- ```
103
-
104
- ## Generated Project Structure
105
108
 
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
109
+ action createTodo {
110
+ fn: import { createTodo } from "@src/actions.ts"
111
+ entities: [Todo]
112
+ auth: true
113
+ }
119
114
  ```
120
115
 
121
116
  ## License