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
63 changes: 57 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,52 @@ jobs:

windows:
runs-on: windows-latest
timeout-minutes: 30
timeout-minutes: 45

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.4

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Cache node_modules
uses: actions/cache@v4
with:
path: |
node_modules
examples/*/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
examples/*/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -217,16 +258,26 @@ jobs:
- name: Cargo check Windows
run: cargo check --target x86_64-pc-windows-msvc

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.4

- name: Install dependencies
run: pnpm install

- name: TypeScript check
run: pnpm check

# Plugin lib test exe hits 0xc0000139 (STATUS_ENTRYPOINT_NOT_FOUND) on GHA Windows.
# Hub/PTY coverage stays on Ubuntu/macOS nextest; still run the rest of the workspace.
- name: Run Rust tests (workspace except plugin lib exe)
run: cargo test --workspace --exclude tauri-plugin-serialplugin

- name: Run JavaScript tests
run: pnpm test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-windows
path: |
coverage/
test-results/
if-no-files-found: warn
25 changes: 25 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"git": {
"commitMessage": "chore(release): ${version}",
"tagName": "v${version}",
"requireCleanWorkingDir": true,
"push": true
},
"github": {
"release": true
},
"npm": {
"publish": false
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md",
"header": "# Changelog\n"
}
},
"hooks": {
"after:bump": "node scripts/sync-cargo-version.cjs ${version} && git add Cargo.toml CHANGELOG.md package.json",
"after:release": "echo \"Tagged v${version}. Next: pnpm whoami || pnpm login; then pnpm release:publish\""
}
}
18 changes: 0 additions & 18 deletions .versionrc.json

This file was deleted.

96 changes: 96 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contributing

Thanks for helping improve **tauri-plugin-serialplugin**.

## Prerequisites

- Rust stable (see `rust-version` in `Cargo.toml`)
- Node 20+ and [pnpm](https://pnpm.io) 9.15.x (see `packageManager` in `package.json`)
- For Android / Robolectric: **JDK 17**

## Quick start

```bash
pnpm install
pnpm check && pnpm test && pnpm build
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
```

Faster local gate (no Android cross / Robolectric):

```bash
./scripts/ci-fast.sh
```

Playground app:

```bash
pnpm playground
```

## Project layout

| Path | Role |
|------|------|
| `src/` | Rust plugin (desktop + Android) |
| `guest-js/` | TypeScript API published as `tauri-plugin-serialplugin-api` |
| `permissions/` | Tauri ACL permission TOMLs |
| `android/` | Kotlin / Gradle Android module |
| `crates/android-usb-serial/` | Pure-Rust USB serial drivers |
| `examples/serialport-test/` | Demo / playground |
| `tests/` | Jest suites for guest-js |

## Pull requests

1. Keep changes focused; prefer small PRs.
2. Match existing style; run fmt / clippy / tests before pushing.
3. Update `CHANGELOG.md` for user-visible changes (or rely on `pnpm release:patch` / `release:minor` / `release:major`, which write it via release-it).
4. Do **not** add new top-level CI workflows unless an existing job cannot cover the need.
5. Public API changes (Rust or JS) need a clear migration note for the next semver bump.

### Semver reminders

- **Patch**: bugfixes, docs, internal refactors with no public API break.
- **Minor**: additive API (new commands / options) that stays backward compatible.
- **Major**: removed / renamed JS or Rust exports, ACL identifier renames, behavior breaks.

Deprecated Rust items (e.g. `PortBackend`) stay until the next major.

## Publishing (maintainers)

Full checklist: **[PUBLISHING.md](./PUBLISHING.md)**.

Bump (pick one):

```bash
pnpm release:patch
pnpm release:minor
pnpm release:major
```

Auth + publish:

```bash
pnpm whoami
# if logged out:
pnpm login
cargo login

pnpm release:publish
```

Dry-run: `./scripts/publish.sh --dry-run`
Surface check: `pnpm publish:check`

`release-it` bumps `package.json` + `Cargo.toml` (via `scripts/sync-cargo-version.cjs`), writes `CHANGELOG.md`, tags, and opens a GitHub Release.
`scripts/publish.sh` publishes with **pnpm** first, then `cargo publish`.

## Security

See [SECURITY.md](./SECURITY.md). Do not file public issues for vulnerabilities.

## License

Contributions are dual-licensed under MIT and Apache-2.0, same as the repository.
Loading
Loading