Git Product home page Git Product logo

skpm's Introduction

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

I'm a plugin developer

Documentation

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

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:

  • skpm.main: pointing to your .sketchplugin
  • skpm.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

To watch for changes:

skpm build --watch

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

  • version
  • name
  • description
  • homepage
  • appcast

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
  • Check the sketchplugins/plugin-directory repo to see if the plugin is already there. If not, open a PR to add it.

License

MIT

skpm's People

Contributors

mathieudutour avatar jemgold avatar stwind avatar mcansh avatar bomberstudios avatar everlof avatar markdalgleish avatar kannonboy avatar marionebl avatar

Watchers

James Cloos avatar Sam Daitzman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.