This guide walks you through publishing the @linkforty/core package to GitHub and npm.
- Git repository initialized
- .gitignore configured
- .npmignore configured
- README.md complete with examples
- LICENSE file (MIT)
- CHANGELOG.md created
- CONTRIBUTING.md created
- Package builds successfully
- Examples directory with working code
- All exports properly configured in package.json
# Install GitHub CLI if needed
brew install gh
# Login to GitHub
gh auth login
# Create repository
cd /Users/brandon/WebstormProjects/linkforty-core
gh repo create linkforty/core --public --description "Open-source deeplink management engine with device detection and analytics"
# Add remote
git remote add origin https://github.com/linkforty/core.git- Go to https://github.com/new
- Repository name:
core - Organization:
linkforty(or create organization first at https://github.com/organizations/new) - Description: "Open-source deeplink management engine with device detection and analytics"
- Public repository
- Do NOT initialize with README, .gitignore, or license (we have these)
- Click "Create repository"
Then add the remote:
cd /Users/brandon/WebstormProjects/linkforty-core
git remote add origin https://github.com/linkforty/core.gitcd /Users/brandon/WebstormProjects/linkforty-core
# Stage all files
git add .
# Create initial commit
git commit -m "feat: initial release of @linkforty/core v1.0.0
- Smart link routing with device detection
- Click analytics with geolocation
- UTM parameter support
- Link expiration and targeting rules
- Redis caching for performance
- PostgreSQL storage
- Full TypeScript support
- Docker deployment examples"
# Create main branch and push
git branch -M main
git push -u origin main
# Create v1.0.0 tag
git tag -a v1.0.0 -m "Release v1.0.0 - Initial public release"
git push origin v1.0.0- Go to repository Settings → Pages
- Source: Deploy from branch → main → /docs (if you add docs later)
- Settings → Branches → Add rule
- Branch name pattern:
main - Enable:
- Require pull request reviews before merging
- Require status checks to pass before merging
- Go to repository main page
- Click ⚙️ next to "About"
- Add topics:
deeplink,onelink,url-shortener,analytics,mobile-links,typescript,fastify,nodejs
Before publishing, verify what will be included:
cd /Users/brandon/WebstormProjects/linkforty-core
npm pack --dry-runThis should show:
- dist/ directory (compiled JavaScript)
- *.d.ts files (TypeScript declarations)
- README.md
- LICENSE
- CHANGELOG.md
- package.json
npm login
# Follow prompts to enter credentials# For first-time publish of scoped package
npm publish --access public
# Verify it's published
npm view @linkforty/coreFor subsequent releases:
# Update version in package.json
npm version patch # 1.0.0 → 1.0.1
npm version minor # 1.0.0 → 1.1.0
npm version major # 1.0.0 → 2.0.0
# This creates a git commit and tag automatically
# Push changes and tags
git push && git push --tags
# Publish to npm
npm publishgh release create v1.0.0 \
--title "v1.0.0 - Initial Release" \
--notes "$(cat CHANGELOG.md | sed -n '/## \[1.0.0\]/,/^---/p' | sed '1d;$d')"- Go to https://github.com/linkforty/core/releases/new
- Tag: v1.0.0
- Title: "v1.0.0 - Initial Release"
- Description: Copy content from CHANGELOG.md for v1.0.0
- Click "Publish release"
# View package info
npm view @linkforty/core
# Test installation
mkdir /tmp/test-linkforty
cd /tmp/test-linkforty
npm init -y
npm install @linkforty/core
# Verify it works
node -e "const { createServer } = require('@linkforty/core'); console.log('✓ Package works!');"- Visit https://github.com/linkforty/core
- Verify README displays correctly
- Check releases page
- Verify topics are visible
The npm version badge should now work:
[](https://www.npmjs.com/package/@linkforty/core)Create .github/workflows/publish.yml for automated publishing:
name: Publish Package
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}- Post on social media (Twitter, LinkedIn, Reddit r/opensource)
- Submit to https://news.ycombinator.com
- Share in relevant Discord/Slack communities
- Update your portfolio/website
After publication, promote your open-source project:
- Share on Twitter/X with relevant hashtags (#opensource #nodejs #typescript)
- Post on LinkedIn
- Submit to https://www.producthunt.com
- Share on Reddit: r/opensource, r/node, r/typescript
- Post on Hacker News: https://news.ycombinator.com/submit
- Add to awesome lists (search "awesome-nodejs" on GitHub)
- Write a blog post about the project
- Create demo video/GIF for README
- Set up project website (optional)
- Enable GitHub Discussions for questions
- Use issue templates for bug reports and feature requests
- Triage issues weekly
- Label issues appropriately
- Review PRs promptly
- Require tests for new features
- Maintain code quality standards
- Update CHANGELOG.md for each release
- Credit contributors in release notes
Suggested release cadence:
- Patch releases (bug fixes): As needed
- Minor releases (new features): Monthly or quarterly
- Major releases (breaking changes): Annually or as needed
If you encounter any issues during publication:
- Verify npm credentials:
npm whoami - Check package name availability:
npm view @linkforty/core - Ensure you have permissions for the @linkforty scope
- Review npm documentation: https://docs.npmjs.com/
For GitHub issues:
- Check SSH keys:
ssh -T git@github.com - Verify remote:
git remote -v - Check permissions: Ensure you own the repository or have write access
Ready to publish? Follow these steps in order and you'll have your package live on npm and GitHub! 🚀