@waelio/cli 0.1.9 โ 0.1.11
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 +153 -102
- package/dist/scaffold.js +53 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.js +139 -50
- package/package.json +2 -2
- package/ui/dist/assets/PublicSitesView-BONa1Zoj.js +1 -0
- package/ui/dist/assets/PublicSitesView-EfFQbc8j.css +1 -0
- package/ui/dist/assets/index-BzotlfpW.css +1 -0
- package/ui/dist/assets/index-DP7Yrd8J.js +3 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/PublicSitesView-DBnqmdMy.css +0 -1
- package/ui/dist/assets/PublicSitesView-DuDEMQT0.js +0 -1
- package/ui/dist/assets/index-BASEVOdG.js +0 -27
- package/ui/dist/assets/index-MlBRo6xM.css +0 -1
package/README.md
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
# @waelio/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@waelio/cli)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
[](https://nodejs.org)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
> TypeScript CLI + browser UI toolkit for building [`waelio/siteforge`](https://github.com/waelio/siteforge) from the terminal or a local web interface.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
๐ **Live demo:** [cli.waelio.workers.dev](https://cli.waelio.workers.dev)
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
- previews the build plan before running it
|
|
11
|
-
- clones `waelio/siteforge` into a working directory
|
|
12
|
-
- installs dependencies with `npm ci`
|
|
13
|
-
- runs `npm run build`
|
|
14
|
-
- shows the full workflow in a browser UI with live logs
|
|
11
|
+
Built with **Vite 8 ยท TypeScript ยท Vue 3 ยท Commander**.
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
---
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
- npm
|
|
20
|
-
- git
|
|
21
|
-
- Go
|
|
15
|
+
## โจ Features
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
- ๐ฉบ **Doctor** โ checks that required local tools are installed
|
|
18
|
+
- ๐ **Dry-run** โ previews the build plan before running it
|
|
19
|
+
- ๐ง **Build** โ clones `waelio/siteforge`, installs deps, and runs the build
|
|
20
|
+
- ๐๏ธ **Scaffold** โ generates full Next.js + NestJS projects from a blueprint JSON
|
|
21
|
+
- ๐ฅ๏ธ **Browser UI** โ a Vue dashboard with live logs, scaffold forms, and public site listings
|
|
22
|
+
- ๐ **12 locales** โ `ar` `de` `en` `es` `fr` `he` `id` `it` `ru` `sv` `tr` `zh` (RTL-ready)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ๐ฆ Install
|
|
24
27
|
|
|
25
28
|
Run without installing:
|
|
26
29
|
|
|
@@ -34,15 +37,13 @@ Or install globally:
|
|
|
34
37
|
npm install -g @waelio/cli
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
---
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
## ๐ CLI Commands
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
### `waelio --help`
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
waelio --help
|
|
45
|
-
```
|
|
46
|
+
Print the top-level help and list all available commands.
|
|
46
47
|
|
|
47
48
|
### `waelio doctor`
|
|
48
49
|
|
|
@@ -60,18 +61,17 @@ Clone and build the `waelio/siteforge` website:
|
|
|
60
61
|
waelio build
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
**
|
|
64
|
+
**Options:**
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```
|
|
66
|
+
| Flag | Description | Default |
|
|
67
|
+
|------|-------------|---------|
|
|
68
|
+
| `--repo <url>` | Custom repository URL | `waelio/siteforge` |
|
|
69
|
+
| `--ref <ref>` | Branch, tag, or commit to checkout | `main` |
|
|
70
|
+
| `--source <path>` | Skip cloning, use an existing checkout | โ |
|
|
71
|
+
| `--workdir <path>` | Directory to clone into | `./tmp` |
|
|
72
|
+
| `--dry-run` | Print the plan without running anything | `false` |
|
|
73
73
|
|
|
74
|
-
**
|
|
74
|
+
**Examples:**
|
|
75
75
|
|
|
76
76
|
```sh
|
|
77
77
|
# default โ clone and build waelio/siteforge
|
|
@@ -83,153 +83,204 @@ waelio build --dry-run
|
|
|
83
83
|
# build a specific branch
|
|
84
84
|
waelio build --ref feat/new-homepage
|
|
85
85
|
|
|
86
|
-
# build from a local checkout
|
|
86
|
+
# build from a local checkout
|
|
87
87
|
waelio build --source ~/Code/GitHub/waelio/siteforge
|
|
88
88
|
|
|
89
|
-
# clone into a custom directory
|
|
90
|
-
waelio build --workdir /tmp/siteforge-build
|
|
91
|
-
|
|
92
89
|
# build a fork
|
|
93
90
|
waelio build --repo https://github.com/yourname/siteforge.git
|
|
94
91
|
```
|
|
95
92
|
|
|
96
93
|
### `waelio ui`
|
|
97
94
|
|
|
98
|
-
Start the local web UI and API server
|
|
95
|
+
Start the local web UI and API server:
|
|
99
96
|
|
|
100
97
|
```sh
|
|
101
98
|
waelio ui
|
|
99
|
+
waelio ui --port 4000 # default: 3000
|
|
102
100
|
```
|
|
103
101
|
|
|
104
|
-
|
|
105
|
-
- **Scaffold View:** Form-based generator to produce and deploy Siteforge blueprints to webhooks.
|
|
106
|
-
- **Public Sites View:** A dedicated dashboard for listing and accessing successfully scaffolded client sites served via the `/api/public-sites` route.
|
|
102
|
+
Open `http://localhost:3000` in your browser.
|
|
107
103
|
|
|
108
|
-
**
|
|
104
|
+
**UI Views:**
|
|
109
105
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Open `http://localhost:3000` in your browser after running this.
|
|
106
|
+
| View | Description |
|
|
107
|
+
|------|-------------|
|
|
108
|
+
| **Scaffold** | Form-based generator to produce and deploy Siteforge blueprints |
|
|
109
|
+
| **Public Sites** | Dashboard listing scaffolded client sites served via `/api/public-sites` |
|
|
115
110
|
|
|
116
111
|
### `waelio scaffold <blueprint>`
|
|
117
112
|
|
|
118
|
-
Scaffold a full Next.js (frontend) + NestJS (backend) project from a
|
|
113
|
+
Scaffold a full Next.js (frontend) + NestJS (backend) project from a Siteforge blueprint JSON:
|
|
119
114
|
|
|
120
115
|
```sh
|
|
121
116
|
waelio scaffold ./blueprint.json
|
|
122
117
|
```
|
|
123
118
|
|
|
124
|
-
**
|
|
119
|
+
**Options:**
|
|
125
120
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
```
|
|
121
|
+
| Flag | Description | Default |
|
|
122
|
+
|------|-------------|---------|
|
|
123
|
+
| `--out <dir>` | Output root directory | `siteforge/sites` |
|
|
124
|
+
| `--no-git` | Skip `git init` and the initial commit | `false` |
|
|
131
125
|
|
|
132
|
-
**
|
|
126
|
+
**Examples:**
|
|
133
127
|
|
|
134
128
|
```sh
|
|
135
129
|
# scaffold with defaults
|
|
136
130
|
waelio scaffold ./blueprint.json
|
|
137
131
|
|
|
138
|
-
# scaffold into a custom
|
|
132
|
+
# scaffold into a custom directory
|
|
139
133
|
waelio scaffold ./blueprint.json --out ~/projects/my-site
|
|
140
134
|
|
|
141
135
|
# scaffold without initialising a git repository
|
|
142
136
|
waelio scaffold ./blueprint.json --no-git
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The blueprint JSON describes the project name, slug, pages, features, integrations, locales, roles, brand tones, visual styles, content models, and SEO focuses. The scaffolder generates both workspaces from those selections.
|
|
143
140
|
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## ๐๏ธ Project Structure
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
@waelio/cli
|
|
147
|
+
โโโ src/
|
|
148
|
+
โ โโโ index.ts # CLI entry point (Commander)
|
|
149
|
+
โ โโโ server.ts # Express API server
|
|
150
|
+
โ โโโ siteforge.ts # Build orchestration
|
|
151
|
+
โ โโโ scaffold.ts # Blueprint scaffolder
|
|
152
|
+
โ โโโ localRepos.ts # Local repo discovery
|
|
153
|
+
โ โโโ locals/ # i18n locale files (12 languages)
|
|
154
|
+
โโโ ui/
|
|
155
|
+
โ โโโ src/
|
|
156
|
+
โ โ โโโ App.vue # Root Vue component
|
|
157
|
+
โ โ โโโ views/ # ScaffoldView, PublicSitesView
|
|
158
|
+
โ โโโ dist/ # Built static assets
|
|
159
|
+
โโโ templates/ # Multi-framework scaffold templates
|
|
160
|
+
โโโ public-sites/ # Scaffolded demo sites (acme-dental, agent-007, e2e-test-site)
|
|
161
|
+
โโโ wrangler.toml # Cloudflare Workers deployment config
|
|
162
|
+
โโโ vite.config.ts # Vite build config
|
|
163
|
+
โโโ package.json
|
|
146
164
|
```
|
|
147
165
|
|
|
148
|
-
|
|
149
|
-
pages, features, integrations, locales, roles, brand tones, visual styles,
|
|
150
|
-
content models, and SEO focuses. The scaffolder generates both workspaces from
|
|
151
|
-
those selections.
|
|
166
|
+
---
|
|
152
167
|
|
|
153
|
-
## Development
|
|
168
|
+
## ๐ ๏ธ Development
|
|
154
169
|
|
|
155
170
|
### Install dependencies
|
|
156
171
|
|
|
157
172
|
```sh
|
|
158
|
-
|
|
173
|
+
pnpm install
|
|
159
174
|
```
|
|
160
175
|
|
|
161
176
|
### Run in development
|
|
162
177
|
|
|
163
178
|
```sh
|
|
164
|
-
|
|
179
|
+
pnpm dev
|
|
165
180
|
```
|
|
166
181
|
|
|
167
|
-
Starts:
|
|
182
|
+
Starts concurrently:
|
|
168
183
|
|
|
169
|
-
- API
|
|
170
|
-
- Vite UI on `http://localhost:5173`
|
|
184
|
+
- **API server** on `http://localhost:3000`
|
|
185
|
+
- **Vite UI** on `http://localhost:5173` (proxies `/api` โ `:3000`)
|
|
171
186
|
|
|
172
187
|
### Build everything
|
|
173
188
|
|
|
174
189
|
```sh
|
|
175
|
-
|
|
190
|
+
pnpm run build
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Run the production server
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
pnpm start
|
|
176
197
|
```
|
|
177
198
|
|
|
178
|
-
###
|
|
199
|
+
### Quality checks
|
|
179
200
|
|
|
180
201
|
```sh
|
|
181
|
-
|
|
202
|
+
pnpm run typecheck # tsc --noEmit + vue-tsc for the UI
|
|
203
|
+
pnpm test # run *.test.ts via tsx --test
|
|
204
|
+
pnpm run check # typecheck + tests
|
|
182
205
|
```
|
|
183
206
|
|
|
184
|
-
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## โ๏ธ Deployment
|
|
210
|
+
|
|
211
|
+
The UI is deployed to **Cloudflare Workers** as a static site.
|
|
212
|
+
|
|
213
|
+
### Deploy manually
|
|
185
214
|
|
|
186
215
|
```sh
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
npm run check # typecheck + tests
|
|
216
|
+
pnpm run build
|
|
217
|
+
npx wrangler deploy
|
|
190
218
|
```
|
|
191
219
|
|
|
192
|
-
|
|
220
|
+
The `wrangler.toml` configuration serves the built Vue app from `ui/dist`:
|
|
221
|
+
|
|
222
|
+
```toml
|
|
223
|
+
name = "cli"
|
|
224
|
+
compatibility_date = "2024-12-01"
|
|
225
|
+
|
|
226
|
+
[assets]
|
|
227
|
+
directory = "./ui/dist"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Live URL:** [https://cli.waelio.workers.dev](https://cli.waelio.workers.dev)
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## ๐ API Endpoints
|
|
235
|
+
|
|
236
|
+
### Build & Scaffold
|
|
237
|
+
|
|
238
|
+
| Method | Endpoint | Description |
|
|
239
|
+
|--------|----------|-------------|
|
|
240
|
+
| `POST` | `/api/build` | Trigger a siteforge build |
|
|
241
|
+
| `POST` | `/api/scaffold` | Scaffold from a blueprint |
|
|
242
|
+
| `GET` | `/api/public-sites` | List scaffolded demo sites |
|
|
243
|
+
|
|
244
|
+
### Local Repository Discovery
|
|
193
245
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
246
|
+
| Method | Endpoint | Description |
|
|
247
|
+
|--------|----------|-------------|
|
|
248
|
+
| `GET` | `/api/local-repos` | Returns the local repository index |
|
|
249
|
+
| `GET` | `/api/local-repos/tree?repoId=...&path=...` | Browse a repo's file tree |
|
|
197
250
|
|
|
198
|
-
|
|
251
|
+
**Safety rules:**
|
|
199
252
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
253
|
+
- Repository IDs map to scanned local repos only
|
|
254
|
+
- Folder browsing is restricted to paths inside the selected repository
|
|
255
|
+
- Path traversal (`..`) is rejected
|
|
256
|
+
- `.git` directories are hidden from listings
|
|
257
|
+
- Default scan root: `~/Code/GitHub` (override with `WAELIO_LOCAL_ROOT`)
|
|
203
258
|
|
|
204
|
-
|
|
259
|
+
---
|
|
205
260
|
|
|
206
|
-
|
|
261
|
+
## ๐ Localization
|
|
207
262
|
|
|
208
|
-
|
|
263
|
+
UI strings live in `src/locals/<lang>/<lang>.json` with a top-level `src/locals/manifest.json`.
|
|
209
264
|
|
|
210
|
-
|
|
265
|
+
Supported locales:
|
|
211
266
|
|
|
212
|
-
|
|
213
|
-
- override with `WAELIO_LOCAL_ROOT`
|
|
214
|
-
- top-level repositories are included
|
|
215
|
-
- nested build/checkouts such as `.build`, `node_modules`, `dist`, and `.git` internals are excluded from discovery
|
|
267
|
+
`ar` ยท `de` ยท `en` ยท `es` ยท `fr` ยท `he` ยท `id` ยท `it` ยท `ru` ยท `sv` ยท `tr` ยท `zh`
|
|
216
268
|
|
|
217
|
-
|
|
269
|
+
> RTL locales (`ar`, `he`) are supported โ keep them in mind when editing UI copy.
|
|
218
270
|
|
|
219
|
-
|
|
220
|
-
- `GET /api/local-repos/tree?repoId=...&path=...` โ returns a sanitized physical folder listing for a selected local repository
|
|
271
|
+
---
|
|
221
272
|
|
|
222
|
-
|
|
273
|
+
## ๐ Related Packages
|
|
223
274
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
275
|
+
| Package | Description |
|
|
276
|
+
|---------|-------------|
|
|
277
|
+
| [`@waelio/utils`](https://www.npmjs.com/package/@waelio/utils) | Shared utilities and UI helpers |
|
|
278
|
+
| [`@waelio/ustore`](https://www.npmjs.com/package/@waelio/ustore) | Universal storage and state patterns |
|
|
279
|
+
| [`@waelio/agent`](https://www.npmjs.com/package/@waelio/agent) | AI agent frontend toolkit |
|
|
280
|
+
| [`@waelio/sync`](https://www.npmjs.com/package/@waelio/sync) | Real-time sync utilities |
|
|
228
281
|
|
|
229
|
-
|
|
282
|
+
---
|
|
230
283
|
|
|
231
|
-
|
|
232
|
-
- A custom workdir can be used when you want a persistent local checkout.
|
|
233
|
-
- If `source` is provided, cloning is skipped and the existing checkout is built directly.
|
|
284
|
+
## ๐ License
|
|
234
285
|
|
|
235
|
-
|
|
286
|
+
[MIT](./LICENSE) ยฉ [Waelio](https://waelio.com)
|
package/dist/scaffold.js
CHANGED
|
@@ -308,6 +308,58 @@ ${list(sel.selectedLocales)}
|
|
|
308
308
|
${list(sel.selectedRoles)}
|
|
309
309
|
`;
|
|
310
310
|
}
|
|
311
|
+
function rootIndexHtml(name, slug) {
|
|
312
|
+
return `<!doctype html>
|
|
313
|
+
<html lang="en">
|
|
314
|
+
<head>
|
|
315
|
+
<meta charset="UTF-8" />
|
|
316
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
317
|
+
<title>${name}</title>
|
|
318
|
+
<style>
|
|
319
|
+
:root { color-scheme: light dark; }
|
|
320
|
+
body {
|
|
321
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
|
|
322
|
+
margin: 0;
|
|
323
|
+
min-height: 100vh;
|
|
324
|
+
display: grid;
|
|
325
|
+
place-items: center;
|
|
326
|
+
background: #0b1220;
|
|
327
|
+
color: #e5e7eb;
|
|
328
|
+
}
|
|
329
|
+
main {
|
|
330
|
+
width: min(760px, calc(100% - 2rem));
|
|
331
|
+
background: rgba(17, 24, 39, 0.92);
|
|
332
|
+
border: 1px solid rgba(148, 163, 184, 0.35);
|
|
333
|
+
border-radius: 14px;
|
|
334
|
+
padding: 1.2rem 1.25rem;
|
|
335
|
+
}
|
|
336
|
+
h1 { margin: 0 0 0.4rem; font-size: 1.25rem; }
|
|
337
|
+
p { margin: 0.35rem 0; line-height: 1.45; }
|
|
338
|
+
code {
|
|
339
|
+
background: rgba(148, 163, 184, 0.18);
|
|
340
|
+
padding: 0.12rem 0.4rem;
|
|
341
|
+
border-radius: 0.4rem;
|
|
342
|
+
}
|
|
343
|
+
ul { margin: 0.8rem 0 0; padding-left: 1.1rem; }
|
|
344
|
+
a { color: #93c5fd; }
|
|
345
|
+
</style>
|
|
346
|
+
</head>
|
|
347
|
+
<body>
|
|
348
|
+
<main>
|
|
349
|
+
<h1>${name}</h1>
|
|
350
|
+
<p>This scaffold was generated by <code>@waelio/cli</code>.</p>
|
|
351
|
+
<p>Project slug: <code>${slug}</code></p>
|
|
352
|
+
<p>Run the generated apps locally:</p>
|
|
353
|
+
<ul>
|
|
354
|
+
<li>Frontend source: <code>frontend/</code> (Next.js, port 3001)</li>
|
|
355
|
+
<li>Backend source: <code>backend/</code> (NestJS, port 3002)</li>
|
|
356
|
+
<li>Details: <a href="./README.md">README.md</a></li>
|
|
357
|
+
</ul>
|
|
358
|
+
</main>
|
|
359
|
+
</body>
|
|
360
|
+
</html>
|
|
361
|
+
`;
|
|
362
|
+
}
|
|
311
363
|
const ROOT_GITIGNORE = `node_modules/
|
|
312
364
|
dist/
|
|
313
365
|
.next/
|
|
@@ -428,6 +480,7 @@ async function writeScaffold(blueprint, projectName, slug, outDir, initGit) {
|
|
|
428
480
|
}
|
|
429
481
|
// Root
|
|
430
482
|
await writeFileEnsured(path.join(outDir, "README.md"), rootReadme(projectName, slug, blueprint));
|
|
483
|
+
await writeFileEnsured(path.join(outDir, "index.html"), rootIndexHtml(projectName, slug));
|
|
431
484
|
await writeFileEnsured(path.join(outDir, ".gitignore"), ROOT_GITIGNORE);
|
|
432
485
|
await writeFileEnsured(path.join(outDir, "blueprint.json"), JSON.stringify(blueprint, null, 2));
|
|
433
486
|
if (initGit !== false) {
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { type Server as HttpServer } from "node:http";
|
|
2
|
+
import { type Blueprint } from "./scaffold.js";
|
|
3
|
+
interface ResolvedScaffoldRequest {
|
|
4
|
+
blueprint: Blueprint;
|
|
5
|
+
outRoot: string;
|
|
6
|
+
initGit: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ScaffoldPayloadResolution {
|
|
9
|
+
mode: "none" | "scaffold" | "invalid";
|
|
10
|
+
request?: ResolvedScaffoldRequest;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveScaffoldRequestPayload(payload: unknown, defaultOutRoot?: string): ScaffoldPayloadResolution;
|
|
2
14
|
export declare function startServer(options?: {
|
|
3
15
|
port?: number;
|
|
4
16
|
}): Promise<HttpServer>;
|
|
17
|
+
export declare function listPublicSites(rootDirectory?: string): Promise<string[]>;
|
|
18
|
+
export {};
|