v0.2.5
🚀 adnbn v0.2.5 Release
Compare: v0.2.4...v0.2.5
🚀 Highlights
- ♻️ Migrated package to ESM-only delivery. The package now uses ESM as the primary and only module format (no CommonJS export). This affects both
import/requireusage and the CLI entry. - 🧭 Config reorganization: localization fields were moved from a nested
localeobject to top-level fields with clearer names. This simplifies configuration and fits better with the new modular layout.
🧨 Breaking Changes
-
📦 ESM-only package
package.jsonnow has"type": "module"and the export map no longer includes a CommonJS entry.- Previously (v0.2.4) exports:
exports: { ".": { types: "./dist/index.d.ts", import: "./dist/index.js", require: "./dist/index.cjs" } }
- Now (v0.2.5) exports:
exports: { ".": { types: "./dist/index.d.ts", default: "./dist/index.js" } }
- What this means:
- Node/CommonJS consumers using
require("adnbn")must migrate to ESMimportsyntax or use a compatible loader/bridge.
- Node/CommonJS consumers using
-
🧰 CLI entry updated to ESM
bin/adnbn.jshas moved fromrequire(...)toimport ... from ....- If you executed the CLI directly under a Node environment expecting CJS semantics, ensure you run it in an ESM-aware context (Node ≥16 with ESM or via npx/pnpm dlx which already handle it).
-
🌐 Config: localization moved and renamed
- Previously (v0.2.4), localization lived under
config.locale:locale.dir,locale.lang,locale.name,locale.shortName,locale.description.
- Now (v0.2.5), these are top-level with clearer names:
localeDir,lang,name,shortName,description.
- The old
localeobject is no longer used.
- Previously (v0.2.4), localization lived under
💡 Features & Improvements
- ⚙️ Rspack-level customization hook
- Config now supports a
bundlerfield that can be either a Rspack config object or a function receiving the system-prepared Rspack config and returning a patch. The system will deep-merge your changes—no need to manually merge.
- Config now supports a
- 🧩 Entry/adapters export map consolidated
- Clear, adapter-oriented export paths for locale, message, storage, entry/content, and entry/view components.
🗂️ Configuration changes — before vs after
-
Localization layout
- Before (v0.2.4):
// adnbn.config.ts export default { // ... locale: { dir: "locales", lang: "en", name: "@app.name", shortName: "@app.short_name", description: "@app.description", }, };
- After (v0.2.5):
// adnbn.config.ts export default { // ... localeDir: "locales", lang: "en", name: "@app.name", shortName: "@app.short_name", description: "@app.description", };
- Before (v0.2.4):
-
Rspack config customization
- New optional
bundlerfield:import type { Configuration as RspackConfig } from "@rspack/core"; export default { // ... bundler: (current: RspackConfig) => ({ optimization: { concatenateModules: true }, }), // or bundler: { devtool: false, }, };
- New optional
🔁 Migration guide
-
Switch to ESM imports
- Before:
// CommonJS (no longer supported) const adnbn = require("adnbn");
- After:
// ESM import adnbn from "adnbn";
- Before:
-
Update localization configuration
- Move fields from
locale.*to top-level and renamedir→localeDir.
- Move fields from
-
CLI usage
- Continue using
npx adnbn/pnpm dlx adnbn/ installed binary. Node will treat the CLI as ESM. If you run it directly withnode bin/adnbn.js, ensure your Node runtime is ESM-enabled or run via package manager scripts.
- Continue using
-
Adapters and exports
- Use the documented subpath exports as exposed in
package.json(e.g.,adnbn/locale,adnbn/message,adnbn/storage,adnbn/entry/content/*,adnbn/entry/view/*). All are ESM.
- Use the documented subpath exports as exposed in
🐛 Fixes & Refactors
- Internal refactors around builders and manifest helpers to align with the new modular layout.
- Consistency passes across adapters and entry points; updated typings for better DX.
📦 Dependency notes
- Tooling updated around Rspack/RSDoctor integration and test harnesses; ensure your environment matches the peer ranges (React peers remain optional but supported up to v19).
✅ Summary
- ESM-only, streamlined config, clearer exports, and a flexible Rspack customization hook. Follow the migration steps above to update your config and imports.