Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

44 changes: 29 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,45 @@ name: Plugin Template CI
on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: template-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
node:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up Node
uses: actions/setup-node@v4
with:
targets: wasm32-wasip1
node-version: 24
cache: npm

- name: Format
working-directory: PluginTemplate
run: cargo fmt --all -- --check
- name: Install dependencies
run: npm ci

- name: Lint
working-directory: PluginTemplate
run: cargo clippy --all-targets -- -D warnings
run: npm run lint

- name: Test
working-directory: PluginTemplate
run: cargo test
run: npm test

- name: Build
run: npm run build

- name: Pack plugin
run: |
mkdir -p dist
npm pack --pack-destination dist

- name: Build WASI module
working-directory: PluginTemplate
run: cargo build --target wasm32-wasip1 --bin hello-world-plugin
- name: Verify package
run: test -n "$(ls dist/*.tgz)"
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/dist
/target
/Cargo.lock
/bin
/node_modules
/tsconfig.tsbuildinfo
39 changes: 0 additions & 39 deletions ARCHITECTURE.md

This file was deleted.

11 changes: 0 additions & 11 deletions Cargo.toml

This file was deleted.

150 changes: 0 additions & 150 deletions PLANS.md

This file was deleted.

46 changes: 19 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
# PluginTemplate: Hello, World!

This folder is a starter template for building OpenVCS plugins.
This folder is a starter template for building OpenVCS plugins with the same SDK/runtime architecture used by the Git plugin.

It includes a single **WASI/Rust module** (`src/main.rs`) that prints a message when the plugin starts.
It keeps the behavior simple: when the plugin starts, it logs one line:

## Build (`.ovcsp`)
- `Hello, World from PluginTemplate!`

## Build

From `PluginTemplate/`, run:

```bash
cargo openvcs dist
npm install
npm run build
```

This bundles the plugin into `dist/*.ovcsp`.

If `cargo openvcs` is not installed, you can run the SDK packager directly:
## Validate

```bash
cargo run --manifest-path ../OpenVCS-SDK/Cargo.toml --bin openvcs-plugin -- --plugin-dir PluginTemplate --out PluginTemplate/dist
npm run lint
npm test
```

Notes:
- These plugins build for `wasm32-wasip1`. If needed: `rustup target add wasm32-wasip1`.

## What it does

- When enabled/loaded, it logs one line:
- `Hello, World from PluginTemplate!`

## Files
## What it contains

- `openvcs.plugin.json`: Plugin manifest (id + module exec).
- `Cargo.toml`, `src/main.rs`: Rust/WASI module executable.
- `package.json`: OpenVCS plugin manifest and npm scripts.
- `tsconfig.json`: TypeScript build settings for the plugin runtime.
- `src/plugin.ts`: plugin definition and startup hook.
- `test/plugin.test.ts`: basic smoke tests for the exported plugin contract.

## Customizing for your own plugin
## Customizing

1. Pick a new plugin id (example: `com.yourname.my-plugin`).
2. Update these in sync:
- `PluginTemplate/openvcs.plugin.json` (`id`, and any file names you change)
- `PluginTemplate/src/main.rs` (the startup message and any method names you add)
3. If you rename the module executable, update:
- `PluginTemplate/openvcs.plugin.json` → `module.exec`
- `PluginTemplate/Cargo.toml` → `[[bin]].name`
1. Change the `openvcs.id` in `package.json`.
2. Update the startup log line in `src/plugin.ts`.
3. Add more plugin behavior using the same `PluginDefinition` / `OnPluginStart()` entrypoint pattern.
12 changes: 0 additions & 12 deletions openvcs.plugin.json

This file was deleted.

Loading
Loading