Skip to content
Merged
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
20 changes: 20 additions & 0 deletions content/bones-console/bones-console.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ Three directories are never consulted, because your repository's ignore rules do

Use `--keep-ignored` when an ignored file really does belong in the package. If the plugin is not a git repository, nothing is filtered.

#### Test suites

Since `v3.2.0` the deploy leaves your plugin's tests out of the package:

- the PHP suite, where PHPUnit looks for it: `tests/`, `phpunit.xml`, `phpunit.xml.dist` and `phpunit.dist.xml`;
- `jest.config.js` and `jest.config.json`;
- every `__tests__` folder, and every `*.test.*` or `*.spec.*` script (`.ts`, `.tsx`, `.js`, `.jsx`) outside `vendor/` and `node_modules/`: the files the `jest.config.js` written by `migrate:to-v2` runs, together with the `__snapshots__` and `__mocks__` folders Jest keeps beside them.

The last ones matter with `--wp`, which keeps `resources/assets`: up to `v3.1.0` every Jest test in there went to WordPress.org with the scripts beside it, unless your `deploy.php` listed it. The cache PHPUnit writes, `.phpunit.cache`, never shipped, because the deploy skips every file and folder whose name starts with a dot. PHPUnit itself and the rest of your `require-dev` tree are removed as the next section explains.

If your `composer.json` loads a file from `tests/` through `autoload-dev`'s `files`, the deploy stops and names it, rather than produce a plugin that fails as it loads. That only happens when the development autoloader reaches the package, with `--keep-dev` or with no `require-dev` package installed: move the file out of `autoload-dev`, or keep it in the package.

If your plugin really ships one of these paths, take it out of the default list in `deploy.php`:

```php copy
add_filter('wpbones_console_deploy_default_skip_files_folders', function ($skip) {
return array_values(array_diff($skip, ['/tests']));
});
```

#### Composer dev packages

The deploy copies `vendor/` as it is on disk, and a working copy normally has the `require-dev` tree installed — PHPUnit, Brain Monkey and the like. Up to `v2.0.6` all of it went into the package, WordPress.org included, unless your `deploy.php` ran `composer install --no-dev` itself.
Expand Down