Skip to content

Commit

Permalink
minor: add tsup and cjs for require support in codemod-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
amirabbas-gh committed Feb 4, 2025
1 parent 4a183a2 commit 9334c81
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-planes-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codemod.com/codemod-utils": minor
---

Add tsup for build and add support for common js for require
9 changes: 8 additions & 1 deletion packages/codemod-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
"tsconfig.json"
],
"scripts": {
"build": "tsc",
"build": "tsup",
"test": "vitest run",
"test:watch": "vitest watch",
"coverage": "vitest run --coverage"
},
"keywords": [],
"license": "Apache-2.0",
"devDependencies": {
"typescript": "5.5.4",
"tsup": "8.3.6",
"@types/node": "20.10.3",
"@vitest/coverage-v8": "catalog:",
"ts-node": "10.9.1",
Expand All @@ -35,5 +37,10 @@
"@types/jscodeshift": "^0.11.11",
"@babel/parser": "^7.24.4",
"jscodeshift": "^0.16.1"
},
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
}
13 changes: 13 additions & 0 deletions packages/codemod-utils/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
format: ["esm", "cjs"],
dts: {
compilerOptions: {
incremental: false, // Fix for incremental error
},
},
clean: true,
sourcemap: true,
});
Loading

0 comments on commit 9334c81

Please sign in to comment.