@nikaat-crop/es-icons 0.0.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/script/update-storybook.js +0 -66
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nikaat-crop/es-icons",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A comprehensive collection of beautiful and modern SVG icons specifically designed for Skenas (اسکناس) project, featuring 160+ carefully crafted financial and service icons with TypeScript support.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"release": "node release.js",
|
|
10
|
-
"icons:generate": "node script/svgr-convert-only-new.js && node script/update-icon-exports.js
|
|
10
|
+
"icons:generate": "node script/svgr-convert-only-new.js && node script/update-icon-exports.js",
|
|
11
11
|
"storybook": "storybook dev -p 6006",
|
|
12
12
|
"build-storybook": "storybook build"
|
|
13
13
|
},
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const ICONS_DIR = path.resolve(__dirname, '../src/icons');
|
|
5
|
-
const STORYBOOK_FILE = path.resolve(__dirname, '../src/stories/icons.stories.tsx');
|
|
6
|
-
const INDEX_FILE = path.resolve(__dirname, '../src/index.ts');
|
|
7
|
-
|
|
8
|
-
function toPascalCase(str) {
|
|
9
|
-
return str
|
|
10
|
-
.split(/[-_]/)
|
|
11
|
-
.map(s => s.charAt(0).toUpperCase() + s.slice(1))
|
|
12
|
-
.join('');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function updateStorybook() {
|
|
16
|
-
console.log('🔄 Updating storybook with new icons...');
|
|
17
|
-
|
|
18
|
-
// Get all .tsx files from icons directory
|
|
19
|
-
const iconFiles = fs.readdirSync(ICONS_DIR)
|
|
20
|
-
.filter(f => f.endsWith('.tsx'))
|
|
21
|
-
.map(f => path.basename(f, '.tsx'));
|
|
22
|
-
|
|
23
|
-
// Convert to PascalCase names
|
|
24
|
-
const iconNames = iconFiles.map(toPascalCase);
|
|
25
|
-
iconNames.sort(); // Sort alphabetically
|
|
26
|
-
|
|
27
|
-
// Read current storybook file
|
|
28
|
-
let storybookContent = fs.readFileSync(STORYBOOK_FILE, 'utf8');
|
|
29
|
-
|
|
30
|
-
// Update imports section
|
|
31
|
-
const importStart = storybookContent.indexOf('import {');
|
|
32
|
-
const importEnd = storybookContent.indexOf("} from '../index';") + "} from '../index';".length;
|
|
33
|
-
|
|
34
|
-
const newImports = `import {\n ${iconNames.join(',\n ')}\n} from '../index';`;
|
|
35
|
-
|
|
36
|
-
storybookContent = storybookContent.substring(0, importStart) +
|
|
37
|
-
newImports +
|
|
38
|
-
storybookContent.substring(importEnd);
|
|
39
|
-
|
|
40
|
-
// Update icons array
|
|
41
|
-
const arrayStart = storybookContent.indexOf('const icons = [');
|
|
42
|
-
const arrayEnd = storybookContent.indexOf('];', arrayStart) + 2;
|
|
43
|
-
|
|
44
|
-
const iconEntries = iconNames.map(name =>
|
|
45
|
-
` { name: '${name}', component: ${name} }`
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const newIconsArray = `const icons = [\n${iconEntries.join(',\n')}\n ];`;
|
|
49
|
-
|
|
50
|
-
storybookContent = storybookContent.substring(0, arrayStart) +
|
|
51
|
-
newIconsArray +
|
|
52
|
-
storybookContent.substring(arrayEnd);
|
|
53
|
-
|
|
54
|
-
// Write updated content back to file
|
|
55
|
-
fs.writeFileSync(STORYBOOK_FILE, storybookContent);
|
|
56
|
-
|
|
57
|
-
console.log(`✅ Storybook updated with ${iconNames.length} icons`);
|
|
58
|
-
console.log('📋 Updated icons:', iconNames.join(', '));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Run if called directly
|
|
62
|
-
if (require.main === module) {
|
|
63
|
-
updateStorybook();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
module.exports = { updateStorybook };
|