# Changelog @open-pioneer/vite-plugin-pioneer

## 7.1.1

### Patch Changes

- 125b7d4: Exclude virtual modules from vitest's file system cache.

    This regenerates `open-pioneer:*` modules on vitest watch reruns.
    With vitest's `fsModuleCache` (enabled by default since vitest 5), a change to an i18n file or a `build.config.mjs` triggered a rerun that still used the previously generated (and thus stale) `open-pioneer:test-support` and app modules.

    In addition, the plugin now listens to vitest's file watcher, because vitest does not forward file changes to the vite server of a project with its own config, such as a browser project.
    `vitest` (`^5.0.0`) is now an optional peer dependency of the plugin.

## 7.1.0

### Minor Changes

- 5b85124: Add the virtual module `open-pioneer:test-support` for tests of Trails packages.

    The module exports `messages`, the i18n messages of the importing package and of all its dependencies.
    The record can be passed to the `messages` property of `PackageContextProvider` from `@open-pioneer/test-utils/react`.
    It also exports `messageLocale`, the locale of these messages.
    Both properties can be helpful when implementing browser tests for React components based on Trails.

    Messages are returned in the first locale of the package's `i18n` array in `build.config.mjs` by default.
    A different locale can be requested with a query, for example `open-pioneer:test-support?locale=de`.

    The module can only be imported from tests.
    `vite dev` and `vite build` fail with an error when they encounter the import.

### Patch Changes

- 4e657f0: Update dependencies
- 2aa6424: Fix virtual modules such as `open-pioneer:source-info` failing on the second Vitest run when `fsModuleCache` is enabled (default since Vitest 5.0.4).
  The plugin should now resolve the root-relative module ids requested by the warm cache correctly.
- Updated dependencies [4e657f0]
- Updated dependencies [5b85124]
    - @open-pioneer/build-common@5.1.0

## 7.0.1

### Patch Changes

- 9e63026: Replace the `@babel/*` dependencies used for code generation with `esrap`.
- 4337957: Update dependencies
- Updated dependencies [4337957]
    - @open-pioneer/build-common@5.0.1

## 7.0.0

### Major Changes

- 8e38b33: Switch this package from legacy `main` / `types` fields to the modern `exports` field in `package.json`

### Patch Changes

- 8e38b33: Change build setup: now uses tsdown instead of esbuild.
- Updated dependencies [8e38b33]
- Updated dependencies [8e38b33]
- Updated dependencies [8e38b33]
    - @open-pioneer/build-common@5.0.0

## 6.0.3

### Patch Changes

- 3b1f9cf: Migrate from eslint to oxlint and from prettier to oxfmt
- Updated dependencies [3b1f9cf]
    - @open-pioneer/build-common@4.0.3

## 6.0.2

### Patch Changes

- 1a78924: Bump dependencies
- 82b4559: Fix parsing of `qualifier` for services defined by dependencies in `node_modules`.
- Updated dependencies [1a78924]
- Updated dependencies [82b4559]
    - @open-pioneer/build-common@4.0.2

## 6.0.1

### Patch Changes

- 78e38e2: Bump various dependencies
- 7d706a3: Refactor: use private javascript properties instead of typescript private keyword
- Updated dependencies [78e38e2]
    - @open-pioneer/build-common@4.0.1

## 6.0.0

### Major Changes

- a13823e: Update to Vite 8 (support for Vite 7 is dropped).

### Minor Changes

- 9dda91c: Support a new virtual module to get the current deployment's base URL both during development and production:

    ```ts
    import { baseUrl } from "open-pioneer:deployment";

    // Base URL of the deployed application, for example:
    // - http://localhost:5173/ or http://localhost:5173/optional/path/ (during development)
    // - https://example.com/path/to/root/ (during production)
    console.log(baseUrl);
    ```

- 18c9d75: Add codegen support for hot reloading of i18n message during development.
  HMR of i18n messages requires the latest version of the runtime package.
- 9dda91c: Support for package metadata version `1.1.0`.

### Patch Changes

- b49be74: Bump dependencies
- 9dda91c: Improve error message when the plugin encounters an unsupported package metadata version.
- Updated dependencies [b49be74]
- Updated dependencies [9dda91c]
- Updated dependencies [9dda91c]
- Updated dependencies [9dda91c]
    - @open-pioneer/build-common@4.0.0

## 5.1.2

### Patch Changes

- 50ddcbd: Fix default package property values not being applied correctly when using a trails package from node modules.
- Updated dependencies [50ddcbd]
    - @open-pioneer/build-common@3.2.2

## 5.1.1

### Patch Changes

- fa84b0e: Bump dependencies
- 093ae42: Prevent detection of duplicated packages on windows
- Updated dependencies [fa84b0e]
    - @open-pioneer/build-common@3.2.1

## 5.1.0

### Minor Changes

- eac3ef4: Add service modules of trails packages from `node_modules` to the modules optimized by vite's deps optimizer.

    This can reduce the number of events like this:

    ```
    5:14:21 PM [vite] (client) ✨ new dependencies optimized: <...>
    5:14:21 PM [vite] (client) ✨ optimized dependencies changed. reloading
    ```

- 19aa36f: Implement sourceId helper which provides an easy way to obtain an id for the current source file:

    ```ts
    import { sourceId } from "open-pioneer:source-info";

    // If imported from foo/bar/baz.ts in package my-package: my-package/foo/bar/baz
    console.log(sourceId);
    ```

### Patch Changes

- eac3ef4: Switch from fast-glob to tinyglobby (it has fewer dependencies).
- Updated dependencies [19aa36f]
    - @open-pioneer/build-common@3.2.0

## 5.0.3

### Patch Changes

- 2c45a18: Bump dependencies
- Updated dependencies [2c45a18]
    - @open-pioneer/build-common@3.1.2

## 5.0.2

### Patch Changes

- fe37e18: Remove obsolete eslint directive from typings.
- f229f63: Bump dependencies
- Updated dependencies [f229f63]
    - @open-pioneer/build-common@3.1.1

## 5.0.1

### Patch Changes

- 1b99d82: Update eslint to version 9.
- f12e73f: Emit better errors when an application's i18n configuration does not match the supported locales of its dependencies.

    This can happen if:

    - An application does not list the `i18n` option in its `build.config.mjs` at all, or if
    - there is no overlap between the application's locales and the locales supported by one of its dependencies.

    The vite plugin will now throw errors such as this to make it easier to detect the issue:

    ```
    [plugin:pioneer:codegen] Invalid i18n configuration in application at <...>/src/samples/chakra-sample/chakra-app:
    There is no match between the locales supported by the application (none) and the locales supported by the packages '@open-pioneer/chakra-snippets' (de, en).
    ```

## 5.0.0

### Major Changes

- 6dc999e: Update to Vite 7

### Minor Changes

- ba600ea: Update to zod v4.

### Patch Changes

- 340c415: Update dependencies
- 6dc999e: Refactor caching of package.json, build.config.mjs and i18n files. Manual caching code was removed.
- Updated dependencies [340c415]
- Updated dependencies [ba600ea]
    - @open-pioneer/build-common@3.1.0

## 4.0.2

### Patch Changes

- 26cb9d8: Bump dependencies
- Updated dependencies [26cb9d8]
    - @open-pioneer/build-common@3.0.2

## 4.0.1

### Patch Changes

- 23c031a: Bump dependencies
- 1fefee8: Update babel dependencies (CVE-2025-27789)
- 67ba039: Bump dependencies
- Updated dependencies [23c031a]
- Updated dependencies [67ba039]
    - @open-pioneer/build-common@3.0.1

## 4.0.0

### Major Changes

- 798ef0b: Update to vite v6.
- 798ef0b: Requires minimum node version 20.

### Minor Changes

- 798ef0b: Update dependencies

### Patch Changes

- Updated dependencies [798ef0b]
- Updated dependencies [798ef0b]
    - @open-pioneer/build-common@3.0.0

## 3.0.5

### Patch Changes

- 2526935: Update dependencies
- 7668cd9: Update dependencies.
- Updated dependencies [2526935]
- Updated dependencies [7668cd9]
    - @open-pioneer/build-common@2.0.5

## 3.0.4

### Patch Changes

- 1b84a49: Fix a problem that may produce dev server errors on newer versions of vite:

    ```
    11:11:21 AM [vite] Internal server error: Failed to resolve services entry point for package $DIR/src/samples/showcase/showcase-app

    Caused by: Cannot read properties of undefined (reading 'resolveId')
    ```

## 3.0.3

### Patch Changes

- 3550ca8: Update dependencies
- Updated dependencies [d9a0c1b]
    - @open-pioneer/build-common@2.0.4

## 3.0.2

### Patch Changes

- 0565d4d: Preserve exports from public app entry points (open-pioneer/trails-build-tools#53).

## 3.0.1

### Patch Changes

- 017b8f3: Harmonize naming of Open Pioneer Trails in READMEs, package.json files and error messages.
- Updated dependencies [017b8f3]
    - @open-pioneer/build-common@2.0.3

## 3.0.0

### Major Changes

- c08520d: Switch to `type`: `module`
- c08520d: Add support for vite 5.

### Patch Changes

- c08520d: Update zod-validation-error to 3.x
- c08520d: Update dependencies
- Updated dependencies [c08520d]
- Updated dependencies [c08520d]
    - @open-pioneer/build-common@2.0.2

## 2.0.1

### Patch Changes

- 9d4a9d5: Bump dependencies
- 715b45e: Update package.json metadata
- Updated dependencies [715b45e]
    - @open-pioneer/build-common@2.0.1

## 2.0.0

### Major Changes

- 5601a5e: **Breaking Change:** Require Node >= 18
- c15512c: **Breaking Change:** A trails package's `devDependencies` are no longer included in the build (fixes #43).
  For normal dependencies, service classes are automatically picked up and compiled into the application.

    This behavior is surprising for `devDependencies`: license scanners and cve scanner sometimes chose to exclude
    `devDependencies`; which would have been invalid prior to this change (as the code was compiled in anyway).

    If your package depends on another trails package at runtime, configure an entry in `peerDependencies` instead.

### Patch Changes

- 5601a5e: Bump dependencies
- Updated dependencies [5601a5e]
- Updated dependencies [5601a5e]
    - @open-pioneer/build-common@2.0.0

## 1.1.2

### Patch Changes

- de95243: Fix infinite recursion when packages depend on each other (dependency cycle).

## 1.1.1

### Patch Changes

- 7d90953: Only consider devDependencies for local (in-source) packages.

## 1.1.0

### Minor Changes

- e05d707: Include devDependencies in dependency analysis. Dev dependencies will now have their services, properties, etc. automatically linked into the application.

### Patch Changes

- 99354bf: Improve error message when two versions of the same Trails package are encountered.
  Only a single version per Trails package per app is supported: all packages must share the same version and location on disk.

    The vite overlay in the browser now shows a comprehensible error message such as this:

    ```text
    [plugin:pioneer:codegen] Encountered the package '@open-pioneer/runtime' at two different locations.
    Trails packages cannot be used more than once in the same application.
    All packages must use a common version of '@open-pioneer/runtime'.

    1. @open-pioneer/runtime@1.0.0 at $HOME/projects/pioneer/starter/node_modules/.pnpm/@open-pioneer+runtime@1.0.0_@formatjs+intl@2.9.0_@open-pioneer+chakra-integration@1.0.0_@open_4cza3noe47gq2v2rsqn2cypo4q/node_modules/@open-pioneer/runtime

    2. @open-pioneer/runtime@0.1.5 at $HOME/projects/pioneer/starter/node_modules/.pnpm/@open-pioneer+runtime@0.1.5_@formatjs+intl@2.9.0_@open-pioneer+chakra-integration@0.1.4_@open_m544g2vyxvedm3ipuqpqhltgfy/node_modules/@open-pioneer/runtime
    ```

- 146743d: Bump dependencies
- Updated dependencies [3a0fb62]
- Updated dependencies [146743d]
    - @open-pioneer/build-common@1.0.2

## 1.0.2

### Patch Changes

- Updated dependencies [1a8c745]
    - @open-pioneer/build-common@1.0.1

## 1.0.1

### Patch Changes

- 8985433: Redo release (1.0.0 was published by mistake very early)

## 1.0.0

### Major Changes

- 991be0f: Initial release

### Patch Changes

- Updated dependencies [991be0f]
    - @open-pioneer/build-common@1.0.0

## 0.8.7

### Patch Changes

- f0cd283: Add package.json metadata
- Updated dependencies [f0cd283]
    - @open-pioneer/build-common@0.6.1

## 0.8.6

### Patch Changes

- cf32df5: Add another workaround that unfortunately currently requires pnpm's `shamefully-hoist` option.

    [`shamefully-hoist`](https://pnpm.io/npmrc#shamefully-hoist) allows the application to 'see' all other installed node packages.
    This is usually a bad practice but we currently require it for the virtual module that imports all Open Pioneer Trails services.
    For more details see the linked commit.

## 0.8.5

### Patch Changes

- ab271dc: Don't consider virtual app-css modules if they end in '.map'. This is a workaround for vite currently requesting source maps for inline css with the 'wrong' importer.
- 38d3c6b: Work around problems with vite's depOptimizer

## 0.8.4

### Patch Changes

- 57a81cd: Improve error logging in dev mode.

## 0.8.3

### Patch Changes

- e6bbbfb: Simplify license comment in README
- Updated dependencies [b6f55fe]
- Updated dependencies [e6bbbfb]
    - @open-pioneer/build-common@0.6.0

## 0.8.2

### Patch Changes

- fdb5347: Use unresolved module ids for generated code.
- Updated dependencies [fdb5347]
    - @open-pioneer/build-common@0.5.1

## 0.8.1

### Patch Changes

- 9f82090: Use react hooks code generation from @open-pioneer/build-common
- Updated dependencies [9f82090]
    - @open-pioneer/build-common@0.5.0

## 0.8.0

### Minor Changes

- 23a6f4c: Report an error if a package uses the 'overrides' property in an i18n file (even if there are no actual overrides)
- 348afd8: An error is now thrown if a package uses the 'overrides' key, even if the object is empty.

### Patch Changes

- aeb702c: Add supported node versions (>= 16) to package.json
- 38c8ee0: Don't re-emit warnings when a cached metadata entry is returned.
- Updated dependencies [348afd8]
- Updated dependencies [aeb702c]
    - @open-pioneer/build-common@0.4.0

## 0.7.0

### Minor Changes

- 900057b: Allow framework metadata from package.json for local packages. It is still an error to use both in a package at the same time.

## 0.6.1

### Patch Changes

- 0692aa2: Revert back to commonjs
- Updated dependencies [0692aa2]
    - @open-pioneer/build-common@0.3.1

## 0.6.0

### Minor Changes

- 393b294: Distribute package as ESM.
- 39ee4c0: Use stable metadata facilities from @open-pioneer/build-common

### Patch Changes

- Updated dependencies [393b294]
- Updated dependencies [454ea2b]
- Updated dependencies [39855ce]
    - @open-pioneer/build-common@0.3.0

## 0.5.3

### Patch Changes

- ef54f35: Move loading of build config file into common package.
- Updated dependencies [ef54f35]
- Updated dependencies [125fd57]
- Updated dependencies [37413f4]
    - @open-pioneer/build-common@0.2.0

## 0.5.2

### Patch Changes

- 434cc23: Migrate all tests to vitest.
- 41399fa: Use new shared package to validate build.config.mjs
- Updated dependencies [41399fa]
    - @open-pioneer/build-common@0.1.0

## 0.5.1

### Patch Changes

- 4f271c8: Build using new build script.

## v0.5.0

- Implement support for SCSS in package `styles`.
  `sass` must now be installed as a dependency.

## v0.4.0

- Read services from `./services` by default

## v0.3.3

- Improve i18n override detection

## v0.3.2

- Initialize overrides to an empty map when a package name is mentioned.

## v0.3.1

- Relax i18n schema validation: More nulls are allowed in yaml to allow for empty object syntax

## v0.3.0

- Add support for advanced app configuration (with custom paths)
- Change configuration of sites to allow for more flexible locations

## v0.2.4

- Add support for the `useIntl` hook

## v0.2.3

- Add caching for i18n files

## v0.2.2

- Make type of app metadata required

## v0.2.1

- Do not skip package metadata during codegen anymore.
  All packages (with pioneer extensions) have an entry in the app's metadata.

## v0.2.0

- Initial support for i18n files

## v0.1.0

- Initial release
