@jolter/jdt
v0.2.0
Published
Development toolkit for Jolter plugins.
Readme
Jolter Development Toolkit
@jolter/jdt provides the jdt CLI for building, validating,
running, and packaging Jolter plugins.
Quick Start
npm install -D @jolter/jdt
npx jdt init
npx jdt build
npx jdt run list-tools
npx jdt run resolve-tool example latest
npx jdt pack --version 1.0.0jdt pack writes:
dist/plugin.wasmdist/plugin.release.jsondist/checksums.txt
Commands
jdt init
jdt build
jdt build --wasm ./prebuilt.wasm
jdt manifest --version 1.2.3
jdt validate
jdt pack --version 1.2.3
jdt run list-tools
jdt run resolve-tool <tool> <selector> --os linux --arch x64
jdt run validate-installed <tool> <version> <root>jdt build uses Bytecode Alliance jco componentize with
@bytecodealliance/componentize-js. Componentization currently requires
Node.js even when the rest of the toolkit is run with Bun. It fails if
compilation fails. Use --wasm only when
intentionally packaging a prebuilt artifact.
jdt run executes the local TypeScript/JavaScript plugin API and validates the
returned shape. It is a developer runner, not Jolter's production sandbox.
Plugin API
Plugins export these functions from src/plugin.ts or src/plugin.js:
import type { Platform, Tool, ToolRelease } from "jolter-development-toolkit/types/plugin-api";
export function listTools(): Tool[] {
return [{ name: "example", commands: ["example"] }];
}
export function resolveTool(tool: string, selector: string, platform: Platform): ToolRelease {
return {
version: "1.0.0",
url: `https://example.com/${tool}-${platform.os}-${platform.arch}.tar.gz`,
sha256: "0".repeat(64),
archiveFormat: "tar.gz",
stripComponents: 1,
commands: [tool],
};
}
export function validateInstalled(tool: string, version: string, root: string): boolean {
return true;
}Examples
examples/hello-tool: deterministic fixture used by tests.examples/github-release-tool: demonstrates GitHub release-style artifact URLs and network permission metadata without live network calls.
Development
bun install
bun test
bun run format:checkSee CONTRIBUTING.md for contribution guidelines and local development notes.
Releases
Publishing is handled by GitHub Actions and npm Trusted Publishing. To publish:
- Update
package.jsonandCHANGELOG.md. - Open and merge a pull request.
- Create a GitHub release whose tag matches the package version, for example
v1.0.0.
When the release is published, .github/workflows/npm-publish.yml verifies the
package and publishes it to npm with provenance using OIDC.
