diff --git a/templates/frontend-vue/.github/workflows/release.yml b/templates/frontend-vue/.github/workflows/release.yml index e232c16..a1ad252 100644 --- a/templates/frontend-vue/.github/workflows/release.yml +++ b/templates/frontend-vue/.github/workflows/release.yml @@ -3,10 +3,6 @@ name: 🚀 Release on: workflow_dispatch: -env: - NODE_VERSION: 20 - PNPM_VERSION: 9 - jobs: release: name: Release @@ -25,16 +21,11 @@ jobs: - name: Checkout project uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - run_install: true + - name: Install dependencies + run: pnpm install - name: Build package run: pnpm build diff --git a/templates/frontend-vue/.github/workflows/validate.yml b/templates/frontend-vue/.github/workflows/validate.yml index e303f6b..bc943f4 100644 --- a/templates/frontend-vue/.github/workflows/validate.yml +++ b/templates/frontend-vue/.github/workflows/validate.yml @@ -10,10 +10,6 @@ concurrency: group: validate-${{ github.ref_name }} cancel-in-progress: true -env: - CAIDO_NODE_VERSION: 20 - CAIDO_PNPM_VERSION: 9 - jobs: typecheck: name: 'Typecheck' @@ -22,17 +18,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.CAIDO_NODE_VERSION }} + uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v3.0.0 - with: - version: ${{ env.CAIDO_PNPM_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - name: Install dependencies run: pnpm install @@ -48,15 +37,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.CAIDO_NODE_VERSION }} - - - name: Setup pnpm - uses: pnpm/action-setup@v4.1.0 - with: - version: ${{ env.CAIDO_PNPM_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - name: Install dependencies run: pnpm install @@ -72,15 +54,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.CAIDO_NODE_VERSION }} - - - name: Setup pnpm - uses: pnpm/action-setup@v4.1.0 - with: - version: ${{ env.CAIDO_PNPM_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - name: Install dependencies run: pnpm install diff --git a/templates/frontend-vue/.gitignore b/templates/frontend-vue/.gitignore index 0ca39c0..34c69bb 100644 --- a/templates/frontend-vue/.gitignore +++ b/templates/frontend-vue/.gitignore @@ -1,3 +1,4 @@ node_modules dist .DS_Store +mise.local.toml diff --git a/templates/frontend-vue/README.md b/templates/frontend-vue/README.md index f619cca..cf4aec9 100644 --- a/templates/frontend-vue/README.md +++ b/templates/frontend-vue/README.md @@ -4,7 +4,20 @@ This template should be used as a starting point for creating a new plugin with ## Features +- [mise](https://mise.jdx.dev/) to manage the Node.js and pnpm toolchain - [pnpm](https://pnpm.io/) as package manager - [TypeScript](https://www.typescriptlang.org/) - [VueJS](https://vuejs.org/) - [PrimeVue](https://primevue.org/) for UI components + +## Getting Started + +The Node.js and pnpm versions are pinned in [`mise.toml`](./mise.toml). Install them once with mise, then build: + +```bash +mise install # installs the pinned Node.js and pnpm +pnpm install +pnpm build +``` + +CI uses the same `mise.toml`, so your local and CI toolchains stay in sync. diff --git a/templates/frontend-vue/mise.toml b/templates/frontend-vue/mise.toml new file mode 100644 index 0000000..d025f7a --- /dev/null +++ b/templates/frontend-vue/mise.toml @@ -0,0 +1,3 @@ +[tools] +node = '24' +pnpm = '10.20.0' diff --git a/templates/no-frontend/.github/workflows/release.yml b/templates/no-frontend/.github/workflows/release.yml index e232c16..a1ad252 100644 --- a/templates/no-frontend/.github/workflows/release.yml +++ b/templates/no-frontend/.github/workflows/release.yml @@ -3,10 +3,6 @@ name: 🚀 Release on: workflow_dispatch: -env: - NODE_VERSION: 20 - PNPM_VERSION: 9 - jobs: release: name: Release @@ -25,16 +21,11 @@ jobs: - name: Checkout project uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - run_install: true + - name: Install dependencies + run: pnpm install - name: Build package run: pnpm build diff --git a/templates/no-frontend/.github/workflows/validate.yml b/templates/no-frontend/.github/workflows/validate.yml index e303f6b..bc943f4 100644 --- a/templates/no-frontend/.github/workflows/validate.yml +++ b/templates/no-frontend/.github/workflows/validate.yml @@ -10,10 +10,6 @@ concurrency: group: validate-${{ github.ref_name }} cancel-in-progress: true -env: - CAIDO_NODE_VERSION: 20 - CAIDO_PNPM_VERSION: 9 - jobs: typecheck: name: 'Typecheck' @@ -22,17 +18,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.CAIDO_NODE_VERSION }} + uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v3.0.0 - with: - version: ${{ env.CAIDO_PNPM_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - name: Install dependencies run: pnpm install @@ -48,15 +37,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.CAIDO_NODE_VERSION }} - - - name: Setup pnpm - uses: pnpm/action-setup@v4.1.0 - with: - version: ${{ env.CAIDO_PNPM_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - name: Install dependencies run: pnpm install @@ -72,15 +54,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.CAIDO_NODE_VERSION }} - - - name: Setup pnpm - uses: pnpm/action-setup@v4.1.0 - with: - version: ${{ env.CAIDO_PNPM_VERSION }} + - name: Setup mise + uses: jdx/mise-action@v2 - name: Install dependencies run: pnpm install diff --git a/templates/no-frontend/.gitignore b/templates/no-frontend/.gitignore index 0ca39c0..34c69bb 100644 --- a/templates/no-frontend/.gitignore +++ b/templates/no-frontend/.gitignore @@ -1,3 +1,4 @@ node_modules dist .DS_Store +mise.local.toml diff --git a/templates/no-frontend/README.md b/templates/no-frontend/README.md index 96d50c9..bd2c137 100644 --- a/templates/no-frontend/README.md +++ b/templates/no-frontend/README.md @@ -4,5 +4,18 @@ This template should be used as a starting point for creating a new plugin with ## Features +- [mise](https://mise.jdx.dev/) to manage the Node.js and pnpm toolchain - [pnpm](https://pnpm.io/) as package manager - [TypeScript](https://www.typescriptlang.org/) + +## Getting Started + +The Node.js and pnpm versions are pinned in [`mise.toml`](./mise.toml). Install them once with mise, then build: + +```bash +mise install # installs the pinned Node.js and pnpm +pnpm install +pnpm build +``` + +CI uses the same `mise.toml`, so your local and CI toolchains stay in sync. diff --git a/templates/no-frontend/mise.toml b/templates/no-frontend/mise.toml new file mode 100644 index 0000000..d025f7a --- /dev/null +++ b/templates/no-frontend/mise.toml @@ -0,0 +1,3 @@ +[tools] +node = '24' +pnpm = '10.20.0' diff --git a/templates/shared/skills/caido-plugin-development/SKILL.md b/templates/shared/skills/caido-plugin-development/SKILL.md index c65eb87..ceccc8e 100644 --- a/templates/shared/skills/caido-plugin-development/SKILL.md +++ b/templates/shared/skills/caido-plugin-development/SKILL.md @@ -42,6 +42,16 @@ Plugins are described by a `caido.config.ts` file that declares each sub-plugin - Frontend plugins create pages, UI components, and handle user interactions. - Backend plugins register API endpoints (and can emit events) that the frontend consumes. +## Toolchain (mise) + +This plugin pins its Node.js and pnpm versions with [mise](https://mise.jdx.dev/) in `mise.toml` at the repo root. **Use mise** so you build and run with the exact toolchain CI uses — don't rely on a globally-installed Node/pnpm: + +- Install the pinned tools once with `mise install`. +- Run package scripts through the mise-managed toolchain. Either activate mise in your shell (so `pnpm ...` resolves to the pinned version) or prefix commands with `mise exec --`, e.g. `mise exec -- pnpm install`, `mise exec -- pnpm build`. +- `mise.toml` is the single source of truth for tool versions — CI reads it too (via `jdx/mise-action`). If a version needs to change, edit `mise.toml`; don't hardcode versions elsewhere. + +Package scripts (run with pnpm under the mise toolchain): `build`, `watch`, `typecheck`, `lint`, `knip`. + ## Plugin API Contract (the `shared` package) The contract lives in `shared` and is consumed by both sides. The current SDK builds it from `@caido/sdk-shared`'s `DefinePluginPackageSpec`.