@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 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`
@@ -1,6 +1,6 @@
1
1
  {
2
- "buildDate": "2026-08-17T09:27:29+00:00",
3
- "buildDateISO": "2026-08-17T09:27:29.656Z",
2
+ "buildDate": "2026-08-20T11:42:47+00:00",
3
+ "buildDateISO": "2026-08-20T11:42:47.262Z",
4
4
  "timeZone": "UTC",
5
- "gitHash": "3a0ec15"
5
+ "gitHash": "78ab335"
6
6
  }
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' })