@dxos/plugin-github 0.7.4 → 0.13.0
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/LICENSE +102 -5
- package/PLUGIN.mdl +784 -0
- package/dist/lib/GitHubCapabilities.mjs +10 -0
- package/dist/lib/GitHubCapabilities.mjs.map +1 -0
- package/dist/lib/GitHubEvents.mjs +15 -0
- package/dist/lib/GitHubEvents.mjs.map +1 -0
- package/dist/lib/GitHubOperation.mjs +358 -0
- package/dist/lib/GitHubOperation.mjs.map +1 -0
- package/dist/lib/GitHubPlugin.mjs +16 -0
- package/dist/lib/GitHubPlugin.mjs.map +1 -0
- package/dist/lib/Walkthrough.mjs +59 -0
- package/dist/lib/Walkthrough.mjs.map +1 -0
- package/dist/lib/capabilities.browser.mjs +54 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +54 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/capabilities.node.mjs +30 -0
- package/dist/lib/capabilities.node.mjs.map +1 -0
- package/dist/lib/capabilities.tauri.mjs +54 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +30 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -0
- package/dist/lib/chunk-ImportPullRequestDialog.mjs +116 -0
- package/dist/lib/chunk-ImportPullRequestDialog.mjs.map +1 -0
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestArticle.mjs +1486 -0
- package/dist/lib/chunk-PullRequestArticle.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestArticle2.mjs +2 -0
- package/dist/lib/chunk-PullRequestCardMenu.mjs +123 -0
- package/dist/lib/chunk-PullRequestCardMenu.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestsArticle.mjs +594 -0
- package/dist/lib/chunk-PullRequestsArticle.mjs.map +1 -0
- package/dist/lib/chunk-WalkthroughArticle.mjs +26 -0
- package/dist/lib/chunk-WalkthroughArticle.mjs.map +1 -0
- package/dist/lib/chunk-add-pull-request-comment.mjs +19 -0
- package/dist/lib/chunk-add-pull-request-comment.mjs.map +1 -0
- package/dist/lib/chunk-add-pull-request-review-comment.mjs +25 -0
- package/dist/lib/chunk-add-pull-request-review-comment.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +39 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-connector.mjs +70 -0
- package/dist/lib/chunk-connector.mjs.map +1 -0
- package/dist/lib/chunk-constants.mjs +11 -0
- package/dist/lib/chunk-constants.mjs.map +1 -0
- package/dist/lib/chunk-errors.mjs +29 -0
- package/dist/lib/chunk-errors.mjs.map +1 -0
- package/dist/lib/chunk-generate-walkthrough.mjs +86 -0
- package/dist/lib/chunk-generate-walkthrough.mjs.map +1 -0
- package/dist/lib/chunk-generate.mjs +719 -0
- package/dist/lib/chunk-generate.mjs.map +1 -0
- package/dist/lib/chunk-get-pull-request-diff.mjs +25 -0
- package/dist/lib/chunk-get-pull-request-diff.mjs.map +1 -0
- package/dist/lib/chunk-get-pull-request-status.mjs +29 -0
- package/dist/lib/chunk-get-pull-request-status.mjs.map +1 -0
- package/dist/lib/chunk-get-repositories.mjs +32 -0
- package/dist/lib/chunk-get-repositories.mjs.map +1 -0
- package/dist/lib/chunk-github-api.mjs +375 -0
- package/dist/lib/chunk-github-api.mjs.map +1 -0
- package/dist/lib/chunk-github-link.mjs +59 -0
- package/dist/lib/chunk-github-link.mjs.map +1 -0
- package/dist/lib/chunk-import-pull-request-from-snapshot.mjs +25 -0
- package/dist/lib/chunk-import-pull-request-from-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-import-pull-request.mjs +96 -0
- package/dist/lib/chunk-import-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-link-resolver.mjs +109 -0
- package/dist/lib/chunk-link-resolver.mjs.map +1 -0
- package/dist/lib/chunk-markdown-extension.mjs +92 -0
- package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
- package/dist/lib/chunk-materialize-target.mjs +36 -0
- package/dist/lib/chunk-materialize-target.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +12 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-page-action.mjs +22 -0
- package/dist/lib/chunk-page-action.mjs.map +1 -0
- package/dist/lib/chunk-pull-request.mjs +58 -0
- package/dist/lib/chunk-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-pull-request2.mjs +110 -0
- package/dist/lib/chunk-pull-request2.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +233 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-schema.mjs +15 -0
- package/dist/lib/chunk-schema.mjs.map +1 -0
- package/dist/lib/chunk-skill-definition.mjs +10 -0
- package/dist/lib/chunk-skill-definition.mjs.map +1 -0
- package/dist/lib/chunk-submit-pull-request-approval.mjs +56 -0
- package/dist/lib/chunk-submit-pull-request-approval.mjs.map +1 -0
- package/dist/lib/chunk-sync-pull-request.mjs +24 -0
- package/dist/lib/chunk-sync-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-sync.mjs +481 -0
- package/dist/lib/chunk-sync.mjs.map +1 -0
- package/dist/lib/chunk-useOpenObject.mjs +43 -0
- package/dist/lib/chunk-useOpenObject.mjs.map +1 -0
- package/dist/lib/extensions.mjs +132 -0
- package/dist/lib/extensions.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +47 -0
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/ns/Extensions.mjs +18 -0
- package/dist/lib/ns/Extensions.mjs.map +1 -0
- package/dist/lib/operations.mjs +22 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/skills.mjs +44 -0
- package/dist/lib/skills.mjs.map +1 -0
- package/dist/lib/testing.mjs +189 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +136 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +5 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/Extensions.d.ts +2 -0
- package/dist/types/src/Extensions.d.ts.map +1 -0
- package/dist/types/src/GitHubPlugin.d.ts +37 -0
- package/dist/types/src/GitHubPlugin.d.ts.map +1 -0
- package/dist/types/src/GitHubPlugin.workerd.test.d.ts +2 -0
- package/dist/types/src/GitHubPlugin.workerd.test.d.ts.map +1 -0
- package/dist/types/src/approval.d.ts +21 -0
- package/dist/types/src/approval.d.ts.map +1 -0
- package/dist/types/src/approval.test.d.ts +2 -0
- package/dist/types/src/approval.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +9 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/connector.d.ts +17 -0
- package/dist/types/src/capabilities/connector.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/browser.d.ts +13 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts +13 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts +13 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts +13 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +13 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/link-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/link-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts +14 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/page-action.d.ts +5 -0
- package/dist/types/src/capabilities/page-action.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema.d.ts +12 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/cards/GitHubCard.d.ts +11 -0
- package/dist/types/src/cards/GitHubCard.d.ts.map +1 -0
- package/dist/types/src/cards/GitHubCard.stories.d.ts +45 -0
- package/dist/types/src/cards/GitHubCard.stories.d.ts.map +1 -0
- package/dist/types/src/cards/PullRequestCard.d.ts +9 -0
- package/dist/types/src/cards/PullRequestCard.d.ts.map +1 -0
- package/dist/types/src/cards/index.d.ts +3 -0
- package/dist/types/src/cards/index.d.ts.map +1 -0
- package/dist/types/src/components/CommentComposer/CommentComposer.d.ts +30 -0
- package/dist/types/src/components/CommentComposer/CommentComposer.d.ts.map +1 -0
- package/dist/types/src/components/CommentComposer/index.d.ts +2 -0
- package/dist/types/src/components/CommentComposer/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts +8 -0
- package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/FileTree.d.ts +17 -0
- package/dist/types/src/components/PullRequestFiles/FileTree.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts +23 -0
- package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/files.d.ts +39 -0
- package/dist/types/src/components/PullRequestFiles/files.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/files.test.d.ts +2 -0
- package/dist/types/src/components/PullRequestFiles/files.test.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/index.d.ts +5 -0
- package/dist/types/src/components/PullRequestFiles/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts +21 -0
- package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts +15 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts +10 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts +16 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts +28 -0
- package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/index.d.ts +6 -0
- package/dist/types/src/components/PullRequestOverview/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts +20 -0
- package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestStatus/index.d.ts +2 -0
- package/dist/types/src/components/PullRequestStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts +18 -0
- package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/extensions.d.ts +16 -0
- package/dist/types/src/components/WalkthroughView/extensions.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/index.d.ts +3 -0
- package/dist/types/src/components/WalkthroughView/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +7 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts +6 -0
- package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts +15 -0
- package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/failure.d.ts +10 -0
- package/dist/types/src/containers/PullRequestArticle/failure.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts +2 -0
- package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts +14 -0
- package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestCardMenu/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestCardMenu/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts +13 -0
- package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts +44 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts +2 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/format.d.ts +3 -0
- package/dist/types/src/containers/PullRequestsArticle/format.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestsArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts +13 -0
- package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts.map +1 -0
- package/dist/types/src/containers/WalkthroughArticle/index.d.ts +2 -0
- package/dist/types/src/containers/WalkthroughArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +157 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +3 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/links.d.ts +21 -0
- package/dist/types/src/extensions/links.d.ts.map +1 -0
- package/dist/types/src/extensions/links.test.d.ts +2 -0
- package/dist/types/src/extensions/links.test.d.ts.map +1 -0
- package/dist/types/src/extensions/references.d.ts +23 -0
- package/dist/types/src/extensions/references.d.ts.map +1 -0
- package/dist/types/src/extensions/references.test.d.ts +2 -0
- package/dist/types/src/extensions/references.test.d.ts.map +1 -0
- package/dist/types/src/github-link.d.ts +29 -0
- package/dist/types/src/github-link.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useOpenObject.d.ts +9 -0
- package/dist/types/src/hooks/useOpenObject.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestChecks.d.ts +10 -0
- package/dist/types/src/hooks/usePullRequestChecks.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestDiff.d.ts +12 -0
- package/dist/types/src/hooks/usePullRequestDiff.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestFiles.d.ts +22 -0
- package/dist/types/src/hooks/usePullRequestFiles.d.ts.map +1 -0
- package/dist/types/src/hooks/useSyncPullRequest.d.ts +10 -0
- package/dist/types/src/hooks/useSyncPullRequest.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +34 -11
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-pull-request-comment.d.ts +5 -0
- package/dist/types/src/operations/add-pull-request-comment.d.ts.map +1 -0
- package/dist/types/src/operations/add-pull-request-review-comment.d.ts +5 -0
- package/dist/types/src/operations/add-pull-request-review-comment.d.ts.map +1 -0
- package/dist/types/src/operations/generate-walkthrough.d.ts +11 -0
- package/dist/types/src/operations/generate-walkthrough.d.ts.map +1 -0
- package/dist/types/src/operations/get-pull-request-diff.d.ts +5 -0
- package/dist/types/src/operations/get-pull-request-diff.d.ts.map +1 -0
- package/dist/types/src/operations/get-pull-request-status.d.ts +5 -0
- package/dist/types/src/operations/get-pull-request-status.d.ts.map +1 -0
- package/dist/types/src/operations/get-repositories.d.ts +13 -0
- package/dist/types/src/operations/get-repositories.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts +12 -0
- package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request.d.ts +63 -0
- package/dist/types/src/operations/import-pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request.test.d.ts +2 -0
- package/dist/types/src/operations/import-pull-request.test.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/materialize-target.d.ts +12 -0
- package/dist/types/src/operations/materialize-target.d.ts.map +1 -0
- package/dist/types/src/operations/pull-request.d.ts +48 -0
- package/dist/types/src/operations/pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/pull-request.test.d.ts +2 -0
- package/dist/types/src/operations/pull-request.test.d.ts.map +1 -0
- package/dist/types/src/operations/submit-pull-request-approval.d.ts +5 -0
- package/dist/types/src/operations/submit-pull-request-approval.d.ts.map +1 -0
- package/dist/types/src/operations/sync-pull-request.d.ts +5 -0
- package/dist/types/src/operations/sync-pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/sync.d.ts +123 -0
- package/dist/types/src/operations/sync.d.ts.map +1 -0
- package/dist/types/src/operations/sync.test.d.ts +2 -0
- package/dist/types/src/operations/sync.test.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/plugin.test.d.ts +2 -0
- package/dist/types/src/plugin.test.d.ts.map +1 -0
- package/dist/types/src/pull-request-body.d.ts +37 -0
- package/dist/types/src/pull-request-body.d.ts.map +1 -0
- package/dist/types/src/pull-request-body.test.d.ts +2 -0
- package/dist/types/src/pull-request-body.test.d.ts.map +1 -0
- package/dist/types/src/pull-request.d.ts +28 -0
- package/dist/types/src/pull-request.d.ts.map +1 -0
- package/dist/types/src/pull-request.test.d.ts +2 -0
- package/dist/types/src/pull-request.test.d.ts.map +1 -0
- package/dist/types/src/services/github-api.d.ts +332 -0
- package/dist/types/src/services/github-api.d.ts.map +1 -0
- package/dist/types/src/services/index.d.ts +2 -0
- package/dist/types/src/services/index.d.ts.map +1 -0
- package/dist/types/src/skills/GitHubSkill.d.ts +12 -0
- package/dist/types/src/skills/GitHubSkill.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/stories/Generate.stories.d.ts +27 -0
- package/dist/types/src/stories/Generate.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Links.stories.d.ts +23 -0
- package/dist/types/src/stories/Links.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestArticle.stories.d.ts +359 -0
- package/dist/types/src/stories/PullRequestArticle.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestFiles.stories.d.ts +365 -0
- package/dist/types/src/stories/PullRequestFiles.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestOverview.stories.d.ts +367 -0
- package/dist/types/src/stories/PullRequestOverview.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestsArticle.stories.d.ts +357 -0
- package/dist/types/src/stories/PullRequestsArticle.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Walkthrough.stories.d.ts +380 -0
- package/dist/types/src/stories/Walkthrough.stories.d.ts.map +1 -0
- package/dist/types/src/stories/github.d.ts +23 -0
- package/dist/types/src/stories/github.d.ts.map +1 -0
- package/dist/types/src/stories/github.test.d.ts +2 -0
- package/dist/types/src/stories/github.test.d.ts.map +1 -0
- package/dist/types/src/stories/walkthrough-fixture.d.ts +8 -0
- package/dist/types/src/stories/walkthrough-fixture.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures.d.ts +14 -0
- package/dist/types/src/testing/fixtures.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/plugin.d.ts +4 -0
- package/dist/types/src/testing/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/pull-request-13348.d.ts +6 -0
- package/dist/types/src/testing/pull-request-13348.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +339 -53
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/GitHubCapabilities.d.ts +13 -0
- package/dist/types/src/types/GitHubCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/GitHubEvents.d.ts +8 -0
- package/dist/types/src/types/GitHubEvents.d.ts.map +1 -0
- package/dist/types/src/types/GitHubOperation.d.ts +270 -0
- package/dist/types/src/types/GitHubOperation.d.ts.map +1 -0
- package/dist/types/src/types/PullRequestsView.d.ts +35 -0
- package/dist/types/src/types/PullRequestsView.d.ts.map +1 -0
- package/dist/types/src/types/Walkthrough.d.ts +31 -0
- package/dist/types/src/types/Walkthrough.d.ts.map +1 -0
- package/dist/types/src/types/Walkthrough.test.d.ts +2 -0
- package/dist/types/src/types/Walkthrough.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/walkthrough/fill.d.ts +28 -0
- package/dist/types/src/walkthrough/fill.d.ts.map +1 -0
- package/dist/types/src/walkthrough/fill.test.d.ts +2 -0
- package/dist/types/src/walkthrough/fill.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generate.d.ts +67 -0
- package/dist/types/src/walkthrough/generate.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generate.test.d.ts +2 -0
- package/dist/types/src/walkthrough/generate.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generated.d.ts +20 -0
- package/dist/types/src/walkthrough/generated.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generated.test.d.ts +2 -0
- package/dist/types/src/walkthrough/generated.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/headings.d.ts +8 -0
- package/dist/types/src/walkthrough/headings.d.ts.map +1 -0
- package/dist/types/src/walkthrough/headings.test.d.ts +2 -0
- package/dist/types/src/walkthrough/headings.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/index.d.ts +9 -0
- package/dist/types/src/walkthrough/index.d.ts.map +1 -0
- package/dist/types/src/walkthrough/patch.d.ts +48 -0
- package/dist/types/src/walkthrough/patch.d.ts.map +1 -0
- package/dist/types/src/walkthrough/plan.d.ts +55 -0
- package/dist/types/src/walkthrough/plan.d.ts.map +1 -0
- package/dist/types/src/walkthrough/plan.test.d.ts +2 -0
- package/dist/types/src/walkthrough/plan.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/prompt.d.ts +33 -0
- package/dist/types/src/walkthrough/prompt.d.ts.map +1 -0
- package/dist/types/src/walkthrough/prompt.test.d.ts +2 -0
- package/dist/types/src/walkthrough/prompt.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/score.d.ts +43 -0
- package/dist/types/src/walkthrough/score.d.ts.map +1 -0
- package/dist/types/src/walkthrough/score.test.d.ts +2 -0
- package/dist/types/src/walkthrough/score.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dx.config.ts +39 -0
- package/package.json +167 -48
- package/src/Extensions.ts +7 -0
- package/src/GitHubPlugin.ts +15 -0
- package/src/GitHubPlugin.workerd.test.ts +23 -0
- package/src/approval.test.ts +40 -0
- package/src/approval.ts +39 -0
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/connector.ts +95 -0
- package/src/capabilities/gen/browser.ts +82 -0
- package/src/capabilities/gen/node.ts +43 -0
- package/src/capabilities/gen/tauri.ts +82 -0
- package/src/capabilities/gen/workerd.ts +43 -0
- package/src/capabilities/index.ts +71 -0
- package/src/capabilities/link-resolver.ts +137 -0
- package/src/capabilities/markdown-extension.ts +146 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/page-action.ts +32 -0
- package/src/capabilities/react-surface.ts +98 -0
- package/src/capabilities/schema.ts +16 -0
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/cards/GitHubCard.stories.tsx +165 -0
- package/src/cards/GitHubCard.tsx +93 -0
- package/src/cards/PullRequestCard.tsx +23 -0
- package/src/cards/index.ts +6 -0
- package/src/components/CommentComposer/CommentComposer.tsx +109 -0
- package/src/components/CommentComposer/index.ts +5 -0
- package/src/components/PullRequestFiles/DiffStat.tsx +15 -0
- package/src/components/PullRequestFiles/FileTree.tsx +102 -0
- package/src/components/PullRequestFiles/PullRequestFiles.tsx +87 -0
- package/src/components/PullRequestFiles/files.test.ts +59 -0
- package/src/components/PullRequestFiles/files.ts +115 -0
- package/src/components/PullRequestFiles/index.ts +8 -0
- package/src/components/PullRequestOverview/ArtifactPill.tsx +82 -0
- package/src/components/PullRequestOverview/CheckRunList.tsx +120 -0
- package/src/components/PullRequestOverview/PullRequestDetails.tsx +15 -0
- package/src/components/PullRequestOverview/PullRequestOverview.tsx +110 -0
- package/src/components/PullRequestOverview/RelatedCards.tsx +147 -0
- package/src/components/PullRequestOverview/index.ts +9 -0
- package/src/components/PullRequestStatus/PullRequestStatus.tsx +81 -0
- package/src/components/PullRequestStatus/index.ts +5 -0
- package/src/components/WalkthroughView/WalkthroughView.tsx +62 -0
- package/src/components/WalkthroughView/extensions.ts +53 -0
- package/src/components/WalkthroughView/index.ts +6 -0
- package/src/components/index.ts +6 -9
- package/src/constants.ts +12 -0
- package/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.tsx +160 -0
- package/src/containers/ImportPullRequestDialog/index.ts +7 -0
- package/src/containers/PullRequestArticle/PullRequestArticle.tsx +573 -0
- package/src/containers/PullRequestArticle/failure.test.ts +42 -0
- package/src/containers/PullRequestArticle/failure.ts +16 -0
- package/src/containers/PullRequestArticle/index.ts +5 -0
- package/src/containers/PullRequestCardMenu/PullRequestCardMenu.tsx +134 -0
- package/src/containers/PullRequestCardMenu/index.ts +5 -0
- package/src/containers/PullRequestsArticle/PullRequestsArticle.tsx +361 -0
- package/src/containers/PullRequestsArticle/arrange.test.ts +122 -0
- package/src/containers/PullRequestsArticle/arrange.ts +245 -0
- package/src/containers/PullRequestsArticle/format.ts +31 -0
- package/src/containers/PullRequestsArticle/index.ts +5 -0
- package/src/containers/WalkthroughArticle/WalkthroughArticle.tsx +31 -0
- package/src/containers/WalkthroughArticle/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/errors.ts +61 -0
- package/src/extensions/index.ts +6 -0
- package/src/extensions/links.test.ts +133 -0
- package/src/extensions/links.ts +91 -0
- package/src/extensions/references.test.ts +83 -0
- package/src/extensions/references.ts +100 -0
- package/src/github-link.ts +70 -0
- package/src/hooks/index.ts +6 -3
- package/src/hooks/useOpenObject.ts +48 -0
- package/src/hooks/usePullRequestChecks.ts +81 -0
- package/src/hooks/usePullRequestDiff.ts +57 -0
- package/src/hooks/usePullRequestFiles.ts +98 -0
- package/src/hooks/useSyncPullRequest.ts +51 -0
- package/src/index.ts +4 -6
- package/src/meta.ts +8 -13
- package/src/operations/add-pull-request-comment.ts +31 -0
- package/src/operations/add-pull-request-review-comment.ts +32 -0
- package/src/operations/generate-walkthrough.ts +124 -0
- package/src/operations/get-pull-request-diff.ts +37 -0
- package/src/operations/get-pull-request-status.ts +44 -0
- package/src/operations/get-repositories.ts +53 -0
- package/src/operations/import-pull-request-from-snapshot.ts +48 -0
- package/src/operations/import-pull-request.test.ts +151 -0
- package/src/operations/import-pull-request.ts +141 -0
- package/src/operations/index.ts +29 -0
- package/src/operations/materialize-target.ts +60 -0
- package/src/operations/pull-request.test.ts +120 -0
- package/src/operations/pull-request.ts +141 -0
- package/src/operations/submit-pull-request-approval.ts +41 -0
- package/src/operations/sync-pull-request.ts +37 -0
- package/src/operations/sync.test.ts +453 -0
- package/src/operations/sync.ts +807 -0
- package/src/plugin.test.ts +40 -0
- package/src/plugin.ts +37 -0
- package/src/pull-request-body.test.ts +61 -0
- package/src/pull-request-body.ts +144 -0
- package/src/pull-request.test.ts +67 -0
- package/src/pull-request.ts +80 -0
- package/src/services/github-api.ts +735 -0
- package/src/services/index.ts +5 -0
- package/src/skills/GitHubSkill.ts +46 -0
- package/src/skills/index.ts +5 -0
- package/src/stories/Generate.stories.tsx +152 -0
- package/src/stories/Links.stories.tsx +153 -0
- package/src/stories/PullRequestArticle.stories.tsx +107 -0
- package/src/stories/PullRequestFiles.stories.tsx +69 -0
- package/src/stories/PullRequestOverview.stories.tsx +113 -0
- package/src/stories/PullRequestsArticle.stories.tsx +170 -0
- package/src/stories/Walkthrough.stories.tsx +110 -0
- package/src/stories/github.test.ts +65 -0
- package/src/stories/github.ts +70 -0
- package/src/stories/walkthrough-fixture.ts +115 -0
- package/src/testing/fixtures.ts +99 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/plugin.ts +25 -0
- package/src/testing/pull-request-13348.ts +104 -0
- package/src/testing/pull-request-13363.patch +2981 -0
- package/src/translations.ts +135 -63
- package/src/types/GitHubCapabilities.ts +27 -0
- package/src/types/GitHubEvents.ts +16 -0
- package/src/types/GitHubOperation.ts +371 -0
- package/src/types/PullRequestsView.ts +45 -0
- package/src/types/Walkthrough.test.ts +75 -0
- package/src/types/Walkthrough.ts +66 -0
- package/src/types/index.ts +8 -0
- package/src/vite-env.d.ts +15 -0
- package/src/walkthrough/fill.test.ts +337 -0
- package/src/walkthrough/fill.ts +246 -0
- package/src/walkthrough/generate.test.ts +219 -0
- package/src/walkthrough/generate.ts +248 -0
- package/src/walkthrough/generated.test.ts +70 -0
- package/src/walkthrough/generated.ts +70 -0
- package/src/walkthrough/headings.test.ts +40 -0
- package/src/walkthrough/headings.ts +39 -0
- package/src/walkthrough/index.ts +12 -0
- package/src/walkthrough/patch.ts +154 -0
- package/src/walkthrough/plan.test.ts +178 -0
- package/src/walkthrough/plan.ts +251 -0
- package/src/walkthrough/prompt.test.ts +100 -0
- package/src/walkthrough/prompt.ts +147 -0
- package/src/walkthrough/score.test.ts +272 -0
- package/src/walkthrough/score.ts +430 -0
- package/README.md +0 -15
- package/dist/lib/browser/chunk-S4MPSBA5.mjs +0 -21
- package/dist/lib/browser/chunk-S4MPSBA5.mjs.map +0 -7
- package/dist/lib/browser/index.css +0 -7
- package/dist/lib/browser/index.css.map +0 -7
- package/dist/lib/browser/index.mjs +0 -1535
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/GithubPlugin.d.ts +0 -4
- package/dist/types/src/GithubPlugin.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts +0 -4
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts +0 -9
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/index.d.ts +0 -2
- package/dist/types/src/components/EmbeddedMain/index.d.ts.map +0 -1
- package/dist/types/src/components/ExportDialog.d.ts +0 -8
- package/dist/types/src/components/ExportDialog.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts +0 -3
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts +0 -15
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/index.d.ts +0 -3
- package/dist/types/src/components/GithubApiProviders/index.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts +0 -7
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts +0 -16
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts +0 -3
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts +0 -11
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts +0 -3
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts.map +0 -1
- package/dist/types/src/components/ImportDialog.d.ts +0 -7
- package/dist/types/src/components/ImportDialog.d.ts.map +0 -1
- package/dist/types/src/components/Issue.d.ts +0 -5
- package/dist/types/src/components/Issue.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.d.ts +0 -15
- package/dist/types/src/components/Loading/Loading.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts +0 -40
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +0 -1
- package/dist/types/src/components/Loading/index.d.ts +0 -2
- package/dist/types/src/components/Loading/index.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownActions.d.ts +0 -7
- package/dist/types/src/components/MarkdownActions.d.ts.map +0 -1
- package/dist/types/src/components/UrlDialog.d.ts +0 -6
- package/dist/types/src/components/UrlDialog.d.ts.map +0 -1
- package/dist/types/src/hooks/useDocGhId.d.ts +0 -6
- package/dist/types/src/hooks/useDocGhId.d.ts.map +0 -1
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts +0 -2
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -30
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/GithubPlugin.tsx +0 -127
- package/src/components/EmbeddedMain/EmbeddedMain.tsx +0 -294
- package/src/components/EmbeddedMain/GfmPreview.tsx +0 -110
- package/src/components/EmbeddedMain/embedded.css +0 -3
- package/src/components/EmbeddedMain/index.ts +0 -5
- package/src/components/ExportDialog.tsx +0 -157
- package/src/components/GithubApiProviders/GitHubSettings.tsx +0 -72
- package/src/components/GithubApiProviders/OctokitProvider.tsx +0 -60
- package/src/components/GithubApiProviders/index.ts +0 -6
- package/src/components/GithubEchoResolverProviders/DocumentTreeItem.tsx +0 -26
- package/src/components/GithubEchoResolverProviders/ResolverContext.tsx +0 -137
- package/src/components/GithubEchoResolverProviders/ResolverDialog.tsx +0 -34
- package/src/components/GithubEchoResolverProviders/ResolverProps.ts +0 -23
- package/src/components/GithubEchoResolverProviders/ResolverTree.tsx +0 -86
- package/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx +0 -105
- package/src/components/GithubEchoResolverProviders/index.ts +0 -6
- package/src/components/GithubEchoResolverProviders/spaceResolvers.ts +0 -86
- package/src/components/ImportDialog.tsx +0 -72
- package/src/components/Issue.tsx +0 -62
- package/src/components/Loading/Loading.stories.tsx +0 -32
- package/src/components/Loading/Loading.tsx +0 -70
- package/src/components/Loading/index.ts +0 -5
- package/src/components/MarkdownActions.tsx +0 -136
- package/src/components/UrlDialog.tsx +0 -52
- package/src/hooks/useDocGhId.ts +0 -38
- package/src/hooks/useGhIdFromUrl.ts +0 -26
- package/src/types.ts +0 -51
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import { afterEach, beforeEach, describe, test } from 'vitest';
|
|
7
|
+
|
|
8
|
+
import { Database, Obj, Ref } from '@dxos/echo';
|
|
9
|
+
import { EchoTestBuilder } from '@dxos/echo-client/testing';
|
|
10
|
+
import * as EffectEx from '@dxos/effect/EffectEx';
|
|
11
|
+
import { AccessToken, Connection, Cursor } from '@dxos/link';
|
|
12
|
+
import { Milestone, Organization, Person, Task, TaskSet } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { GITHUB_SOURCE } from '../constants.ts';
|
|
15
|
+
import { GitHubApi } from '../services/index.ts';
|
|
16
|
+
import { pushRepoUpdates, setTaskContainer, upsertMilestone, upsertTask } from './sync.ts';
|
|
17
|
+
|
|
18
|
+
const repo = (overrides: Partial<GitHubApi.GitHubRepo> = {}): GitHubApi.GitHubRepo => ({
|
|
19
|
+
id: 1234,
|
|
20
|
+
name: 'composer',
|
|
21
|
+
full_name: 'dxos/composer',
|
|
22
|
+
description: 'composer monorepo',
|
|
23
|
+
owner: { id: 1, login: 'dxos' },
|
|
24
|
+
...overrides,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const issue = (overrides: Partial<GitHubApi.GitHubIssue> = {}): GitHubApi.GitHubIssue => ({
|
|
28
|
+
id: 5678,
|
|
29
|
+
number: 42,
|
|
30
|
+
title: 'Investigate flake',
|
|
31
|
+
body: 'desc',
|
|
32
|
+
state: 'open',
|
|
33
|
+
...overrides,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const milestone = (overrides: Partial<GitHubApi.GitHubMilestone> = {}): GitHubApi.GitHubMilestone => ({
|
|
37
|
+
id: 91011,
|
|
38
|
+
number: 3,
|
|
39
|
+
title: 'v1.0',
|
|
40
|
+
description: 'first stable release',
|
|
41
|
+
state: 'open',
|
|
42
|
+
due_on: '2026-06-01T07:00:00Z',
|
|
43
|
+
...overrides,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('plugin-github sync — push (snapshot diff → PATCH)', () => {
|
|
47
|
+
let builder: EchoTestBuilder;
|
|
48
|
+
|
|
49
|
+
beforeEach(async () => {
|
|
50
|
+
builder = await new EchoTestBuilder().open();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
afterEach(async () => {
|
|
54
|
+
await builder.close();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Builds an external-sync `Cursor` (spec.source = Connection's access token,
|
|
59
|
+
* spec.target = a Project standing in for the repo's local root) plus seeds
|
|
60
|
+
* the binding's snapshots as if a previous pull had run.
|
|
61
|
+
*/
|
|
62
|
+
const setup = async (snapshots: Record<string, unknown>) => {
|
|
63
|
+
const { db, graph } = await builder.createDatabase();
|
|
64
|
+
graph.registry.add([
|
|
65
|
+
AccessToken.AccessToken,
|
|
66
|
+
Connection.Connection,
|
|
67
|
+
Cursor.Cursor,
|
|
68
|
+
Organization.Organization,
|
|
69
|
+
Person.Person,
|
|
70
|
+
TaskSet.TaskSet,
|
|
71
|
+
Task.Task,
|
|
72
|
+
Milestone.Milestone,
|
|
73
|
+
]);
|
|
74
|
+
const token = db.add(Obj.make(AccessToken.AccessToken, { source: GITHUB_SOURCE, token: 'tok' }));
|
|
75
|
+
const connection = db.add(Obj.make(Connection.Connection, { connectorId: 'github', accessToken: Ref.make(token) }));
|
|
76
|
+
const project = db.add(
|
|
77
|
+
TaskSet.make({
|
|
78
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: String(repo().id) }] },
|
|
79
|
+
name: repo().full_name,
|
|
80
|
+
// Seed description to match a prior pull so tests that only diverge `name`
|
|
81
|
+
// don't trip the description-push path.
|
|
82
|
+
description: repo().description ?? undefined,
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
const created = db.add(
|
|
86
|
+
Cursor.makeExternal({
|
|
87
|
+
source: connection.accessToken,
|
|
88
|
+
target: Ref.make(project),
|
|
89
|
+
externalId: String(repo().id),
|
|
90
|
+
snapshots,
|
|
91
|
+
}),
|
|
92
|
+
);
|
|
93
|
+
if (!Cursor.isExternal(created)) {
|
|
94
|
+
throw new Error('expected external-sync cursor');
|
|
95
|
+
}
|
|
96
|
+
return { db, binding: created, project };
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
test('locally-edited issue title PATCHes only diverged fields', async ({ expect }) => {
|
|
100
|
+
const { db, binding } = await setup({
|
|
101
|
+
'5678': { title: 'Investigate flake', description: 'desc', status: 'todo' },
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Seed local task as if a previous pull had run.
|
|
105
|
+
const localTask = db.add(
|
|
106
|
+
Task.make({
|
|
107
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: '5678' }] },
|
|
108
|
+
title: 'Edited locally',
|
|
109
|
+
description: 'desc',
|
|
110
|
+
status: 'todo',
|
|
111
|
+
}),
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
let updateIssueInput: GitHubApi.IssueUpdateInput | undefined;
|
|
115
|
+
let updateIssueNumber: number | undefined;
|
|
116
|
+
const result = await Effect.gen(function* () {
|
|
117
|
+
return yield* pushRepoUpdates(binding, repo(), new Map([['5678', issue()]]), {
|
|
118
|
+
updateIssue: (_owner, _repo, num, input) => {
|
|
119
|
+
updateIssueInput = input;
|
|
120
|
+
updateIssueNumber = num;
|
|
121
|
+
return Effect.succeed(undefined);
|
|
122
|
+
},
|
|
123
|
+
updateRepo: () => Effect.succeed(undefined),
|
|
124
|
+
});
|
|
125
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
126
|
+
|
|
127
|
+
expect(result.tasks).toBe(1);
|
|
128
|
+
expect(updateIssueNumber).toBe(42);
|
|
129
|
+
expect(updateIssueInput).toEqual({ title: 'Edited locally' });
|
|
130
|
+
// Snapshot refreshed on the binding.
|
|
131
|
+
const snapshots = (binding.spec.snapshots ?? {}) as Record<string, any>;
|
|
132
|
+
expect(snapshots['5678']?.title).toBe('Edited locally');
|
|
133
|
+
void localTask;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('snapshot-equal task is not pushed', async ({ expect }) => {
|
|
137
|
+
const { db, binding } = await setup({
|
|
138
|
+
'5678': { title: 'Investigate flake', description: 'desc', status: 'todo' },
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
db.add(
|
|
142
|
+
Task.make({
|
|
143
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: '5678' }] },
|
|
144
|
+
title: 'Investigate flake',
|
|
145
|
+
description: 'desc',
|
|
146
|
+
status: 'todo',
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
let calls = 0;
|
|
151
|
+
const result = await Effect.gen(function* () {
|
|
152
|
+
return yield* pushRepoUpdates(binding, repo(), new Map([['5678', issue()]]), {
|
|
153
|
+
updateIssue: () => {
|
|
154
|
+
calls++;
|
|
155
|
+
return Effect.succeed(undefined);
|
|
156
|
+
},
|
|
157
|
+
updateRepo: () => Effect.succeed(undefined),
|
|
158
|
+
});
|
|
159
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
160
|
+
|
|
161
|
+
expect(result.tasks).toBe(0);
|
|
162
|
+
expect(calls).toBe(0);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('local status flip → PATCH state', async ({ expect }) => {
|
|
166
|
+
const { db, binding } = await setup({
|
|
167
|
+
'5678': { title: 'Investigate flake', description: 'desc', status: 'todo' },
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
db.add(
|
|
171
|
+
Task.make({
|
|
172
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: '5678' }] },
|
|
173
|
+
title: 'Investigate flake',
|
|
174
|
+
description: 'desc',
|
|
175
|
+
status: 'done',
|
|
176
|
+
}),
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
let updateIssueInput: GitHubApi.IssueUpdateInput | undefined;
|
|
180
|
+
await Effect.gen(function* () {
|
|
181
|
+
yield* pushRepoUpdates(binding, repo(), new Map([['5678', issue()]]), {
|
|
182
|
+
updateIssue: (_owner, _repo, _num, input) => {
|
|
183
|
+
updateIssueInput = input;
|
|
184
|
+
return Effect.succeed(undefined);
|
|
185
|
+
},
|
|
186
|
+
updateRepo: () => Effect.succeed(undefined),
|
|
187
|
+
});
|
|
188
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
189
|
+
|
|
190
|
+
expect(updateIssueInput?.state).toBe('closed');
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test('locally-edited repo description → PATCH /repos', async ({ expect }) => {
|
|
194
|
+
const { db, binding, project } = await setup({
|
|
195
|
+
'1234': { name: 'dxos/composer', description: 'composer monorepo' },
|
|
196
|
+
});
|
|
197
|
+
Obj.update(project, (project) => {
|
|
198
|
+
project.description = 'rewritten';
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
let updateRepoInput: GitHubApi.RepoUpdateInput | undefined;
|
|
202
|
+
const result = await Effect.gen(function* () {
|
|
203
|
+
return yield* pushRepoUpdates(binding, repo(), new Map(), {
|
|
204
|
+
updateIssue: () => Effect.succeed(undefined),
|
|
205
|
+
updateRepo: (_owner, _repo, input) => {
|
|
206
|
+
updateRepoInput = input;
|
|
207
|
+
return Effect.succeed(undefined);
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
211
|
+
|
|
212
|
+
expect(result.projects).toBe(1);
|
|
213
|
+
expect(updateRepoInput).toEqual({ description: 'rewritten' });
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
test('repo rename diverges locally → logged but NOT pushed', async ({ expect }) => {
|
|
217
|
+
const { db, binding, project } = await setup({
|
|
218
|
+
'1234': { name: 'dxos/composer', description: 'composer monorepo' },
|
|
219
|
+
});
|
|
220
|
+
Obj.update(project, (project) => {
|
|
221
|
+
project.name = 'dxos/composer-renamed';
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
let calls = 0;
|
|
225
|
+
const result = await Effect.gen(function* () {
|
|
226
|
+
return yield* pushRepoUpdates(binding, repo(), new Map(), {
|
|
227
|
+
updateIssue: () => Effect.succeed(undefined),
|
|
228
|
+
updateRepo: () => {
|
|
229
|
+
calls++;
|
|
230
|
+
return Effect.succeed(undefined);
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
234
|
+
|
|
235
|
+
expect(result.projects).toBe(0);
|
|
236
|
+
expect(calls).toBe(0);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
test('PR status divergence is NOT pushed (status is pull-only for PRs)', async ({ expect }) => {
|
|
240
|
+
// GitHub's /issues/{n} endpoint accepts state changes for both issues and
|
|
241
|
+
// PRs, but `closed` on a PR rejects it (closed-without-merge). The push
|
|
242
|
+
// path skips status changes for PRs and logs instead.
|
|
243
|
+
const { db, binding } = await setup({
|
|
244
|
+
'5678': { title: 'fix flake', description: 'desc', status: 'todo' },
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
db.add(
|
|
248
|
+
Task.make({
|
|
249
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: '5678' }] },
|
|
250
|
+
title: 'fix flake',
|
|
251
|
+
description: 'desc',
|
|
252
|
+
status: 'done',
|
|
253
|
+
}),
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
const pullRequestIssue = issue({
|
|
257
|
+
pull_request: { url: 'https://api.github.com/repos/dxos/dxos/pulls/42', merged_at: null },
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
let updateIssueInput: GitHubApi.IssueUpdateInput | undefined;
|
|
261
|
+
let calls = 0;
|
|
262
|
+
const result = await Effect.gen(function* () {
|
|
263
|
+
return yield* pushRepoUpdates(binding, repo(), new Map([['5678', pullRequestIssue]]), {
|
|
264
|
+
updateIssue: (_owner, _repo, _num, input) => {
|
|
265
|
+
calls++;
|
|
266
|
+
updateIssueInput = input;
|
|
267
|
+
return Effect.succeed(undefined);
|
|
268
|
+
},
|
|
269
|
+
updateRepo: () => Effect.succeed(undefined),
|
|
270
|
+
});
|
|
271
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
272
|
+
|
|
273
|
+
// No task push (status was the only diverging field, and PR status is
|
|
274
|
+
// pull-only).
|
|
275
|
+
expect(result.tasks).toBe(0);
|
|
276
|
+
expect(calls).toBe(0);
|
|
277
|
+
expect(updateIssueInput).toBeUndefined();
|
|
278
|
+
// Snapshot status stays at the previous remote-pulled value so the
|
|
279
|
+
// divergence warning keeps firing each sync until either the user
|
|
280
|
+
// reverts locally or GitHub catches up.
|
|
281
|
+
const snapshots = (binding.spec.snapshots ?? {}) as Record<string, any>;
|
|
282
|
+
expect(snapshots['5678']?.status).toBe('todo');
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
test('PR title divergence still pushes (only status is pull-only)', async ({ expect }) => {
|
|
286
|
+
const { db, binding } = await setup({
|
|
287
|
+
'5678': { title: 'fix flake', description: 'desc', status: 'todo' },
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
db.add(
|
|
291
|
+
Task.make({
|
|
292
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: '5678' }] },
|
|
293
|
+
title: 'fix flake (renamed)',
|
|
294
|
+
description: 'desc',
|
|
295
|
+
status: 'todo',
|
|
296
|
+
}),
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
const pullRequestIssue = issue({
|
|
300
|
+
pull_request: { url: 'https://api.github.com/repos/dxos/dxos/pulls/42', merged_at: null },
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
let updateIssueInput: GitHubApi.IssueUpdateInput | undefined;
|
|
304
|
+
await Effect.gen(function* () {
|
|
305
|
+
yield* pushRepoUpdates(binding, repo(), new Map([['5678', pullRequestIssue]]), {
|
|
306
|
+
updateIssue: (_owner, _repo, _num, input) => {
|
|
307
|
+
updateIssueInput = input;
|
|
308
|
+
return Effect.succeed(undefined);
|
|
309
|
+
},
|
|
310
|
+
updateRepo: () => Effect.succeed(undefined),
|
|
311
|
+
});
|
|
312
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
313
|
+
|
|
314
|
+
expect(updateIssueInput).toEqual({ title: 'fix flake (renamed)' });
|
|
315
|
+
expect(updateIssueInput?.state).toBeUndefined();
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test('soft-deleted local task is not pushed', async ({ expect }) => {
|
|
319
|
+
const { db, binding } = await setup({
|
|
320
|
+
'5678': { title: 'orig', description: '', status: 'todo' },
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
const task = db.add(
|
|
324
|
+
Task.make({
|
|
325
|
+
[Obj.Meta]: { keys: [{ source: GITHUB_SOURCE, id: '5678' }] },
|
|
326
|
+
title: 'edited locally',
|
|
327
|
+
description: '',
|
|
328
|
+
status: 'todo',
|
|
329
|
+
}),
|
|
330
|
+
);
|
|
331
|
+
await db.remove(task);
|
|
332
|
+
|
|
333
|
+
let calls = 0;
|
|
334
|
+
const result = await Effect.gen(function* () {
|
|
335
|
+
return yield* pushRepoUpdates(binding, repo(), new Map([['5678', issue()]]), {
|
|
336
|
+
updateIssue: () => {
|
|
337
|
+
calls++;
|
|
338
|
+
return Effect.succeed(undefined);
|
|
339
|
+
},
|
|
340
|
+
updateRepo: () => Effect.succeed(undefined),
|
|
341
|
+
});
|
|
342
|
+
}).pipe(Effect.provide(Database.layer(db)), EffectEx.runAndForwardErrors);
|
|
343
|
+
|
|
344
|
+
expect(result.tasks).toBe(0);
|
|
345
|
+
expect(calls).toBe(0);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
test('pull adds the task to the set once, however many passes run', async ({ expect }) => {
|
|
349
|
+
const { db, binding, project } = await setup({});
|
|
350
|
+
const layer = Database.layer(db);
|
|
351
|
+
|
|
352
|
+
const task = await Effect.gen(function* () {
|
|
353
|
+
const { task } = yield* upsertTask(binding, issue(), undefined, undefined);
|
|
354
|
+
yield* setTaskContainer(task, project);
|
|
355
|
+
yield* setTaskContainer(task, project);
|
|
356
|
+
return task;
|
|
357
|
+
}).pipe(Effect.provide(layer), EffectEx.runAndForwardErrors);
|
|
358
|
+
|
|
359
|
+
expect(project.tasks.map((ref) => ref.target?.id)).toEqual([task.id]);
|
|
360
|
+
// The parent edge rides along so the task cascades with the set.
|
|
361
|
+
expect(Obj.getParent(task)?.id).toBe(project.id);
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
test('an issue moved between repos moves its ref', async ({ expect }) => {
|
|
365
|
+
const { db, binding, project } = await setup({});
|
|
366
|
+
const layer = Database.layer(db);
|
|
367
|
+
const other = db.add(TaskSet.make({ name: 'dxos/other' }));
|
|
368
|
+
|
|
369
|
+
const task = await Effect.gen(function* () {
|
|
370
|
+
const { task } = yield* upsertTask(binding, issue(), undefined, undefined);
|
|
371
|
+
yield* setTaskContainer(task, project);
|
|
372
|
+
yield* Database.flush();
|
|
373
|
+
yield* setTaskContainer(task, other);
|
|
374
|
+
return task;
|
|
375
|
+
}).pipe(Effect.provide(layer), EffectEx.runAndForwardErrors);
|
|
376
|
+
|
|
377
|
+
expect(project.tasks).toEqual([]);
|
|
378
|
+
expect(other.tasks.map((ref) => ref.target?.id)).toEqual([task.id]);
|
|
379
|
+
expect(Obj.getParent(task)?.id).toBe(other.id);
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
test('a mirrored task filed as a sub-task leaves its parent when re-rooted', async ({ expect }) => {
|
|
383
|
+
const { db, binding, project } = await setup({});
|
|
384
|
+
const layer = Database.layer(db);
|
|
385
|
+
const parent = TaskSet.addTask(db, project, 'Local parent');
|
|
386
|
+
|
|
387
|
+
const task = await Effect.gen(function* () {
|
|
388
|
+
const { task } = yield* upsertTask(binding, issue(), undefined, undefined);
|
|
389
|
+
TaskSet.moveTask(project, task, { parentTask: parent });
|
|
390
|
+
yield* Database.flush();
|
|
391
|
+
yield* setTaskContainer(task, project);
|
|
392
|
+
return task;
|
|
393
|
+
}).pipe(Effect.provide(layer), EffectEx.runAndForwardErrors);
|
|
394
|
+
|
|
395
|
+
expect(parent.subtasks ?? []).toEqual([]);
|
|
396
|
+
expect(project.tasks.map((ref) => ref.target?.id)).toEqual([parent.id, task.id]);
|
|
397
|
+
expect(Obj.getParent(task)?.id).toBe(project.id);
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
test('a stale set entry for a task parented elsewhere does not stop it being re-rooted', async ({ expect }) => {
|
|
401
|
+
const { db, binding, project } = await setup({});
|
|
402
|
+
const layer = Database.layer(db);
|
|
403
|
+
const parent = TaskSet.addTask(db, project, 'Local parent');
|
|
404
|
+
|
|
405
|
+
const task = await Effect.gen(function* () {
|
|
406
|
+
const { task } = yield* upsertTask(binding, issue(), undefined, undefined);
|
|
407
|
+
TaskSet.moveTask(project, task, { parentTask: parent });
|
|
408
|
+
// The entry a concurrent peer's list write can leave behind.
|
|
409
|
+
Obj.update(project, (project) => {
|
|
410
|
+
project.tasks.push(Ref.make(task));
|
|
411
|
+
});
|
|
412
|
+
yield* Database.flush();
|
|
413
|
+
yield* setTaskContainer(task, project);
|
|
414
|
+
return task;
|
|
415
|
+
}).pipe(Effect.provide(layer), EffectEx.runAndForwardErrors);
|
|
416
|
+
|
|
417
|
+
expect(parent.subtasks ?? []).toEqual([]);
|
|
418
|
+
expect(project.tasks.map((ref) => ref.target?.id)).toEqual([parent.id, task.id]);
|
|
419
|
+
expect(Obj.getParent(task)?.id).toBe(project.id);
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
test('milestones are mirrored onto the set with a date-only target', async ({ expect }) => {
|
|
423
|
+
const { db, binding, project } = await setup({});
|
|
424
|
+
const layer = Database.layer(db);
|
|
425
|
+
|
|
426
|
+
const { task, local } = await Effect.gen(function* () {
|
|
427
|
+
const local = yield* upsertMilestone(project, milestone());
|
|
428
|
+
// Re-pull to prove the ref is not appended twice.
|
|
429
|
+
yield* upsertMilestone(project, milestone({ title: 'v1.0.1' }));
|
|
430
|
+
const { task } = yield* upsertTask(binding, issue({ milestone: milestone() }), undefined, local);
|
|
431
|
+
return { task, local };
|
|
432
|
+
}).pipe(Effect.provide(layer), EffectEx.runAndForwardErrors);
|
|
433
|
+
|
|
434
|
+
expect(project.milestones.map((ref) => ref.target?.id)).toEqual([local.id]);
|
|
435
|
+
expect(local.name).toBe('v1.0.1');
|
|
436
|
+
expect(local.targetDate).toBe('2026-06-01');
|
|
437
|
+
expect(task.milestone?.target?.id).toBe(local.id);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
test('an issue unassigned from its milestone remotely is cleared locally', async ({ expect }) => {
|
|
441
|
+
const { db, binding, project } = await setup({});
|
|
442
|
+
const layer = Database.layer(db);
|
|
443
|
+
|
|
444
|
+
const task = await Effect.gen(function* () {
|
|
445
|
+
const local = yield* upsertMilestone(project, milestone());
|
|
446
|
+
const { task } = yield* upsertTask(binding, issue({ milestone: milestone() }), undefined, local);
|
|
447
|
+
yield* upsertTask(binding, issue(), undefined, undefined);
|
|
448
|
+
return task;
|
|
449
|
+
}).pipe(Effect.provide(layer), EffectEx.runAndForwardErrors);
|
|
450
|
+
|
|
451
|
+
expect(task.milestone).toBeUndefined();
|
|
452
|
+
});
|
|
453
|
+
});
|