New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jag-k/rollup-plugin-scriptable

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jag-k/rollup-plugin-scriptable

Create a Scriptable bundle from your project

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
Maintainers
1
Weekly downloads
 
Created
Source

Rollup Plugin Scriptable

NPM Main version License Install size

Create a Scriptable bundle from your project

Installation

npm i -D @jag-k/rollup-plugin-scriptable

Usage

// rollup.config.js
import scriptableBundle from "@jag-k/rollup-plugin-scriptable";
import * as config from "./config.json";

export default {
  input: 'src/index.js',
  output: [
    {
      file: `dist/widget.js`,
      format: 'es',
      plugins: [scriptableBundle(config)]
    }
  ]
};
// config.json
{
  "always_run_in_app": false,
  "icon": {
    "color": "blue",
    "glyph": "users"
  },
  "name": "Widget",
  "share_sheet_inputs": []
}

After build, you will get 2 files:

dist
├── HASS Persons.js
└── HASS Persons.scriptable

In .js file added banner for Scriptable app.

.scriptable file contains bundle for Scriptable app. This is config.json file with script key which value is compiled code.

Quick Tips

You can use rollup-plugin-copy to copy files to iCloud for easy development and debugging Scriptable scripts.

// rollup.config.js
import { homedir } from 'os';
import scriptableBundle from '@jag-k/rollup-plugin-scriptable';
import copy from 'rollup-plugin-copy';
import * as config from './config.json';

export default {
  input: 'src/main.js',
  output: [
    {
      file: `dist/${config.name}.js`,
      format: 'es',
      plugins: [scriptableBundle(config)]
    },
  ],
  plugins: process.env.COPY_TO_ICLOUD === 'true' ? [
    copy({
      hook: 'writeBundle',
      targets: [
        {
          src: `dist/*.js`,
          dest: `${homedir()}/Library/Mobile Documents/iCloud~dk~simonbs~Scriptable/Documents/`
        },
      ]
    })
  ] : []
};

License

Apache 2.0

Keywords

FAQs

Package last updated on 14 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc