Skip to content

Modernize tooling and drop the build step#34

Merged
philihp merged 2 commits into
masterfrom
claude/modernize-deps
May 15, 2026
Merged

Modernize tooling and drop the build step#34
philihp merged 2 commits into
masterfrom
claude/modernize-deps

Conversation

@philihp
Copy link
Copy Markdown
Owner

@philihp philihp commented May 15, 2026

Summary

This is a 35-line library, and the tooling around it was disproportionate: a babel transpile chain, a jest.config.js copy-pasted from a frontend app (with asset moduleNameMapper for images/CSS), husky + lint-staged, etc. Pretty much none of it was pulling its weight.

What changed

  • Source → CommonJS. src/index.js now uses module.exports; the test uses require. Both import WeekDate from 'week-date' (default-interop) and import { parse } from 'week-date' still work for consumers.
  • No more build. Deleted .babelrc.js; removed @babel/cli, @babel/core, @babel/preset-env. Removed the build and prepare scripts. main now points at ./src/index.js. Added a files: ["src"] allowlist so npm publishes just the source.
  • No husky / lint-staged. Optional local-only tooling — easy to re-add later if desired.
  • No jest.config.js. Its only non-default settings were a babel-jest transform and a frontend-app asset moduleNameMapper, neither of which apply here. Jest defaults are fine.
  • Bumped what's left: jest 26 → 30, prettier 2 → 3, @philihp/eslint-config 3 → 6 (eslint 7 → 8).
  • CI modernized: Node matrix 10/11/12/13/14.x (all EOL) → 18/20/22.x; actions/checkout and actions/setup-node → v4; coverallsapp/github-action → v2; dropped the now-meaningless npm run build --if-present step.
  • .tool-versions bumped to nodejs 22.11.0.

Net result: 7 files changed, 27 insertions(+), 64 deletions(-), and node_modules drops from ~880 to ~545 packages.

Test plan

  • npm test — 22/22 pass
  • npm run test:coverage — 100% coverage; coverage/lcov.info produced for Coveralls
  • require('week-date').parse('2020-W09-6') and require('week-date').default ?? require('week-date') both yield 2020-02-29T00:00:00.000Z
  • CI matrix runs on Node 18, 20, 22

Generated by Claude Code

This is a 35-line library; the babel transpile chain, copy-pasted
frontend jest config, and husky/lint-staged setup were heavier than
the code they wrapped. Rewrite the source as plain CommonJS and ship
src/ directly so consumers (and tests) just require it.

- Source: ESM `export` → `module.exports`; tests use `require`.
- Delete .babelrc.js; drop @babel/cli, @babel/core, @babel/preset-env.
- Drop the `build` and `prepare` scripts; point `main` at
  ./src/index.js and add a `files` allowlist so npm publishes just src/.
- Drop husky + lint-staged config (optional local-only tooling that
  the maintainer can re-add at will).
- Delete jest.config.js — its only non-default settings were a
  frontend-app asset moduleNameMapper and a babel-jest transform,
  neither of which apply to a CommonJS date library.
- Bump remaining devDeps: jest 26 → 30, prettier 2 → 3,
  @philihp/eslint-config 3 → 6 (eslint 7 → 8).
- CI: bump Node matrix from 10/11/12/13/14.x (all EOL) to 18/20/22.x;
  bump actions/{checkout,setup-node} to v4 and coverallsapp to v2;
  drop the now-meaningless `npm run build --if-present` step.
- Bump .tool-versions to nodejs 22.11.0.

All 22 tests pass; coverage still produces coverage/lcov.info for
Coveralls.
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25929668808

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 19
Covered Lines: 19
Line Coverage: 100.0%
Relevant Branches: 3
Covered Branches: 3
Branch Coverage: 100.0%
Branches in Coverage %: Yes
Coverage Strength: 24.11 hits per line

💛 - Coveralls

@philihp philihp marked this pull request as ready for review May 15, 2026 16:45
@philihp
Copy link
Copy Markdown
Owner Author

philihp commented May 15, 2026

thanks dad

@philihp philihp merged commit 710587a into master May 15, 2026
4 checks passed
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.

3 participants