Open
Conversation
841f8cc to
34ad6d0
Compare
mcollina
requested changes
Apr 5, 2026
post-build.js
Outdated
| import path from 'node:path' | ||
| import { fileURLToPath } from 'node:url' | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)) |
Member
There was a problem hiding this comment.
import.meta.dirname is a thing.
Member
Author
There was a problem hiding this comment.
-import { fileURLToPath } from 'node:url'
-const __dirname = path.dirname(fileURLToPath(import.meta.url))
+const __dirname = import.meta.dirnameYeah, we can do it that way too
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal:
Upgrade to typescript v6.0.2
Changes made:
post-build.js:- Migrated from CommonJS (
require) to ESM (import) syntax- Added
fileURLToPath+import.meta.urlto polyfill__dirnamein ESM context- Added automatic creation of
dist/cjs/package.jsonwith{ "type": "commonjs" }to ensure CJS output is correctly interpreted by Node.js- Fixed file extension mapping: CJS output now correctly renamed from
.mjs→.cjs(and.d.mts→.d.cts)tsconfig.json:- Added
"module": "Node16"and"moduleResolution": "Node16"for proper dual CJS/ESM supportpackage.json:- Bumped
typeboxpeer dependency from^1.0.13to^1.1.14- Updated
build:cjsscript: switched--moduleResolutionfromNode10tobundler- Fixed
test:nodescript: now runstest/index.cjsinstead oftest/index.js- Added
filesfield to control what gets published to npm (dist,index.ts)- Updated
typescriptdevDependency from~5.9.3to~6.0.2- Added
"type": "module"and"module"field to package exports- Reorganized
exportsmap: movedrequirecondition afterimportNote:
eslint.config.cjsuses the.cjsextension because the package is now"type": "module".This PR should resolve this PR: #272