say-yo
v1.0.1
Published
A simple package that says Yo!!
Readme
say-yo
A simple npm package that says "Yo!!" whenever you want it to.
Installation
npm install say-yoUsage
import { Speaker } from 'say-yo';
const speaker = new Speaker();
speaker.sayYo(); // console logs "Yo!!"API
Speaker
The main class exported by the package.
Methods
sayYo(): void- Logs "Yo!!" to the console.
Development
Prerequisites
- Node.js >= 18
- npm >= 9
Setup
# Install dependencies
npm install
# Build the package
npm run build
# Run tests
npm test
# Lint code
npm run lint
# Format code
npm run formatProject Structure
say-yo/
├── src/
│ ├── Speaker.ts # Main Speaker class
│ ├── index.ts # Package entry point
│ └── __tests__/
│ └── Speaker.test.ts # Unit tests
├── dist/ # Compiled output (generated)
├── .gitlab-ci.yml # CI/CD pipeline configuration
├── .releaserc.json # Semantic release configuration
├── package.json
├── tsconfig.json
└── README.mdCI/CD Pipeline
This package uses semantic-release for automated versioning and publishing.
Branch Strategy
main- Production releases withlatesttagstaging- Pre-releases withstagingtag
Release Process
Staging Releases
When code is merged to the staging branch:
- Tests and linting are run
- Package is built
- A pre-release version is published with the
stagingtag (e.g.,1.0.0-staging.1)
npm install say-yo@stagingProduction Releases
When code is merged to the main branch:
- Tests and linting are run
- Package is built
- A production version is published with the
latesttag (e.g.,1.0.0) - The
stagingbranch is automatically synced withmain
npm install say-yo
# or
npm install say-yo@latestCommit Message Convention
This package follows the Conventional Commits specification:
feat:- A new feature (triggers minor version bump)fix:- A bug fix (triggers patch version bump)docs:- Documentation changeschore:- Maintenance taskstest:- Adding or updating testsrefactor:- Code refactoringBREAKING CHANGE:- Breaking changes (triggers major version bump)
Examples:
feat: add new greeting method
fix: correct console output formatting
docs: update usage examples
BREAKING CHANGE: rename Speaker class to GreeterLicense
MIT
Author
Created as a sample npm package demonstrating CI/CD with changeset.
