Skip to content

Commit 734445f

Browse files
feat!: rebuild library with createIcon factory and modern API
Major rewrite of the runtime, build, and source organisation. The icon set itself is unchanged (287 icons, Feather 4.29.2 upstream), but every component now goes through a shared createIcon factory and ships fresh ESM+CJS+typings via tsup. API additions - size: shorthand for width and height (default 24). - color: documented alias for stroke (default "currentColor"). - absoluteStrokeWidth: keeps perceived stroke weight constant across sizes by computing strokeWidth * 24 / size. Useful at 14-16 px. - forwardRef on every icon, exposing the underlying Svg ref. - displayName on every icon, removing the React lint warning. - Stable per-child key on every path/polygon/etc., silencing the list key warning when an icon mounts. - createIcon itself is exported so users can ship custom icons sharing the same prop API. Build / packaging - Output moved from lib/ to dist/. - Dual ESM (.js) + CJS (.cjs) with matching .d.ts and .d.cts. - Per-icon deep imports via the exports map, e.g. react-native-feather/icons/ArrowUpCircle. - Icons are now generated and committed under src/icons/ by scripts/build-icons.mjs, so the source tree is reproducible and browseable on GitHub. - Strict tsconfig (noUncheckedIndexedAccess, verbatimModuleSyntax, isolatedModules) under bundler resolution. - ESLint flat config and Vitest smoke tests cover all 287 components. Closes #15, #16, #17. BREAKING CHANGE: Peer deps widened to react >=16.8, react-native: "*", react-native-svg >=12. Output moved from lib/ to dist/ and the package now ships dual ESM+CJS via the exports field. Old props (width, height, stroke) still work, but size and color are the documented v2 names.
1 parent 4c1dabd commit 734445f

300 files changed

Lines changed: 8817 additions & 5999 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
node_modules/
2-
typings/
2+
dist/
3+
coverage/
34
*.log
45
.DS_Store
5-
lib/
6-
src/
6+
.npm
7+
.vscode/
8+
.idea/

eslint.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import tseslint from 'typescript-eslint';
2+
3+
export default tseslint.config(
4+
{
5+
ignores: [
6+
'dist/**',
7+
'src/icons/**',
8+
'node_modules/**',
9+
'coverage/**',
10+
'**/*.config.{js,ts,mjs}',
11+
'scripts/**',
12+
],
13+
},
14+
...tseslint.configs.recommended,
15+
{
16+
rules: {
17+
'@typescript-eslint/consistent-type-imports': 'error',
18+
'@typescript-eslint/no-explicit-any': 'warn',
19+
'@typescript-eslint/no-unused-vars': [
20+
'error',
21+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
22+
],
23+
},
24+
},
25+
);

0 commit comments

Comments
 (0)