contributing!!

This commit is contained in:
tiago
2025-09-26 15:52:55 +01:00
parent 6620f17120
commit 080e678e4f
4 changed files with 66 additions and 6 deletions
+42
View File
@@ -0,0 +1,42 @@
# Contributing
Thanks for your interest in contributing to Cap!
## Ways to help
- Report bugs by opening issues.
- Suggest features with clear use cases.
- Improve docs or add examples.
- Submit pull requests.
## Development setup
**Notes**:
- You need to have the latest release version of [Bun](https://bun.com/) installed. For WASM, Rust is also required.
- VSCode is the recommended IDE for working on Cap.
- Put new docs in `docs/guide` and make sure to update the sidebar in `docs/.vitepress/config.mjs`, not scattered in subfolders.
Run `bun install` in each package you want to work on.
## Guidelines
- Formatting uses [Biome](https://biomejs.dev/). Make sure there are no warnings or errors before submitting a PR.
- Keep PRs small and focused.
- We prefer conventional commits, but they are not enforced. See [here](https://www.conventionalcommits.org/en/v1.0.0/) for reference.
- Avoid excessive duplication of code or code comments.
- No AI-generated code please! AI autocomplete is fine, but not fully AI code. If you submit AI-generated code without making it clear, it may be rejected.
- Don't edit type files directly, they're auto-generated from JSDoc comments.
- For optimizations, please always publish a benchmark of the before/after difference before submitting a PR, ideally including your device specs. RAM/CPU usage is also appreciated.
Maintainers may reject PRs at their discretion if they don't follow these guidelines or don't align with the project's goals.
Please also read our [code of conduct](CODE_OF_CONDUCT.md).
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
"formatter": {
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"style": {
"useConst": "error"
},
"correctness": {
"noUnusedVariables": "error"
}
}
}
}
+1 -1
View File
@@ -12,4 +12,4 @@ To run:
bun run index.js
```
This project was created using `bun init` in bun v1.2.9. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
This project was created using `bun init` in bun v1.2.9. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
+5 -5
View File
@@ -1,5 +1,5 @@
import { Worker } from "worker_threads";
import os from "os";
import os from "node:os";
import { Worker } from "node:worker_threads";
function prng(seed, length) {
function fnv1a(str) {
@@ -61,7 +61,7 @@ try {
],
{
type: "application/typescript",
}
},
);
const workerUrl = URL.createObjectURL(workerBlob);
@@ -114,7 +114,7 @@ export default function solve(challenge, config = {}) {
if (result.error) {
console.error(
`Error in worker for challenge ${currentChallengeIndex}:`,
result.error
result.error,
);
reject(new Error(`Worker error: ${result.error}`));
return;
@@ -126,7 +126,7 @@ export default function solve(challenge, config = {}) {
if (config?.onProgress) {
config.onProgress({
progress: Math.floor(
(challengesProcessed / totalChallenges) * 100
(challengesProcessed / totalChallenges) * 100,
),
currentChallenge: currentChallengeIndex,
challengesProcessed,