Skip to content

fix: CJS default-export interop, doc corrections, and agent skills - #140

Merged
knowledgecode merged 3 commits into
masterfrom
develop
Sep 22, 2026
Merged

knowledgecode merged 3 commits into
masterfrom
develop

Conversation

@knowledgecode

Copy link
Copy Markdown
Owner

Summary

  • Fix CJS default-export interop for locale/numeral/timezone modules, with matching .d.cts output and a build-time test
  • Fix incorrect day-of-week and escaping in doc examples
  • Add date-and-time and date-and-time-migration Agent Skills, linked from the README

@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (b95de0e) to head (95c27fc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #140   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files          77       77           
  Lines        1235     1235           
  Branches      357      357           
=======================================
  Hits         1220     1220           
  Partials       15       15           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…modules

require() on the CJS build of a locale, numeral, or timezone module lost
the ability to be used as the value it exports once terser/esbuild's
default-export handling flattened module.exports.default onto
module.exports itself. Add a renderChunk plugin that re-defines
module.exports.default to point back at module.exports so both
require('...') and require('...').default keep working, and generate a
matching .d.cts with `export =` via a dts renderChunk plugin so the
CommonJS types line up.

Also wire tests/build into prepublishOnly so a broken interop or
missing .d.cts fails the build before publish.
- Aug 23, 2025 is a Saturday, not a Friday; correct the day-of-week
  shown in parse() example outputs across parse.md and quick-start.md,
  and likewise Aug 23, 1970 (a Sunday, not a Saturday). Drop the
  now-redundant ignoreCase example that duplicated the corrected one.
- Fix the escaped-bracket example in format.md: the closing bracket was
  escaped in the wrong position (`...]\\` instead of `...\\]`).
- Fix the plugin import example in installation.mdx: plugins export a
  named `formatter` (and `parser`), not a default export, and the
  microsecond plugin was replaced by zonename to match its actual token
  in the example.
Add two self-contained Agent Skills for AI coding agents: `date-and-time`
covers writing v4 code (formatting, parsing, timezones, locales,
plugins, date arithmetic, durations), and `date-and-time-migration`
covers migrating a project from v3 to v4. Either can be installed on
its own via `npx skills add` and neither depends on `docs/`.

Document them in the README with install instructions (skills CLI and
manual copy) and a pointer from the v3->v4 migration section.
@knowledgecode
knowledgecode merged commit d79f98f into master Sep 22, 2026
6 checks passed
@knowledgecode
knowledgecode deleted the develop branch September 22, 2026 07:38
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