NPM Scripts
The project includes three main npm scripts defined inpackage.json:
Script Details
| Script | Command | Description |
|---|---|---|
serve | vite | Starts the Vite development server on port 5173 |
build | vite build | Builds the production bundle |
release | vite build && sh scripts/release.sh $npm_package_version | Builds and packages the plugin for distribution |
Build Process
Run the Build Command
Execute the build script to create a production bundle:This uses Vite to bundle the application with optimizations.
Vite Compilation
Vite processes the source files:
- Compiles TypeScript to JavaScript
- Bundles Vue components
- Processes Python files using
designerPythonLoader - Minifies and optimizes assets
- Generates source maps
Asset Copying
The build process automatically copies plugin metadata files:This ensures the plugin icon and metadata are included in the output.
Vite Configuration
The build process is configured invite.config.mts:
Key Configuration Options
base: './' - Uses relative URLs so the plugin works when hosted in DesignerdesignerPythonLoader() - Vite plugin that processes Python files and makes them importable from TypeScripthost: '0.0.0.0' - Allows the dev server to be accessible from outside the containerRelease Process
Run the Release Script
Create a release package with the current version from This runs the build and then executes
package.json:scripts/release.sh with the package version.Package Creation
The release script (This creates a zip file named
scripts/release.sh) packages the build:liveupdate_tester_v{VERSION}.zip.The release zip can be extracted directly to the
plugins folder of a Designer project. The plugin will appear in the plugin launcher.Plugin Structure
d3plugin.json
The plugin metadata file defines the plugin configuration:name- Display name shown in the Designer plugin launcherrequiresSession- Set totrue, requiring an active Designer session to run
icon.svg
The plugin icon displayed in the Designer plugin launcher. This SVG file is copied to the dist folder during the build.Dependencies
The project relies on two key packages from the disguise-one organization:@disguise-one/vue-liveupdate
useLiveUpdatecomposable for creating connectionsLiveUpdateOverlaycomponent for connection statususeSubscriptionVisibilityfor pausing subscriptions when not visible
@disguise-one/designer-pythonapi
designerPythonLoaderVite plugin for processing.pyfiles- Runtime for executing Python modules in Designer
- Type definitions for Python module imports
Build Artifacts
After a successful build, thedist/ directory contains:
| File/Directory | Description |
|---|---|
index.html | Entry point HTML file with asset references |
assets/ | Bundled and minified JavaScript and CSS files |
icon.svg | Plugin icon for Designer launcher |
d3plugin.json | Plugin metadata and configuration |
The asset filenames include content hashes (e.g.,
index-a1b2c3d4.js) for cache busting.Troubleshooting
Build Fails with Python Errors
Ensure the@disguise-one/designer-pythonapi package is installed correctly:
Missing Assets in dist/
Verify thaticon.svg and d3plugin.json exist in the project root before building.