Skip to content

v2.1.0

Latest

Choose a tag to compare

@gfazioli gfazioli released this 25 Sep 12:14

The bones CLI gets sturdier: it runs from any folder, renames only what it has to, updates the framework without removing it first, and the commands it generates behave as their names say.

bones

  • Runs from any folder. Up to 2.0.12 bones read the plugin's namespace file, readme.txt and its stubs against the shell's directory, so php my-plugin/bones <anything> stopped with a TypeError. It now moves into the plugin first, and custom commands find WordPress from there too. A relative deploy path still means the folder it was typed in, and a plugin symlinked into wp-content/plugins still finds WordPress (#117).
  • rename writes only what changes. It used to rewrite every file of the plugin and corrupt compiled .mo catalogues: a longer plugin id shifts their strings while the offset table stays put. Files with a NUL byte are now left alone. rename --update, which Composer runs after every install, now renames vendor/ only: in a renamed plugin with an index.php in its root, it used to move that file over the main plugin file. The language files are renamed by the rename itself, --reset included, and Domain Path: /languages (with the slash) is found.
  • update no longer deletes the framework first. It removed vendor/wpbones/wpbones and then ran a full composer update, so a failing Composer left the plugin with no framework. It now runs composer update wpbones/wpbones --with-dependencies, the framework and what it needs, and exits with Composer's status. For every package, run composer update.
  • The migrated format:check checks. wp-scripts format drops --check and always writes, so the "check" reformatted the plugin, compiled bundles included, and exited 0. migrate:to-v2 now writes prettier --check on the same files, a .prettierignore (public/, vendor/, Composer's files, the translation JSON) so that format leaves the bundles alone too, and prettier as wp-prettier, which pnpm 12 needs to find the binary.
  • Every generated widget is its own. make:widget gave every widget of a plugin the id_base <plugin-id>-demo-widget, so a second widget shared the first one's settings, and the description sat under a misspelled key. make:widget Shop/RecentPosts now writes <plugin-id>-shop-recent-posts, a name and a description.

The boilerplates carry the new format:check, and their sources pass it.

Upgrading

composer update wpbones/wpbones. One behaviour to know: php bones update updates the framework and its dependencies, not every package of the plugin. Plugins migrated before 2.1.0 still have "format:check": "wp-scripts format --check": replace it as described in package.json.

Full Changelog: v2.0.12...v2.1.0