Skip to content

Commit

Permalink
add script to generate .d.mts file
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Oct 30, 2024
1 parent 20cced0 commit 94d9c07
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"pendulumchain",
"phala",
"polkadot",
"postbuild",
"precompile",
"preinstall",
"rmrk",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "turbo run build",
"postbuild": "npx bun scripts/copy-dts.ts",
"dev": "turbo run dev",
"link": "turbo run link",
"lint": "pnpm biome check .",
Expand Down
13 changes: 13 additions & 0 deletions scripts/copy-dts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { copyFile } from 'node:fs/promises';
import { glob } from 'glob';

async function copyDtsToMts() {
const dtsFiles = await glob('packages/*/build/**/*.d.ts');

for (const file of dtsFiles) {
const mtsFile = file.replace('.d.ts', '.d.mts');
await copyFile(file, mtsFile);
}
}

copyDtsToMts().catch(console.error);

0 comments on commit 94d9c07

Please sign in to comment.