Publishing to npm
wireai-rn is published to the npm registry. Both npm install wireai-rn and yarn add wireai-rn install from the same registry, there is no separate yarn registry.
For package maintainers
This page is for maintainers publishing new versions of wireai-rn. If you're building an app that uses wireai-rn, see the Installation page.
One-time setup
1
Create an npm account
Register at npmjs.com (free). Then log in from the terminal:
$npmlogin# Enter username, password, email, and OTP2
Verify login
$npmwhoami# → your-npm-usernameRelease workflow
1
Build the package
$cdpackages/core$yarnbuild# Outputs:# dist/index.js ← CommonJS# dist/index.mjs ← ESM# dist/index.d.ts ← TypeScript declarations# dist/components/ ← components sub-path2
Bump the version
Follow semver:
# Patch: bug fixes (0.1.3 → 0.1.4)$npmversion patch# Minor: new features, backwards-compatible (0.1.3 → 0.2.0)$npmversion minor# Major: breaking changes (0.1.3 → 1.0.0)$npmversion major# This updates package.json and creates a git tag automatically3
Publish
# From packages/core/$npmpublish --access public# With yarn:$yarnpublish --access public# (yarn publish also prompts for a new version and runs build)--access public
The
--access public flag is required for scoped packages (@wireai/rn) on the first publish. For unscoped packages like wireai-rn it's optional.4
Verify the publish
$npmview wireai-rn# Shows version, dist-tags, tarball URL# Test in a fresh project$npxcreate-expo-app test-install && cd test-install$yarnadd wireai-rn zod# → Should install without errorsAutomated CI release (recommended)
Add a GitHub Actions workflow that publishes automatically when a tag is pushed:
.github/workflows/publish.yml
name: Publish to npmon: push: tags:$-"v*" # triggers on v0.1.4, v1.0.0, etc.jobs: publish: runs-on: ubuntu-latest steps:$-uses: actions/checkout@v4$-uses: actions/setup-node@v4 with: node-version: 20 registry-url: "https://registry.npmjs.org"$-run: yarn install --frozen-lockfile working-directory: packages/core$-run: yarn build working-directory: packages/core$-run: npm publish --access public working-directory: packages/core env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}Store your npm token as a GitHub Actions secret named NPM_TOKEN. Then release with:
$gittag v0.1.4$gitpush origin v0.1.4# → GitHub Actions publishes automaticallyPre-releases / beta tags
$npmversion 1.0.0-beta.1$npmpublish --tag beta# Users install:$yarnadd wireai-rn # → latest stable$yarnadd wireai-rn@beta # → latest betaScoped vs unscoped packages
| Unscoped (current) | Scoped | |
|---|---|---|
| Package name | wireai-rn | @wireai/rn |
| Install | yarn add wireai-rn | yarn add @wireai/rn |
| First publish flag | optional | --access public required |
| Namespace collision risk | Higher | None (namespaced) |