Just a quick one, I’ve just updated the Known dev tools with a new script – plugin.php.

There’s currently only one function available enable-composer which, following my last post, provides a handy script for making your plugin composer installable.

Run the script, passing it the repository you’ve saved it as (so that the script can set the packagist headers correctly), and you’ll get an updated / new composer.json with all the appropriate values set.

You can optionally set whether the plugin is a straight plugin, theme or console plugin (known-plugin is default). You can also target directories other than the current directory, although realistically you’re never really going to run it from any other directory.

Enjoy!

» Visit the project on Github...

Just a quick one.

I’ve added a library, which hopefully will help Known development. I’ll be adding to this library as I go, but for now there’s a version manipulation tool.

I got sick of modifying version details in the various files related to Known and their plugins, so I wrote a quick tool.

version.php will allow you to bump patch, minor and major numbers, as well as maintain the build number.

I’m probably going to be running this from a commit script from now on. Hopefully this will be of some use to you!

» Visit the project on Github...

The recent move to Composer for Known (and eventually Known plugins) has given me the opportunity to improve the experience for plugin developers.

Previously, generating a .pot file for languages would require a script in Known’s central language directory. This meant all sorts of “relative path” hijinks in your Gruntfile.js, and was generally bad.

So, I’ve taken this opportunity to package up the script into its own project that can be installed via composer as a development dependency into your plugin project.

How to use

  1. Create your CoolProject, and add your translation string hooks, and load them as described here.
  2. In your project, add known-language-tools as a dependency using composer require mapkyca/known-language-tools --dev
  3. In the project directory you’ll find a Sample.package.json file. Copy this to your project root as package.json and edit accordingly. Note your project name should be the name of your project.
  4. In the project directory, you’ll find a Sample.Gruntfile.js. Again, copy this into your project root.
  5. Create a languages directory
  6. Run the grunt task, grunt build-lang (if grunt isn’t found, npm install --only=dev first.

Hope this is useful to you!

» Visit the project on Github...