Skip to content

Commit 1fab9ba

Browse files
committed
Add local development setup instructions to README
1 parent eb3b6be commit 1fab9ba

File tree

1 file changed

+74
-8
lines changed

1 file changed

+74
-8
lines changed

README.md

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cloudinary's WordPress Plugin
22

3-
Cloudinary is a cloud service that offers a solution to a web application's entire image and video management pipeline.
3+
Cloudinary is a cloud service that offers a solution to a web application's entire image and video management pipeline.
44
With Cloudinary, all your images are automatically uploaded, normalized, optimized and backed-up in the cloud instead of being hosted on your servers.
55

66
With Cloudinary, you can stop messing around with image editors. Cloudinary can manipulate and transform your images online, on-the-fly, directly from your WordPress console. Enhance your images using every possible filter and effect you can think of. All manipulations are done in the cloud using super-powerful hardware, and all resulting images are cached, optimized (smushed and more) and delivered via a lightning fast content delivery network (CDN).
@@ -12,20 +12,18 @@ The plugin is publicly available at: [https://wordpress.org/plugins/cloudinary-i
1212

1313
This Git repository is the development repository, while there's a mirror public SVN repository of the actual released WordPress plugin version: [https://plugins.svn.wordpress.org/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/](https://plugins.svn.wordpress.org/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/)
1414

15-
1615
> **Deprecation Note**
17-
> The legacy WordPress Plugin version (v1.x) will be deprecated as of **February 1st, 2021**, after which support, updates and bug fixes for the legacy plugin will continue in limited fashion.
16+
> The legacy WordPress Plugin version (v1.x) will be deprecated as of **February 1st, 2021**, after which support, updates and bug fixes for the legacy plugin will continue in limited fashion.
1817
> The legacy plugin will be made obsolete on **August 1st, 2021** (end-of-life date), meaning, Version 1.x of the plugin will no longer function after that date.
19-
> We ask that you update to our latest WordPress Plugin v2.x before the August 1st deadline.
20-
18+
> We ask that you update to our latest WordPress Plugin v2.x before the August 1st deadline.
2119
2220
## Additional resources
2321

2422
Additional resources are available at:
2523

26-
* [Website](https://cloudinary.com)
27-
* [Documentation](https://cloudinary.com/documentation)
28-
* [Knowledge Base](https://support.cloudinary.com/hc/en-us)
24+
- [Website](https://cloudinary.com)
25+
- [Documentation](https://cloudinary.com/documentation)
26+
- [Knowledge Base](https://support.cloudinary.com/hc/en-us)
2927

3028
## Support
3129

@@ -37,6 +35,74 @@ Stay tuned for updates, tips and tutorials: [Blog](https://cloudinary.com/blog),
3735

3836
## Development
3937

38+
### Prerequisites
39+
40+
- [Node.js](https://nodejs.org/) v16+ (see `.nvmrc`)
41+
- [npm](https://www.npmjs.com/) v6.9+
42+
- [Composer](https://getcomposer.org/)
43+
- [Docker](https://www.docker.com/) (required for the WordPress local environment via `wp-env`)
44+
45+
### Local Development Setup
46+
47+
1. **Clone the repository:**
48+
49+
```bash
50+
git clone https://github.com/cloudinary/cloudinary_wordpress.git
51+
cd cloudinary_wordpress
52+
```
53+
54+
2. **Set the correct Node version** (if using [nvm](https://github.com/nvm-sh/nvm)):
55+
56+
```bash
57+
nvm install
58+
nvm use
59+
```
60+
61+
3. **Install dependencies:**
62+
63+
```bash
64+
npm install
65+
```
66+
67+
This will also run `composer install` automatically via the `postinstall` script, setting up PHP dependencies and linting tools.
68+
69+
4. **Start the local WordPress environment:**
70+
71+
Make sure Docker is running, then:
72+
73+
```bash
74+
npm run env:start
75+
```
76+
77+
This spins up a WordPress instance at [http://localhost:8888](http://localhost:8888) with the plugin activated and `WP_DEBUG` enabled. A loopback fix is applied automatically so REST API self-requests work inside the container.
78+
79+
5. **Build front-end assets:**
80+
81+
```bash
82+
npm run build # One-time production build
83+
npm run dev # Watch mode for development
84+
```
85+
86+
### Useful Commands
87+
88+
| Command | Description |
89+
| ---------------------- | ---------------------------------------- |
90+
| `npm run env:start` | Start the local WordPress environment |
91+
| `npm run env:stop` | Stop the local WordPress environment |
92+
| `npm run env:destroy` | Remove the local environment completely |
93+
| `npm run env:logs` | View container logs |
94+
| `npm run env:cli` | Run WP-CLI commands inside the container |
95+
| `npm run env:clean` | Reset the environment (removes all data) |
96+
| `npm run build` | Build front-end assets for production |
97+
| `npm run dev` | Build front-end assets in watch mode |
98+
| `npm run lint` | Run all linters (PHP, JS, CSS) |
99+
| `npm run lint:php` | Run PHP CodeSniffer |
100+
| `npm run lint:php:fix` | Auto-fix PHP linting issues |
101+
| `npm run lint:js` | Run ESLint on JavaScript files |
102+
| `npm run lint:js:fix` | Auto-fix JS linting issues |
103+
| `npm run lint:style` | Run stylelint on SCSS files |
104+
| `npm run i18n` | Generate translation files |
105+
40106
### Create a Plugin Release Package
41107

42108
Run `npm run package` to create the plugin release in the `/build` directory and package it as `cloudinary-image-management-and-manipulation-in-the-cloud-cdn.zip` in the root directory.

0 commit comments

Comments
 (0)