feat(abacus-react): add dual publishing to npm and GitHub Packages

- Configure semantic-release for simultaneous publishing to both registries
- Update GitHub Actions workflow with dual authentication setup
- Add npm configuration for both registry.npmjs.org and npm.pkg.github.com
- Update package.json with correct repository URL and registry config
- Enhance documentation across README, CONTRIBUTING.md, and .claude/ files
- GitHub Packages uses GITHUB_TOKEN, npm requires NPM_TOKEN secret

This provides redundancy and choice for package consumers while maintaining
the same automatic semantic versioning workflow.
This commit is contained in:
Thomas Hallock 2025-09-28 08:55:05 -05:00
parent f923b53a44
commit 242ee523ed
3 changed files with 29 additions and 4 deletions

View File

@ -45,6 +45,15 @@
"npmPublish": true "npmPublish": true
} }
], ],
[
"@semantic-release/npm",
{
"npmPublish": true,
"pkgRoot": ".",
"tarballDir": "dist",
"registry": "https://npm.pkg.github.com"
}
],
[ [
"@semantic-release/github", "@semantic-release/github",
{ {

View File

@ -16,6 +16,8 @@ A comprehensive React component for rendering interactive Soroban (Japanese abac
## Installation ## Installation
### From npm (recommended)
```bash ```bash
npm install @soroban/abacus-react npm install @soroban/abacus-react
# or # or
@ -24,6 +26,18 @@ pnpm add @soroban/abacus-react
yarn add @soroban/abacus-react yarn add @soroban/abacus-react
``` ```
### From GitHub Packages
```bash
# Configure npm to use GitHub Packages for @soroban scope
echo "@soroban:registry=https://npm.pkg.github.com" >> .npmrc
# Then install
npm install @soroban/abacus-react
```
The package is published to both npm and GitHub Packages simultaneously for redundancy and choice.
## Quick Start ## Quick Start
@ -404,8 +418,9 @@ BREAKING CHANGE: callback functions now receive different parameters
### Release Process ### Release Process
1. **Automatic**: Releases happen automatically when changes are pushed to `main` branch 1. **Automatic**: Releases happen automatically when changes are pushed to `main` branch
2. **Manual testing**: Run `pnpm release:dry-run` to test release without publishing 2. **Dual publishing**: Package is published to both npm and GitHub Packages simultaneously
3. **Version tags**: Releases are tagged as `abacus-react-v1.2.3` (separate from monorepo versions) 3. **Manual testing**: Run `pnpm release:dry-run` to test release without publishing
4. **Version tags**: Releases are tagged as `abacus-react-v1.2.3` (separate from monorepo versions)
### Development Commands ### Development Commands

View File

@ -89,13 +89,14 @@
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/soroban-flashcards/soroban-abacus-flashcards", "url": "https://github.com/antialias/soroban-abacus-flashcards",
"directory": "packages/abacus-react" "directory": "packages/abacus-react"
}, },
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public",
"registry": "https://registry.npmjs.org"
} }
} }