woocommerce-dev-cycle
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWooCommerce Development Cycle
WooCommerce 开发周期
This skill provides guidance for the WooCommerce development workflow, including running tests, code quality checks, and troubleshooting.
本技能为WooCommerce开发工作流提供指导,包括运行测试、代码质量检测以及问题排查。
Instructions
操作指南
Follow these guidelines for WooCommerce development workflow:
- Running tests: See running-tests.md for PHP and JavaScript test commands, test environment setup, and troubleshooting
- Code quality: See code-quality.md for linting and code style fixes
- PHP linting patterns: See php-linting-patterns.md for common PHP linting issues and fixes
- Markdown linting: See markdown-linting.md for markdown file linting and formatting
请遵循以下WooCommerce开发工作流指南:
- 运行测试:查看running-tests.md获取PHP和JavaScript测试命令、测试环境搭建以及问题排查方法
- 代码质量:查看code-quality.md获取代码检查和代码风格修复的相关内容
- PHP代码检查模式:查看php-linting-patterns.md了解常见PHP代码检查问题及修复方案
- Markdown代码检查:查看markdown-linting.md获取Markdown文件的代码检查和格式化方法
Development Workflow
开发工作流
The standard development workflow:
- Make code changes
- Run relevant tests:
pnpm run test:php:env -- --filter YourTestClass - Run linting/type checking:
pnpm run lint:changes:branch:php - Fix any issues:
pnpm run lint:php:fix - Commit changes only after tests pass
Note: WooCommerce uses pnpm for its build system. For other Node.js projects, prefer bun over npm/pnpm.
标准开发工作流:
- 进行代码修改
- 运行相关测试:
pnpm run test:php:env -- --filter YourTestClass - 运行代码检查/类型检测:
pnpm run lint:changes:branch:php - 修复所有问题:
pnpm run lint:php:fix - 仅在测试通过后提交修改
注意:WooCommerce使用pnpm作为构建系统。对于其他Node.js项目,优先使用bun而非npm/pnpm。
Key Principles
核心原则
- Always run tests after making changes to verify functionality
- Use specific test filters to run relevant tests during development
- Fix linting errors solely for code in your current branch
- Test failures provide detailed output showing expected vs actual values
- The test environment handles WordPress/WooCommerce setup automatically
- 代码修改后务必运行测试以验证功能
- 开发过程中使用特定测试过滤器来运行相关测试
- 仅修复当前分支代码中的代码检查错误
- 测试失败会提供详细输出,显示预期值与实际值的对比
- 测试环境会自动完成WordPress/WooCommerce的搭建