Skip to content

Commit 8cf3e8b

Browse files
zhensherlockcodex
andcommitted
docs: add contributing guide
Co-Authored-By: Codex <267193182+codex@users.noreply.github.com>
1 parent fa5f088 commit 8cf3e8b

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Contributing to Protocol Launcher
2+
3+
Thank you for helping improve `protocol-launcher`. Contributions to protocol integrations, tests, documentation,
4+
examples, and issue triage are welcome.
5+
6+
By participating, you agree to follow the project [Code of Conduct](CODE_OF_CONDUCT.md).
7+
8+
## Choose the right channel
9+
10+
- Use [GitHub Discussions](https://github.com/zhensherlock/protocol-launcher/discussions) for usage questions,
11+
integration help, ideas, and showcases.
12+
- Use [GitHub Issues](https://github.com/zhensherlock/protocol-launcher/issues/new/choose) for reproducible bugs,
13+
concrete feature proposals, and documentation problems.
14+
- Search existing issues and discussions before opening a new one.
15+
16+
A bug report should include the `protocol-launcher` version, the generated URL, the expected URL, the affected app
17+
and app version, the operating system, and a public minimal reproduction when possible. Remove API keys, tokens, and
18+
other sensitive values before sharing URLs or payloads.
19+
20+
## Development setup
21+
22+
This repository is a pnpm workspace managed with Turbo. It uses the Node.js version declared in
23+
[.nvmrc](.nvmrc) and the pnpm version declared in [package.json](package.json).
24+
25+
```bash
26+
git clone https://github.com/zhensherlock/protocol-launcher.git
27+
cd protocol-launcher
28+
nvm use
29+
corepack enable
30+
pnpm install
31+
```
32+
33+
Run the documentation site, promo video app, and their package watchers together:
34+
35+
```bash
36+
pnpm dev
37+
```
38+
39+
Use a focused development command when working on one workspace:
40+
41+
```bash
42+
pnpm --filter ./packages/protocol-launcher dev
43+
pnpm --filter ./apps/docs dev
44+
pnpm --filter ./apps/promo-video dev
45+
```
46+
47+
Use path filters rather than package-name filters because the root package and the published library package are
48+
both named `protocol-launcher`.
49+
50+
## Making a change
51+
52+
1. Create a focused branch from the current `main` branch.
53+
2. Keep the change limited to one problem or feature.
54+
3. Add or update Vitest coverage for behavior changes.
55+
4. Update both `apps/docs/en` and `apps/docs/zh` when changing user-facing APIs or documentation.
56+
5. Add a changeset with `pnpm changeset` for package-visible changes.
57+
6. Use a [Conventional Commit](https://www.conventionalcommits.org/) message such as
58+
`feat: add raycast protocol support` or `fix: encode vscode file paths`.
59+
60+
When adding a protocol integration, keep the implementation, exports, tests, and documentation in sync. A typical
61+
addition includes:
62+
63+
- `packages/protocol-launcher/src/<name>/index.ts`
64+
- the namespace export in `packages/protocol-launcher/src/index.ts`
65+
- the `./<name>` export in `packages/protocol-launcher/package.json`
66+
- `packages/protocol-launcher/tests/<name>.test.ts`
67+
- matching English and Chinese documentation pages and navigation entries
68+
69+
Follow the ordering and conventions of nearby integrations. Do not edit generated output such as `dist`, `coverage`,
70+
VitePress build/cache directories, Turbo caches, or rendered promo-video files.
71+
72+
## Verification
73+
74+
Run the checks relevant to your change before opening a pull request. The CI-equivalent library and documentation
75+
checks are:
76+
77+
```bash
78+
npx biome check .
79+
pnpm build
80+
pnpm coverage
81+
```
82+
83+
For a focused library change, run the closest test and package build first:
84+
85+
```bash
86+
pnpm test packages/protocol-launcher/tests/vscode.test.ts
87+
pnpm --filter ./packages/protocol-launcher build
88+
```
89+
90+
For promo-video changes, run:
91+
92+
```bash
93+
pnpm check:promo
94+
pnpm build:promo
95+
```
96+
97+
## Pull requests
98+
99+
- Link the related issue or discussion when one exists.
100+
- Explain the problem, the chosen solution, and any tradeoffs.
101+
- Include generated URL examples and the source of the app's official URL-scheme behavior for protocol changes.
102+
- Include screenshots or recordings for visible documentation or promo-video changes.
103+
- Call out breaking changes and migration steps explicitly.
104+
- Keep unrelated formatting, dependency, and generated-file changes out of the pull request.
105+
- Make sure the relevant checks pass and package-visible changes include an appropriate changeset.
106+
107+
Maintainers may ask for a smaller reproduction, official protocol documentation, or additional exact-string tests
108+
before reviewing an implementation. This keeps reviews focused and helps prevent invalid or unsafe launch URLs.

0 commit comments

Comments
 (0)