Skip to content

Commit

Permalink
:feat
Browse files Browse the repository at this point in the history
  • Loading branch information
irsyadadl committed Feb 24, 2024
1 parent b2a1224 commit c136c35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions generate-declarations.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const fs = require("fs");
const path = require("path");

const iconsDir = path.join(__dirname, "src"); // Path to your icons
const outputDir = path.join(__dirname, "dist"); // Output directory
const iconsDir = path.join(__dirname, "src");
const outputDir = path.join(__dirname, "dist");
const outputFile = path.join(outputDir, "index.d.ts");

fs.readdir(iconsDir, (err, files) => {
Expand All @@ -12,14 +12,14 @@ fs.readdir(iconsDir, (err, files) => {
}

const exports = files
.filter((file) => file.endsWith(".js")) // Adjust the extension if needed
.map((file) => {
const iconName = path.basename(file, ".js"); // Remove file extension
.filter(file => file.endsWith(".js"))
.map(file => {
const iconName = path.basename(file, ".js");
return `export declare const ${iconName}: React.FC<React.SVGProps<SVGSVGElement>>;`;
});

if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir);
fs.mkdirSync(outputDir, { recursive: true });
}

const content = ["import React from 'react';", ...exports].join("\n");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@irsyadadl/paranoid",
"version": "0.11.14",
"version": "1.0.0",
"description": "A library of beautifully crafted react icons, perfect for enhancing the visual appeal and user experience of your web applications.",
"author": "Irsyad A. Panjaitan",
"license": "MIT",
Expand Down

0 comments on commit c136c35

Please sign in to comment.