node package manager

skpm

A utility to transpile JavaScript to CocoaScript

ūüíéūüď¶ skpm - Sketch Plugin Manager

A utility to build, publish, install and manage sketch plugins.

Installation

npm install -g skpm

The npm command-line tool is bundled with Node.js. If you have it installed, then you already have npm too. If not, go download Node.js.

Usage

I'm a sketch user

Installing a plugin

To install a sketch plugin:

skpm install name-of-the-plugin

Uninstalling a plugin

To uninstall a sketch plugin:

skpm uninstall name-of-the-plugin

Search for plugins

To search for a sketch plugin:

skpm search query

I'm a plugin developer

Scaffold the architecture of a new plugin

To interactively create the architecture to start developing a new plugin (see the sketch documentation for more information):

skpm init

This will create:

  • a package.json file
  • a src folder with:
    • a manifest.json file
    • a command.js file for an example of command
  • a .gitignore file if non-existent

The package.json must contain 3 specific fields:

  • main: pointing to your .sketchplugin
  • manifest: pointing to your manifest.json (src/manifest.json by default)
  • repository: pointing to your github repository

Build the plugin

To transpile the JavaScript to CocoaScript and copy the manifest.json to the .sketchplugin:

skpm build

Additionally, some fields from the package.json will be set in the manifest.json (if not present):

  • version
  • name
  • description
  • homepage

Symlinking the local plugin to the sketch plugins folder

skpm link path-to-local-plugin

It will also ask you if you want to disable the caching mechanism and force Sketch to always reload a Plugin’s code from disk (recommended when developing).

Publish the plugin on the registry

To publish a new version of the plugin to the registry:

skpm publish <newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease

The exact order of execution is as follows:

  • Run the preversion script
  • Bump version in package.json as requested (patch, minor, major, etc).
  • Run the version script
  • Commit and tag
  • Run the postversion script.
  • Run the build script
  • Zip the folder specified in the main field
  • Create a draft release on GitHub
  • Upload the zip to GitHub
  • Publish the release
  • Remove the zip
  • Notify the registry

License

MIT