|
| 1 | +# @knighted/module 1.0.0 release notes |
| 2 | + |
| 3 | +## Status |
| 4 | + |
| 5 | +- Current candidate: 1.0.0-rc.0 (tag `latest` until final 1.0.0). |
| 6 | +- Stability: API surface locked for 1.0.x; only bug fixes expected before GA. |
| 7 | + |
| 8 | +## Requirements |
| 9 | + |
| 10 | +- Node >= 22.21.1 (tested primarily on 22.x). Older LTS are not guaranteed; add matrix coverage if support is desired. |
| 11 | + |
| 12 | +## Highlights |
| 13 | + |
| 14 | +- Symmetric ESM↔CJS transforms with optioned behaviors: |
| 15 | + - `topLevelAwait`: `error` (default), `wrap`, `preserve` for CJS targets. |
| 16 | + - `importMetaMain`: `shim` (default), `warn`, `error` with Node version gate. |
| 17 | + - `liveBindings`: `strict` (default), `loose`, `off` for ESM→CJS. |
| 18 | + - `cjsDefault`: `auto` (default), `module-exports`, `none` for default import interop. |
| 19 | + - `rewriteSpecifier`: extension or callback-based specifier rewriting for both directions. |
| 20 | + - `requireSource`: `builtin` (default) or `create-require` fallback. |
| 21 | +- Defensive handling: reject `with` / unshadowed `eval` when raising to ESM; reject shadowed `module`/`exports` in CJS lowering. |
| 22 | +- Runtime coverage: fixtures and integration tests for **filename/**dirname/import.meta globals, `require.main` rewrites, TLA wrapping, namespace/default interop, export hoisting, and project-level conversions. |
| 23 | + |
| 24 | +## Behavior guarantees |
| 25 | + |
| 26 | +- Live bindings are strict by default for ESM→CJS; CJS→ESM rewrites avoid unsound cases by throwing on unsupported constructs. |
| 27 | +- `import.meta` properties shimmed when targeting CJS; `import.meta.main` guarded by version-aware warnings/errors. |
| 28 | +- Top-level await in CJS targets defaults to `error`; wrapping/preserve are opt-in and keep exports intact. |
| 29 | + |
| 30 | +## Packaging and metadata |
| 31 | + |
| 32 | +- Confirm `package.json` exports/fields (`main`, `exports`, `types`) match the build outputs. |
| 33 | +- Dependencies: `oxc-parser`, `@babel/parser/traverse`, `magic-string`, `@knighted/specifier`, `@knighted/walk`, `node-module-type`. |
| 34 | +- Consider source maps (not emitted today); document absence if deferring. |
| 35 | + |
| 36 | +## Testing |
| 37 | + |
| 38 | +- Lint: `npm run lint` (oxlint) — clean. |
| 39 | +- Tests: `npm test` — ~98% statements, ~93% branches; format.ts 100% line coverage, remaining branches are defensive/unreachable. |
| 40 | +- Add Node matrix if supporting additional runtimes before GA. |
| 41 | + |
| 42 | +## Release steps to GA |
| 43 | + |
| 44 | +1. Publish 1.0.0-rc.0 as `latest` (per plan); keep `next` if needed for future prereleases. |
| 45 | +2. Monitor for regressions; if none, tag 1.0.0 with the same artifacts. |
| 46 | +3. Update README and docs links to reference this release note; remove any “remaining gaps” language now that coverage is closed. |
| 47 | +4. Add changelog entry summarizing changes since 1.0.0-alpha.8/1.0.0-beta.5. |
| 48 | + |
| 49 | +## Open questions |
| 50 | + |
| 51 | +- Do we want official support for Node 20/18? If yes, run matrix and adjust shims accordingly. |
| 52 | +- CLI packaging: still library-only; document intentionally if not providing a CLI. |
0 commit comments