# AltPilot

This is a guide for setting up a development environment for WordPress plugins using the AltPilot.
Your computer should have Node.js and npm installed. If you don't have them installed, you can download them from [Node.js official website](https://nodejs.org/).

## Getting Started

1. Project used FontAwesome PRO icons and requires a key for it. Create a file `.npmrc` in the root of the project and add your FontAwesome PRO key:
```bash
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
```
Replace `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` with your actual FontAwesome PRO key. You can get it from your FontAwesome account.

2. Install package dependencies:
```bash
npm install
```

3. Run gulp task depends on your needs:

| Task                     | Description                                                             | 
|--------------------------|-------------------------------------------------------------------------|
| `gulp build`             | Build the plugin core assets for production.                            |
| `gulp watch`             | Watch for changes in the plugin files and rebuild automatically.        |
| `gulp makeZip`           | Create a zip file of the plugin for distribution.                       |
| `gulp buildMediaLibrary` | Build the media library assets for the plugin.                          |
| `gulp devMediaLibrary`   | Watch for changes in the media library files and rebuild automatically. |


## Translations

Please fill package.json with your plugin details before running any command. Use name from package as slug and text domain.

#### Important
For translations `WP CLI` must me installed globally. Available commands: [https://developer.wordpress.org/cli/commands/language/]() You can install WP-CLI globally with the following steps:

1. Download and install WP-CLI globally using the following command:
```bash
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
```

2. Make it executable:

```bash
chmod +x wp-cli.phar
```

3. Move it to a directory in your PATH (for global access):

```bash
sudo mv wp-cli.phar /usr/local/bin/wp
````

4. You can now verify the installation by typing:

```bash
wp --info
```
