@tantawowa/hosanna-tools 2.18.0 → 2.20.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/README.md +77 -8
- package/dist/build-info.json +3 -3
- package/dist/cli.js +121 -71
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +148 -0
- package/dist/index.js +293 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cli.configure-hosanna-url.d.ts +11 -1
- package/dist/lib/cli.configure-hosanna-url.js +17 -10
- package/dist/lib/cli.configure-hosanna-url.js.map +1 -1
- package/dist/lib/env-cloud-agent-setup-help.js +3 -6
- package/dist/lib/env-cloud-agent-setup-help.js.map +1 -1
- package/dist/support-tools/build-config-resolver.d.ts +33 -0
- package/dist/support-tools/build-config-resolver.js +168 -0
- package/dist/support-tools/build-config-resolver.js.map +1 -0
- package/dist/support-tools/build-config-secrets.d.ts +17 -0
- package/dist/support-tools/build-config-secrets.js +114 -0
- package/dist/support-tools/build-config-secrets.js.map +1 -0
- package/dist/support-tools/cloud-agent-setup.d.ts +7 -3
- package/dist/support-tools/cloud-agent-setup.js +20 -27
- package/dist/support-tools/cloud-agent-setup.js.map +1 -1
- package/dist/support-tools/dev-runner.d.ts +2 -0
- package/dist/support-tools/dev-runner.js +27 -12
- package/dist/support-tools/dev-runner.js.map +1 -1
- package/dist/support-tools/mcp-server/cli-test-runner.d.ts +12 -1
- package/dist/support-tools/mcp-server/cli-test-runner.js +24 -19
- package/dist/support-tools/mcp-server/cli-test-runner.js.map +1 -1
- package/dist/support-tools/mcp-server/index.d.ts +10 -1
- package/dist/support-tools/mcp-server/index.js +12 -3
- package/dist/support-tools/mcp-server/index.js.map +1 -1
- package/dist/support-tools/roku-map-stack.d.ts +7 -0
- package/dist/support-tools/roku-map-stack.js +79 -0
- package/dist/support-tools/roku-map-stack.js.map +1 -0
- package/dist/support-tools/roku-stack-resolver.d.ts +1 -0
- package/dist/support-tools/roku-stack-resolver.js +53 -1
- package/dist/support-tools/roku-stack-resolver.js.map +1 -1
- package/package.json +42 -3
- package/dist/support-tools/extract-ci-config.d.ts +0 -5
- package/dist/support-tools/extract-ci-config.js +0 -70
- package/dist/support-tools/extract-ci-config.js.map +0 -1
- package/dist/support-tools/restore-debug-flags.d.ts +0 -26
- package/dist/support-tools/restore-debug-flags.js +0 -172
- package/dist/support-tools/restore-debug-flags.js.map +0 -1
package/README.md
CHANGED
|
@@ -18,6 +18,43 @@ Note, if you are developing hosanna-tools, you will install the package locally.
|
|
|
18
18
|
npm install . -g # path to the hosanna-tools directory
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## Embedding as a library
|
|
22
|
+
|
|
23
|
+
Hosanna Tools can also be imported by app build chains. The CLI remains available as `hst`, but package imports are library-safe and do not parse CLI arguments or call `process.exit` during import. Public wrappers for process-oriented commands use no-exit mode where supported, so API callers receive structured results or thrown errors instead of forced process termination.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { buildConfig, env, generate, install, roku, secrets } from '@tantawowa/hosanna-tools';
|
|
27
|
+
|
|
28
|
+
await generate.all({
|
|
29
|
+
rootFolder: './src',
|
|
30
|
+
generatedFolder: './src-generated',
|
|
31
|
+
mode: 'runtime',
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await buildConfig.resolve({
|
|
35
|
+
env: 'dev',
|
|
36
|
+
platform: 'roku',
|
|
37
|
+
out: 'assets/meta/build-config.json',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
await install.compiler({ version: '0.33.7' });
|
|
41
|
+
await roku.package({ env: 'prod', prebuild: 'npm run roku:build:prod' });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Common build-script replacements:
|
|
45
|
+
|
|
46
|
+
| CLI command | Programmatic API |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `npx hst generate --rootFolder ./src` | `await generate.all({ rootFolder: './src' })` |
|
|
49
|
+
| `npx hst generate:clean` | `await generate.clean()` |
|
|
50
|
+
| `npx hst build-config resolve --env dev --platform roku --out assets/meta/build-config.json` | `await buildConfig.resolve({ env: 'dev', platform: 'roku', out: 'assets/meta/build-config.json' })` |
|
|
51
|
+
| `npx hst install:compiler 0.33.7` | `await install.compiler({ version: '0.33.7' })` |
|
|
52
|
+
| `npx hst roku:package --env prod --prebuild 'npm run roku:build:prod'` | `await roku.package({ env: 'prod', prebuild: 'npm run roku:build:prod' })` |
|
|
53
|
+
| `npx hst secrets:check` | `await secrets.check({ cwd: process.cwd() })` |
|
|
54
|
+
| `npx hst env` | `await env.check({ cwd: process.cwd() })` |
|
|
55
|
+
|
|
56
|
+
Long-running APIs such as `dev.run`, `debugger.start`, `mcp.start`, `test.record`, and RASP capture-style workflows keep the same operational behavior as the corresponding CLI commands: they start services, attach to debuggers, or wait for user/session activity. `mcp.start`, `dev.run`, and `test.ui` are wired for programmatic no-exit behavior through the top-level API.
|
|
57
|
+
|
|
21
58
|
# Getting started
|
|
22
59
|
|
|
23
60
|
Ensure you have Node.js 20 or higher.
|
|
@@ -113,6 +150,22 @@ The CLI commands are organized into logical groups using colon-separated namespa
|
|
|
113
150
|
### Roku Commands (`roku:*`) - Roku Deployment & Packaging
|
|
114
151
|
- `roku:run` - Deploy a Roku app to a device (supports .zip file or folder)
|
|
115
152
|
- `roku:package` - Package and sign a Roku channel using roku-deploy
|
|
153
|
+
- `roku:map-stack` - Resolve Roku `.brs` stack traces, compile errors, and crash snippets to original TypeScript locations using `.brs.map` files
|
|
154
|
+
|
|
155
|
+
Resolve pasted Roku output:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
pbpaste | hst roku:map-stack --source-map-root platforms/roku/src
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Resolve a saved crash report or a single line:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
hst roku:map-stack --file crash.txt --source-map-root platforms/roku/src
|
|
165
|
+
hst roku:map-stack --text "file/line: pkg:/components/source_0.brs(7475)"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Supported inputs include `file/line: pkg:/components/source_0.brs(7475)`, `at ... (pkg:/components/source_1.brs:6636)`, `in pkg:/components/source_3.brs(4710)`, and bare generated references such as `source_10.brs:8211`. See [docs/roku-map-stack.md](docs/roku-map-stack.md).
|
|
116
169
|
|
|
117
170
|
### Generate Commands (`generate:*`) - Code Generation
|
|
118
171
|
- `generate` - Generate structs and command handler maps
|
|
@@ -124,13 +177,30 @@ The CLI commands are organized into logical groups using colon-separated namespa
|
|
|
124
177
|
- `install:compiler` - Install or update the Hosanna compiler (hsc)
|
|
125
178
|
- `install:template` - Create a new template app with the Hosanna SDK
|
|
126
179
|
|
|
180
|
+
### Build Config Commands (`build-config`) - Runtime Configuration
|
|
181
|
+
- `build-config resolve` - Resolve `build-config/base.json`, env/platform overlays, secrets, and optional developer profiles into the canonical runtime `build-config.json`
|
|
182
|
+
|
|
183
|
+
Native builds can resolve config immediately before the platform build:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npx hst build-config resolve --env dev --platform roku --out assets/meta/build-config.json
|
|
187
|
+
npm run roku:build
|
|
188
|
+
|
|
189
|
+
HS_ENV=dev HS_PLATFORM=android npx hst build-config resolve --out assets/meta/build-config.json
|
|
190
|
+
npm run android:build-code
|
|
191
|
+
|
|
192
|
+
HS_ENV=dev HS_PLATFORM=apple HS_BUILD_PROFILE=george npx hst build-config resolve --out assets/meta/build-config.json
|
|
193
|
+
npm run apple:build-code
|
|
194
|
+
```
|
|
195
|
+
|
|
127
196
|
### CI Commands (`ci:*`) - Continuous Integration
|
|
128
197
|
- `ci:extract-pkg-key` - Extract signing key from an existing signed Roku package as base64
|
|
129
|
-
- `ci:extract-config` - Extract debug-flags JSON files as base64 environment variables
|
|
130
|
-
- `ci:restore-flags` - Restore debug-flags JSON files from base64 environment variables
|
|
131
|
-
- `ci:prepare-debug-flags` - Prepare one runtime `debug-flags.json` from `DEBUG_FLAGS_<ENV>_BASE64` or a local source file
|
|
132
198
|
- `ci:configure-hosanna-url` - Configure hosanna.json git-url from argument or environment
|
|
133
199
|
|
|
200
|
+
### Build Config Commands (`build-config:*`) - Build/runtime config
|
|
201
|
+
- `build-config resolve` - Merge build config overlays into `assets/meta/build-config.json`
|
|
202
|
+
- `build-config:restore-secrets` - Restore ignored `secrets/*.json` overlays from `BUILD_CONFIG_SECRETS_*_BASE64`
|
|
203
|
+
|
|
134
204
|
### Secrets Commands (`secrets:*`) - Portable `.secrets` files
|
|
135
205
|
- `secrets:list` - Print key names from `.secrets` (or `--template` for `.secrets.example`); `--format json`
|
|
136
206
|
- `secrets:check` - Compare `.secrets` to the template; report missing, empty, and extra keys; `--strict` fails on extras
|
|
@@ -142,13 +212,13 @@ Shared options: `--file` (secrets path), `--template` (template path for `check`
|
|
|
142
212
|
### Environment Commands (`env:*`) - Environment Management
|
|
143
213
|
- `env` - Print environment information and run checks with auto-fix option
|
|
144
214
|
- `env:prepare-gitignore` - Ensure .gitignore contains required entries
|
|
145
|
-
- `env:cloud-agent-setup` -
|
|
215
|
+
- `env:cloud-agent-setup` - Write `build-config/profiles/cloud-agent.json`, patch `remoteDebug` for cloud agents, optionally start debugger and `npm run dev` with `HS_BUILD_PROFILE=cloud-agent`
|
|
146
216
|
|
|
147
217
|
### MCP Debugging Commands (`run:mcp`, `stop:mcp`) - AI Agent Debugging
|
|
148
218
|
- `run:mcp` - Start the Hosanna MCP server for AI agent debugging
|
|
149
219
|
- `stop:mcp` - Stop the Hosanna MCP server
|
|
150
220
|
|
|
151
|
-
**Cursor agents and MCP:** Cursor does not magically attach to a terminal `hst run:mcp`. You add Hosanna as an MCP server (project **`.cursor/mcp.json`** or **Cursor Settings → MCP → Add Custom MCP**) so Cursor spawns **`hosanna-mcp`** (stdio transport). That process talks to the **command debugger** on HTTP **59150** and extension WebSocket **59153** by default. In **Cursor Cloud Agents**, run **`npx hst env:cloud-agent-setup --start-debugger --start-app`**
|
|
221
|
+
**Cursor agents and MCP:** Cursor does not magically attach to a terminal `hst run:mcp`. You add Hosanna as an MCP server (project **`.cursor/mcp.json`** or **Cursor Settings → MCP → Add Custom MCP**) so Cursor spawns **`hosanna-mcp`** (stdio transport). That process talks to the **command debugger** on HTTP **59150** and extension WebSocket **59153** by default. In **Cursor Cloud Agents**, run **`npx hst env:cloud-agent-setup --start-debugger --start-app`** so those services are up before the agent uses MCP tools. See [Cursor MCP settings](#cursor-settings--mcp-hosanna-debugger) below.
|
|
152
222
|
|
|
153
223
|
### UI Test Commands (`test:*`) - UI Test Automation
|
|
154
224
|
- `test:ui` - Replay UI test recordings against a running Hosanna app
|
|
@@ -173,9 +243,8 @@ hst install:template # Create new template app
|
|
|
173
243
|
|
|
174
244
|
# CI/CD operations
|
|
175
245
|
hst ci:extract-pkg-key myapp.pkg # Extract signing key for CI
|
|
176
|
-
hst
|
|
177
|
-
hst
|
|
178
|
-
hst ci:prepare-debug-flags --env prod --source assets/meta/debug-flags.prod.json --output-file build/debug-flags/prod/debug-flags.json
|
|
246
|
+
hst build-config:restore-secrets
|
|
247
|
+
hst build-config resolve --env prod --platform roku --out assets/meta/build-config.json
|
|
179
248
|
|
|
180
249
|
# Secrets (.secrets / .secrets.example)
|
|
181
250
|
hst secrets:list
|
package/dist/build-info.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -87,12 +87,95 @@ catch (err) {
|
|
|
87
87
|
// Let yargs handle all commands including env
|
|
88
88
|
(0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
89
89
|
.version(`${buildVersion}\n git: ${buildGitHash}\n built: ${buildDate}`)
|
|
90
|
-
.usage('$0 [command] [options]', `Hosanna Tools CLI\nVersion: ${buildVersion}\nBuild Date: ${buildDate}\n\nCommand Groups:\n run:*
|
|
90
|
+
.usage('$0 [command] [options]', `Hosanna Tools CLI\nVersion: ${buildVersion}\nBuild Date: ${buildDate}\n\nCommand Groups:\n run:* Development execution (dev, roku, debugger, mcp)\n stop:mcp Stop the Hosanna MCP server (PID lock; alias: run:stop)\n roku:* Roku deployment & packaging (run, package)\n generate:* Code generation (structs, clean)\n install:* Setup & installation (compiler, template)\n build-config Build/runtime configuration resolution\n ci:* Continuous integration (extract-pkg-key)\n secrets:* Portable .secrets (list, check, exec, init)\n test:* UI testing (replay recordings, visual regression)\n rasp:* RASP cert scripts (capture, export, validate)\n env:* Environment management (prepare-gitignore, cloud-agent-setup)`)
|
|
91
91
|
.option('verbose', {
|
|
92
92
|
type: 'boolean',
|
|
93
93
|
default: false,
|
|
94
94
|
describe: 'Enable verbose logging for all operations',
|
|
95
95
|
global: true
|
|
96
|
+
})
|
|
97
|
+
.command('build-config resolve', 'Resolve Hosanna build config overlays into the canonical runtime build-config.json', yargs => yargs
|
|
98
|
+
.option('env', { type: 'string', describe: 'Environment, e.g. dev, qa, or prod (or HS_ENV / HOSANNA_BUILD_ENV)' })
|
|
99
|
+
.option('platform', { type: 'string', describe: 'Platform, e.g. web, roku, android, apple, or ios (or HS_PLATFORM / HOSANNA_BUILD_PLATFORM)' })
|
|
100
|
+
.option('profile', { type: 'string', describe: 'Optional explicit local developer profile (or HS_BUILD_PROFILE)' })
|
|
101
|
+
.option('format', { type: 'string', choices: ['json'], describe: 'Print resolved config to stdout as JSON' })
|
|
102
|
+
.option('out', { type: 'string', describe: 'Write resolved config to this file' })
|
|
103
|
+
.option('manifest-out', { type: 'string', describe: 'Write a sanitized source manifest to this file' })
|
|
104
|
+
.option('explain', { type: 'boolean', default: false, describe: 'Print source summary without secret values' })
|
|
105
|
+
.option('allow-profile-in-prod', { type: 'boolean', default: false, describe: 'Allow applying --profile with --env prod (or HS_ALLOW_PROFILE_IN_PROD=true)' })
|
|
106
|
+
.example('$0 build-config resolve --env dev --platform web --format json', 'Resolve dev web config to stdout')
|
|
107
|
+
.example('HS_ENV=dev HS_PLATFORM=roku $0 build-config resolve --out assets/meta/build-config.json', 'Resolve config from env-prefixed shell arguments')
|
|
108
|
+
.example('$0 build-config resolve --env prod --platform roku --out assets/meta/build-config.json', 'Resolve prod Roku config to a runtime file')
|
|
109
|
+
.epilog([
|
|
110
|
+
'Environment fallbacks:',
|
|
111
|
+
' --env: HS_ENV or HOSANNA_BUILD_ENV',
|
|
112
|
+
' --platform: HS_PLATFORM or HOSANNA_BUILD_PLATFORM',
|
|
113
|
+
' --profile: HS_BUILD_PROFILE',
|
|
114
|
+
' --allow-profile-in-prod: HS_ALLOW_PROFILE_IN_PROD=true',
|
|
115
|
+
].join('\n')), async (args) => {
|
|
116
|
+
if (args.verbose) {
|
|
117
|
+
process.env.HOSANNA_VERBOSE = '1';
|
|
118
|
+
process.env.HOSANNA_UPDATER_VERBOSE = '1';
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/build-config-resolver.js')));
|
|
122
|
+
const options = mod.resolveBuildConfigCommandArgs({
|
|
123
|
+
env: args.env,
|
|
124
|
+
platform: args.platform,
|
|
125
|
+
profile: args.profile,
|
|
126
|
+
allowProfileInProd: Boolean(args['allow-profile-in-prod']),
|
|
127
|
+
});
|
|
128
|
+
const result = args.out
|
|
129
|
+
? mod.writeResolvedBuildConfig(Object.assign(Object.assign({}, options), { out: args.out, manifestOut: args['manifest-out'] }))
|
|
130
|
+
: mod.resolveBuildConfig(options);
|
|
131
|
+
if (args.format === 'json') {
|
|
132
|
+
console.log(JSON.stringify(result.config, null, 2));
|
|
133
|
+
}
|
|
134
|
+
if (args.explain || (!args.format && !args.out)) {
|
|
135
|
+
console.info(mod.explainBuildConfig(result));
|
|
136
|
+
}
|
|
137
|
+
if (args.out && !args.format && !args.explain) {
|
|
138
|
+
console.info(`✅ Resolved build config to ${args.out}`);
|
|
139
|
+
console.info(mod.explainBuildConfig(result));
|
|
140
|
+
}
|
|
141
|
+
process.exit(0);
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
console.error('❌ Failed to resolve build config:', err);
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
.command('build-config:restore-secrets', 'Restore ignored build config secret overlays from BUILD_CONFIG_SECRETS_*_BASE64 environment variables', yargs => yargs
|
|
149
|
+
.option('out-dir', { type: 'string', describe: 'Output directory for secret overlays (default: secrets)' })
|
|
150
|
+
.option('env', { type: 'string', describe: 'Restore only one environment overlay, e.g. dev or prod' })
|
|
151
|
+
.option('profile', { type: 'string', describe: 'Restore only one profile overlay, e.g. george' })
|
|
152
|
+
.option('quiet', { type: 'boolean', default: false, describe: 'Reduce output' })
|
|
153
|
+
.example('$0 build-config:restore-secrets', 'Restore all build config secret overlays from the environment')
|
|
154
|
+
.example('$0 build-config:restore-secrets --env prod', 'Restore only BUILD_CONFIG_SECRETS_PROD_BASE64')
|
|
155
|
+
.epilog([
|
|
156
|
+
'Environment variables:',
|
|
157
|
+
' BUILD_CONFIG_SECRETS_<ENV>_BASE64 -> secrets/<env>.json',
|
|
158
|
+
' BUILD_CONFIG_PROFILE_SECRETS_<PROFILE>_BASE64 -> secrets/profiles/<profile>.json',
|
|
159
|
+
'Values must be base64-encoded JSON objects. Secret values are never printed.',
|
|
160
|
+
].join('\n')), async (args) => {
|
|
161
|
+
if (args.verbose) {
|
|
162
|
+
process.env.HOSANNA_VERBOSE = '1';
|
|
163
|
+
process.env.HOSANNA_UPDATER_VERBOSE = '1';
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/build-config-secrets.js')));
|
|
167
|
+
mod.restoreBuildConfigSecrets({
|
|
168
|
+
outDir: args['out-dir'],
|
|
169
|
+
env: args.env,
|
|
170
|
+
profile: args.profile,
|
|
171
|
+
quiet: Boolean(args.quiet),
|
|
172
|
+
});
|
|
173
|
+
process.exit(0);
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
console.error('❌ Failed to restore build config secret overlays:', err);
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
96
179
|
})
|
|
97
180
|
.command(['version', 'v'], 'Print the version number', yargs => yargs, () => {
|
|
98
181
|
console.log(buildVersion);
|
|
@@ -165,6 +248,41 @@ catch (err) {
|
|
|
165
248
|
console.error('❌ Failed to publish Roku package:', err);
|
|
166
249
|
process.exit(1);
|
|
167
250
|
}
|
|
251
|
+
})
|
|
252
|
+
.command('roku:map-stack', 'Resolve Roku BrightScript stack traces or compile errors to original TypeScript locations using .brs.map files', yargs => yargs
|
|
253
|
+
.option('source-map-root', {
|
|
254
|
+
type: 'string',
|
|
255
|
+
default: 'platforms/roku/src',
|
|
256
|
+
describe: 'Path to packaged Roku source root containing .brs.map files, e.g. platforms/roku/src'
|
|
257
|
+
})
|
|
258
|
+
.option('file', {
|
|
259
|
+
type: 'string',
|
|
260
|
+
describe: 'Read stack trace text from a file instead of stdin'
|
|
261
|
+
})
|
|
262
|
+
.option('text', {
|
|
263
|
+
type: 'string',
|
|
264
|
+
describe: 'Resolve this stack trace text directly instead of stdin'
|
|
265
|
+
})
|
|
266
|
+
.example('pbpaste | $0 roku:map-stack --source-map-root platforms/roku/src', 'Resolve a pasted Roku crash or compiler log')
|
|
267
|
+
.example('$0 roku:map-stack --file crash.txt --source-map-root platforms/roku/src', 'Resolve stack trace text from a file')
|
|
268
|
+
.example('$0 roku:map-stack --text "file/line: pkg:/components/source_0.brs(7475)"', 'Resolve a single Roku backtrace line'), async (args) => {
|
|
269
|
+
if (args.verbose) {
|
|
270
|
+
process.env.HOSANNA_VERBOSE = '1';
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/roku-map-stack.js')));
|
|
274
|
+
await mod.runRokuMapStackCommand({
|
|
275
|
+
sourceMapRoot: args['source-map-root'],
|
|
276
|
+
file: args.file,
|
|
277
|
+
text: args.text,
|
|
278
|
+
});
|
|
279
|
+
process.exit(0);
|
|
280
|
+
}
|
|
281
|
+
catch (err) {
|
|
282
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
283
|
+
console.error(`❌ Failed to map Roku stack trace: ${msg}`);
|
|
284
|
+
process.exit(1);
|
|
285
|
+
}
|
|
168
286
|
})
|
|
169
287
|
.command('publish-roku', '[DEPRECATED] Use "roku:package" instead. Package and sign a Roku channel using roku-deploy. Flags fall back to env vars.', yargs => yargs
|
|
170
288
|
.option('ip', { type: 'string', describe: 'Roku device IP (env: ROKU_IP)' })
|
|
@@ -258,74 +376,6 @@ catch (err) {
|
|
|
258
376
|
console.error('❌ Failed to create CI package:', err);
|
|
259
377
|
process.exit(1);
|
|
260
378
|
}
|
|
261
|
-
})
|
|
262
|
-
.command('ci:extract-config', 'Extract debug-flags JSON files as base64 environment variables for CI', yargs => yargs
|
|
263
|
-
.option('output-dir', { type: 'string', describe: 'Directory containing debug-flags files (default: assets/meta)' })
|
|
264
|
-
.option('root-keys', { type: 'string', describe: 'Comma-separated list of root keys to include (default: env,remoteDebug,services,appController,config,remoteStyleFile)' })
|
|
265
|
-
.example('$0 ci:extract-config', 'Extract all debug-flags.*.json files as base64 environment variables')
|
|
266
|
-
.example('$0 ci:extract-config --output-dir ./config', 'Extract from custom directory')
|
|
267
|
-
.example('$0 ci:extract-config --root-keys env,remoteDebug', 'Extract only specific root keys'), async (args) => {
|
|
268
|
-
if (args.verbose) {
|
|
269
|
-
process.env.HOSANNA_VERBOSE = '1';
|
|
270
|
-
process.env.HOSANNA_UPDATER_VERBOSE = '1';
|
|
271
|
-
}
|
|
272
|
-
try {
|
|
273
|
-
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/extract-ci-config.js')));
|
|
274
|
-
await mod.extractCiConfig({
|
|
275
|
-
outputDir: args['output-dir'],
|
|
276
|
-
rootKeys: args['root-keys'],
|
|
277
|
-
});
|
|
278
|
-
process.exit(0);
|
|
279
|
-
}
|
|
280
|
-
catch (err) {
|
|
281
|
-
console.error('❌ Failed to extract CI config:', err);
|
|
282
|
-
process.exit(1);
|
|
283
|
-
}
|
|
284
|
-
})
|
|
285
|
-
.command('ci:restore-flags', 'Restore debug-flags JSON files from DEBUG_FLAGS_*_BASE64 environment variables', yargs => yargs
|
|
286
|
-
.option('output-dir', { type: 'string', describe: 'Directory to restore debug-flags files (default: assets/meta)' })
|
|
287
|
-
.example('$0 ci:restore-flags', 'Restore debug-flags files from environment variables')
|
|
288
|
-
.example('$0 ci:restore-flags --output-dir ./config', 'Restore to custom directory'), async (args) => {
|
|
289
|
-
if (args.verbose) {
|
|
290
|
-
process.env.HOSANNA_VERBOSE = '1';
|
|
291
|
-
process.env.HOSANNA_UPDATER_VERBOSE = '1';
|
|
292
|
-
}
|
|
293
|
-
try {
|
|
294
|
-
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/restore-debug-flags.js')));
|
|
295
|
-
await mod.restoreDebugFlags({
|
|
296
|
-
outputDir: args['output-dir'],
|
|
297
|
-
});
|
|
298
|
-
process.exit(0);
|
|
299
|
-
}
|
|
300
|
-
catch (err) {
|
|
301
|
-
console.error('❌ Failed to restore debug flags:', err);
|
|
302
|
-
process.exit(1);
|
|
303
|
-
}
|
|
304
|
-
})
|
|
305
|
-
.command('ci:prepare-debug-flags', 'Prepare one runtime debug-flags.json file from DEBUG_FLAGS_<ENV>_BASE64 or a local source file', yargs => yargs
|
|
306
|
-
.option('env', { type: 'string', demandOption: true, describe: 'Environment to prepare, e.g. dev or prod' })
|
|
307
|
-
.option('source', { type: 'string', demandOption: true, describe: 'Local debug-flags source file to use when the env var is absent' })
|
|
308
|
-
.option('output-file', { type: 'string', demandOption: true, describe: 'Runtime debug-flags.json output path' })
|
|
309
|
-
.option('quiet', { type: 'boolean', default: false, describe: 'Reduce output' })
|
|
310
|
-
.example('$0 ci:prepare-debug-flags --env prod --source assets/meta/debug-flags.prod.json --output-file build/debug-flags/prod/debug-flags.json', 'Prepare prod runtime debug flags without overwriting the local source file'), async (args) => {
|
|
311
|
-
if (args.verbose) {
|
|
312
|
-
process.env.HOSANNA_VERBOSE = '1';
|
|
313
|
-
process.env.HOSANNA_UPDATER_VERBOSE = '1';
|
|
314
|
-
}
|
|
315
|
-
try {
|
|
316
|
-
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/restore-debug-flags.js')));
|
|
317
|
-
await mod.prepareDebugFlags({
|
|
318
|
-
env: args.env,
|
|
319
|
-
source: args.source,
|
|
320
|
-
outputFile: args['output-file'],
|
|
321
|
-
quiet: Boolean(args.quiet),
|
|
322
|
-
});
|
|
323
|
-
process.exit(0);
|
|
324
|
-
}
|
|
325
|
-
catch (err) {
|
|
326
|
-
console.error('❌ Failed to prepare debug flags:', err);
|
|
327
|
-
process.exit(1);
|
|
328
|
-
}
|
|
329
379
|
})
|
|
330
380
|
.command('secrets:list', 'Print secret key names from .secrets (values hidden). Use --template for .secrets.example', yargs => yargs
|
|
331
381
|
.option('file', { type: 'string', describe: 'Path to .secrets (default: .secrets in cwd or git root)' })
|
|
@@ -481,7 +531,7 @@ catch (err) {
|
|
|
481
531
|
}
|
|
482
532
|
})
|
|
483
533
|
.command('env:cloud-agent-setup', 'Restore debug flags, patch remoteDebug for agents, optionally start debugger and npm dev (see --help for Cursor Cloud Agents)', yargs => yargs
|
|
484
|
-
.option('output-dir', { type: 'string', describe: 'Directory for
|
|
534
|
+
.option('output-dir', { type: 'string', describe: 'Directory for cloud-agent.json build config profile (default: build-config/profiles)' })
|
|
485
535
|
.option('start-debugger', { type: 'boolean', default: false, describe: 'Start command debugger in-process (non-blocking)' })
|
|
486
536
|
.option('start-app', { type: 'boolean', default: false, describe: 'Spawn npm run dev detached and wait for Vite port' })
|
|
487
537
|
.option('vite-port', { type: 'number', default: 5173, describe: 'Port to wait on when --start-app is set' })
|
|
@@ -1026,7 +1076,7 @@ catch (err) {
|
|
|
1026
1076
|
process.env.HOSANNA_VERBOSE = '1';
|
|
1027
1077
|
process.env.HOSANNA_UPDATER_VERBOSE = '1';
|
|
1028
1078
|
}
|
|
1029
|
-
|
|
1079
|
+
(0, cli_configure_hosanna_url_js_1.runConfigureHosannaUrl)(typeof args.gitUrl === 'string' ? args.gitUrl : undefined);
|
|
1030
1080
|
})
|
|
1031
1081
|
.command('test:ui [recordings..]', 'Replay UI test recordings against a running Hosanna app and exit with pass/fail. ' +
|
|
1032
1082
|
'Requires a running debug proxy (hst run:debugger) and a connected app.', yargs => yargs
|