dev

द्वारा automattic

वर्डप्रेस एक्टिविटीपब प्लगइन के लिए विकास कार्यप्रवाह, जिसमें wp-env सेटअप, परीक्षण कमांड, लिंटिंग और बिल्ड प्रक्रियाएँ शामिल हैं। विकास सेटअप करते समय उपयोग करें…

npx skills add https://github.com/automattic/wordpress-activitypub --skill dev

ActivityPub Development Cycle

Quick reference for common development workflows in the WordPress ActivityPub plugin.

Quick Reference

Environment Management

npm run env-start    # Start WordPress at http://localhost:8888.
npm run env-stop     # Stop WordPress environment.

Testing Commands

npm run env-test                      # Run all PHP tests.
npm run env-test -- --filter=pattern  # Run tests matching pattern.
npm run env-test -- path/to/test.php  # Run specific test file.
npm run env-test -- --group=name      # Run tests with @group annotation.
npm run test:e2e                      # Run Playwright E2E tests.
npm run test:e2e:debug                # Debug E2E tests.

Code Quality

composer lint         # Check PHP coding standards.
composer lint:fix     # Auto-fix PHP issues.
npm run lint:js       # Check JavaScript.
npm run lint:css      # Check CSS styles.
npm run format        # Format all code (wp-scripts).

Building Assets

npm run build         # Build for production (formatted and minified).
npm run dev           # Start development watch mode.

Code Coverage

npm run env-start -- --xdebug=coverage    # Start with coverage support.
npm run env-test -- --coverage-text       # Generate text coverage report.
npm run env-test -- --coverage-html ./coverage  # Generate HTML report.

Comprehensive Documentation

See docs/development-environment.md for detailed setup instructions.

See tests/README.md for comprehensive testing guidance.

See docs/code-linting.md for linting configuration and standards.

Pre-commit Hooks

The repository uses automated pre-commit hooks (.githooks/pre-commit) that run automatically on git commit:

  1. Sort PHP imports - Automatically organizes use statements.
  2. Check unused imports - Prevents unused use statements.
  3. Validate test patterns - Blocks remove_all_filters('pre_http_request').
  4. Run PHPCS auto-fix - Applies coding standards automatically.
  5. Format JavaScript - Runs wp-scripts formatter.

IMPORTANT: Hooks modify staged files automatically. Always review changes before committing. If hooks make changes, you'll need to stage them and commit again.

Setup: Hooks are installed by npm run prepare (runs automatically after npm install).

Common Development Workflows

Initial Setup

git clone git@github.com:Automattic/wordpress-activitypub.git
cd wordpress-activitypub
npm install           # Also runs 'npm run prepare' to install hooks.
composer install
npm run env-start     # WordPress at http://localhost:8888.

Making Changes Workflow

# 1. Make code changes.

# 2. Run relevant tests.
npm run env-test -- --filter=FeatureName

# 3. Check code quality (optional - pre-commit hook does this).
composer lint
npm run lint:js

# 4. Commit (pre-commit hook runs automatically).
git add .
git commit -m "Description"
# Hook may modify files - review and stage again if needed.

When the admin app imports from a @wordpress/* package that the build externalizes to a wp.* global, check the export against what the plugin's minimum WordPress version ships (wp-includes/js/dist/<package>.js, or typeof wp.<package>.<name> in the browser), not against node_modules. Newer npm versions export names the shipped global does not have.

Before Creating PR

# Run full test suite.
npm run env-test

# Build assets.
npm run build

# Final lint check.
composer lint
npm run lint:js

Debugging Failing Tests

# Run with verbose output.
npm run env-test -- --verbose --filter=test_name

# Run single test file to isolate issue.
npm run env-test -- tests/phpunit/tests/path/to/test.php

# Check test groups.
npm run env-test -- --list-groups
npm run env-test -- --group=specific_group

Fresh Environment

npm run env-stop
npm run env-start
# wp-env automatically sets up WordPress with debug mode and test users.

Key Files

  • package.json - npm scripts and dependencies.
  • composer.json - PHP dependencies and lint scripts.
  • .wp-env.json - wp-env configuration.
  • phpcs.xml - PHP coding standards (custom WordPress rules).
  • .githooks/pre-commit - Pre-commit automation.

automattic की और Skills

testing-js
automattic
जावास्क्रिप्ट फ़ाइलों में सिंटैक्स त्रुटियों की जाँच करने के दिशानिर्देश
setup
automattic
सत्यापित करें कि dn CLI स्थापित और कॉन्फ़िगर किया गया है। इसका उपयोग तब करें जब उपयोगकर्ता पहली बार domain-names प्लगइन स्थापित करता है, या जब dn कमांड CLI के कारण विफल हो जाता है…
studio-cli
automattic
स्टूडियो CLI का उपयोग करके स्थानीय WordPress साइटों, प्रमाणीकरण और पूर्वावलोकन साइटों का प्रबंधन करें। इस कौशल को तब लागू करें जब आपको स्टूडियो CLI कमांड चलाने, प्रबंधित करने की आवश्यकता हो…
dn-info
automattic
dn CLI का उपयोग करके पंजीकृत डोमेन के बारे में विस्तृत जानकारी प्राप्त करें। जब उपयोगकर्ता डोमेन विवरण जैसे समाप्ति तिथि, नेमसर्वर, संपर्क आदि देखना चाहे तब उपयोग करें।
qa
automattic
निकाले गए WXR सामग्री की तुलना मूल स्रोत साइट से पृष्ठ दर पृष्ठ करें। लापता पाठ, शीर्षक, चित्र और लिंक खोजें। WXR को पैच करके या… ठीक करें।
add-skill
automattic
a8c-design प्लगइन में एक नया स्किल जोड़ें। जब आपने Claude Code स्किल बनाया हो और उसे साझा Automattic a8c-design प्लगइन में योगदान देना चाहते हों तो इसका उपयोग करें —…
design-foundations
automattic
मुक्त साइट से एक सुसंगत डिज़ाइन-फाउंडेशन JSON बनाएं — सिमेंटिक रंग/टाइपोग्राफी/स्पेसिंग भूमिकाएँ साक्ष्य-निशानों के साथ। आंशिक स्कैफोल्ड का उपभोग करता है…
wp-phpstan
automattic
वर्डप्रेस प्रोजेक्ट्स (प्लगइन्स/थीम्स/साइट्स) में PHPStan स्टैटिक एनालिसिस को कॉन्फ़िगर करने, चलाने या ठीक करने के लिए उपयोग करें: phpstan.neon सेटअप, बेसलाइन्स,…