Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/skpmPublic

💎📦 A utility to build and publish Sketch plugins

License

NotificationsYou must be signed in to change notification settings

skpm/skpm

Repository files navigation


A utility to create, build and publishsketch plugins.

Installation

Important:Node.js > V6.x is a minimum requirement. You also need thecommand line tools installed.

npm install -g skpm

Usage

skpm create my-plugin

The above command pulls the template fromskpm/skpm, prompts for some information, and generates the project at ./my-plugin/.

Create a new plugin

skpm create<plugin-name>--name        The plugin display name.--cwd         A directory to use instead of$PWD.--force       Force option to create the directoryfor the new app. [boolean] [default: false]--template    The repository hosting the template to start from.    [string]  [default: skpm/skpm]--git         Initialize version control using git.                 [boolean] [default: true]--install     Installs dependencies.                                [boolean] [default: true]
A note on templates

The purpose of official skpm plugin templates are to provide opinionated development tooling setups so that users can get started with actual plugin code as fast as possible. However, these templates are un-opinionated in terms of how you structure your plugin code and what libraries you use in addition to skpm.

Current available official templates include:

💁 Tip: Any Github repo with a 'template' folder can be used as a custom template:skpm create <project-name> --template=<username>/<repository>

Build the plugin

Once the installation is done, you can run some commands inside the project folder:

npm run build

To watch for changes:

npm run watch

Additionally, if you wish to run the plugin every time it is built:

npm run start

View the plugin's log

To view the output of yourconsole.log, you have a few different options:

  • Use thesketch-dev-tools
  • OpenConsole.app and look for the sketch logs
  • Look at the~/Library/Logs/com.bohemiancoding.sketch3/Plugin Output.log file

Skpm provides a convenient way to do the latter:

skpm log  -f, -F        The`-f` option causes tail to not stop when end of file is                reached, but rather towaitfor additional data to be appended                to the input.                       [boolean] [default:"false"]  --number, -n  Shows`number` lines of the logs.                       [number]

Publish the plugin on the registry

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

skpm publish<new-version>| major| minor| patch| premajor| preminor| prepatch| prerelease  --repo-url          Specify the repository URL (default to the one specifiedin package.json).                                 [string]  --skip-release      Do not create a release on GitHub.com.           [boolean]  --open-release, -o  Open the newly created release on GitHub.com.    [boolean]  --skip-registry     Do not publish to the plugins registryif not already                      present.                                         [boolean]  --download-url      Specify the new version's download URL (default to the                      asset of the release created on GitHub.com).      [string]

The exact order of execution (without options) is as follows:

  • Run thepreversion script
  • Bumpversion in package.json as requested (patch,minor,major, etc).
  • Run theversion script
  • Commit and tag
  • Run thepostversion script.
  • Run theprepublish orbuild script
  • Zip the folder specified in themain field
  • Create a draft release on GitHub
  • Upload the zip to GitHub
  • Publish the release
  • Remove the zip
  • Check thesketchplugins/plugin-directory repo to see if the plugin is already there. If not, open a PR to add it.

License

MIT


[8]ページ先頭

©2009-2025 Movatter.jp