-
Notifications
You must be signed in to change notification settings - Fork 40
Refactor frontend into multi-package monorepo with EditorPort abstraction #589
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
Changes from 8 commits
7d59ae6
29ad89e
27aa075
862895e
11555c6
207f6d7
dc65bae
a338bd9
19bf4bd
9987546
0ab6387
c66a2ea
a1bf1d2
3e901a5
64377a4
4543db6
e98b350
209ce78
4634662
bdf3495
d8b231e
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,13 +4,17 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ".github/workflows/ci_frontend.yaml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "frontend/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "packages/frontend/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "packages/ui/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "packages/codemirror/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ".github/workflows/ci_frontend.yaml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "frontend/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "packages/frontend/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "packages/ui/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "packages/codemirror/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
6
to
+19
Contributor
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. Include root workspace/lockfile paths in filters to avoid skipped CI. Changes to root workspace config or lockfile won’t trigger this workflow, so dependency updates could land unvalidated. Add the root workspace/lockfile paths to both ✅ Suggested patch paths:
- ".github/workflows/ci_frontend.yaml"
+ - "package.json"
+ - "pnpm-lock.yaml"
+ - "pnpm-workspace.yaml"
- "packages/frontend/**"
- "packages/ui/**"
- "packages/codemirror/**"
@@
paths:
- ".github/workflows/ci_frontend.yaml"
+ - "package.json"
+ - "pnpm-lock.yaml"
+ - "pnpm-workspace.yaml"
- "packages/frontend/**"
- "packages/ui/**"
- "packages/codemirror/**"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -20,8 +24,6 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version: [20.x, 22.x, 24.x] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ./frontend | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout 🛎️ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -34,13 +36,13 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: "pnpm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install packages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ env.working-directory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint UI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm --filter=@codepair/ui lint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint CodeMirror | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm --filter=@codepair/codemirror lint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Prettier | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm run format:check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ env.working-directory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm --filter=@codepair/frontend format:check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm run lint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ env.working-directory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm --filter=@codepair/frontend lint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm run build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ${{ env.working-directory }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm --filter=@codepair/frontend build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,31 +4,31 @@ LINT_FRONTEND=false | |
| LINT_BACKEND=false | ||
|
|
||
| for FILE in $CHANGED_FILES; do | ||
| if [[ "$FILE" =~ ^frontend/ ]]; then | ||
| if [[ "$FILE" =~ ^packages/frontend/ ]]; then | ||
| LINT_FRONTEND=true | ||
| elif [[ "$FILE" =~ ^backend/ ]]; then | ||
| elif [[ "$FILE" =~ ^packages/backend/ ]]; then | ||
| LINT_BACKEND=true | ||
| fi | ||
| done | ||
|
Comment on lines
8
to
18
Contributor
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. Add lint coverage for new packages (ui, codemirror). Line 7 only sets lint flags for frontend/backend. Changes in ✅ Proposed fix (add flags + blocks for new packages) LINT_FRONTEND=false
LINT_BACKEND=false
+LINT_UI=false
+LINT_CODEMIRROR=false
for FILE in $CHANGED_FILES; do
if [[ "$FILE" =~ ^packages/frontend/ ]]; then
LINT_FRONTEND=true
elif [[ "$FILE" =~ ^packages/backend/ ]]; then
LINT_BACKEND=true
+ elif [[ "$FILE" =~ ^packages/ui/ ]]; then
+ LINT_UI=true
+ elif [[ "$FILE" =~ ^packages/codemirror/ ]]; then
+ LINT_CODEMIRROR=true
fi
done
+# UI package
+if [ "$LINT_UI" = true ]; then
+ echo "Changes detected in ui. Linting & Formatting ui..."
+ cd packages/ui
+ npx lint-staged
+ if [ $? -ne 0 ]; then
+ echo "UI Linting & Formatting failed. Commit aborted."
+ exit 1
+ fi
+ cd ../..
+fi
+
+# CodeMirror package
+if [ "$LINT_CODEMIRROR" = true ]; then
+ echo "Changes detected in codemirror. Linting & Formatting codemirror..."
+ cd packages/codemirror
+ npx lint-staged
+ if [ $? -ne 0 ]; then
+ echo "CodeMirror Linting & Formatting failed. Commit aborted."
+ exit 1
+ fi
+ cd ../..
+fi🤖 Prompt for AI Agents |
||
|
|
||
| if [ "$LINT_FRONTEND" = true ]; then | ||
| echo "Changes detected in the frontend. Linting & Formatting frontend..." | ||
| cd frontend | ||
| cd packages/frontend | ||
| npx lint-staged | ||
| if [ $? -ne 0 ]; then | ||
| echo "Frontend Linting & Formatting failed. Commit aborted." | ||
| exit 1 | ||
| fi | ||
| cd .. | ||
| cd ../.. | ||
| fi | ||
|
|
||
| if [ "$LINT_BACKEND" = true ]; then | ||
| echo "Changes detected in the backend. Linting & Formatting backend..." | ||
| cd backend | ||
| cd packages/backend | ||
| npx lint-staged | ||
| if [ $? -ne 0 ]; then | ||
| echo "Backend Linting & Formatting failed. Commit aborted." | ||
| exit 1 | ||
| fi | ||
| cd .. | ||
| cd ../.. | ||
| fi | ||
This file was deleted.
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.
Include workspace root dependency files in the CI path filters.
Backend CI can break when workspace-level files change (e.g., lockfile or workspace config), but those edits won’t currently trigger this workflow.
🛠️ Suggested update
@@ paths: - ".github/workflows/ci_backend.yaml" - "packages/backend/**" + - "pnpm-lock.yaml" + - "pnpm-workspace.yaml" @@ paths: - ".github/workflows/ci_backend.yaml" - "packages/backend/**" + - "pnpm-lock.yaml" + - "pnpm-workspace.yaml"📝 Committable suggestion
🤖 Prompt for AI Agents