-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #89
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
Dev #89
Changes from all commits
67e57c6
9d908e3
6099b3b
34b6268
3e932ed
20f44a7
4cab7cc
7bf10cd
ebae11b
3c11ba2
efee407
bb9d16e
3636a09
a72928c
d66de8f
752ba56
8e4b634
82c6c5b
dc05460
ed8e99b
b03d6ef
cd601d1
500ee87
d74cb9f
6e5f620
cba01e8
9bd61b4
b78f2f2
360e525
d2f8c1b
c6f62fb
178ee79
23d8a30
f7bf4b8
38dac59
5daf2b4
dfc6097
6cb167e
f6a77b5
8f4101c
faa454d
6a9f4e3
ebfa570
b537885
7cdeb3f
c472b33
09e68d7
b12750a
1cb7653
9f4552c
d732e34
efa8044
e934a1d
7e933c4
f05593e
38c118b
bc7cd6f
e617f6a
fe62280
5fd185d
683374c
91fa58c
db4b62a
9ff5ed0
4deef58
91ff7cd
121a1aa
ab8e9c3
3a3fab3
0e1ac62
9e186a5
c1cf730
a0778f2
bb99e05
7f57594
384fcbc
98c8918
4a93345
7e815c2
12498ef
ffd9cd2
5b3f66f
ca53017
d962082
1873167
83ac13a
8fed99d
3b16643
f325be6
3583cc1
64b6baf
7472b7b
6373040
edc99ea
be79e36
ee8ad9b
c6a18d5
fe9e236
d29a2a5
5276c12
663e9fc
67d9232
1a442a4
f94d8e2
039c105
8d58a35
618b7dd
952d91e
06f2341
0bad2a8
2fed732
41c4480
4d3fb41
e4885fc
bafd9ab
9e38862
3834063
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 |
|---|---|---|
| @@ -0,0 +1,236 @@ | ||
| # --------------------------------------------------------------------------- | ||
| # CodeRabbit Configuration for mindfiredigital/markdown-reader | ||
| # | ||
| # Stack : Electron + React + TypeScript + Vite + Tailwind CSS | ||
| # Tooling : pnpm + Vitest + ESLint + Prettier + electron-vite | ||
| # Pattern : Electron desktop app monorepo with main, preload, renderer, shared packages, and Docusaurus docs | ||
| # | ||
| # Validate : https://docs.coderabbit.ai/configuration/yaml-validator | ||
| # Reference: https://docs.coderabbit.ai/reference/configuration | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| language: 'en-US' | ||
|
|
||
| tone_instructions: 'Senior Electron/React/TS reviewer. Be concise. Prioritise IPC/preload boundaries, markdown sanitisation, local file safety, a11y, tests, packaging, and CI. Flag real risks; suggest concrete fixes.' | ||
|
|
||
| early_access: false | ||
|
|
||
| reviews: | ||
| profile: 'assertive' | ||
| request_changes_workflow: true | ||
|
|
||
| high_level_summary: true | ||
| high_level_summary_instructions: > | ||
| Summarise the PR in concise bullets grouped by: | ||
| Electron main/preload, renderer UI, markdown rendering, shared packages, | ||
| tests, tooling/CI, docs, and packaging. End with "Breaking changes: None" | ||
| unless a public API, IPC contract, file behaviour, shortcut, or packaging | ||
| change is breaking. | ||
| high_level_summary_in_walkthrough: false | ||
|
|
||
| collapse_walkthrough: false | ||
| changed_files_summary: true | ||
| sequence_diagrams: true | ||
| estimate_code_review_effort: true | ||
| assess_linked_issues: true | ||
| related_issues: true | ||
| related_prs: true | ||
|
|
||
| suggested_labels: true | ||
| auto_apply_labels: false | ||
| suggested_reviewers: true | ||
| auto_assign_reviewers: false | ||
|
|
||
| commit_status: true | ||
| fail_commit_status: false | ||
| review_status: true | ||
| review_details: true | ||
|
|
||
| poem: false | ||
| in_progress_fortune: false | ||
|
|
||
| auto_review: | ||
| enabled: true | ||
| base_branches: | ||
| - main | ||
| - dev | ||
|
|
||
| path_filters: | ||
| - '!out/**' | ||
| - '!dist/**' | ||
| - '!build/**' | ||
| - '!coverage/**' | ||
| - '!release/**' | ||
| - '!node_modules/**' | ||
| - '!docs/.docusaurus/**' | ||
| - '!docs/build/**' | ||
| - '!pnpm-lock.yaml' | ||
| - '!**/*.snap' | ||
| - '!**/__snapshots__/**' | ||
| - '!**/*.{png,jpg,jpeg,gif,webp,ico,icns,mp4,zip}' | ||
|
|
||
| path_instructions: | ||
| - path: 'apps/main-processor/src/**/*.ts' | ||
| instructions: | | ||
| Review as Electron main-process code. | ||
| - IPC handlers must use shared constants and validate renderer input. | ||
| - File/folder access must guard path traversal, missing files, permissions, symlinks, and deleted watched files. | ||
| - Watchers, menus, dialogs, and IPC listeners must be cleaned up. | ||
| - Do not expose Node/Electron internals or unrestricted filesystem access. | ||
| - Export/update/download flows must sanitize content, close resources, and avoid executing embedded scripts. | ||
|
|
||
| - path: 'apps/preload/src/**/*.ts' | ||
| instructions: | | ||
| Review as a strict preload boundary. | ||
| - Expose only typed contextBridge APIs, never raw ipcRenderer. | ||
| - Use shared IPC constants and shared payload/result types. | ||
| - Listener methods must return unsubscribe functions. | ||
| - Reject broad channel names, arbitrary invoke/send wrappers, and any-typed payloads. | ||
|
|
||
| - path: 'apps/renderer/src/**/*.{ts,tsx}' | ||
| instructions: | | ||
| Review as React renderer code. | ||
| - Keep components typed, accessible, keyboard-friendly, and resilient to missing preload APIs. | ||
| - Effects must have correct dependencies and cleanup. | ||
| - Handle loading, empty, error, stale-response, and rejected-promise states. | ||
| - Do not import Node-only modules into renderer code. | ||
| - Avoid unnecessary derived state, unsafe globals, and broad any types. | ||
|
|
||
| - path: 'apps/renderer/src/**/{renderer,markdown,utils}/**/*.{ts,tsx}' | ||
| instructions: | | ||
| Review markdown rendering carefully. | ||
| - Sanitize raw HTML, links, images, Mermaid, KaTeX, anchors, and exported content. | ||
| - Block script execution, javascript: URLs, unsafe inline handlers, and unsafe local file references. | ||
| - Heading IDs and TOC entries must be stable and collision-safe. | ||
| - Mermaid/KaTeX/code highlighting failures should not break the whole document. | ||
| - Add tests for unsafe HTML, malformed markdown, links, images, code blocks, Mermaid, and KaTeX when changed. | ||
|
|
||
| - path: 'apps/renderer/src/**/*.{css,tsx}' | ||
| instructions: | | ||
| Review UI, theme, and accessibility. | ||
| - Interactive controls need semantic elements, visible focus, and keyboard access. | ||
| - Theme changes must preserve readable contrast in light and dark modes. | ||
| - Markdown prose must remain readable for tables, code, blockquotes, links, lists, and images. | ||
| - Prefer existing tokens/classes over ad hoc inline styling. | ||
|
|
||
| - path: 'packages/shared-* /src/**/*.ts' | ||
| instructions: | | ||
| Review shared package contracts. | ||
| - IPC constants, menu constants, shortcuts, and shared types are public contracts. | ||
| - New IPC constants must have handler, preload wrapper, renderer usage, and tests. | ||
| - Breaking type/API changes must be called out clearly. | ||
| - Prefer precise types over string/object/unknown/any shapes. | ||
|
|
||
| - path: '**/*.{test,spec}.{ts,tsx}' | ||
| instructions: | | ||
| Review tests. | ||
| - Cover success and failure paths, especially IPC, filesystem, markdown rendering, search, settings, tabs, and exports. | ||
| - Use isolated temp directories for disk tests and clean them up. | ||
| - Mock Electron/preload APIs explicitly. | ||
| - Prefer Testing Library user-event and getByRole for UI tests. | ||
|
|
||
| - path: '.github/workflows/**/*.yml' | ||
| instructions: | | ||
| Review CI/CD. | ||
| - Actions should use version tags, not @main. | ||
| - Secrets must use ${{ secrets.* }} and never be hardcoded. | ||
| - CI should install with pinned pnpm, then run lint, typecheck, tests, build, and package checks. | ||
| - Security scans should fail for high/critical findings unless justified. | ||
|
|
||
| - path: 'electron.vite.config.ts' | ||
| instructions: | | ||
| Review Electron/Vite build separation. | ||
| - Main, preload, and renderer entry points must stay separated. | ||
| - Main/preload should externalize Node/Electron dependencies where needed. | ||
| - Renderer must not bundle Node-only or Electron main-process modules. | ||
| - Production sourcemap/minify/external settings must be intentional. | ||
|
|
||
| - path: 'electron-builder.ts' | ||
| instructions: | | ||
| Review packaging. | ||
| - Check appId, productName, files, asar, icons, targets, file associations, artifact names, and publish settings. | ||
| - Exclude source-only, test, coverage, cache, and map files from releases. | ||
| - Signing/notarisation/update config must not hardcode secrets. | ||
| - Platform targets should match expected Windows, macOS, and Linux release formats. | ||
|
|
||
| - path: '**/package.json' | ||
| instructions: | | ||
| Review scripts and dependencies. | ||
| - Scripts for lint, typecheck, test, coverage, build, and dist must fail on errors. | ||
| - Dependencies should live in the package that imports them. | ||
| - Runtime imports must not be placed only in devDependencies. | ||
| - Electron, Vite, React, TypeScript, Tailwind, and testing upgrades need compatibility attention. | ||
|
|
||
| - path: 'tsconfig*.json' | ||
| instructions: | | ||
| Review TypeScript config. | ||
| - Keep strict type safety enabled. | ||
| - Module, target, moduleResolution, paths, and includes must match electron-vite and workspace boundaries. | ||
| - Renderer configs should include DOM types; main/preload should not accidentally depend on browser globals. | ||
|
|
||
| - path: 'eslint.config.*' | ||
| instructions: | | ||
| Review lint config. | ||
| - TypeScript parsing should cover workspace TS/TSX files. | ||
| - React hooks rules must apply to renderer code. | ||
| - Avoid disabling rules that hide runtime errors or weaken type safety. | ||
|
|
||
| - path: 'docs/**/*.{md,mdx,ts,tsx}' | ||
| instructions: | | ||
| Review docs. | ||
| - Docs must match current shortcuts, markdown support, export behaviour, install steps, and privacy/offline claims. | ||
| - Code blocks need language tags. | ||
| - Links and images should resolve. | ||
| - Docusaurus components must guard browser-only APIs during static build. | ||
|
|
||
| - path: 'pnpm-workspace.yaml' | ||
| instructions: | | ||
| Review workspace config. | ||
| - Workspace globs must intentionally include apps, packages, and docs. | ||
| - allowBuilds entries should stay minimal and justified. | ||
|
|
||
| tools: | ||
| eslint: | ||
| enabled: true | ||
| markdownlint: | ||
| enabled: true | ||
| actionlint: | ||
| enabled: true | ||
| gitleaks: | ||
| enabled: true | ||
| htmlhint: | ||
| enabled: true | ||
| checkov: | ||
| enabled: true | ||
| languagetool: | ||
| enabled: true | ||
| enabled_rules: | ||
| - 'OXFORD_COMMA' | ||
| - 'EN_QUOTES' | ||
| - 'COMMA_PARENTHESIS_WHITESPACE' | ||
| disabled_categories: | ||
| - 'TYPOGRAPHY' | ||
| yamllint: | ||
| enabled: true | ||
| ast-grep: | ||
| essential_rules: true | ||
| biome: | ||
| enabled: false | ||
|
|
||
| chat: | ||
| auto_reply: true | ||
|
|
||
| knowledge_base: | ||
| opt_out: false | ||
| web_search: | ||
| enabled: true | ||
| code_guidelines: | ||
| enabled: true | ||
| filePatterns: | ||
| - 'README.md' | ||
| - 'CONTRIBUTING.md' | ||
| - 'SECURITY.md' | ||
| - 'docs/**/*.md' | ||
| - 'docs/**/*.mdx' | ||
| learnings: | ||
| scope: auto |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ jobs: | |||||||||||||
| node-version: 22 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup pnpm | ||||||||||||||
| uses: pnpm/action-setup@v3 | ||||||||||||||
| uses: pnpm/action-setup@v4 | ||||||||||||||
| with: | ||||||||||||||
| version: 10 | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -40,4 +40,37 @@ jobs: | |||||||||||||
| run: pnpm test:coverage | ||||||||||||||
|
|
||||||||||||||
| - name: Build Electron app | ||||||||||||||
| run: pnpm dist | ||||||||||||||
| run: pnpm dist | ||||||||||||||
|
|
||||||||||||||
| security: | ||||||||||||||
| name: Security Audit | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
Comment on lines
+49
to
+50
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the relevant section around the cited lines
echo "=== production.yml lines 35-80 ==="
nl -ba .github/workflows/production.yml | sed -n '35,80p'
echo
echo "=== All checkout steps in production.yml (with context) ==="
rg -n --context 2 "uses:\s*actions/checkout@" .github/workflows/production.yml
echo
echo "=== Any persist-credentials occurrences in production.yml ==="
rg -n "persist-credentials" .github/workflows/production.yml || trueRepository: mindfiredigital/markdown-reader Length of output: 171 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== production.yml lines 35-80 (cat -n) ==="
cat -n .github/workflows/production.yml | sed -n '35,80p'
echo
echo "=== All checkout steps in production.yml (with context) ==="
rg -n --context 2 "uses:\s*actions/checkout@" .github/workflows/production.yml
echo
echo "=== Any persist-credentials occurrences in production.yml ==="
rg -n "persist-credentials" .github/workflows/production.yml || trueRepository: mindfiredigital/markdown-reader Length of output: 1573 Disable persisted checkout credentials in the Security Audit job. The “Security Audit” job checks out the repo and runs scanners; its Suggested change - name: Checkout
uses: actions/checkout@v4
+ with:
+ persist-credentials: false📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 47-48: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 48-48: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| - name: Setup pnpm | ||||||||||||||
| uses: pnpm/action-setup@v4 | ||||||||||||||
| with: | ||||||||||||||
| version: 10 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Node | ||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||
| with: | ||||||||||||||
| node-version: 22 | ||||||||||||||
| cache: pnpm | ||||||||||||||
|
|
||||||||||||||
| - name: Install dependencies | ||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||
|
|
||||||||||||||
| - name: pnpm audit | ||||||||||||||
| run: pnpm audit --audit-level=high | ||||||||||||||
|
|
||||||||||||||
| - name: Run Trivy vulnerability scanner | ||||||||||||||
| uses: aquasecurity/trivy-action@v0.36.0 | ||||||||||||||
| with: | ||||||||||||||
| scan-type: fs | ||||||||||||||
| scan-ref: . | ||||||||||||||
| severity: CRITICAL,HIGH | ||||||||||||||
| format: table | ||||||||||||||
| exit-code: 1 | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,40 @@ | ||
| node_modules | ||
| dist | ||
| build | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build outputs | ||
| out/ | ||
| dist/ | ||
| build/ | ||
| release/ | ||
| *.tgz | ||
| .vite/ | ||
|
|
||
| # Electron builder | ||
| .cache/ | ||
|
|
||
| # Environment | ||
| .env | ||
| out | ||
| coverage | ||
| release | ||
| .vite/ | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Logs | ||
| *.log | ||
| npm-debug.log* | ||
| pnpm-debug.log* | ||
|
|
||
| # OS artifacts | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Test coverage | ||
| coverage/ | ||
|
|
||
| # Docusaurus | ||
| docs/.docusaurus/ | ||
| docs/build/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| pnpm test |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: mindfiredigital/markdown-reader
Length of output: 354
Pin GitHub Actions
uses:refs to commit SHAs in.github/workflows/production.yml.uses: actions/checkout@v4(15, 48),uses: actions/setup-node@v4(18, 54),uses: pnpm/action-setup@v4(23, 51), anduses: aquasecurity/trivy-action@v0.36.0(66) are on mutable tags; pin each to the exact 40-hex commit SHA for reproducible, supply-chain-safe runs.🧰 Tools
🪛 zizmor (1.25.2)
[error] 23-23: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents