Gathering detailed insights and metrics for esbuild-plugin-scriptable
Gathering detailed insights and metrics for esbuild-plugin-scriptable
Gathering detailed insights and metrics for esbuild-plugin-scriptable
Gathering detailed insights and metrics for esbuild-plugin-scriptable
npm install esbuild-plugin-scriptable
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
1
An ESBuild plugin for developing Scriptable iOS app scripts with modern JavaScript tooling.
1npm install esbuild-plugin-scriptable --save-dev
1pnpm add esbuild-plugin-scriptable --save-dev
1yarn add esbuild-plugin-scriptable --dev
1import {build} from 'esbuild'; 2import {scriptableBanner, scriptableDeploy} from 'esbuild-plugin-scriptable'; 3 4await build({ 5 entryPoints: ['src/widget.ts'], 6 outfile: 'dist/widget.js', 7 bundle: true, 8 plugins: [ 9 scriptableBanner({ 10 warnOnMissingManifest: true, 11 patterns: '**/*.widget.ts', 12 }), 13 scriptableDeploy({ 14 logLevel: 'verbose', 15 patterns: '**/*.widget.ts', 16 }), 17 ], 18});
manifestExtensions
: Custom manifest file extensions (default: ['.manifest.json', '.manifest', '.json'])warnOnMissingManifest
: Show warning when manifest file is missing (default: true)warnOnInvalidManifest
: Show warning when manifest file is invalid (default: true)warnOnMissingEntry
: Show warning when no matching entry point is found (default: true)getManifestPath
: Custom manifest file path mapping functionpatterns
: Source file patterns to match entry points (default: ['**/*.{ts,tsx,js,jsx}'])
'**/*.widget.ts'
- only process widget source files['**/*.ts', '!**/*.test.ts']
- exclude test fileslogLevel
: Control logging detail (default: 'auto')
logLevel
: Control deployment logging detail (default: 'normal')
continueOnError
: Continue building when deployment fails (default: true)scriptableDir
: Custom Scriptable directory path (default: auto-detect in iCloud Drive)patterns
: Source file patterns to match entry points (default: ['**/*.{ts,tsx,js,jsx}'])
'**/*.widget.ts'
- only deploy widget source files['**/*.ts', '!**/*.test.ts']
- exclude test filesaddBanner
: Whether to add Scriptable banner from manifest (default: true)manifestExtensions
: Custom manifest file extensions (default: ['.manifest.json', '.manifest', '.json'])The manifest file can be used to configure both the script metadata and the output filename:
1{ 2 "name": "weather-widget", 3 "alwaysRunInApp": true, 4 "shareSheetInputs": ["file-url", "url"], 5 "iconColor": "blue", 6 "iconGlyph": "cloud", 7 "version": "1.0.0", 8 "description": "A weather widget for Scriptable" 9}
When a manifest includes a name
property:
weather-widget.js
)1import {build} from 'esbuild'; 2import {scriptableBanner, scriptableDeploy} from 'esbuild-plugin-scriptable'; 3 4await build({ 5 entryPoints: ['src/widget.ts'], 6 outfile: 'dist/widget.js', 7 bundle: true, 8 plugins: [ 9 scriptableBanner({ 10 warnOnMissingManifest: true, 11 patterns: ['**/*.ts', '!**/*.test.ts'], 12 getManifestPath: entryPath => { 13 return entryPath.replace(/\.ts$/, '.manifest.json'); 14 }, 15 }), 16 scriptableDeploy({ 17 logLevel: 'verbose', 18 addBanner: true, 19 patterns: ['**/*.ts', '!**/*.test.ts'], 20 scriptableDir: '/custom/path/to/Scriptable', 21 }), 22 ], 23});
The banner can be added in two stages:
Build stage (via scriptableBanner
plugin):
Deploy stage (via scriptableDeploy
plugin's addBanner
option):
When using both plugins:
scriptableBanner
will add banner to build outputscriptableDeploy
with addBanner: true
will update/override the banner in deployed filesscriptableDeploy
with addBanner: false
will keep the existing banner (if any)1// Example 1: Banner in both build output and deployed files 2plugins: [ 3 scriptableBanner({...}), // Adds banner to build output 4 scriptableDeploy({ 5 addBanner: true // Updates banner in deployed files 6 }) 7] 8 9// Example 2: Banner only in deployed files 10plugins: [ 11 scriptableDeploy({ 12 addBanner: true // Adds banner only to deployed files 13 }) 14] 15 16// Example 3: Banner only in build output 17plugins: [ 18 scriptableBanner({...}), // Adds banner to build output 19 scriptableDeploy({ 20 addBanner: false // Keeps existing banner in deployed files 21 }) 22]
The addBanner
option in scriptableDeploy
:
true
, will ensure the latest banner from manifest is used in deployed filesfalse
, will preserve any existing banner in the filesApache-2.0
No vulnerabilities found.
No security vulnerabilities found.