Repository navigation
Update AGENTS.md to mention additional pitfalls #78718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,14 @@ | |
| ```bash | ||
| # Setup | ||
| npm install && composer install | ||
| npm run wp-env status # Always check status first | ||
| npm run wp-env start # Only start if not already running | ||
| npm run wp-env status # Always check status first. | ||
| npm run wp-env start # Only start if not already running. | ||
| npm run wp-env-test status # Status of test environment. Always check first. | ||
| npm run wp-env-test start # Start the test env, only start if not already running. | ||
|
|
||
| # Development | ||
| npm start # Development with watch | ||
| npm run build # Production build | ||
| npm start # Development with watch | ||
| npm run build # Production build | ||
| ``` | ||
|
|
||
| ### Key Directories | ||
|
|
@@ -28,7 +30,7 @@ npm run build # Production build | |
|
|
||
| ## Testing instructions | ||
|
|
||
| > **Note**: PHP/E2E tests require wp-env running. | ||
| > **Note**: PHP/E2E tests require `wp-env-test` running. | ||
|
|
||
| ```bash | ||
| # JavaScript | ||
|
|
@@ -37,12 +39,12 @@ npm run test:unit # Unit tests | |
| npm run test:unit -- --testNamePattern="<TestName>" # Specific test | ||
| npm run test:unit <path_to_test_directory> | ||
|
|
||
| # PHP (requires wp-env) | ||
| # PHP (requires wp-env-test) | ||
| composer test # All PHP tests | ||
| vendor/bin/phpunit <path_to_test_file.php> # Specific file | ||
| vendor/bin/phpunit <path_to_test_directory>/ # Directory | ||
|
|
||
| # E2E (requires wp-env) | ||
| # E2E (requires wp-env-test) | ||
| npm run test:e2e | ||
| npm run test:e2e -- <path_to_test_file.spec.js> # Specific test file | ||
| npm run test:e2e -- --headed # Run with browser visible | ||
|
|
@@ -72,8 +74,10 @@ For full architecture details, see `docs/explanations/architecture/`. | |
| - Do not add dependencies to the root `package.json`. Add them to the workspace that uses them, or create a new workspace under `tools/` (or `test/` for test infrastructure). See [Workspace Development](docs/contributors/code/workspace-development.md). | ||
| - PHP features in `lib/compat/` MUST target a specific `wordpress-X.Y/` subdirectory. | ||
| - Avoid using private APIs in bundled packages (packages without `wpScript` or `wpModuleExports`). Private APIs are intended for Core usage; bundled packages may also be imported via npm into plugin scripts, causing incompatibilities. | ||
| - Avoid adding new APIs prefixed with `__experimental` or `__unstable`. This pattern is now not used. Instead use private APIs or in bundled packages regular exports. | ||
| - `block-editor` is a WordPress-agnostic package. NEVER add `core-data` dependencies or direct REST API calls to it. | ||
| - `@wordpress/build` (`packages/wp-build`) is a generic build tool used both in Gutenberg and by plugins targeting WordPress Core directly. Avoid Gutenberg-specific changes in it. | ||
| - Never run `npx prettier`. WordPress uses its own fork of prettier, `wp-prettier`. Use npm scripts (e.g. `npm run format`) commands to format code instead. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with this, thanks for updating! |
||
|
|
||
| ## PR instructions | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG thanks for updating this. It was annoying the hell out of me.