@tantawowa/hosanna-tools 3.19.0 → 3.21.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 +24 -0
- package/dist/build-info.json +3 -3
- package/dist/cli.js +32 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/support-tools/project-actions.d.ts +31 -0
- package/dist/support-tools/project-actions.js +157 -0
- package/dist/support-tools/project-actions.js.map +1 -0
- package/dist/testing/client.js +1 -3
- package/dist/testing/client.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +2 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/launcher.d.ts +2 -1
- package/dist/testing/launcher.js +8 -3
- package/dist/testing/launcher.js.map +1 -1
- package/dist/testing/types.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -435,9 +435,33 @@ npm run apple:build-code
|
|
|
435
435
|
```
|
|
436
436
|
|
|
437
437
|
### CI Commands (`ci:*`) - Continuous Integration
|
|
438
|
+
- `ci:project-actions --base <ref> [--head <ref>]` - Select `hst.json` `prScopeRules` actions for changed files; add `--run` to execute matched npm scripts
|
|
438
439
|
- `ci:extract-pkg-key` - Extract signing key from an existing signed Roku package as base64
|
|
439
440
|
- `config set --git-url` - Configure hosanna.json git-url from argument or environment
|
|
440
441
|
|
|
442
|
+
Project-specific PR rules belong in `hst.json`; SDK source/version settings
|
|
443
|
+
remain in `hosanna.json`:
|
|
444
|
+
|
|
445
|
+
```json
|
|
446
|
+
{
|
|
447
|
+
"prScopeRules": [
|
|
448
|
+
{
|
|
449
|
+
"name": "collection view performance check",
|
|
450
|
+
"globs": ["src/hosanna-list/**", "src/hosanna-ui/views/lib/BaseView.ts"],
|
|
451
|
+
"actions": [
|
|
452
|
+
{ "kind": "npm", "command": "regression:collectionView" }
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
Rules and actions run in declaration order. Repeated identical actions are run
|
|
460
|
+
once. The command emits `matched`, `matched_rules`, and `actions` through
|
|
461
|
+
`GITHUB_OUTPUT` when that environment variable is present. This first version
|
|
462
|
+
supports npm actions; the action object is intentionally extensible for future
|
|
463
|
+
consumers.
|
|
464
|
+
|
|
441
465
|
### Build Config Commands (`build-config:*`) - Build/runtime config
|
|
442
466
|
- `build-config:resolve` - Merge build config overlays into `assets/meta/build-config.json`
|
|
443
467
|
- `build-config:restore-secrets` - Restore ignored `secrets/*.json` overlays from `BUILD_CONFIG_SECRETS_*_BASE64`
|
package/dist/build-info.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -947,6 +947,38 @@ async function runEnvironmentCommand(action, verbose) {
|
|
|
947
947
|
console.error(`❌ Failed to map Roku stack trace: ${msg}`);
|
|
948
948
|
process.exit(1);
|
|
949
949
|
}
|
|
950
|
+
})
|
|
951
|
+
.command('ci:project-actions', 'Select config-driven project actions for files changed between two Git revisions', yargs => yargs
|
|
952
|
+
.option('base', { type: 'string', demandOption: true, describe: 'Base Git revision' })
|
|
953
|
+
.option('head', { type: 'string', default: 'HEAD', describe: 'Candidate Git revision' })
|
|
954
|
+
.option('section', { type: 'string', default: 'prScopeRules', describe: 'hst.json rule-array property to evaluate' })
|
|
955
|
+
.option('run', { type: 'boolean', default: false, describe: 'Run selected npm actions sequentially' })
|
|
956
|
+
.option('format', { type: 'string', choices: ['text', 'json'], default: 'text', describe: 'Output format' })
|
|
957
|
+
.example('$0 ci:project-actions --base origin/main --head HEAD', 'Show PR-scoped actions from hst.json')
|
|
958
|
+
.example('$0 ci:project-actions --base origin/main --run', 'Run matched npm actions'), async (args) => {
|
|
959
|
+
try {
|
|
960
|
+
const mod = await Promise.resolve().then(() => __importStar(require('./support-tools/project-actions.js')));
|
|
961
|
+
const cwd = process.cwd();
|
|
962
|
+
const selection = mod.selectProjectActions(mod.loadProjectActionConfig(cwd), args.section, mod.changedProjectFiles(args.base, args.head, cwd));
|
|
963
|
+
mod.writeProjectActionGitHubOutputs(process.env.GITHUB_OUTPUT, selection);
|
|
964
|
+
if (args.format === 'json') {
|
|
965
|
+
console.info(JSON.stringify(selection, null, 2));
|
|
966
|
+
}
|
|
967
|
+
else {
|
|
968
|
+
console.info(`Changed files (${selection.changedFiles.length}):`);
|
|
969
|
+
for (const file of selection.changedFiles)
|
|
970
|
+
console.info(` ${file}`);
|
|
971
|
+
console.info(`Matched ${args.section} rules: ${selection.matchedRules.map(rule => rule.name).join(', ') || '(none)'}`);
|
|
972
|
+
console.info(`Selected actions: ${selection.actions.map(action => `npm run ${action.command}`).join(', ') || '(none)'}`);
|
|
973
|
+
}
|
|
974
|
+
if (args.run)
|
|
975
|
+
mod.runSelectedNpmActions(selection, cwd);
|
|
976
|
+
process.exit(0);
|
|
977
|
+
}
|
|
978
|
+
catch (err) {
|
|
979
|
+
console.error('❌ ci:project-actions failed:', err instanceof Error ? err.message : String(err));
|
|
980
|
+
process.exit(1);
|
|
981
|
+
}
|
|
950
982
|
})
|
|
951
983
|
.command('ci:extract-pkg-key <input-pkg>', 'Extract signing key from an existing signed Roku package as base64 for CI use', yargs => yargs
|
|
952
984
|
.positional('input-pkg', { type: 'string', describe: 'Path to existing signed Roku package (.pkg) file to extract key from' })
|