Description
Since v8.6.0, all published @orval/* packages on npm contain a "development" export condition in their package.json that points to TypeScript source files (./src/index.ts). These source files are not included in the published tarball (the files field only includes dist/).
Any bundler or runtime that activates the "development" condition — such as Vite in dev mode, or a tsconfig.json with "customConditions": ["development"] — will resolve @orval/core (and other @orval/* packages) to ./src/index.ts, which does not exist, causing a runtime error:
Error: Cannot find module '.../node_modules/@orval/core/src/index.ts'
Root cause: Commit 82fde637 changed packages/tsdown.base.ts from exports: true to exports: { devExports: 'development' }, which made tsdown auto-generate "development": "./src/index.ts" in the exports field of every package. A publishConfig.exports block was added to override this during publish, but the CI uses bun publish (release-publish.yaml L60), which does not apply publishConfig.exports — unlike npm publish.
Proof from the published tarball (npm pack @orval/core@8.7.0):
"exports": {
".": {
"development": "./src/index.ts",
"default": "./dist/index.mjs"
}
}
In v8.5.3 this was simply:
"exports": {
".": "./dist/index.mjs"
}
Affected versions: 8.6.0, 8.6.1, 8.6.2, 8.7.0
Affected packages: All 12 published packages in the monorepo (core, orval, angular, axios, fetch, hono, mcp, mock, query, solid-start, swr, zod).
Output client
other
Configuration (orval.config)
// Any config triggers the bug when using a bundler that activates
// the "development" export condition (e.g., Vite dev mode).
export default defineConfig({
api: {
input: { target: "./openapi.yaml" },
output: {
client: "react-query",
target: "src/api",
},
},
});
Environment
System:
OS: macOS 13.5
CPU: Apple M1
Node: v24.14.0
npmPackages:
orval: 8.7.0
Expected behavior
All @orval/* packages should resolve to compiled dist/ files regardless of the consumer's export conditions. The published package.json should not contain a "development" condition pointing to files that are excluded from the tarball.
Actual behavior
Error: Cannot find module '.../node_modules/@orval/core/src/index.ts'
imported from .../node_modules/orval/dist/config-CO914zjc.mjs
Node/bundler follows the "development" export condition → ./src/index.ts → file not found.
Additional context
Proposed fix: Revert packages/tsdown.base.ts to exports: true (removes the "development" condition from all packages) and remove the now-unnecessary publishConfig.exports blocks. Dev-mode DX is already covered by tsdown --watch.
Description
Since v8.6.0, all published
@orval/*packages on npm contain a"development"export condition in theirpackage.jsonthat points to TypeScript source files (./src/index.ts). These source files are not included in the published tarball (thefilesfield only includesdist/).Any bundler or runtime that activates the
"development"condition — such as Vite in dev mode, or atsconfig.jsonwith"customConditions": ["development"]— will resolve@orval/core(and other@orval/*packages) to./src/index.ts, which does not exist, causing a runtime error:Root cause: Commit
82fde637changedpackages/tsdown.base.tsfromexports: truetoexports: { devExports: 'development' }, which made tsdown auto-generate"development": "./src/index.ts"in theexportsfield of every package. ApublishConfig.exportsblock was added to override this during publish, but the CI usesbun publish(release-publish.yaml L60), which does not applypublishConfig.exports— unlikenpm publish.Proof from the published tarball (
npm pack @orval/core@8.7.0):In v8.5.3 this was simply:
Affected versions: 8.6.0, 8.6.1, 8.6.2, 8.7.0
Affected packages: All 12 published packages in the monorepo (core, orval, angular, axios, fetch, hono, mcp, mock, query, solid-start, swr, zod).
Output client
other
Configuration (orval.config)
Environment
Expected behavior
All
@orval/*packages should resolve to compileddist/files regardless of the consumer's export conditions. The publishedpackage.jsonshould not contain a"development"condition pointing to files that are excluded from the tarball.Actual behavior
Node/bundler follows the
"development"export condition →./src/index.ts→ file not found.Additional context
Proposed fix: Revert
packages/tsdown.base.tstoexports: true(removes the"development"condition from all packages) and remove the now-unnecessarypublishConfig.exportsblocks. Dev-mode DX is already covered bytsdown --watch.