Development Environment Configuration
This document provides detailed guidelines for setting up and using the development environment.
System Requirements
- Node.js: 16.x or higher
- PNPM: 8.x or higher
- Git: Latest version
Installing Dependencies
Installing Node.js
We recommend using nvm or fnm to manage Node.js versions:
# Using nvm
nvm install 16
nvm use 16
# Or using fnm
fnm install 16
fnm use 16Installing PNPM
npm install -g pnpm@8Cloning the Repository
git clone https://github.com/real-jacket/create-your-app.git
cd create-your-appInstalling Project Dependencies
pnpm installDevelopment Workflow
Starting Development Mode
# Developing the CLI tool
pnpm dev
# Developing the documentation website
pnpm docs:devBuilding the Project
# Building all packages
pnpm build:all
# Building a specific package
pnpm --filter=@rjkt/create-your-app buildRunning Tests
# Running all tests
pnpm test
# Running tests for a specific package
pnpm --filter=@rjkt/create-your-app testCode Checking and Formatting
# Running ESLint checks
pnpm lint
# Auto-fixing ESLint issues
pnpm lint:fix
# Formatting code
pnpm formatDocker Development Environment
We provide a Docker development environment to ensure all developers use the same environment:
Building the Docker Image
docker build -t create-your-app-dev -f Dockerfile.dev .Running the Docker Container
docker run -it --rm -v $(pwd):/app create-your-app-dev bashDeveloping New Features
Create a new branch:
bashgit checkout -b feature/your-feature-nameDevelop the feature and commit your code:
bashgit add . pnpm commitCreate a changeset:
bashpnpm changesetPush the branch and create a Pull Request:
bashgit push origin feature/your-feature-name
Debugging
Debugging the CLI Tool
Link the CLI tool globally:
bashcd packages/create-your-app pnpm link --globalUse the Node.js debugger:
bashnode --inspect-brk $(which cya) create my-app
Debugging Tests
# Using Jest debug mode
pnpm --filter=@rjkt/create-your-app test --debugCommon Issues
Dependency Issues
If you encounter dependency issues, try clearing the cache and reinstalling:
pnpm clean
pnpm installBuild Errors
If you encounter build errors, check the TypeScript configuration and dependency versions:
pnpm type-checkIDE Configuration
VSCode
We provide recommended VSCode configurations in the .vscode directory, including:
- Recommended extensions
- Editor settings
- Debug configurations
VSCode will prompt you to install the recommended extensions when you open the project.