create-asaje-go-vue 0.3.5 → 0.3.7
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 +45 -10
- package/bin/create-asaje-go-vue.js +823 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@ CLI package for scaffolding and running the Asaje Go + Vue boilerplate.
|
|
|
9
9
|
| Command | Purpose |
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| `asaje sync-project-config [directory]` | Scan the project, detect managed services, and rewrite `asaje.config.json` / `asaje.railway.json` |
|
|
12
|
+
| `asaje sync-readme [directory]` | Regenerate the project `README.md` from `asaje.config.json` |
|
|
13
|
+
| `asaje sync-github-workflow [directory]` | Regenerate the GitHub Actions Railway deploy workflow from `asaje.config.json` |
|
|
12
14
|
| `asaje setup-railway [directory]` | Provision infrastructure, create missing Railway services, wire variables, and deploy |
|
|
13
15
|
| `asaje update-railway [directory]` | Reconcile an existing Railway project after changing `asaje.config.json` |
|
|
14
16
|
| `asaje sync-railway-env [directory]` | Reapply Railway variables without reprovisioning infra |
|
|
@@ -74,6 +76,20 @@ npx -p create-asaje-go-vue@latest asaje sync-project-config ./my-app --dry-run
|
|
|
74
76
|
npx -p create-asaje-go-vue@latest asaje sync-project-config ./my-app --yes
|
|
75
77
|
```
|
|
76
78
|
|
|
79
|
+
### Regenerate the GitHub Actions Railway workflow
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx -p create-asaje-go-vue@latest asaje sync-github-workflow ./my-app
|
|
83
|
+
npx -p create-asaje-go-vue@latest asaje sync-github-workflow ./my-app --dry-run
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Regenerate the project README
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx -p create-asaje-go-vue@latest asaje sync-readme ./my-app
|
|
90
|
+
npx -p create-asaje-go-vue@latest asaje sync-readme ./my-app --dry-run
|
|
91
|
+
```
|
|
92
|
+
|
|
77
93
|
### Provision Railway resources
|
|
78
94
|
|
|
79
95
|
```bash
|
|
@@ -82,12 +98,14 @@ npx -p create-asaje-go-vue@latest asaje setup-railway ./my-app --dry-run
|
|
|
82
98
|
npx -p create-asaje-go-vue@latest asaje update-railway ./my-app --yes
|
|
83
99
|
```
|
|
84
100
|
|
|
85
|
-
By default this manages
|
|
101
|
+
By default this manages six Railway app services:
|
|
86
102
|
|
|
87
103
|
- `api`
|
|
88
104
|
- `worker`
|
|
89
105
|
- `realtime-gateway`
|
|
90
106
|
- `admin`
|
|
107
|
+
- `landing`
|
|
108
|
+
- `pwa`
|
|
91
109
|
|
|
92
110
|
The default `worker` service reuses `api/Dockerfile` and starts with `API_COMMAND=worker`.
|
|
93
111
|
|
|
@@ -154,7 +172,7 @@ npx -p create-asaje-go-vue@latest asaje destroy-railway ./my-app --scope project
|
|
|
154
172
|
- removes template-only files such as `cli/`
|
|
155
173
|
- asks project setup questions for ports, storage, mail, seeds, and locale
|
|
156
174
|
- writes `asaje.config.json`
|
|
157
|
-
- generates `admin
|
|
175
|
+
- generates service-local `.env` files for `admin`, `api`, `realtime-gateway`, `landing`, and `pwa`
|
|
158
176
|
- optionally installs dependencies and starts Docker infrastructure
|
|
159
177
|
|
|
160
178
|
## What `asaje start` does
|
|
@@ -163,7 +181,7 @@ npx -p create-asaje-go-vue@latest asaje destroy-railway ./my-app --scope project
|
|
|
163
181
|
- creates missing `.env` files from examples when possible
|
|
164
182
|
- optionally installs dependencies
|
|
165
183
|
- optionally starts Docker infrastructure
|
|
166
|
-
- starts any combination of `api`, `worker`, `realtime-gateway`, and `
|
|
184
|
+
- starts any combination of `api`, `worker`, `realtime-gateway`, `admin`, `landing`, and `pwa`
|
|
167
185
|
- supports profiles: `full`, `backend-only`, `frontend-only`, and `custom`
|
|
168
186
|
- streams service logs until you stop with `Ctrl+C`
|
|
169
187
|
|
|
@@ -205,9 +223,9 @@ npx -p create-asaje-go-vue@latest asaje destroy-railway ./my-app --scope project
|
|
|
205
223
|
- reads the linked Railway project context
|
|
206
224
|
- provisions PostgreSQL, RabbitMQ, and S3-compatible object storage on Railway
|
|
207
225
|
- creates missing Railway app services for the configured app service list
|
|
208
|
-
- defaults to `api`, `worker`, `realtime-gateway`, and `
|
|
226
|
+
- defaults to `api`, `worker`, `realtime-gateway`, `admin`, `landing`, and `pwa` when no custom Railway service config is present
|
|
209
227
|
- applies Railway variables from `asaje.config.json` when configured
|
|
210
|
-
- keeps the
|
|
228
|
+
- keeps the automatic variable wiring for `api`, `worker`, `realtime-gateway`, `admin`, `landing`, and `pwa`; by default existing Railway values are preserved unless explicitly overridden in project config
|
|
211
229
|
- triggers the first Railway deployment for each app service using the service-local `Dockerfile` and `railway.json`
|
|
212
230
|
- generates missing app secrets such as `JWT_SECRET` and `SWAGGER_PASSWORD`, while reusing existing Railway values when present
|
|
213
231
|
- supports `--dry-run` to preview provisioning and variable changes without applying them
|
|
@@ -228,7 +246,7 @@ npx -p create-asaje-go-vue@latest asaje destroy-railway ./my-app --scope project
|
|
|
228
246
|
- reads the linked Railway project context
|
|
229
247
|
- discovers existing Railway app and infra services
|
|
230
248
|
- syncs configured Railway variables without provisioning infra resources
|
|
231
|
-
- keeps the
|
|
249
|
+
- keeps the automatic variable wiring for `api`, `worker`, `realtime-gateway`, `admin`, `landing`, and `pwa`; by default existing Railway values are preserved unless explicitly overridden in project config
|
|
232
250
|
- supports `--diff` to show what would be added or changed compared with the current Railway variables
|
|
233
251
|
- supports `--dry-run` to preview variable changes without applying them
|
|
234
252
|
|
|
@@ -288,7 +306,7 @@ If the `railway` block is omitted, the CLI keeps the default built-in services a
|
|
|
288
306
|
"projectName": "My App",
|
|
289
307
|
"projectSlug": "my-app",
|
|
290
308
|
"railway": {
|
|
291
|
-
"variablesMode": "
|
|
309
|
+
"variablesMode": "preserve-remote",
|
|
292
310
|
"services": [
|
|
293
311
|
{
|
|
294
312
|
"key": "api",
|
|
@@ -378,13 +396,15 @@ If the `railway` block is omitted, the CLI keeps the default built-in services a
|
|
|
378
396
|
|
|
379
397
|
Supported top-level Railway fields:
|
|
380
398
|
|
|
381
|
-
- `variablesMode`: `
|
|
399
|
+
- `variablesMode`: `preserve-remote` by default; use `sync-managed` to force CLI-managed values to overwrite Railway values, or `replace` to disable automatic generated variables and rely only on `railway.variables`
|
|
382
400
|
- `services`: managed Railway application services deployed by `setup-railway` and `deploy-railway`
|
|
383
401
|
- `variables.shared`: variables applied to every managed service
|
|
384
402
|
- `variables.services.<key>`: variables applied only to one managed service
|
|
385
403
|
- `environments.<name>.railwayEnvironment`: optional mapping from a logical config key like `production` to the real Railway environment name or id
|
|
386
404
|
- `environments.<name>.variables.shared`: shared variables only for that deployment environment
|
|
387
405
|
- `environments.<name>.variables.services.<key>`: service-specific overrides only for that deployment environment
|
|
406
|
+
- `ci.githubActions.deployRailway.enabled`: generate a GitHub Actions workflow for Railway deploys
|
|
407
|
+
- `ci.githubActions.deployRailway.branchEnvironments`: map Git branches to logical Railway environments such as `develop -> staging` and `main -> production`
|
|
388
408
|
|
|
389
409
|
Supported fields per service in `railway.services`:
|
|
390
410
|
|
|
@@ -396,13 +416,20 @@ Supported fields per service in `railway.services`:
|
|
|
396
416
|
- `seedImage`: optional bootstrap image used only when `setup-railway` needs to create the Railway service before the first deploy
|
|
397
417
|
- `dockerfile`: optional project-relative Dockerfile path validated by the CLI for documentation/safety; Railway still builds from the declared `directory`
|
|
398
418
|
|
|
399
|
-
How variable
|
|
419
|
+
How variable resolution works:
|
|
400
420
|
|
|
401
421
|
- `railway.variables.shared`
|
|
402
422
|
- then `railway.variables.services.<key>`
|
|
403
423
|
- then `railway.environments.<name>.variables.shared`
|
|
404
424
|
- then `railway.environments.<name>.variables.services.<key>`
|
|
405
425
|
|
|
426
|
+
Variable modes:
|
|
427
|
+
|
|
428
|
+
- `preserve-remote`: existing Railway values win over generated CLI defaults; explicit values declared in `asaje.config.json` still override Railway
|
|
429
|
+
- `sync-managed`: CLI-managed values overwrite the matching Railway variables, while undeclared Railway-only variables are left alone
|
|
430
|
+
- `replace`: disables generated defaults and only applies the declarative variables defined in `asaje.config.json`
|
|
431
|
+
- legacy `merge` is still accepted as an alias of `sync-managed`
|
|
432
|
+
|
|
406
433
|
Environment-aware usage:
|
|
407
434
|
|
|
408
435
|
- `--environment production` can point to either the logical config key or the real Railway environment name/id
|
|
@@ -414,12 +441,20 @@ Notes:
|
|
|
414
441
|
- the service directory should contain the `Dockerfile` Railway will build from
|
|
415
442
|
- custom services are provisioned and deployed by `setup-railway` and `deploy-railway`
|
|
416
443
|
- `sync-railway-env` can now apply declarative variables to any managed service key, including custom services
|
|
417
|
-
- with `variablesMode: "
|
|
444
|
+
- with `variablesMode: "preserve-remote"`, the core services still receive generated defaults only for missing Railway variables, while explicit `railway.variables` entries override the remote values
|
|
445
|
+
- with `variablesMode: "sync-managed"`, the core services `api`, `worker`, `realtime-gateway`, `admin`, `landing`, and `pwa` receive the CLI-managed values even when Railway already has a different value
|
|
418
446
|
- the default `worker` service reuses the `api` image and starts with `API_COMMAND=worker`
|
|
419
447
|
- with `variablesMode: "replace"`, only the variables declared in `asaje.config.json` are applied
|
|
420
448
|
- after changing the Railway config, run `asaje update-railway ./my-app --yes` to reconcile the linked Railway project with the new configuration
|
|
421
449
|
- you can target a custom service with `asaje deploy-railway ./my-app --service worker`
|
|
422
450
|
|
|
451
|
+
GitHub Actions deploy workflow notes:
|
|
452
|
+
|
|
453
|
+
- the generated workflow triggers only on the configured branches
|
|
454
|
+
- it detects changes per service directory and redeploys only the impacted Railway services
|
|
455
|
+
- config changes trigger `asaje sync-railway-env` before service deploys
|
|
456
|
+
- add `RAILWAY_TOKEN` as a GitHub repository secret before enabling the workflow in production
|
|
457
|
+
|
|
423
458
|
## What `asaje destroy-railway` does
|
|
424
459
|
|
|
425
460
|
- validates the target project structure
|