Scripts

Last updatedView as Markdown

Every script key from the root Composer and npm manifests, plus the keys the blocks overlay merges into root package.json.

Composer

From composer.json scripts and scripts-descriptions.

Reference

composer.json scripts

Typed options, defaults, and constraints in one scannable reference.
12 fields
php-lint string
Syntax lint only (parallel-lint).
phpcs string
Coding standards against phpcs.xml.dist, whole tree.
phpcbf string
Auto-fix what phpcs can.
phpstan string
Static analysis at the level in phpstan.neon.
check-branch-cs string
PHPCS over only the lines this branch changed. What linchpin/actions’ php-checks.yml runs.
check-staged-cs string
The same line-scoped check against what a commit is about to introduce. What the husky pre-commit hook runs.
fixer string
php-cs-fixer, applying fixes.
fixer:test string
php-cs-fixer in dry-run mode.
phpunit string
Unit suite. No database.
lint string
Every static gate.
test string
Every static gate, then the unit suite.
build string
Build the distributable zip into build/plugin-scaffold.zip.
composer test bash
composer test

npm (root)

From root package.json scripts. Commands are @wordpress/scripts except prepare.

Reference

package.json scripts

Typed options, defaults, and constraints in one scannable reference.
7 fields
build string
Compile src/admin/index.js to build/.
start string
Watch the root webpack config.
format string
Format JavaScript with wp-scripts.
lint:js string
ESLint via wp-scripts. What js.yml runs.
lint:css string
Style lint via wp-scripts.
packages-update string
Update @wordpress/* packages through wp-scripts.
prepare string
Install Husky git hooks after npm install.

Blocks overlay scripts

Merged into root package.json only after --with-blocks. Source: overlays/blocks/package-scripts.json.

Reference

package-scripts.json

Typed options, defaults, and constraints in one scannable reference.
5 fields
install:all string
Install root and nested workspaces.
install:ci string
Lockfile-strict install for both workspaces.
build:blocks string
Build the nested blocks project.
build:all string
Build admin, then blocks.
start:blocks string
Watch the nested blocks project.

The nested blocks/package.json defines its own build, start, format, lint:js, lint:css, and packages-update scripts. The build command includes --blocks-manifest --webpack-copy-php --experimental-modules. See the blocks overlay.

Have a question about this page?

Linchpin assistant

Was this helpful?