Code Monkey home page Code Monkey 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

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

skpm's People

Contributors

mathieudutour avatar everlof avatar jemgold avatar

Watchers

 avatar James Cloos 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.