Contributing to Create JS Stack CLI
October 17, 2025 ยท View on GitHub
Thank you for your interest in contributing to Create JS Stack CLI! ๐
This document provides guidelines and instructions for contributing to this project. We welcome contributions from developers of all skill levels.
๐ Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- How to Contribute
- Adding New Templates
- Testing
- Submitting Changes
- Release Process
- Community Guidelines
๐ค Code of Conduct
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this code.
๐ Getting Started
Prerequisites
- Node.js: Version 18.0.0 or higher
- npm: Version 8.0.0 or higher
- Git: Latest version
- VS Code (recommended) or your preferred editor
Quick Start
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/vipinyadav01/js-stack.git cd js-stack - Install dependencies:
npm install - Build the CLI:
npm run build:cli
๐ ๏ธ Development Setup
Local Development
-
Create a development branch:
git checkout -b feature/your-feature-name -
Make your changes and test locally:
# Test the CLI locally node dist/cli.js init test-project --help # Run linting npm run lint # Run tests npm run test -
Rebuild after changes:
npm run build:cli
Development Scripts
# Build the CLI
npm run build:cli
# Run development server for web dashboard
npm run dev:web
# Run linting
npm run lint
npm run lint:fix
# Run tests
npm run test
# Format code
npm run format
# Clean build artifacts
npm run clean
๐ Project Structure
js-stack/
โโโ src/ # Source code
โ โโโ cli.js # Main CLI entry point
โ โโโ commands/ # CLI commands
โ โโโ generators/ # Project generators
โ โโโ utils/ # Utility functions
โ โโโ types.js # Type definitions
โโโ templates/ # Project templates
โ โโโ frontend/ # Frontend frameworks
โ โโโ backend/ # Backend frameworks
โ โโโ database/ # Database configurations
โ โโโ auth/ # Authentication templates
โ โโโ docker/ # Docker configurations
โ โโโ testing/ # Testing frameworks
โ โโโ config/ # Configuration files
โโโ web/ # Web dashboard (Next.js)
โโโ dist/ # Built CLI files
โโโ scripts/ # Build and deployment scripts
๐ฏ How to Contribute
Types of Contributions
We welcome several types of contributions:
- ๐ Bug Fixes: Fix existing issues
- โจ New Features: Add new functionality
- ๐ Documentation: Improve docs and examples
- ๐จ Templates: Add new framework templates
- ๐งช Tests: Add or improve test coverage
- ๐ง Tooling: Improve development tools
- ๐ Translations: Add language support
Before You Start
- Check existing issues to see if someone is already working on it
- Create an issue for significant changes to discuss the approach
- Keep changes focused - one feature/fix per pull request
Contribution Workflow
- Fork and clone the repository
- Create a feature branch from
main - Make your changes following our coding standards
- Test your changes thoroughly
- Update documentation if needed
- Submit a pull request
๐จ Adding New Templates
Template Structure
Templates use Handlebars for dynamic content:
// Example: templates/frontend/react/package.json.hbs { "name": "{{projectName}}",
"version": "1.0.0", "scripts": { "dev": "vite", "build": "vite build" },
"dependencies": {
{{#if typescript}}
"react": "^18.0.0", "react-dom": "^18.0.0", "@types/react": "^18.0.0"
{{else}}
"react": "^18.0.0", "react-dom": "^18.0.0"
{{/if}}
} }
Template Context Variables
Available variables in templates:
{
projectName: "my-app",
typescript: true,
useTypeScript: true,
frontend: ["react"],
backend: "express",
database: "postgres",
orm: "prisma",
auth: "jwt",
packageManager: "npm",
hasDocker: true,
hasTesting: true,
// ... more variables
}
Adding a New Framework Template
-
Create template directory:
mkdir -p templates/frontend/your-framework -
Add template files:
package.json.hbs- Package configurationsrc/App.jsx.hbs- Main componentsrc/main.jsx.hbs- Entry pointindex.html.hbs- HTML template- Any other framework-specific files
-
Update template resolver in
src/utils/template-resolver.js:[FRONTEND_OPTIONS.YOUR_FRAMEWORK]: { base: "your-framework", files: ["package.json", "src/App.jsx", "src/main.jsx"], dependencies: ["your-framework", "build-tool"] } -
Add framework option in
src/types.js:export const FRONTEND_OPTIONS = { // ... existing options YOUR_FRAMEWORK: "your-framework", }; -
Update prompts in
src/prompts-modern.jsorsrc/prompts-enhanced.js
Template Best Practices
- Use conditional logic for TypeScript/JavaScript variations
- Include all necessary files for a working project
- Follow framework conventions and best practices
- Add helpful comments in generated code
- Test templates by generating projects
๐งช Testing
Running Tests
# Run all tests
npm run test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
Testing Templates
-
Generate a test project:
node dist/cli.js init test-project --frontend your-framework --yes -
Verify the generated project:
- Check file structure
- Verify package.json dependencies
- Test that the project builds and runs
-
Clean up test projects:
rm -rf test-project
Test Coverage
We aim for good test coverage. When adding new features:
- Add unit tests for utility functions
- Add integration tests for CLI commands
- Test template generation with various configurations
- Verify error handling and edge cases
๐ Submitting Changes
Pull Request Guidelines
- Clear title describing the change
- Detailed description of what was changed and why
- Reference issues using
Fixes #123orCloses #123 - Add screenshots for UI changes
- Update documentation if needed
Pull Request Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tests pass locally
- [ ] New tests added for new functionality
- [ ] Manual testing completed
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No breaking changes (or marked as such)
Code Review Process
- Automated checks must pass (linting, tests)
- Manual review by maintainers
- Address feedback promptly
- Squash commits before merging
๐ Release Process
Version Bumping
We use semantic versioning:
- Patch (1.0.1): Bug fixes
- Minor (1.1.0): New features, backward compatible
- Major (2.0.0): Breaking changes
Release Steps
- Update version in
package.json - Update CHANGELOG.md with changes
- Create release notes
- Tag the release:
git tag v1.0.1 - Publish to npm:
npm publish - Create GitHub release
๐ฌ Community Guidelines
Getting Help
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Discord: Join our community
Code Style
- ESLint: Follow the configured ESLint rules
- Prettier: Code formatting is handled automatically
- Conventional Commits: Use conventional commit messages
- Comments: Add comments for complex logic
Commit Message Format
type(scope): description
[optional body]
[optional footer]
Examples:
feat(templates): add Vue 3 template support
fix(cli): resolve template path resolution issue
docs(readme): update installation instructions
๐ Recognition
Contributors are recognized in:
- README.md contributor section
- Release notes for significant contributions
- GitHub contributor graphs
- Community highlights
๐ Contact
- Maintainer: @vipinyadav01
- Email: [your-email@example.com]
- Twitter: [@your-twitter]
๐ Thank You
Thank you for contributing to Create JS Stack CLI! Your contributions help make JavaScript development more accessible and efficient for developers worldwide.
Happy Coding! ๐