Skip to content

Commit 74cb493

Browse files
fix: typedefs (#20)
1 parent 77ef189 commit 74cb493

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.changeset/brown-bats-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@zenml-io/react-component-library": patch
3+
---
4+
5+
fix for types generated by cva

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@
4242
"dist"
4343
],
4444
"scripts": {
45-
"build": "tsup",
45+
"build": "tsup && npm run fix:types",
4646
"changeset": "changeset && pnpm install",
4747
"changeset:publish": "changeset publish",
4848
"changeset:version": "changeset version && pnpm install --lockfile-only",
4949
"dev": "tsup --watch",
50+
"fix:types": "node scripts/fix-type-defs.js",
5051
"format": "prettier -w src",
5152
"prepare": "husky install",
5253
"prepublishOnly": "pnpm build",
@@ -82,6 +83,7 @@
8283
"postcss": "^8.4.28",
8384
"prettier": "^3.0.2",
8485
"publint": "^0.2.0",
86+
"replace-in-files": "^3.0.0",
8587
"storybook": "^7.3.1",
8688
"tsup": "^7.2.0",
8789
"typescript": "^5.1.6"

pnpm-lock.yaml

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/fix-type-defs.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import replaceFiles from "replace-in-files";
2+
3+
async function fix() {
4+
try {
5+
const { countOfMatchesByPaths } = await replaceFiles({
6+
files: "dist/**/*.d.{ts,cts}",
7+
from: /class-variance-authority\/dist\/types/g,
8+
to: "class-variance-authority/types"
9+
});
10+
console.log("Fixed:", countOfMatchesByPaths);
11+
} catch (error) {
12+
console.error("Error fixing bad imports in d.ts files:", error);
13+
}
14+
}
15+
16+
fix();

0 commit comments

Comments
 (0)