Skip to content

v0.2.5

Choose a tag to compare

@addon-owner addon-owner released this 12 Aug 12:02
· 354 commits to main since this release

🚀 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/require usage and the CLI entry.
  • 🧭 Config reorganization: localization fields were moved from a nested locale object to top-level fields with clearer names. This simplifies configuration and fits better with the new modular layout.

🧨 Breaking Changes

  • 📦 ESM-only package

    • package.json now 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 ESM import syntax or use a compatible loader/bridge.
  • 🧰 CLI entry updated to ESM

    • bin/adnbn.js has moved from require(...) to import ... 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 locale object is no longer used.

💡 Features & Improvements

  • ⚙️ Rspack-level customization hook
    • Config now supports a bundler field 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.
  • 🧩 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",
      };
  • Rspack config customization

    • New optional bundler field:
      import type { Configuration as RspackConfig } from "@rspack/core";
      
      export default {
        // ...
        bundler: (current: RspackConfig) => ({
          optimization: { concatenateModules: true },
        }),
        // or
        bundler: {
          devtool: false,
        },
      };

🔁 Migration guide

  • Switch to ESM imports

    • Before:
      // CommonJS (no longer supported)
      const adnbn = require("adnbn");
    • After:
      // ESM
      import adnbn from "adnbn";
  • Update localization configuration

    • Move fields from locale.* to top-level and rename dirlocaleDir.
  • CLI usage

    • Continue using npx adnbn / pnpm dlx adnbn / installed binary. Node will treat the CLI as ESM. If you run it directly with node bin/adnbn.js, ensure your Node runtime is ESM-enabled or run via package manager scripts.
  • 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.

🐛 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.