Skip to content

feat(cli): add config file support and content gate mode#55

Merged
dev-pi2pie merged 15 commits into
mainfrom
dev
Mar 26, 2026
Merged

feat(cli): add config file support and content gate mode#55
dev-pi2pie merged 15 commits into
mainfrom
dev

Conversation

@dev-pi2pie

Copy link
Copy Markdown
Owner

Summary

This PR adds first-class CLI config file support and related follow-up fixes, then updates repository automation to keep Node 22 CI/CD runs on the latest March 24, 2026 security patch release.

Changes

  • add CLI config loading and normalization support for JSON, JSONC, and TOML config files
  • add config discovery, environment input handling, source resolution, schema typing, merge behavior, and apply logic under src/cli/config/
  • wire config precedence into command execution so CLI flags still override config values correctly
  • add content gate mode support in config
  • restore config path compatibility fallbacks
  • restore expected flag precedence for recursive and progress modes
  • update command, inspect, batch-runtime, doctor, and detector-related CLI flows to consume the new config layer
  • add example config files under examples/wc-config/
  • expand docs for config usage, schema expectations, doctor output, and related plan/research/job records
  • expand automated coverage with new config-focused tests and follow-up regression tests
  • keep the published package runtime contract at Node.js >=22.18.0
  • update GitHub Actions workflow setup-node pins from 22.18.0 to 22.22.2 in CI and release jobs

Main Files Affected

  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • README.md
  • docs/config-usage-guide.md
  • docs/schemas/default-config.md
  • examples/wc-config/wc-intl-seg.config.json
  • examples/wc-config/wc-intl-seg.config.jsonc
  • examples/wc-config/wc-intl-seg.config.toml
  • src/cli/config/
  • src/command.ts
  • test/cli-config.test.ts
  • test/command-config.test.ts
  • test/example-config-files.test.ts

Branch Delta Against main

Notable commits in this branch:

  • feat(cli): add config parsing and discovery foundation
  • feat(cli): wire config precedence and detector defaults
  • feat(cli): complete config file support and docs
  • feat(cli): add config support for content gate mode
  • fix(cli): restore config path compatibility fallbacks
  • fix(cli): restore flag precedence for recursive and progress modes
  • ci(workflows): patch Node 22 CI/CD pins to 22.22.2

Suggested Validation

bun run type-check
bun test
bun run build
bun run verify:package-contents

Notes

  • This PR intentionally does not raise package.json engines.node beyond >=22.18.0.
  • The CI/CD Node pin update is operational hardening for repo automation, not a consumer runtime policy change.

Adjust user config discovery to keep compatibility with existing macOS
and Windows config locations while preserving the new preferred paths.

Honor `XDG_CONFIG_HOME` on macOS before `$HOME/.config`, keep
`$HOME/Library/Application Support` as a legacy fallback, and use
`%USERPROFILE%\.config` on Windows with `%AppData%` as a fallback.

Also keep inspect engine-view validation after config resolution,
prevent debug-only config defaults from activating without debug, remove
behavior-changing skipped-file defaults from example configs, and sync
tests and docs to the final lookup contract.
@dev-pi2pie dev-pi2pie self-assigned this Mar 26, 2026
@dev-pi2pie dev-pi2pie added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 26, 2026
@dev-pi2pie dev-pi2pie merged commit 5661999 into main Mar 26, 2026
1 check passed
@dev-pi2pie dev-pi2pie deleted the dev branch March 26, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant