vela 0.1.0 → 0.9.0
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/LICENSE +21 -0
- package/README.md +186 -0
- package/dist/bin.js +6245 -0
- package/dist/bin.js.map +7 -0
- package/package.json +85 -17
- package/templates/minimal/.ignore +3 -0
- package/templates/minimal/.prettierignore +9 -0
- package/templates/minimal/.prettierrc +15 -0
- package/templates/minimal/.vscode/extensions.json +3 -0
- package/templates/minimal/.vscode/settings.json +5 -0
- package/templates/minimal/_gitignore +30 -0
- package/templates/minimal/_npmrc +1 -0
- package/templates/minimal/components.json +16 -0
- package/templates/minimal/data/fixtures/README.md +1 -0
- package/templates/minimal/data/hooks/README.md +3 -0
- package/templates/minimal/data/seeds/README.md +1 -0
- package/templates/minimal/package.template.json +54 -0
- package/templates/minimal/src/app.css +121 -0
- package/templates/minimal/src/app.d.ts +19 -0
- package/templates/minimal/src/app.html +13 -0
- package/templates/minimal/src/hooks.server.ts +8 -0
- package/templates/minimal/src/lib/assets/favicon.svg +8 -0
- package/templates/minimal/src/lib/components/ui/button/button.svelte +80 -0
- package/templates/minimal/src/lib/components/ui/button/index.ts +17 -0
- package/templates/minimal/src/lib/components/ui/navbar/index.ts +11 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-brand.svelte +8 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-brandname.svelte +8 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-item.svelte +6 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-link.svelte +13 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-list.svelte +22 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-logo.svelte +10 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-mobile-toggle.svelte +20 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-mode.svelte +12 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar-store.ts +5 -0
- package/templates/minimal/src/lib/components/ui/navbar/navbar.svelte +20 -0
- package/templates/minimal/src/lib/components/ui/sonner/index.ts +1 -0
- package/templates/minimal/src/lib/components/ui/sonner/sonner.svelte +13 -0
- package/templates/minimal/src/lib/index.ts +1 -0
- package/templates/minimal/src/lib/utils.ts +13 -0
- package/templates/minimal/src/routes/(public)/+layout.svelte +9 -0
- package/templates/minimal/src/routes/(public)/+page.svelte +65 -0
- package/templates/minimal/src/routes/(public)/root-layout.svelte +55 -0
- package/templates/minimal/src/routes/(public)/server.test.ts +10 -0
- package/templates/minimal/src/routes/+error.svelte +29 -0
- package/templates/minimal/src/routes/+layout.server.ts +30 -0
- package/templates/minimal/src/routes/+layout.svelte +38 -0
- package/templates/minimal/src/routes/api/README.md +26 -0
- package/templates/minimal/static/og.jpg +0 -0
- package/templates/minimal/static/robots.txt +3 -0
- package/templates/minimal/template.json +4 -0
- package/templates/minimal/test/setup.ts +46 -0
- package/templates/minimal/tsconfig.json +15 -0
- package/templates/minimal/vite.config.ts +17 -0
- package/templates/minimal/vitest.config.ts +15 -0
- package/templates/static/.ignore +3 -0
- package/templates/static/.prettierignore +9 -0
- package/templates/static/.prettierrc +15 -0
- package/templates/static/.vscode/extensions.json +3 -0
- package/templates/static/.vscode/settings.json +5 -0
- package/templates/static/_gitignore +23 -0
- package/templates/static/_npmrc +1 -0
- package/templates/static/components.json +16 -0
- package/templates/static/package.template.json +44 -0
- package/templates/static/src/app.css +121 -0
- package/templates/static/src/app.d.ts +13 -0
- package/templates/static/src/app.html +13 -0
- package/templates/static/src/hooks.server.ts +26 -0
- package/templates/static/src/lib/assets/favicon.svg +8 -0
- package/templates/static/src/lib/components/ui/button/button.svelte +80 -0
- package/templates/static/src/lib/components/ui/button/index.ts +17 -0
- package/templates/static/src/lib/components/ui/navbar/index.ts +11 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-brand.svelte +8 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-brandname.svelte +8 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-item.svelte +6 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-link.svelte +13 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-list.svelte +22 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-logo.svelte +10 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-mobile-toggle.svelte +20 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-mode.svelte +12 -0
- package/templates/static/src/lib/components/ui/navbar/navbar-store.ts +5 -0
- package/templates/static/src/lib/components/ui/navbar/navbar.svelte +20 -0
- package/templates/static/src/lib/components/ui/sonner/index.ts +1 -0
- package/templates/static/src/lib/components/ui/sonner/sonner.svelte +13 -0
- package/templates/static/src/lib/index.ts +1 -0
- package/templates/static/src/lib/site.template.ts +11 -0
- package/templates/static/src/lib/utils.ts +13 -0
- package/templates/static/src/routes/(public)/+layout.svelte +9 -0
- package/templates/static/src/routes/(public)/+page.svelte +65 -0
- package/templates/static/src/routes/(public)/root-layout.svelte +55 -0
- package/templates/static/src/routes/+error.svelte +29 -0
- package/templates/static/src/routes/+layout.svelte +25 -0
- package/templates/static/src/routes/+layout.ts +35 -0
- package/templates/static/static/og.jpg +0 -0
- package/templates/static/static/robots.txt +3 -0
- package/templates/static/template.json +4 -0
- package/templates/static/tsconfig.json +15 -0
- package/templates/static/vite.config.ts +31 -0
- package/templates/ui/css/gray.css +68 -0
- package/templates/ui/css/neutral.css +68 -0
- package/templates/ui/css/slate.css +68 -0
- package/templates/ui/css/stone.css +68 -0
- package/templates/ui/css/zinc.css +68 -0
- package/src/Component.js +0 -10
- package/src/index.js +0 -14
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VelaStack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1,187 @@
|
|
|
1
1
|
# vela
|
|
2
|
+
|
|
3
|
+
The VelaStack CLI. Scaffolds and maintains full-stack SvelteKit projects backed by PocketBase — collections, migrations, CRUD scaffolds, auth, payments, and typed data access, all generated into your project as ordinary source you own and edit.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node 20.19+ or 22.12+
|
|
8
|
+
- No separate PocketBase install — generated projects run it locally via `pocketbase-server`
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install -g vela
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This installs two command names, `vela` and `velastack`. They are equivalent.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
vela create my-app
|
|
22
|
+
cd my-app
|
|
23
|
+
npm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`vela create` copies a template and installs dependencies. For a template with a backend it also initializes PocketBase and writes a `.env` holding the local superuser credentials that the other commands authenticate with. That `.env` is gitignored by the generated project.
|
|
27
|
+
|
|
28
|
+
### Templates
|
|
29
|
+
|
|
30
|
+
| Template | Adapter | Backend | Dev server |
|
|
31
|
+
| --------- | ---------------- | --------------------------------- | ---------- |
|
|
32
|
+
| `minimal` | `adapter-auto` | PocketBase, wired up and migrated | `vela dev` |
|
|
33
|
+
| `static` | `adapter-static` | none — frontend only | `vite dev` |
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
vela create my-app --template static
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The `static` template is a prerendered frontend: no PocketBase, no superuser, no
|
|
40
|
+
`.env`, and its scripts call `vite` directly rather than the `vela` commands that
|
|
41
|
+
need a database. Site metadata lives in `src/lib/site.ts` — set `url` there to
|
|
42
|
+
where the site is deployed before building for production. The frontend commands
|
|
43
|
+
(`vela ui`, `vela legal`, `vela routes`, `vela i18n`) still work.
|
|
44
|
+
|
|
45
|
+
Its footer links to `/privacy` and `/terms`, which `vela legal privacy` and
|
|
46
|
+
`vela legal terms` generate. Until they exist, the dev server answers those paths
|
|
47
|
+
with the command that creates them, and the build warns instead of failing. Every
|
|
48
|
+
other broken link is still a build error.
|
|
49
|
+
|
|
50
|
+
| Flag | Description |
|
|
51
|
+
| ----------------------- | --------------------------------------------------- |
|
|
52
|
+
| `--template <type>` | Template to scaffold (default `minimal`) |
|
|
53
|
+
| `--name <name>` | App name, used for emails and metadata |
|
|
54
|
+
| `--email <email>` | Superuser email, skips the prompt (backend only) |
|
|
55
|
+
| `--password <password>` | Superuser password, skips the prompt (backend only) |
|
|
56
|
+
| `--no-install` | Skip installing dependencies |
|
|
57
|
+
|
|
58
|
+
### Existing projects
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
vela bless
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Upgrades a vanilla SvelteKit project in place — adds the PocketBase backend, merges config, and brings the project up to the same layout `vela create` produces. Takes the same `--template`, `--email`, and `--password` flags. Blessing is what adds the backend, so `--template` only accepts backend templates.
|
|
65
|
+
|
|
66
|
+
## Generating
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
vela generate scaffold post title:text body:editor published:bool
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
| Command | Description |
|
|
73
|
+
| ---------------------------------------------- | -------------------------------------------------- |
|
|
74
|
+
| `generate scaffold <model> [fields...]` | Model, forms, list and detail pages — the full set |
|
|
75
|
+
| `generate resource <model> [fields...]` | Model plus CRUD pages |
|
|
76
|
+
| `generate schema <model> [fields...]` | Zod schema only |
|
|
77
|
+
| `generate form [model] [fields...]` | Form only |
|
|
78
|
+
| `generate migration <collection> <op> [args…]` | Migration against an existing collection |
|
|
79
|
+
|
|
80
|
+
`generate scaffold`, `schema`, and `form` accept `--ai <description>` in place of an explicit field list, which designs the collection (and its form layout) from a natural-language prompt and previews it before writing anything.
|
|
81
|
+
|
|
82
|
+
Anything generated can be removed again:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
vela destroy scaffold post
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`destroy` mirrors `generate` with `scaffold`, `resource`, `schema`, and `form`.
|
|
89
|
+
|
|
90
|
+
## Features
|
|
91
|
+
|
|
92
|
+
Features are added as real source in your project, not hidden behind a runtime flag.
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
vela enable auth
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
| Feature | Description |
|
|
99
|
+
| --------------------- | ----------------------------------------------------- |
|
|
100
|
+
| `auth` | Email/password authentication plus an OAuth scaffold |
|
|
101
|
+
| `backend` | The PocketBase backend |
|
|
102
|
+
| `api` | The PocketBase REST API |
|
|
103
|
+
| `api-keys` | API key issuing and verification |
|
|
104
|
+
| `teams` | Teams / multi-tenancy |
|
|
105
|
+
| `payments` | Stripe payments |
|
|
106
|
+
| `subscriptions` | Stripe subscriptions (requires `auth` and `payments`) |
|
|
107
|
+
| `s3` | S3 file storage |
|
|
108
|
+
| `smtp` | SMTP for transactional email |
|
|
109
|
+
| `i18n` | Internationalization |
|
|
110
|
+
| `content-negotiation` | `sveltekit-negotiate` content negotiation |
|
|
111
|
+
| `blog` | An mdsvex blog with posts, tags, and RSS |
|
|
112
|
+
|
|
113
|
+
Every feature except `blog` and `subscriptions` has a matching `vela disable <feature>`.
|
|
114
|
+
|
|
115
|
+
## Data
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
vela migrate up
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
| Command | Description |
|
|
122
|
+
| ----------------------- | --------------------------------------------------- |
|
|
123
|
+
| `migrate up` | Apply pending migrations |
|
|
124
|
+
| `migrate down [n]` | Revert the last N migrations |
|
|
125
|
+
| `migrate create <name>` | New blank migration |
|
|
126
|
+
| `migrate collections` | Snapshot local collections into a new migration |
|
|
127
|
+
| `migrate history-sync` | Drop `_migrations` rows whose files no longer exist |
|
|
128
|
+
|
|
129
|
+
Fixtures are generated fake data for development; seeds are real records you want to keep.
|
|
130
|
+
|
|
131
|
+
| Command | Description |
|
|
132
|
+
| ------------------- | ---------------------------------------------------- |
|
|
133
|
+
| `fixtures generate` | Generate fixture data |
|
|
134
|
+
| `fixtures load` | Load fixtures into the database |
|
|
135
|
+
| `fixtures clear` | Remove loaded fixtures |
|
|
136
|
+
| `fixtures reset` | Clear and reload |
|
|
137
|
+
| `fixtures regen` | Clear the database, regenerate the files, and reload |
|
|
138
|
+
| `seeds save` | Save current data as seeds |
|
|
139
|
+
| `seeds load` | Load seeds into the database |
|
|
140
|
+
| `seeds clear` | Remove seeded records |
|
|
141
|
+
|
|
142
|
+
## UI
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
vela ui add button card dialog
|
|
146
|
+
vela ui base slate
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`ui add` pulls shadcn-svelte components into your project. `ui base` switches the base color.
|
|
150
|
+
|
|
151
|
+
## Everyday commands
|
|
152
|
+
|
|
153
|
+
| Command | Description |
|
|
154
|
+
| ------------- | ---------------------------------------------------------------- |
|
|
155
|
+
| `dev` | Start SvelteKit and PocketBase together, syncing types on change |
|
|
156
|
+
| `build` | Build the app |
|
|
157
|
+
| `preview` | Preview the built app |
|
|
158
|
+
| `sync` | Regenerate types from the live database schema |
|
|
159
|
+
| `test:server` | Run server tests |
|
|
160
|
+
| `routes` | List the project's routes |
|
|
161
|
+
| `i18n` | `extract`, `watch`, `status`, and `clean` for translations |
|
|
162
|
+
| `legal` | Generate placeholder `terms` and `privacy` documents |
|
|
163
|
+
|
|
164
|
+
## Account
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
vela signup
|
|
168
|
+
vela login
|
|
169
|
+
vela whoami
|
|
170
|
+
vela logout
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Authenticates against [velastack.dev](https://velastack.dev) for hosted features.
|
|
174
|
+
|
|
175
|
+
## Version pinning
|
|
176
|
+
|
|
177
|
+
Each project records the CLI version it was created with, so `vela` produces the same migrations, scaffolds, and builds for everyone on the team and in CI — regardless of what any one machine has installed globally. When your global CLI and a project's pinned version differ, the global one hands off to the pinned one automatically, so you never have to think about which is running.
|
|
178
|
+
|
|
179
|
+
`vela create` and `vela bless` always run the version you invoked, since they set up a project rather than work inside one. To force the global CLI everywhere, set `VELA_NO_DELEGATE=1`.
|
|
180
|
+
|
|
181
|
+
## Docs
|
|
182
|
+
|
|
183
|
+
Full documentation lives at [docs.velastack.dev](https://docs.velastack.dev).
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT
|