-
Notifications
You must be signed in to change notification settings - Fork 4k
Update CONTRIBUTING.md #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,9 @@ Thank you for your interest in contributing to OpenCut! This document provides g | |
|
|
||
| 1. Fork the repository | ||
| 2. Clone your fork locally | ||
| ```bash | ||
| git clone https://github.com/<your-username>/opencut.git | ||
| ``` | ||
| 3. Navigate to the web app directory: `cd apps/web` | ||
| 4. Copy `.env.example` to `.env.local`: | ||
|
|
||
|
|
@@ -31,7 +34,10 @@ Thank you for your interest in contributing to OpenCut! This document provides g | |
| Copy-Item .env.example .env.local | ||
| ``` | ||
|
|
||
| 5. Install dependencies: `bun install` | ||
| 5. Install dependencies: We use Bun as our package manager. | ||
| From the project root: `bun install` | ||
| If you prefer, you can also use npm or pnpm, but Bun is the recommended option. | ||
|
|
||
| 6. Start the development server: `bun run dev` | ||
|
|
||
| > **Note:** If you see an error like `Unsupported URL Type "workspace:*"` when running `npm install`, you have two options: | ||
|
|
@@ -48,6 +54,9 @@ Thank you for your interest in contributing to OpenCut! This document provides g | |
| - Performance optimizations | ||
| - Bug fixes in existing functionality | ||
| - UI/UX improvements | ||
| - Improve accessibility (keyboard navigation, screen reader support) | ||
| - Write or enhance unit and integration tests | ||
| - Improve error messages and logging | ||
| - Documentation and testing | ||
|
|
||
| **⚠️ Areas to Avoid:** | ||
|
|
@@ -152,27 +161,37 @@ If you're unsure whether your idea falls into the preview category, feel free to | |
| 4. Run the linter: `bun run lint` | ||
| 5. Format your code: `bunx biome format --write .` | ||
| 6. Commit your changes with a descriptive message | ||
| 7. Push to your fork and create a pull request | ||
| 7. Rebase your branch against main before opening a PR | ||
| 8. Push to your fork and create a pull request | ||
| 9. Look for GitHub issues tagged with good first issue if you’re new | ||
|
|
||
| ## Code Style | ||
|
|
||
| - We use Biome for code formatting and linting | ||
| - Run `bunx biome format --write .` from the `apps/web` directory to format code | ||
| - Run `bun run lint` from the `apps/web` directory to check for linting issues | ||
| - Follow the existing code patterns | ||
| - Use consistent naming conventions for variables, components, and files | ||
| - Write self-documenting code but add comments where clarity is needed | ||
| - Tests should follow the same conventions (framework: Jest/Vitest, check repo for current usage) | ||
| - Aim for sufficient test coverage where relevant | ||
|
Comment on lines
+174
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 🧩 Analysis chainResolve test framework ambiguity (Jest vs Vitest) Specify the actual framework used to avoid confusion. -• Tests should follow the same conventions (framework: Jest/Vitest, check repo for current usage)
+• Tests should follow the same conventions (framework: <Jest or Vitest> — see package.json/scripts)Run this to detect which framework is in use: 🏁 Script executed: #!/bin/bash
# Inspect test tooling across the repo
fd -g package.json -a -E "node_modules" | while read -r f; do
echo "== $f =="
jq -r '.scripts.test?, .devDependencies?.jest, .devDependencies?.vitest, .devDependencies?.biome' "$f" 2>/dev/null
done | rg -nP 'jest|vitest|biome|test'Length of output: 0 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "Searching for package.json files..."
# prefer fd when available
if command -v fd >/dev/null 2>&1; then
mapfile -t pkgs < <(fd -HI -t f -e json package.json || true)
else
mapfile -t pkgs < <(find . -type f -iname package.json -not -path '*/node_modules/*' 2>/dev/null || true)
fi
if [ "${#pkgs[@]}" -eq 0 ]; then
echo "NO_PACKAGE_JSON_FOUND"
exit 0
fi
for p in "${pkgs[@]}"; do
echo "== $p =="
if command -v jq >/dev/null 2>&1; then
jq -r '{
testScript: (.scripts.test // "<no test script>"),
hasJest: ((.dependencies? // {}) | has("jest")) or ((.devDependencies? // {}) | has("jest")),
hasVitest: ((.dependencies? // {}) | has("vitest")) or ((.devDependencies? // {}) | has("vitest")),
jestVersion: (.dependencies.jest // .devDependencies.jest // null),
vitestVersion: (.dependencies.vitest // .devDependencies.vitest // null)
}' "$p" || cat "$p"
else
echo "jq not found; printing file head:"
sed -n '1,120p' "$p"
fi
done
echo "Searching repository for Vitest/Jest references and config files (excluding node_modules)..."
if command -v rg >/dev/null 2>&1; then
rg -n --hidden --no-ignore -S --glob '!node_modules' '(^|\W)(vitest|jest)(\W|$)' || true
else
grep -RIn --exclude-dir=node_modules -E '(^|\W)(vitest|jest)(\W|$)' . || true
fi
echo "Looking for typical config files in repo root..."
for cfg in vitest.config.ts vitest.config.js vitest.config.mjs vite.config.ts vite.config.js jest.config.js jest.config.ts jest.config.cjs; do
[ -f "$cfg" ] && echo "FOUND_CONFIG: $cfg"
doneLength of output: 92 🏁 Script executed: #!/usr/bin/env bash
set -eu
echo "Searching for package.json files..."
tmp="$(mktemp)"
find . -type f -name package.json -not -path '*/node_modules/*' -print0 > "$tmp"
if [ ! -s "$tmp" ]; then
echo "NO_PACKAGE_JSON_FOUND"
rm -f "$tmp"
exit 0
fi
while IFS= read -r -d '' p; do
echo "== $p =="
if command -v jq >/dev/null 2>&1; then
jq -r '
"testScript: " + (.scripts.test // "<no test script>"),
"hasJest: " + ( ((.dependencies? // {}) | has("jest")) or ((.devDependencies? // {}) | has("jest")) | tostring ),
"hasVitest: " + ( ((.dependencies? // {}) | has("vitest")) or ((.devDependencies? // {}) | has("vitest")) | tostring ),
"jestVersion: " + ((.dependencies.jest // .devDependencies.jest) // "null"),
"vitestVersion: " + ((.dependencies.vitest // .devDependencies.vitest) // "null")
' "$p" || sed -n '1,200p' "$p"
else
echo "jq not available; showing package.json head:"
sed -n '1,200p' "$p"
fi
done < "$tmp"
rm -f "$tmp"
echo
echo "Searching repository for 'vitest' or 'jest' references (excluding node_modules)..."
if command -v rg >/dev/null 2>&1; then
rg -n --hidden --no-ignore -S --glob '!node_modules' '(^|\W)(vitest|jest)(\W|$)' || true
else
grep -RIn --exclude-dir=node_modules -E '(^|\W)(vitest|jest)(\W|$)' . || true
fi
echo
echo "Checking for common config files in repo root..."
for cfg in vitest.config.ts vitest.config.js vitest.config.mjs vite.config.ts vite.config.js jest.config.js jest.config.ts jest.config.cjs; do
[ -f "$cfg" ] && echo "FOUND_CONFIG: $cfg"
doneLength of output: 833 Specify test framework in CONTRIBUTING.md — no Jest/Vitest detected Scanned package.json files (./package.json, ./apps/web/package.json, ./packages/auth/package.json, ./packages/db/package.json): none define a test script or list jest/vitest; update .github/CONTRIBUTING.md (lines 174–177) to name the repo's test framework or remove the “Jest/Vitest” hint and point contributors to the actual package.json test scripts or the chosen framework. 🤖 Prompt for AI Agents |
||
|
|
||
| ## Pull Request Process | ||
|
|
||
| 1. Fill out the pull request template completely | ||
| 2. Link any related issues | ||
| 3. Ensure CI passes | ||
| 4. Request review from maintainers | ||
| 5. Address any feedback | ||
| 4. Run tests locally before pushing | ||
| 5. Update documentation if features or setup change | ||
| 6. Request review from maintainers | ||
| 7. Address any feedback | ||
|
|
||
| ## Community | ||
|
|
||
| - Be respectful and inclusive | ||
| - Follow our Code of Conduct | ||
| - Help others in discussions and issues | ||
| - Maintainers may take a few days to respond — please be patient | ||
| - Feel free to review other contributors’ PRs and leave constructive feedback | ||
|
|
||
| Thank you for contributing! | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix fork clone URL casing and add repo cd step
Use the canonical repo name and guide contributors into the repository directory after cloning.
📝 Committable suggestion
🤖 Prompt for AI Agents