# Breaking changes in v10

The package is now a pure ESM module. This was required to support TypeScript v6, which deprecates `moduleResolution: "node"` and `module: "CommonJS"`.

## What changed

- **Package type**: `"type": "module"` added to `package.json` — all `.js` files in this package are now ESM
- **Module output**: Compiled output uses `export default` instead of `module.exports =`
- **TypeScript config**: `module: "esnext"`, `moduleResolution: "bundler"`, `target: "esnext"`
- **Exports map**: Explicit `exports` field added to `package.json` for subpath resolution
- **Test framework**: Migrated from Jest to Vitest (dev-only, does not affect consumers)

## Impact on consumers

### semantic-release config loading

semantic-release v24+ uses `import-from-esm` (dynamic `import()`) to load configs. The `extends` field in `.releaserc` continues to work as before:

```json
{ "extends": "@open-turo/semantic-release-config" }
{ "extends": "@open-turo/semantic-release-config/npm" }
{ "extends": "@open-turo/semantic-release-config/gradle" }
```

Legacy `lib/` paths (e.g. `@open-turo/semantic-release-config/lib/npm`) are also supported via the exports map for backward compatibility.

No changes needed if you are on semantic-release v24+.

### Direct imports in code

If you import this package directly in TypeScript or JavaScript:

```js
// Before (CJS)
const config = require("@open-turo/semantic-release-config");

// After (ESM)
import config from "@open-turo/semantic-release-config";
// or
const config = await import("@open-turo/semantic-release-config");
```

### Node.js version

Requires Node.js >= 20.8.1 (unchanged). ESM is fully supported in all Node.js v20+ releases.

## Upgrade instructions

1. Update the package:

   ```shell
   npx install-peerdeps --dev @open-turo/semantic-release-config
   ```

2. Ensure you are on semantic-release v24+ (already a peer dependency requirement).

3. If you import this package directly (not via `extends`), update your imports to use ESM syntax.
