Skip to content

Conversation

@mnahkies
Copy link
Owner

@mnahkies mnahkies commented Dec 22, 2025

introduces a new typescript-common-runtime package, and refactors the existing runtime packages to move common functionality into it.

this will give us a better place to put code such as the form data request body parsing, and upcoming query string parsing (#381)

there are a couple of minor breaking changes:

  • Drop deprecated exports (not used in regenerated code)
  • Wrap response validation errors properly when using joi

BREAKING CHANGE: deprecated exports removed, regenerate using the latest cli to avoid issues

"test": "jest"
},
"dependencies": {
"@nahkies/typescript-common-runtime": "workspace:^",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I know that lerna won't update these correctly in peerDependencies (lerna/lerna#3671) - but I think it should be ok for dependencies

to be tested as part of an alpha version publish.

"import": "./dist/joi.js",
"types": "./dist/joi.d.ts"
},
"./zod": {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop deprecated export

return result.value
return value
} catch (err) {
throw ExpressRuntimeError.ResponseError(err)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change: previously joi response validation errors weren't wrapped correctly

"bugs": {
"url": "https://github.com/mnahkies/openapi-code-generator/issues"
},
"exports": {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing a single barrel export didn't work, as for ESM consumers I ran into:

error TS1287: A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled.

I don't fully understand why the same code works fine when exporting individual files like this, but it works 🤷‍♂️

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these moved files were identical to the ones deleted form the other runtime

@mnahkies mnahkies force-pushed the mn/feat/common-runtime branch from ca511a9 to 40f2cf9 Compare December 22, 2025 11:37
@@ -0,0 +1,84 @@
{
"name": "@nahkies/typescript-common-runtime",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly, it looks like I'll have to generate an API token and manually publish the package for the first time, in order to then configure trusted publishing settings properly.

@mnahkies mnahkies changed the title feat: introduce a new common runtime feat!: introduce a new common runtime Dec 22, 2025
@mnahkies mnahkies marked this pull request as ready for review December 22, 2025 11:43
@mnahkies mnahkies merged commit 1306741 into main Dec 22, 2025
22 checks passed
@mnahkies mnahkies deleted the mn/feat/common-runtime branch December 22, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants