Skip to content

Commit

Permalink
feat: generate .d.ts files for dir2json imports
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jul 1, 2024
1 parent e1c912f commit b3830b1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ vite.config.ts.timestamp-*
.vercel
.netlify
/.pdm-python
/src/python/**/index.d.ts
8 changes: 7 additions & 1 deletion src/lib/plugins/dir2json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export default ({ includes }: { includes: string[] }): PluginOption => {
promises.length = 0;
}
await Promise.all(promises);
return `export default ${JSON.stringify(files)};`;

const fileContent = `export default ${JSON.stringify(files)};`;

// generate .d.ts file for this directory
await fs.writeFile(path.join(dirPath, "index.d.ts"), fileContent, "utf-8");

return fileContent;
},
};
};
1 change: 0 additions & 1 deletion src/python/chat/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/python/console/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/python/patches/index.d.ts

This file was deleted.

0 comments on commit b3830b1

Please sign in to comment.