Skip to content

Commit

Permalink
refactor dist builds module type marking script into TS (#18)
Browse files Browse the repository at this point in the history
* refactor the mark-dist-package-types script code from JS to TS

* slightly better script filename
  • Loading branch information
shtaif authored Aug 27, 2023
1 parent 0668415 commit afb0969
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"scripts": {
"test": "ts-mocha -p ./tsconfig-cjs.json",
"build": "rimraf ./dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json && node ./scripts/mark-dist-package-module-types.js",
"build": "rimraf ./dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json && ts-node ./scripts/set-module-type-in-dist-builds.ts",
"check-typings": "tsc --noEmit -p ./tsconfig-esm.json",
"prepublishOnly": "npm run build"
},
Expand All @@ -47,6 +47,7 @@
"rimraf": "^5.0.1",
"sinon": "^15.2.0",
"ts-mocha": "^8.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
}
}
100 changes: 100 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { writeFileSync } = require('fs');
import { writeFileSync } from 'fs';

const distDirNameAndPackageFileMappings = {
'dist/esm': { type: 'module' },
Expand Down

0 comments on commit afb0969

Please sign in to comment.