Skip to content
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

Add wp-env support for development #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": ["."],
"lifecycleScripts": {
"afterStart": "npm run env run cli wp plugin activate image-comparison"
}
}
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]:bigbite/image-comparison.git && cd image-comparison
```
Expand All @@ -50,7 +51,7 @@ Install JS packages.
npm install
```

Build all assets
Build all assets.
```
npm run build:dev
```
Expand All @@ -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:
Expand All @@ -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.
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.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down