@ripla/godd-mcp 1.0.4-canary.8 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -94
- package/dist/godd.cjs +349 -233
- package/dist/godd.js +2193 -838
- package/dist/index.js +152 -122
- package/{notes-api → notes/api}/.env.example +6 -1
- package/{notes-api → notes/api}/README.md +6 -5
- package/{notes-api → notes/api}/app/main.py +29 -2
- package/{notes-api → notes/api}/app/routers/auth.py +6 -1
- package/{notes-api → notes/api}/app/routers/issues.py +157 -1
- package/{notes-api → notes/api}/app/routers/pr.py +2 -2
- package/{notes-api → notes/api}/app/services/github_app_token.py +32 -1
- package/{notes-api → notes/api}/app/services/github_issues.py +101 -11
- package/{notes-api → notes/api}/app/services/github_pr.py +6 -1
- package/{notes-api → notes/api}/tests/test_github_app_token.py +49 -1
- package/{notes-api → notes/api}/tests/test_github_service.py +42 -0
- package/notes/api/tests/test_health.py +52 -0
- package/{notes-api → notes/api}/tests/test_issues.py +216 -0
- package/{notes-api → notes/api}/tests/test_pr.py +24 -0
- package/{notes-api → notes/api}/tests/test_pr_chain.py +19 -0
- package/{notes-api → notes/api}/uv.lock +178 -2
- package/notes/app/DESIGN.md +273 -0
- package/{notes-app → notes/app}/README.md +4 -1
- package/notes/app/docker/Dockerfile.e2e +19 -0
- package/notes/app/docker/Dockerfile.prod +15 -0
- package/notes/app/docker/Dockerfile.test +17 -0
- package/notes/app/e2e/file-tree.spec.ts +26 -0
- package/notes/app/e2e/file-view.spec.ts +25 -0
- package/notes/app/e2e/fixtures.ts +28 -0
- package/{notes-app → notes/app}/e2e/global-setup.ts +5 -7
- package/notes/app/e2e/login.spec.ts +25 -0
- package/notes/app/e2e/pages/login-page.ts +29 -0
- package/notes/app/e2e/pages/main-page.ts +29 -0
- package/notes/app/e2e/panel-resize-handle.spec.ts +213 -0
- package/{notes-app → notes/app}/eslint.config.js +9 -0
- package/{notes-app → notes/app}/package.json +0 -3
- package/{notes-app → notes/app}/pnpm-workspace.yaml +1 -0
- package/notes/app/src/components/CommentPanel.test.tsx +194 -0
- package/{notes-app → notes/app}/src/components/CommentPanel.tsx +119 -10
- package/notes/app/src/components/CommentSelectionPopover.tsx +26 -0
- package/notes/app/src/components/EditToolbar.test.tsx +102 -0
- package/{notes-app → notes/app}/src/components/EditToolbar.tsx +5 -54
- package/notes/app/src/components/FileInfoPanel.branch-tab.test.tsx +250 -0
- package/notes/app/src/components/FileInfoPanel.history-tab.test.tsx +146 -0
- package/notes/app/src/components/FileInfoPanel.test.tsx +101 -0
- package/{notes-app → notes/app}/src/components/FileInfoPanel.tsx +135 -20
- package/notes/app/src/components/IssueCommentThread.test.tsx +93 -0
- package/notes/app/src/components/IssueCommentThread.tsx +156 -0
- package/notes/app/src/components/IssueDetailView.test.tsx +1118 -0
- package/notes/app/src/components/IssueDetailView.tsx +476 -0
- package/notes/app/src/components/IssueList.test.tsx +545 -0
- package/notes/app/src/components/IssueList.tsx +374 -0
- package/{notes-app → notes/app}/src/components/LabelSelector.test.tsx +94 -8
- package/notes/app/src/components/LabelSelector.tsx +452 -0
- package/{notes-app → notes/app}/src/components/MarkdownEditor.tsx +140 -2
- package/notes/app/src/components/PanelResizeHandle.test.tsx +481 -0
- package/notes/app/src/components/PanelResizeHandle.tsx +96 -0
- package/{notes-app → notes/app}/src/hooks/useEditSession.test.ts +171 -23
- package/{notes-app → notes/app}/src/hooks/useEditSession.ts +49 -62
- package/notes/app/src/hooks/useMdUpLayout.test.ts +10 -0
- package/notes/app/src/hooks/useMdUpLayout.ts +27 -0
- package/notes/app/src/hooks/usePeriodicSync.test.ts +244 -0
- package/notes/app/src/hooks/usePeriodicSync.ts +83 -0
- package/notes/app/src/hooks/useResizablePanelWidth.test.ts +251 -0
- package/notes/app/src/hooks/useResizablePanelWidth.ts +167 -0
- package/{notes-app → notes/app}/src/lib/api.test.ts +81 -1
- package/{notes-app → notes/app}/src/lib/api.ts +98 -4
- package/notes/app/src/lib/commentAnchor.test.ts +22 -0
- package/notes/app/src/lib/commentAnchor.ts +28 -0
- package/notes/app/src/lib/commentHighlight.test.ts +110 -0
- package/notes/app/src/lib/commentHighlight.ts +44 -0
- package/notes/app/src/lib/github-sync.test.ts +126 -0
- package/notes/app/src/lib/github-sync.ts +89 -0
- package/notes/app/src/lib/issue-list-utils.test.ts +275 -0
- package/notes/app/src/lib/issue-list-utils.ts +135 -0
- package/notes/app/src/lib/issue-mobile-layout.test.ts +17 -0
- package/notes/app/src/lib/issue-mobile-layout.ts +20 -0
- package/notes/app/src/lib/issue-url-sync.test.ts +73 -0
- package/notes/app/src/lib/issue-url-sync.ts +43 -0
- package/notes/app/src/lib/main-page-default-view.test.ts +37 -0
- package/notes/app/src/lib/main-page-default-view.ts +15 -0
- package/notes/app/src/lib/resizable-panel.test.ts +199 -0
- package/notes/app/src/lib/resizable-panel.ts +136 -0
- package/notes/app/src/pages/LoginPage.test.tsx +17 -0
- package/notes/app/src/pages/MainPage.branch-modal.test.tsx +226 -0
- package/notes/app/src/pages/MainPage.issue-sync.test.tsx +145 -0
- package/notes/app/src/pages/MainPage.sidebar.test.tsx +361 -0
- package/{notes-app → notes/app}/src/pages/MainPage.tsx +406 -61
- package/{notes-app → notes/app}/src/pages/SettingsPage.test.tsx +32 -23
- package/{notes-app → notes/app}/src/pages/UserManagementPage.test.tsx +8 -18
- package/notes/app/src/test/mocks.ts +156 -0
- package/notes/app/src/test/render.tsx +27 -0
- package/package.json +3 -5
- package/notes-api/tests/test_health.py +0 -11
- package/notes-app/docker/Dockerfile.e2e +0 -14
- package/notes-app/docker/Dockerfile.prod +0 -12
- package/notes-app/docker/Dockerfile.test +0 -12
- package/notes-app/e2e/file-tree.spec.ts +0 -29
- package/notes-app/e2e/file-view.spec.ts +0 -24
- package/notes-app/e2e/login.spec.ts +0 -32
- package/notes-app/src/components/IssueDetailView.test.tsx +0 -201
- package/notes-app/src/components/IssueDetailView.tsx +0 -318
- package/notes-app/src/components/IssueList.test.tsx +0 -93
- package/notes-app/src/components/IssueList.tsx +0 -169
- package/notes-app/src/components/LabelSelector.tsx +0 -276
- package/notes-app/src/pages/LoginPage.test.tsx +0 -29
- package/stacks/django-vue.yaml +0 -33
- package/stacks/fastapi-react.yaml +0 -160
- package/stacks/flutter-firebase.yaml +0 -58
- package/stacks/nextjs-prisma.yaml +0 -33
- package/stacks/schema.json +0 -144
- package/templates/agents/architect.hbs +0 -183
- package/templates/agents/auto-documenter.hbs +0 -36
- package/templates/agents/backend-developer.hbs +0 -175
- package/templates/agents/code-reviewer.hbs +0 -29
- package/templates/agents/database-developer.hbs +0 -52
- package/templates/agents/debug-specialist.hbs +0 -39
- package/templates/agents/environment-setup.hbs +0 -41
- package/templates/agents/frontend-developer.hbs +0 -45
- package/templates/agents/integration-qa.hbs +0 -26
- package/templates/agents/performance-qa.hbs +0 -24
- package/templates/agents/pr-writer.hbs +0 -53
- package/templates/agents/quality-lead.hbs +0 -26
- package/templates/agents/requirements-analyst.hbs +0 -26
- package/templates/agents/security-analyst.hbs +0 -21
- package/templates/agents/security-reviewer.hbs +0 -20
- package/templates/agents/ssot-updater.hbs +0 -45
- package/templates/agents/technical-writer.hbs +0 -28
- package/templates/agents/unit-test-engineer.hbs +0 -19
- package/templates/agents/user-clone.hbs +0 -43
- package/templates/github-actions/aws/deploy-notes.yml.hbs +0 -117
- package/templates/github-actions/azure/deploy-notes.yml.hbs +0 -78
- package/templates/github-actions/gcp/deploy-notes.yml.hbs +0 -76
- package/templates/github-actions/vercel-railway/deploy-notes.yml.hbs +0 -49
- package/templates/mindsets/agent-stdio.hbs +0 -51
- package/templates/mindsets/dart.hbs +0 -39
- package/templates/mindsets/ddd-clean-architecture.hbs +0 -52
- package/templates/mindsets/electron.hbs +0 -41
- package/templates/mindsets/fastapi.hbs +0 -40
- package/templates/mindsets/flutter.hbs +0 -56
- package/templates/mindsets/kotlin.hbs +0 -46
- package/templates/mindsets/postgresql.hbs +0 -39
- package/templates/mindsets/python.hbs +0 -39
- package/templates/mindsets/react.hbs +0 -51
- package/templates/mindsets/swift.hbs +0 -46
- package/templates/mindsets/terraform.hbs +0 -53
- package/templates/mindsets/typescript.hbs +0 -34
- package/templates/mindsets/vite.hbs +0 -37
- package/templates/notes-compose.yml +0 -82
- package/templates/partials/cogito-geo.hbs +0 -84
- package/templates/partials/cogito-godd.hbs +0 -22
- package/templates/partials/cogito-grammar.hbs +0 -105
- package/templates/partials/cogito-particle.hbs +0 -76
- package/templates/partials/cogito-root-ai.hbs +0 -79
- package/templates/partials/cogito-root-arch.hbs +0 -75
- package/templates/partials/cogito-root-core.hbs +0 -75
- package/templates/partials/cogito-root-daily.hbs +0 -58
- package/templates/partials/cogito-root-dev.hbs +0 -71
- package/templates/partials/cogito-root-devops.hbs +0 -71
- package/templates/partials/cogito-root-framework.hbs +0 -80
- package/templates/partials/cogito-root-lang.hbs +0 -74
- package/templates/partials/godd-core.hbs +0 -50
- package/templates/partials/project-context.hbs +0 -52
- package/templates/partials/ssot-header.hbs +0 -40
- package/templates/partials/ssot-rules.hbs +0 -30
- package/templates/prompts/adr.hbs +0 -39
- package/templates/prompts/agent-dev-workflow.hbs +0 -34
- package/templates/prompts/analyze-report.hbs +0 -36
- package/templates/prompts/auto-documentation.hbs +0 -37
- package/templates/prompts/check.hbs +0 -52
- package/templates/prompts/commit.hbs +0 -96
- package/templates/prompts/dev.hbs +0 -127
- package/templates/prompts/docs-init.hbs +0 -101
- package/templates/prompts/docs-update.hbs +0 -51
- package/templates/prompts/git-workflow.hbs +0 -125
- package/templates/prompts/impact-analysis.hbs +0 -43
- package/templates/prompts/install.hbs +0 -40
- package/templates/prompts/new-branch.hbs +0 -61
- package/templates/prompts/notes-deploy.hbs +0 -138
- package/templates/prompts/pr-analyze.hbs +0 -44
- package/templates/prompts/pr-create.hbs +0 -125
- package/templates/prompts/push-execute.hbs +0 -83
- package/templates/prompts/push.hbs +0 -24
- package/templates/prompts/release-notes.hbs +0 -38
- package/templates/prompts/requirements-to-business-flow.hbs +0 -29
- package/templates/prompts/requirements-to-tickets.hbs +0 -26
- package/templates/prompts/review.hbs +0 -126
- package/templates/prompts/setup.hbs +0 -247
- package/templates/prompts/spec.hbs +0 -35
- package/templates/prompts/specification-to-tickets.hbs +0 -24
- package/templates/prompts/submit.hbs +0 -143
- package/templates/prompts/sync.hbs +0 -63
- package/templates/prompts/test-plan.hbs +0 -56
- package/templates/scripts/aws/terraform-backend-setup.sh.hbs +0 -149
- package/templates/terraform/aws/alb.tf.hbs +0 -58
- package/templates/terraform/aws/backend.tf.hbs +0 -10
- package/templates/terraform/aws/cloudfront.tf.hbs +0 -96
- package/templates/terraform/aws/ecr.tf.hbs +0 -30
- package/templates/terraform/aws/ecs.tf.hbs +0 -142
- package/templates/terraform/aws/iam.tf.hbs +0 -88
- package/templates/terraform/aws/local.tf.hbs +0 -34
- package/templates/terraform/aws/output.tf.hbs +0 -49
- package/templates/terraform/aws/provider.tf.hbs +0 -26
- package/templates/terraform/aws/rds.tf.hbs +0 -38
- package/templates/terraform/aws/s3.tf.hbs +0 -34
- package/templates/terraform/aws/secrets.tf.hbs +0 -53
- package/templates/terraform/aws/security_groups.tf.hbs +0 -81
- package/templates/terraform/aws/vpc.tf.hbs +0 -63
- package/templates/terraform/azure/backend.tf.hbs +0 -8
- package/templates/terraform/azure/iam.tf.hbs +0 -36
- package/templates/terraform/azure/main.tf.hbs +0 -203
- package/templates/terraform/azure/output.tf.hbs +0 -19
- package/templates/terraform/azure/provider.tf.hbs +0 -19
- package/templates/terraform/gcp/backend.tf.hbs +0 -6
- package/templates/terraform/gcp/iam.tf.hbs +0 -47
- package/templates/terraform/gcp/main.tf.hbs +0 -175
- package/templates/terraform/gcp/output.tf.hbs +0 -15
- package/templates/terraform/gcp/provider.tf.hbs +0 -19
- package/templates/terraform/vercel-railway/main.tf.hbs +0 -64
- package/templates/terraform/vercel-railway/output.tf.hbs +0 -11
- /package/{notes-api → notes/api}/.dockerignore +0 -0
- /package/{notes-api → notes/api}/alembic/README +0 -0
- /package/{notes-api → notes/api}/alembic/env.py +0 -0
- /package/{notes-api → notes/api}/alembic/script.py.mako +0 -0
- /package/{notes-api → notes/api}/alembic/versions/001_initial_notes_tables.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/002_add_performance_indexes.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/003_add_yjs_documents.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/004_add_comments.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/005_add_github_username.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/006_add_check_constraints.py +0 -0
- /package/{notes-api → notes/api}/alembic.ini +0 -0
- /package/{notes-api → notes/api}/app/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/config.py +0 -0
- /package/{notes-api → notes/api}/app/database.py +0 -0
- /package/{notes-api → notes/api}/app/http_client.py +0 -0
- /package/{notes-api → notes/api}/app/models/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/models/audit.py +0 -0
- /package/{notes-api → notes/api}/app/models/base.py +0 -0
- /package/{notes-api → notes/api}/app/models/collab.py +0 -0
- /package/{notes-api → notes/api}/app/models/comment.py +0 -0
- /package/{notes-api → notes/api}/app/models/session.py +0 -0
- /package/{notes-api → notes/api}/app/models/setting.py +0 -0
- /package/{notes-api → notes/api}/app/models/user.py +0 -0
- /package/{notes-api → notes/api}/app/path_validation.py +0 -0
- /package/{notes-api → notes/api}/app/routers/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/routers/collab.py +0 -0
- /package/{notes-api → notes/api}/app/routers/comments.py +0 -0
- /package/{notes-api → notes/api}/app/routers/files.py +0 -0
- /package/{notes-api → notes/api}/app/routers/settings.py +0 -0
- /package/{notes-api → notes/api}/app/routers/tree.py +0 -0
- /package/{notes-api → notes/api}/app/routers/upload.py +0 -0
- /package/{notes-api → notes/api}/app/routers/users.py +0 -0
- /package/{notes-api → notes/api}/app/schemas/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/schemas/auth.py +0 -0
- /package/{notes-api → notes/api}/app/schemas/user.py +0 -0
- /package/{notes-api → notes/api}/app/security.py +0 -0
- /package/{notes-api → notes/api}/app/services/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/services/audit.py +0 -0
- /package/{notes-api → notes/api}/app/services/business_date.py +0 -0
- /package/{notes-api → notes/api}/app/services/collab.py +0 -0
- /package/{notes-api → notes/api}/app/services/github.py +0 -0
- /package/{notes-api → notes/api}/app/services/pr_chain.py +0 -0
- /package/{notes-api → notes/api}/app/startup.py +0 -0
- /package/{notes-api → notes/api}/docker/Dockerfile +0 -0
- /package/{notes-api → notes/api}/docker/Dockerfile.test +0 -0
- /package/{notes-api → notes/api}/pyproject.toml +0 -0
- /package/{notes-api → notes/api}/tests/conftest.py +0 -0
- /package/{notes-api → notes/api}/tests/test_audit.py +0 -0
- /package/{notes-api → notes/api}/tests/test_auth.py +0 -0
- /package/{notes-api → notes/api}/tests/test_business_date.py +0 -0
- /package/{notes-api → notes/api}/tests/test_collab.py +0 -0
- /package/{notes-api → notes/api}/tests/test_comments.py +0 -0
- /package/{notes-api → notes/api}/tests/test_config_ssl.py +0 -0
- /package/{notes-api → notes/api}/tests/test_config_warnings.py +0 -0
- /package/{notes-api → notes/api}/tests/test_files.py +0 -0
- /package/{notes-api → notes/api}/tests/test_path_validation.py +0 -0
- /package/{notes-api → notes/api}/tests/test_security.py +0 -0
- /package/{notes-api → notes/api}/tests/test_settings.py +0 -0
- /package/{notes-api → notes/api}/tests/test_tree.py +0 -0
- /package/{notes-api → notes/api}/tests/test_upload.py +0 -0
- /package/{notes-api → notes/api}/tests/test_users.py +0 -0
- /package/{notes-app → notes/app}/.dockerignore +0 -0
- /package/{notes-app → notes/app}/index.html +0 -0
- /package/{notes-app → notes/app}/nginx.conf +0 -0
- /package/{notes-app → notes/app}/package-lock.json +0 -0
- /package/{notes-app → notes/app}/playwright.config.ts +0 -0
- /package/{notes-app → notes/app}/pnpm-lock.yaml +0 -0
- /package/{notes-app → notes/app}/src/App.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/BranchSelectorModal.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/CodeBlockView.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/CodeBlockView.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/CollabStatus.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/DiffPreview.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/DrawioEditor.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/DrawioViewer.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/ErrorBoundary.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/ErrorBoundary.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileContentView.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileContextMenu.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileContextMenu.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileDialogs.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileDialogs.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SaveStatusIndicator.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SaveStatusIndicator.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/Skeleton.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SpreadsheetEditor.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SpreadsheetEditor.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/TextEditor.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/ToastContainer.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/TreeNode.tsx +0 -0
- /package/{notes-app → notes/app}/src/contexts/AuthContext.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/contexts/AuthContext.tsx +0 -0
- /package/{notes-app → notes/app}/src/contexts/ToastContext.test.ts +0 -0
- /package/{notes-app → notes/app}/src/contexts/ToastContext.tsx +0 -0
- /package/{notes-app → notes/app}/src/hooks/useAutoSave.test.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useAutoSave.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useCollaboration.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useComments.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useYText.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/branch-diff.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/branch-diff.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/created-file.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/created-file.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/csv-utils.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/csv-utils.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/deepLinkPathToSearch.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/deepLinkPathToSearch.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/draft-storage.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/draft-storage.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/mermaid-render.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/postLoginRedirect.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/postLoginRedirect.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/tree-utils.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/user-colors.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/xlsx-utils.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/xlsx-utils.ts +0 -0
- /package/{notes-app → notes/app}/src/main.tsx +0 -0
- /package/{notes-app → notes/app}/src/pages/LoginPage.tsx +0 -0
- /package/{notes-app → notes/app}/src/pages/MainPage.insertChildEntry.test.ts +0 -0
- /package/{notes-app → notes/app}/src/pages/SettingsPage.tsx +0 -0
- /package/{notes-app → notes/app}/src/pages/UserManagementPage.tsx +0 -0
- /package/{notes-app → notes/app}/src/styles/globals.css +0 -0
- /package/{notes-app → notes/app}/src/types.ts +0 -0
- /package/{notes-app → notes/app}/src/vite-env.d.ts +0 -0
- /package/{notes-app → notes/app}/tsconfig.json +0 -0
- /package/{notes-app → notes/app}/tsconfig.node.json +0 -0
- /package/{notes-app → notes/app}/vite.config.js +0 -0
- /package/{notes-app → notes/app}/vite.config.ts +0 -0
- /package/{notes-app → notes/app}/vitest.config.ts +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { screen, waitFor, fireEvent, within, act } from "@testing-library/react";
|
|
3
|
+
import type { Proposal } from "@/lib/api";
|
|
4
|
+
import {
|
|
5
|
+
jsonResponse,
|
|
6
|
+
mockAuthContext,
|
|
7
|
+
mockAutoSave,
|
|
8
|
+
mockCollaboration,
|
|
9
|
+
mockComments,
|
|
10
|
+
mockEditSession,
|
|
11
|
+
mockMatchMedia,
|
|
12
|
+
} from "@/test/mocks";
|
|
13
|
+
import { renderWithProviders } from "@/test/render";
|
|
14
|
+
|
|
15
|
+
const mockApiFetch = vi.hoisted(() => vi.fn());
|
|
16
|
+
const mockFetchProposalsApi = vi.hoisted(() => vi.fn());
|
|
17
|
+
const triggerPeriodicSync = vi.hoisted(() => vi.fn());
|
|
18
|
+
|
|
19
|
+
vi.mock("@/hooks/usePeriodicSync", () => {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- mock factory 制約
|
|
21
|
+
const { useEffect } = require("react") as typeof import("react");
|
|
22
|
+
return {
|
|
23
|
+
usePeriodicSync: ({ onSync, enabled }: { onSync: () => void; enabled: boolean }) => {
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
triggerPeriodicSync.mockImplementation(() => {
|
|
26
|
+
if (enabled) onSync();
|
|
27
|
+
});
|
|
28
|
+
}, [enabled, onSync]);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
vi.mock("@/lib/api", async (importOriginal) => {
|
|
34
|
+
const actual = await importOriginal<typeof import("@/lib/api")>();
|
|
35
|
+
return {
|
|
36
|
+
...actual,
|
|
37
|
+
apiFetch: (...args: unknown[]) => mockApiFetch(...args),
|
|
38
|
+
fetchProposalsApi: () => mockFetchProposalsApi(),
|
|
39
|
+
// getErrorMessage / isAbortError は純粋関数のため実体(...actual)をそのまま使う
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
vi.mock("@/contexts/AuthContext", () => ({ useAuth: () => mockAuthContext() }));
|
|
44
|
+
vi.mock("@/hooks/useEditSession", () => ({ useEditSession: () => mockEditSession() }));
|
|
45
|
+
vi.mock("@/hooks/useAutoSave", () => ({ useAutoSave: () => mockAutoSave() }));
|
|
46
|
+
vi.mock("@/hooks/useCollaboration", () => ({
|
|
47
|
+
useCollaboration: () => mockCollaboration(),
|
|
48
|
+
}));
|
|
49
|
+
vi.mock("@/hooks/useComments", () => ({ useComments: () => mockComments() }));
|
|
50
|
+
|
|
51
|
+
import MainPage from "./MainPage";
|
|
52
|
+
|
|
53
|
+
function mockReadyTreeApi() {
|
|
54
|
+
mockApiFetch.mockImplementation((url: string) => {
|
|
55
|
+
if (url.startsWith("/tree")) {
|
|
56
|
+
return Promise.resolve(
|
|
57
|
+
jsonResponse([
|
|
58
|
+
{
|
|
59
|
+
name: "docs",
|
|
60
|
+
path: "docs",
|
|
61
|
+
type: "dir",
|
|
62
|
+
children: [{ name: "readme.md", path: "docs/readme.md", type: "file" }],
|
|
63
|
+
},
|
|
64
|
+
]),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return Promise.resolve({ ok: false, status: 404, headers: { get: () => null } });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const INITIAL_PROPOSAL: Proposal = {
|
|
72
|
+
number: 10,
|
|
73
|
+
title: "Initial branch PR",
|
|
74
|
+
branch: "docs/alice/20260601",
|
|
75
|
+
author: "alice",
|
|
76
|
+
state: "open",
|
|
77
|
+
merged: false,
|
|
78
|
+
createdAt: "2026-06-01T00:00:00Z",
|
|
79
|
+
updatedAt: "2026-06-01T00:00:00Z",
|
|
80
|
+
url: "https://github.com/ripla-inc/GoDD/pull/10",
|
|
81
|
+
draft: false,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const NEW_PROPOSAL: Proposal = {
|
|
85
|
+
number: 11,
|
|
86
|
+
title: "New branch PR from GitHub",
|
|
87
|
+
branch: "docs/bob/20260602",
|
|
88
|
+
author: "bob",
|
|
89
|
+
state: "open",
|
|
90
|
+
merged: false,
|
|
91
|
+
createdAt: "2026-06-02T00:00:00Z",
|
|
92
|
+
updatedAt: "2026-06-02T00:00:00Z",
|
|
93
|
+
url: "https://github.com/ripla-inc/GoDD/pull/11",
|
|
94
|
+
draft: false,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
function renderMainPage() {
|
|
98
|
+
return renderWithProviders(<MainPage />);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function openBranchModal() {
|
|
102
|
+
const sidebar = await waitFor(() => screen.getByTestId("left-sidebar"));
|
|
103
|
+
fireEvent.click(within(sidebar).getByRole("button", { name: "main" }));
|
|
104
|
+
await screen.findByRole("heading", { name: "ブランチ一覧" });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
describe("MainPage — BranchSelectorModal REQ-016-AC-07", () => {
|
|
108
|
+
beforeEach(() => {
|
|
109
|
+
vi.clearAllMocks();
|
|
110
|
+
mockMatchMedia(true);
|
|
111
|
+
HTMLDialogElement.prototype.showModal = vi.fn(function (this: HTMLDialogElement) {
|
|
112
|
+
this.open = true;
|
|
113
|
+
});
|
|
114
|
+
HTMLDialogElement.prototype.close = vi.fn(function (this: HTMLDialogElement) {
|
|
115
|
+
this.open = false;
|
|
116
|
+
});
|
|
117
|
+
mockReadyTreeApi();
|
|
118
|
+
let proposalCalls = 0;
|
|
119
|
+
mockFetchProposalsApi.mockImplementation(() => {
|
|
120
|
+
proposalCalls += 1;
|
|
121
|
+
if (proposalCalls === 1) {
|
|
122
|
+
return Promise.resolve([INITIAL_PROPOSAL]);
|
|
123
|
+
}
|
|
124
|
+
return Promise.resolve([INITIAL_PROPOSAL, NEW_PROPOSAL]);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("REQ-016-AC-07: モーダル表示中の background sync で proposals 一覧が更新される", async () => {
|
|
129
|
+
renderMainPage();
|
|
130
|
+
await openBranchModal();
|
|
131
|
+
|
|
132
|
+
expect(screen.getByText("Initial branch PR")).toBeTruthy();
|
|
133
|
+
expect(screen.queryByText("New branch PR from GitHub")).toBeNull();
|
|
134
|
+
|
|
135
|
+
await act(async () => {
|
|
136
|
+
triggerPeriodicSync();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
await waitFor(() => {
|
|
140
|
+
expect(screen.getByText("New branch PR from GitHub")).toBeTruthy();
|
|
141
|
+
});
|
|
142
|
+
expect(mockFetchProposalsApi).toHaveBeenCalledTimes(2);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("REQ-016-AC-04 相当: background sync 失敗時は error を表示せず直前の proposals を維持する", async () => {
|
|
146
|
+
mockFetchProposalsApi.mockReset();
|
|
147
|
+
mockFetchProposalsApi
|
|
148
|
+
.mockResolvedValueOnce([INITIAL_PROPOSAL])
|
|
149
|
+
.mockRejectedValueOnce(new Error("502 Bad Gateway"));
|
|
150
|
+
|
|
151
|
+
renderMainPage();
|
|
152
|
+
await openBranchModal();
|
|
153
|
+
|
|
154
|
+
expect(screen.getByText("Initial branch PR")).toBeTruthy();
|
|
155
|
+
|
|
156
|
+
await act(async () => {
|
|
157
|
+
triggerPeriodicSync();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
await waitFor(() => {
|
|
161
|
+
expect(mockFetchProposalsApi).toHaveBeenCalledTimes(2);
|
|
162
|
+
});
|
|
163
|
+
expect(screen.getByText("Initial branch PR")).toBeTruthy();
|
|
164
|
+
expect(screen.queryByText(/502 Bad Gateway/)).toBeNull();
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it("REQ-016-AC-07 競合(#936): 手動 refresh と background poll の並走で古い proposals が新しい一覧を上書きしない", async () => {
|
|
168
|
+
let resolveStalePoll: ((v: Proposal[]) => void) | undefined;
|
|
169
|
+
const stalePoll = new Promise<Proposal[]>((resolve) => {
|
|
170
|
+
resolveStalePoll = resolve;
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
mockFetchProposalsApi.mockReset();
|
|
174
|
+
let calls = 0;
|
|
175
|
+
mockFetchProposalsApi.mockImplementation(() => {
|
|
176
|
+
calls += 1;
|
|
177
|
+
if (calls === 1) return Promise.resolve([INITIAL_PROPOSAL]); // mount foreground
|
|
178
|
+
if (calls === 2) return stalePoll; // background poll(in-flight・古い一覧)
|
|
179
|
+
return Promise.resolve([INITIAL_PROPOSAL, NEW_PROPOSAL]); // 手動 refresh(新しい一覧)
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
renderMainPage();
|
|
183
|
+
await openBranchModal();
|
|
184
|
+
expect(screen.getByText("Initial branch PR")).toBeTruthy();
|
|
185
|
+
|
|
186
|
+
// background poll を in-flight にする(beginPollBranches で poll seq が進む)
|
|
187
|
+
await act(async () => {
|
|
188
|
+
triggerPeriodicSync();
|
|
189
|
+
await Promise.resolve();
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// 手動 refresh(foreground)が新しい一覧を適用(beginLoadBranches が in-flight poll を無効化)
|
|
193
|
+
const modal = screen.getByRole("dialog");
|
|
194
|
+
await act(async () => {
|
|
195
|
+
fireEvent.click(within(modal).getByTitle("一覧を更新"));
|
|
196
|
+
});
|
|
197
|
+
await waitFor(() => expect(screen.getByText("New branch PR from GitHub")).toBeTruthy());
|
|
198
|
+
|
|
199
|
+
// 後着の古い background poll 応答は破棄され、新しい一覧を上書きしない
|
|
200
|
+
await act(async () => {
|
|
201
|
+
resolveStalePoll?.([INITIAL_PROPOSAL]);
|
|
202
|
+
await Promise.resolve();
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
expect(screen.getByText("New branch PR from GitHub")).toBeTruthy();
|
|
206
|
+
expect(mockFetchProposalsApi).toHaveBeenCalledTimes(3);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("REQ-016-AC-07: モーダル非表示時は background sync で proposals API を再取得しない", async () => {
|
|
210
|
+
renderMainPage();
|
|
211
|
+
await openBranchModal();
|
|
212
|
+
|
|
213
|
+
const callsAfterOpen = mockFetchProposalsApi.mock.calls.length;
|
|
214
|
+
|
|
215
|
+
const modal = screen.getByRole("dialog");
|
|
216
|
+
await act(async () => {
|
|
217
|
+
fireEvent.click(within(modal).getByRole("button", { name: "閉じる" }));
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
await act(async () => {
|
|
221
|
+
triggerPeriodicSync();
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
expect(mockFetchProposalsApi.mock.calls.length).toBe(callsAfterOpen);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { screen, waitFor, fireEvent } from "@testing-library/react";
|
|
3
|
+
import type { IssueDetail, IssueSummary } from "@/lib/api";
|
|
4
|
+
import {
|
|
5
|
+
jsonResponse,
|
|
6
|
+
mockAuthContext,
|
|
7
|
+
mockAutoSave,
|
|
8
|
+
mockCollaboration,
|
|
9
|
+
mockComments,
|
|
10
|
+
mockEditSession,
|
|
11
|
+
mockMatchMedia,
|
|
12
|
+
} from "@/test/mocks";
|
|
13
|
+
import { renderWithProviders } from "@/test/render";
|
|
14
|
+
|
|
15
|
+
const mockApiFetch = vi.hoisted(() => vi.fn());
|
|
16
|
+
const mockFetchProposalsApi = vi.hoisted(() => vi.fn());
|
|
17
|
+
const mockListIssuesApi = vi.hoisted(() => vi.fn());
|
|
18
|
+
const mockListIssueLabelsApi = vi.hoisted(() => vi.fn());
|
|
19
|
+
|
|
20
|
+
// usePeriodicSync は本テストでは不要(外部変更はモック IssueDetailView から手動 dispatch する)
|
|
21
|
+
vi.mock("@/hooks/usePeriodicSync", () => ({
|
|
22
|
+
usePeriodicSync: () => {},
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
vi.mock("@/lib/api", async (importOriginal) => {
|
|
26
|
+
const actual = await importOriginal<typeof import("@/lib/api")>();
|
|
27
|
+
return {
|
|
28
|
+
...actual,
|
|
29
|
+
apiFetch: (...args: unknown[]) => mockApiFetch(...args),
|
|
30
|
+
fetchProposalsApi: () => mockFetchProposalsApi(),
|
|
31
|
+
listIssuesApi: (...args: unknown[]) => mockListIssuesApi(...args),
|
|
32
|
+
listIssueLabelsApi: (...args: unknown[]) => mockListIssueLabelsApi(...args),
|
|
33
|
+
// getErrorMessage / isAbortError は純粋関数のため実体(...actual)をそのまま使う
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
vi.mock("@/contexts/AuthContext", () => ({ useAuth: () => mockAuthContext() }));
|
|
38
|
+
vi.mock("@/hooks/useEditSession", () => ({ useEditSession: () => mockEditSession() }));
|
|
39
|
+
vi.mock("@/hooks/useAutoSave", () => ({ useAutoSave: () => mockAutoSave() }));
|
|
40
|
+
vi.mock("@/hooks/useCollaboration", () => ({
|
|
41
|
+
useCollaboration: () => mockCollaboration(),
|
|
42
|
+
}));
|
|
43
|
+
vi.mock("@/hooks/useComments", () => ({ useComments: () => mockComments() }));
|
|
44
|
+
|
|
45
|
+
// 詳細ビューはテストダブルに差し替え、外部変更検知を手動トリガするボタンを公開する。
|
|
46
|
+
// MainPage の handleIssueExternalChange → optimistic 設定 → clear effect の結線を検証する。
|
|
47
|
+
const issue10v2Detail: IssueDetail = {
|
|
48
|
+
number: 10,
|
|
49
|
+
title: "Issue 10 (外部更新)",
|
|
50
|
+
state: "open",
|
|
51
|
+
labels: [],
|
|
52
|
+
author: "user1",
|
|
53
|
+
assignees: [],
|
|
54
|
+
comments: 0,
|
|
55
|
+
createdAt: "2026-05-19T00:00:00Z",
|
|
56
|
+
updatedAt: "2026-06-10T00:00:00Z",
|
|
57
|
+
body: "更新後の本文",
|
|
58
|
+
url: "https://github.com/ripla-inc/GoDD/issues/10",
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
vi.mock("@/components/IssueDetailView", () => ({
|
|
62
|
+
default: ({
|
|
63
|
+
issueNumber,
|
|
64
|
+
onExternalChange,
|
|
65
|
+
}: {
|
|
66
|
+
issueNumber: number | "new";
|
|
67
|
+
onExternalChange?: (issue: IssueDetail, options?: { background?: boolean }) => void;
|
|
68
|
+
}) => (
|
|
69
|
+
<div>
|
|
70
|
+
<span>detail-{String(issueNumber)}</span>
|
|
71
|
+
<button
|
|
72
|
+
type="button"
|
|
73
|
+
onClick={() => onExternalChange?.(issue10v2Detail, { background: true })}
|
|
74
|
+
>
|
|
75
|
+
外部変更を発火
|
|
76
|
+
</button>
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
import MainPage from "./MainPage";
|
|
82
|
+
|
|
83
|
+
const baseSummary = (overrides: Partial<IssueSummary> = {}): IssueSummary => ({
|
|
84
|
+
number: 0,
|
|
85
|
+
title: "",
|
|
86
|
+
state: "open",
|
|
87
|
+
labels: [],
|
|
88
|
+
author: "user1",
|
|
89
|
+
assignees: [],
|
|
90
|
+
comments: 0,
|
|
91
|
+
createdAt: "2026-05-19T00:00:00Z",
|
|
92
|
+
updatedAt: "2026-05-19T00:00:00Z",
|
|
93
|
+
...overrides,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
function renderMainPage(initialEntry: string) {
|
|
97
|
+
return renderWithProviders(<MainPage />, { initialEntries: [initialEntry] });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
describe("MainPage — Issue 外部変更の即時反映と選択離脱時の破棄(#945 / REQ-016-AC-12)", () => {
|
|
101
|
+
beforeEach(() => {
|
|
102
|
+
vi.clearAllMocks();
|
|
103
|
+
mockMatchMedia(true);
|
|
104
|
+
mockFetchProposalsApi.mockResolvedValue([]);
|
|
105
|
+
mockListIssueLabelsApi.mockResolvedValue({ labels: [] });
|
|
106
|
+
mockListIssuesApi.mockResolvedValue({
|
|
107
|
+
issues: [
|
|
108
|
+
baseSummary({ number: 10, title: "Issue 10" }),
|
|
109
|
+
baseSummary({ number: 9, title: "Issue 9" }),
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
// /tree は live(配列)で返し apiState=ready → githubSyncEnabled=true
|
|
113
|
+
mockApiFetch.mockImplementation((url: string) => {
|
|
114
|
+
if (url.startsWith("/tree")) {
|
|
115
|
+
return Promise.resolve(jsonResponse([]));
|
|
116
|
+
}
|
|
117
|
+
return Promise.resolve({ ok: false, status: 404, headers: { get: () => null } });
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("抑制時の外部変更で一覧行を即時更新し、別 Issue へ移動すると optimistic を破棄する", async () => {
|
|
122
|
+
renderMainPage("/?issue=10");
|
|
123
|
+
|
|
124
|
+
// Issues タブで一覧と詳細(モック)が表示される
|
|
125
|
+
await waitFor(() => expect(screen.getByText("detail-10")).toBeTruthy());
|
|
126
|
+
await waitFor(() => expect(screen.getByText("Issue 10")).toBeTruthy());
|
|
127
|
+
|
|
128
|
+
const listCallsBefore = mockListIssuesApi.mock.calls.length;
|
|
129
|
+
|
|
130
|
+
// 詳細 poll の外部変更検知を発火 → 追加 GET /api/issues なしで一覧行が即時更新される
|
|
131
|
+
fireEvent.click(screen.getByRole("button", { name: "外部変更を発火" }));
|
|
132
|
+
|
|
133
|
+
await waitFor(() => expect(screen.getByText("Issue 10 (外部更新)")).toBeTruthy());
|
|
134
|
+
expect(mockListIssuesApi.mock.calls.length).toBe(listCallsBefore);
|
|
135
|
+
|
|
136
|
+
// 別 Issue (#9) を選択 → snapshot optimistic は破棄され、行は実体(v1)へ戻る
|
|
137
|
+
fireEvent.click(screen.getByText("Issue 9"));
|
|
138
|
+
|
|
139
|
+
await waitFor(() => expect(screen.getByText("detail-9")).toBeTruthy());
|
|
140
|
+
await waitFor(() => {
|
|
141
|
+
expect(screen.queryByText("Issue 10 (外部更新)")).toBeNull();
|
|
142
|
+
expect(screen.getByText("Issue 10")).toBeTruthy();
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
});
|