playcademy 0.26.0 → 0.26.1-beta.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 +67 -0
- package/dist/bucket.js +9 -0
- package/dist/cli.js +311 -183
- package/dist/constants.d.ts +21 -1
- package/dist/constants.js +15 -0
- package/dist/db.js +49 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.js +490 -242
- package/dist/runtime/backend-runtime/index.js +1 -1
- package/dist/runtime/backend-runtime/manifest.json +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +96 -55
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -128,6 +128,7 @@ playcademy deploy --env staging # Deploy to staging
|
|
|
128
128
|
playcademy deploy --backend # Include API routes
|
|
129
129
|
playcademy deploy --no-backend # Skip API routes
|
|
130
130
|
playcademy deploy --dry-run # Validate without deploying
|
|
131
|
+
playcademy deploy --json # Machine-readable output
|
|
131
132
|
playcademy deploy --debug # Show debug info
|
|
132
133
|
```
|
|
133
134
|
|
|
@@ -142,6 +143,7 @@ playcademy deploy --debug # Show debug info
|
|
|
142
143
|
- `--backend` - Deploy API routes
|
|
143
144
|
- `--no-backend` - Skip API routes
|
|
144
145
|
- `--dry-run` - Validate only
|
|
146
|
+
- `--json` - Output a machine-readable deployment result
|
|
145
147
|
- `--verbose` - Show detailed output
|
|
146
148
|
- `--debug` - Show debug information
|
|
147
149
|
|
|
@@ -264,9 +266,13 @@ playcademy timeback cleanup
|
|
|
264
266
|
|
|
265
267
|
## Environment Variables
|
|
266
268
|
|
|
269
|
+
- `CI` - Set to `1` or `true` to disable interactive prompts
|
|
270
|
+
- `PLAYCADEMY_API_TOKEN` - API token for non-interactive authentication
|
|
267
271
|
- `PLAYCADEMY_ENV` - Environment: `staging` or `production` (default: `production`)
|
|
268
272
|
- `PLAYCADEMY_BASE_URL` - Override API endpoint (default: based on `PLAYCADEMY_ENV`)
|
|
269
273
|
- `PLAYCADEMY_PROFILE` - Authentication profile to use (default: `default`)
|
|
274
|
+
- `PLAYCADEMY_CONFIG_PATH` - Path to a config file
|
|
275
|
+
- `DEBUG` - Set to `1` to show debug output (written to stderr, safe with `--json`)
|
|
270
276
|
|
|
271
277
|
**Example:**
|
|
272
278
|
|
|
@@ -281,6 +287,67 @@ PLAYCADEMY_PROFILE=work playcademy deploy
|
|
|
281
287
|
PLAYCADEMY_BASE_URL=http://localhost:5174 playcademy deploy
|
|
282
288
|
```
|
|
283
289
|
|
|
290
|
+
## CI/CD
|
|
291
|
+
|
|
292
|
+
Use `CI=1`, `PLAYCADEMY_API_TOKEN`, and an explicit environment for pipeline deploys:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
CI=1 PLAYCADEMY_API_TOKEN=$PLAYCADEMY_API_TOKEN playcademy deploy --env staging --json
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`deploy --json` implies non-interactive mode. On success, stdout is a single JSON
|
|
299
|
+
object with fields including `slug`, `url`, `environment`, `buildHash`, and
|
|
300
|
+
`backendDeployed`. On handled failures, stdout is a JSON error object and the
|
|
301
|
+
process exits non-zero. Human progress output is suppressed while `--json` is
|
|
302
|
+
active.
|
|
303
|
+
|
|
304
|
+
For local scripts where setting `CI=1` would affect other tools, use global
|
|
305
|
+
`--yes` / `-y` to answer confirmation prompts:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
playcademy --yes deploy --env staging
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
`--yes` runs commands unattended: prompts never appear. Yes/no confirmations
|
|
312
|
+
answer yes, while prompts that need a real value (environment selection, names,
|
|
313
|
+
keys) resolve from an explicit flag or command-defined non-interactive fallback
|
|
314
|
+
or fail fast with instructions, so `--yes` never silently answers a question
|
|
315
|
+
that isn't yes/no. For example, `playcademy --yes deploy` with credentials for
|
|
316
|
+
multiple environments and no `--env` fails fast asking for one rather than
|
|
317
|
+
guessing. When `CI` is also set, CI's auto-defaults (like the staging
|
|
318
|
+
environment fallback) take precedence, so adding `-y` to an existing pipeline
|
|
319
|
+
never changes what it deploys.
|
|
320
|
+
|
|
321
|
+
Prefer `--dry-run` in CI before enabling real deploys, especially when changing
|
|
322
|
+
config or backend resources:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
playcademy deploy --env staging --dry-run --json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Example GitHub Actions workflow:
|
|
329
|
+
|
|
330
|
+
```yaml
|
|
331
|
+
name: Deploy Playcademy
|
|
332
|
+
|
|
333
|
+
on:
|
|
334
|
+
push:
|
|
335
|
+
branches: [main]
|
|
336
|
+
|
|
337
|
+
jobs:
|
|
338
|
+
deploy:
|
|
339
|
+
runs-on: ubuntu-latest
|
|
340
|
+
steps:
|
|
341
|
+
- uses: actions/checkout@v4
|
|
342
|
+
- uses: oven-sh/setup-bun@v2
|
|
343
|
+
- run: bun install --frozen-lockfile
|
|
344
|
+
- run: bun run build
|
|
345
|
+
- run: playcademy deploy --env production --json
|
|
346
|
+
env:
|
|
347
|
+
CI: '1'
|
|
348
|
+
PLAYCADEMY_API_TOKEN: ${{ secrets.PLAYCADEMY_API_TOKEN }}
|
|
349
|
+
```
|
|
350
|
+
|
|
284
351
|
## Configuration Files
|
|
285
352
|
|
|
286
353
|
The CLI supports multiple configuration formats:
|
package/dist/bucket.js
CHANGED
|
@@ -315,6 +315,15 @@ var TIMEBACK_DISCREPANCY_QUEUE_METRIC_VALUES = new Set(TIMEBACK_DISCREPANCY_QUEU
|
|
|
315
315
|
// src/lib/core/import.ts
|
|
316
316
|
import * as esbuild from "esbuild";
|
|
317
317
|
|
|
318
|
+
// src/lib/core/prompts.ts
|
|
319
|
+
import {
|
|
320
|
+
checkbox as inquirerCheckbox,
|
|
321
|
+
confirm as inquirerConfirm,
|
|
322
|
+
input as inquirerInput,
|
|
323
|
+
password as inquirerPassword,
|
|
324
|
+
select as inquirerSelect
|
|
325
|
+
} from "@inquirer/prompts";
|
|
326
|
+
|
|
318
327
|
// src/lib/core/transpile.ts
|
|
319
328
|
import * as esbuild2 from "esbuild";
|
|
320
329
|
|