Skip to content

Commit

Permalink
Update npmignore and package.json, and generate index.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
0pilatos0 committed Jan 6, 2024
1 parent ea0c24a commit 7498b19
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ src/
.github/
.vscode/
tools/
test/
test/
tsconfig.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typelegend",
"version": "0.1.6",
"version": "0.1.7",
"module": "dist/index.mjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export * from "./string";
export * from "./array";
export * from "./date";
export * from "./function";
export * from "./regex";
export * from "./math";
export * from "./number";
export * from "./object";
export * from "./string";
11 changes: 11 additions & 0 deletions tools/generateIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ ${individualExports}
categoryStats[categoryName] = utilityFiles.length;
});

//clear the index.ts file for the root directory
const indexPath = path.join(srcDir, "index.ts");
fs.writeFileSync(indexPath, "");

//Generate the index.ts file for the root directory
srcFolders.forEach((folder: string) => {
const indexContent = `export * from "./${folder}";\n`;
const indexPath = path.join(srcDir, "index.ts");
fs.appendFileSync(indexPath, indexContent);
});

// Print statistics
logColor("Index files generated successfully!", "green");
logColor("Category Statistics:", "yellow");
Expand Down

0 comments on commit 7498b19

Please sign in to comment.