Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
@wordpress/scripts
Advanced tools
Collection of JS scripts for WordPress development.
Install the module
npm install @wordpress/scripts --save-dev
This is a CLI and exposes a binary called wp-scripts
so you can call it directly. However this module is designed to be configured using the scripts
section in the package.json
file of your project.
Example:
{
"scripts": {
"lint:pkg-json": "wp-scripts lint-pkg-json .",
"test": "wp-scripts test-unit-js"
}
}
wp-scripts lint-pkg-json
Helps enforce standards for your package.json file. It uses npm-package-json-lint with the set of default rules provided. You can override them with your own rules as described in npm-package-json-lint wiki.
Example:
{
"scripts": {
"lint:pkg-json": "wp-scripts lint-pkg-json ."
}
}
This is how you execute those scripts using the presented setup:
npm run lint:pkg-jsont
- lints package.json
file in the project's root folder.wp-scripts test-unit-js
Alias: wp-scripts test-unit-jest
Launches the test runner. It uses Jest behind the scenes and you are able to utilize all of its CLI options. You can also run ./node_modules/.bin/wp-scripts test-unit-js --help
or npm run test:help
(as presented below) to view all of the available options.
Example:
{
"scripts": {
"test": "wp-scripts test-unit-js",
"test:help": "wp-scripts test-unit-js --help",
"test:watch": "wp-scripts test-unit-js --watch"
}
}
This is how you execute those scripts using the presented setup:
npm run test
or npm test
- runs all unit tests.npm run test:help
- prints all available options to configure unit tests runner.npm run test:watch
- runs all unit tests in the watch mode.This is inspired by react-scripts and kcd-scripts.
FAQs
Collection of reusable scripts for WordPress development.
The npm package @wordpress/scripts receives a total of 40,070 weekly downloads. As such, @wordpress/scripts popularity was classified as popular.
We found that @wordpress/scripts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.