Repository basics: - CONTRIBUTING.md and CODE_OF_CONDUCT.md (Contributor Covenant 2.1) - SPDX AGPL-3.0-or-later headers on all hand-written sources, checked in CI - golangci-lint (shared .golangci.yml), ESLint and Prettier, all run in CI API codegen from api/openapi.yaml (npm run generate, drift fails CI): - Go types via oapi-codegen in Server/internal/api - a contract test that the router and the spec list the same routes - Dart models via Phone-App/tool/generate_api.dart; the app uses them Spike: shared Tiptap editor in a Flutter WebView (ADR-4) - @docwell/editor-bridge builds the editor into one HTML page with a versioned JSON protocol; Phone-App hosts it with webview_flutter and a native toolbar. Integration test passes on an Android API 35 emulator. - flutter_inappwebview dropped: its Android plugin fails on AGP 9. Spike: Wails v3 desktop (ADR-11) - system tray, docwell:// deep links (page and space only) with single-instance hand-off, and the built-in updater with a required ed25519 signing key. Verified on Windows. - regenerated build assets register the scheme and drop template placeholders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
2.8 KiB
Markdown
62 lines
2.8 KiB
Markdown
# Contributing to Docwell
|
|
|
|
Thanks for helping. This page covers how to set up the repository, the checks a change has to pass, and how to send it.
|
|
|
|
By taking part you agree to follow the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
|
|
## Before you start
|
|
|
|
- For anything bigger than a small fix, open an issue first so we can agree on the approach.
|
|
- Feature priorities (MVP, v1, v2) are fixed per phase. Work outside the current phase is unlikely to be merged yet.
|
|
- Report security problems privately to the maintainers, not in a public issue.
|
|
|
|
## Setup
|
|
|
|
Follow **Development** in the [README](README.md): Go 1.26+, Node 22+, Rust with the `wasm32-wasip1` target, Flutter 3.44+, the Wails v3 CLI and the PocketBase binary.
|
|
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
## Checks
|
|
|
|
CI runs all of these. Run the ones for the parts you touched before you push.
|
|
|
|
| Area | Commands |
|
|
|---|---|
|
|
| Go (`Server/`, `Web-App/`, `Desktop-App/`) | `gofmt -l .`, `go vet ./...`, `golangci-lint run`, `go test ./...` (from each module) |
|
|
| Frontend (`Packages/`, `Server/admin/`, `Web-App/frontend/`, `Desktop-App/frontend/`) | `npm run lint`, `npm run format:check`, `npm run typecheck`, `npm test` (from the repo root) |
|
|
| Mobile (`Phone-App/`) | `dart format --set-exit-if-changed lib test`, `flutter analyze`, `flutter test` |
|
|
| API contract | `npm run generate` (from the repo root) after editing `api/openapi.yaml`, and commit the regenerated files |
|
|
| License headers | `node .github/scripts/spdx.mjs . --check` |
|
|
|
|
`npm run format` and `npm run lint:fix` fix most frontend problems for you.
|
|
|
|
## API changes
|
|
|
|
`api/openapi.yaml` is the source of truth for every client. Change it first, then regenerate:
|
|
|
|
- TypeScript types: `Packages/api-client/src/schema.d.ts`
|
|
- Go types: `Server/internal/api/api.gen.go`
|
|
- Dart models: `Phone-App/lib/api/generated/`
|
|
|
|
`npm run generate` regenerates all three. CI fails if the committed files differ from what the contract generates.
|
|
|
|
## Code style
|
|
|
|
- Match the code around your change: naming, comment density and idiom.
|
|
- Authorization rules belong in `Server/internal/access` as pure functions with tests.
|
|
- Every new source file starts with `SPDX-License-Identifier: AGPL-3.0-or-later` in a comment. `node .github/scripts/spdx.mjs .` adds it.
|
|
- Comments and docs are in plain English: short sentences, and explain why rather than what.
|
|
|
|
## Commits and pull requests
|
|
|
|
- Keep each pull request to one change. Split refactors from behaviour changes.
|
|
- Write commit subjects in the imperative ("Add page trash", not "Added page trash").
|
|
- Describe what changed, why, and how you tested it. Include screenshots for UI changes.
|
|
- Add or update tests for behaviour changes.
|
|
|
|
## License
|
|
|
|
Docwell is licensed under the [GNU AGPL v3.0 or later](LICENSE). By sending a contribution you agree that it is licensed under the same terms.
|