@postal-music/icons
v0.1.16
Published
Shared design system for Postal — icons and tokens for React and React Native
Readme
@postal-music/icons
Shared icon library for Postal — React (web) and React Native, from one source.
Each icon lives as a pair: FooIcon.web.tsx and FooIcon.native.tsx. At build time tsup resolves the platform extension and emits two bundles (dist/index.* for web, dist/index.native.* for native). Consumers import from a single specifier; bundlers/Metro pick the right entry via the exports map in package.json.
Publishing
Published to npm as a public scoped package under the @postal-music org.
Prerequisites
- npm login with publish rights on the
@postal-musicorg:
If not logged in:npm whoami # should print your npm username npm access list packages @postal-music # should list @postal-music/iconsnpm login. - Clean working tree in this package (
packages/postal-icons).package.jsonhas"files": ["dist", "src"], so only those are shipped — but a dirtysrc/will still go out.
Release workflow
Run all commands from packages/postal-icons.
Make sure the build is current.
npm run buildThis runs
tsup(web + native bundles),tsc -p tsconfig.build.json(types intodist/types), thenscripts/strip-web-suffix.mjs(renames*.web.d.ts→*.d.tsso the declarations match the exports map).Bump the version. Pick one:
npm version patch # 0.1.7 → 0.1.8 (icon added, bug fix) npm version minor # 0.1.7 → 0.2.0 (new category, API addition) npm version major # 0.1.7 → 1.0.0 (breaking rename/removal)This rewrites
package.jsonand creates a git commit + tag in this sub-repo (postal-iconsis its own git repo — see the monorepoCLAUDE.md).Publish.
npm publishpublishConfig.accessis alreadypublic, so no--access publicflag needed.Push the version commit and tag.
git push && git push --tagsVerify.
npm view @postal-music/icons version
Dry run
Before publishing, inspect exactly what will be shipped:
npm pack --dry-runThis lists every file that would land in the tarball without touching the registry. Make sure dist/ looks complete and nothing sensitive snuck in.
Bumping consumers
After publish, update the @postal-music/icons dependency in any consuming package (postal-ac-frontend, postal-admin, postal-mobile, postal-desktop, …) and run their respective install.
Adding an icon
- Drop the SVG into the right category under
src/icons/<category>/:FooIcon.web.tsx— uses<svg>/<path>, strokecurrentColor.FooIcon.native.tsx— usesreact-native-svg's<Svg>/<Path>, same path data.
- Export it from that category's
index.tsin alphabetical position. - Run
npm run buildto confirm both bundles compile.
Use currentColor for strokes/fills so consumers can theme via CSS / color prop. Keep the source viewBox (usually 0 0 18 18 or 0 0 24 24); don't rescale paths.
