Commit 734445f
committed
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
- scripts
- src
- icons
- tests
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments