feat(plugins): add plugin build/deploy/manage commands#9
Merged
Conversation
New `insurup plugins` command group: - init: scaffold a plugin project — interactive prompts (or flags) for id, language (ts|js), package manager (bun|npm|pnpm|yarn), and bundler (bun|esbuild) - build / deploy: run the project's own package.json `build` script (with the chosen/detected package manager), then Jint-safety-scan + zip the output and (for deploy) upload via @insurup/sdk, optionally activate + set config - list / get / logs / activate / enable / disable / config / priority The bundler is the plugin project's choice (not hardcoded) — the CLI orchestrates `<pm> run build`. Zipping uses fflate; a select/text prompt helper backs init. Depends on InsurUp/ts-toolkit#71 (the @insurup/sdk plugin endpoints). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2c2e89c to
7f0ba78
Compare
… SDK
- add `insurup plugins remove <id>` (client.plugins.deletePlugin), mirroring the
disable command, for the new backend DELETE /plugins/{id}
- the logs hook filter passed `hookName`; the SDK option was renamed to `hook`
(a PluginHook). Pass `{ hook }` and import the PluginHook type.
Verified against a local @insurup/sdk build that has the plugin client: tsc 0
errors, biome clean. NOTE: CI stays red until @insurup/sdk is published with the
plugin client (ts-toolkit#71) and this PR bumps the dependency + regenerates the
frozen lockfile.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unblocks the plugin commands: 0.1.35 (ts-toolkit#71) ships InsurUpPluginClient with deletePlugin and the UPPER_SNAKE plugin enums. Regenerates the lockfile, fixing the frozen-lockfile CI failure. typecheck / biome / 243 tests / build all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
insurup pluginscommand group to author, deploy, and manage server-side plugins from the terminal — reusing the CLI's existing browser/M2M auth, output, and session.Commands
plugins init <dir>--id,--language(ts/js),--package-manager(bun/npm/pnpm/yarn),--bundler(bun/esbuild)plugins build <dir>buildscript (via the chosen/detected PM) -> Jint-safety scan -> zip ->dist/<id>.zipplugins deploy <dir> [--activate] [--config ...]plugins list / get / logsplugins activate / enable / disable / config / priorityDesign
build/deployrun<pm> run build(the project'spackage.jsonscript —bun build,esbuild, ...), then zip the output. The CLI never hardcodes a bundler. Zipping usesfflate.initis interactive (aselect/textprompt helper) with flags for non-interactive/CI use; non-TTY falls back to defaults (ts/bun/bun).deployactivates before configuring (config validates against the active version) and re-fetches detail so its output reflects final state.init/buildrun locally (no auth); everything else uses the standardwithClientsession.Verified end-to-end (local stack,
@insurup/sdkviabun link)auth login --m2m-> token (client-credentials, scopecore-api)init->deploy --activate --config '{"greeting":"Hola"}'-> v1.0.0 -> triggeredcustomer.updated->plugins logsshowsoutcome 0, "Hola from the plugin"; new-version flow (1.1.0) also verifiedinit --language js --bundler esbuild->buildruns the project's esbuild script -> zip produced; scaffold has no tsconfig +esbuilddevDep only🤖 Generated with Claude Code