diff --git a/.wp-env.json b/.wp-env.json new file mode 100644 index 0000000..86ce4d2 --- /dev/null +++ b/.wp-env.json @@ -0,0 +1,6 @@ +{ + "plugins": ["."], + "lifecycleScripts": { + "afterStart": "npm run env run cli wp plugin activate image-comparison" + } +} diff --git a/README.md b/README.md index 63ab9dc..47fec79 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ When installing to your site, add the following to your `composer.json` file. Th ``` ### Local Development or Manual Install -Clone the repository into your `plugins` or `client-mu-plugins` directory. +Clone the repository into your `plugins` or `client-mu-plugins` directory. +**NB**: If you have access to [Docker](https://www.docker.com/), you can spin up a local development environment using [wp-env](https://github.com/WordPress/gutenberg/tree/trunk/packages/env), in which case you may clone the repository into any directory. ``` git clone git@github.com:bigbite/image-comparison.git && cd image-comparison ``` @@ -50,7 +51,7 @@ Install JS packages. npm install ``` -Build all assets +Build all assets. ``` npm run build:dev ``` @@ -60,6 +61,8 @@ Install PHP packages and create autoloader for the plugin. composer install ``` +If using wp-env, you can run its commands by running `npm run env [command]`. + ## Requirements Image Comparison requires these software with the following versions: @@ -72,4 +75,4 @@ Image Comparison requires these software with the following versions: ## Contributing -Please read [Code of Conduct](./CODE_OF_CONDUCT.md) for details on our code of conduct and [Contributing](./CONTRIBUTING.md) for details on the process for submitting pull requests to us. \ No newline at end of file +Please read [Code of Conduct](./CODE_OF_CONDUCT.md) for details on our code of conduct and [Contributing](./CONTRIBUTING.md) for details on the process for submitting pull requests to us. diff --git a/package.json b/package.json index 65c2c40..cfae0ee 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "scripts": { "build:prod": "build-tools build --production --once", "build:dev": "build-tools build --once", - "watch:dev": "build-tools build" + "watch:dev": "build-tools build", + "env": "npx @wordpress/env" }, "dependencies": { "@wordpress/block-editor": "^13.0.0",