Skip to content

Remove chalk & replace-in-file deps; add Vitest tests and modernize CI - #4

Merged
awps merged 2 commits into
masterfrom
security/remove-chalk-add-tests
Jun 17, 2026
Merged

Remove chalk & replace-in-file deps; add Vitest tests and modernize CI#4
awps merged 2 commits into
masterfrom
security/remove-chalk-add-tests

Conversation

@awps

@awps awps commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

Eliminates the chalk supply-chain risk, adds a test suite, and modernizes the publish workflow. First step toward the v2 zero-deps goal.

Security

  • Removes chalk (advisories MAL-2025-46969 / MSC-2025-7884) and replace-in-file, which was transitively pulling chalk@4.1.2 into the tree.
  • Both are replaced by tiny zero-dependency, cross-platform helpers, so chalk is gone from the dependency tree entirely (npm ls chalk → empty). Also drops glob and a duplicate yargs.

Refactor + tests

  • Extracts pure logic into lib.js (color, file replacement, placeholder substitution, version helpers, package.json bump); index.js keeps only the git/prompts orchestration.
  • Adds Vitest (dev-only) with 32 tests in test/lib.test.js. npm test / npm run test:watch.

CI

  • Upgrades the publish workflow to actions/checkout@v6, actions/setup-node@v6, Node 22.
  • Runs the test suite before npm publish (a failing test now blocks a release).
  • Removes the dead sed step (tagy already commits the version before tagging).
  • Adds a files allowlist so only runtime files (cli.js, index.js, lib.js) are published.

Docs

  • Adds CLAUDE.md.

Notes

  • Version is intentionally not bumped here — the 1.10.8 bump/tag happens via tagy --patch, which triggers the publish workflow.

🤖 Generated with Claude Code

awps added 2 commits June 18, 2026 00:36
Security: drop chalk (advisories MAL-2025-46969 / MSC-2025-7884) and
replace-in-file, which transitively pulled chalk in. Both are replaced
by tiny zero-dependency, cross-platform helpers, removing chalk from the
dependency tree entirely (also drops glob and a duplicate yargs).

Refactor: extract pure logic into lib.js (color, file replacement,
placeholder substitution, version helpers, package.json bump) so it is
unit-testable; index.js keeps only the git/prompts orchestration.

Tests: add Vitest (dev only) with 32 cases in test/lib.test.js; wire up
`npm test` / `npm run test:watch`.

CI: upgrade publish workflow to checkout@v6 / setup-node@v6 / Node 22,
run the test suite before publishing, and drop the dead sed step. Add a
package.json `files` allowlist so only runtime files are published.

Docs: add CLAUDE.md.
@awps
awps merged commit fa80e09 into master Jun 17, 2026
3 checks passed
@awps
awps deleted the security/remove-chalk-add-tests branch June 17, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant