@shirokuma-library/shirokuma-docs 0.1.0-alpha.5
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.
Potentially problematic release.
This version of @shirokuma-library/shirokuma-docs might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.en.md +308 -0
- package/README.md +308 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bin/shirokuma-docs +2 -0
- package/dist/analyzers/details-test-analysis.d.ts +31 -0
- package/dist/analyzers/details-test-analysis.d.ts.map +1 -0
- package/dist/analyzers/details-test-analysis.js +172 -0
- package/dist/analyzers/details-test-analysis.js.map +1 -0
- package/dist/analyzers/feature-map-builder.d.ts +20 -0
- package/dist/analyzers/feature-map-builder.d.ts.map +1 -0
- package/dist/analyzers/feature-map-builder.js +154 -0
- package/dist/analyzers/feature-map-builder.js.map +1 -0
- package/dist/analyzers/feature-map-references.d.ts +34 -0
- package/dist/analyzers/feature-map-references.d.ts.map +1 -0
- package/dist/analyzers/feature-map-references.js +249 -0
- package/dist/analyzers/feature-map-references.js.map +1 -0
- package/dist/analyzers/reference-analyzer.d.ts +95 -0
- package/dist/analyzers/reference-analyzer.d.ts.map +1 -0
- package/dist/analyzers/reference-analyzer.js +372 -0
- package/dist/analyzers/reference-analyzer.js.map +1 -0
- package/dist/commands/adr.d.ts +26 -0
- package/dist/commands/adr.d.ts.map +1 -0
- package/dist/commands/adr.js +129 -0
- package/dist/commands/adr.js.map +1 -0
- package/dist/commands/api-tools.d.ts +83 -0
- package/dist/commands/api-tools.d.ts.map +1 -0
- package/dist/commands/api-tools.js +775 -0
- package/dist/commands/api-tools.js.map +1 -0
- package/dist/commands/coverage.d.ts +139 -0
- package/dist/commands/coverage.d.ts.map +1 -0
- package/dist/commands/coverage.js +481 -0
- package/dist/commands/coverage.js.map +1 -0
- package/dist/commands/deps.d.ts +24 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +211 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/details-context.d.ts +38 -0
- package/dist/commands/details-context.d.ts.map +1 -0
- package/dist/commands/details-context.js +193 -0
- package/dist/commands/details-context.js.map +1 -0
- package/dist/commands/details-types.d.ts +315 -0
- package/dist/commands/details-types.d.ts.map +1 -0
- package/dist/commands/details-types.js +7 -0
- package/dist/commands/details-types.js.map +1 -0
- package/dist/commands/details.d.ts +24 -0
- package/dist/commands/details.d.ts.map +1 -0
- package/dist/commands/details.js +299 -0
- package/dist/commands/details.js.map +1 -0
- package/dist/commands/discussion-templates.d.ts +26 -0
- package/dist/commands/discussion-templates.d.ts.map +1 -0
- package/dist/commands/discussion-templates.js +270 -0
- package/dist/commands/discussion-templates.js.map +1 -0
- package/dist/commands/discussions.d.ts +31 -0
- package/dist/commands/discussions.d.ts.map +1 -0
- package/dist/commands/discussions.js +743 -0
- package/dist/commands/discussions.js.map +1 -0
- package/dist/commands/feature-map-types.d.ts +294 -0
- package/dist/commands/feature-map-types.d.ts.map +1 -0
- package/dist/commands/feature-map-types.js +8 -0
- package/dist/commands/feature-map-types.js.map +1 -0
- package/dist/commands/feature-map.d.ts +30 -0
- package/dist/commands/feature-map.d.ts.map +1 -0
- package/dist/commands/feature-map.js +137 -0
- package/dist/commands/feature-map.js.map +1 -0
- package/dist/commands/generate.d.ts +16 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +88 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/gh-discussions.d.ts +31 -0
- package/dist/commands/gh-discussions.d.ts.map +1 -0
- package/dist/commands/gh-discussions.js +743 -0
- package/dist/commands/gh-discussions.js.map +1 -0
- package/dist/commands/gh-issues-pr.d.ts +74 -0
- package/dist/commands/gh-issues-pr.d.ts.map +1 -0
- package/dist/commands/gh-issues-pr.js +417 -0
- package/dist/commands/gh-issues-pr.js.map +1 -0
- package/dist/commands/gh-issues.d.ts +90 -0
- package/dist/commands/gh-issues.d.ts.map +1 -0
- package/dist/commands/gh-issues.js +1297 -0
- package/dist/commands/gh-issues.js.map +1 -0
- package/dist/commands/gh-projects.d.ts +54 -0
- package/dist/commands/gh-projects.d.ts.map +1 -0
- package/dist/commands/gh-projects.js +966 -0
- package/dist/commands/gh-projects.js.map +1 -0
- package/dist/commands/gh-repo.d.ts +18 -0
- package/dist/commands/gh-repo.d.ts.map +1 -0
- package/dist/commands/gh-repo.js +253 -0
- package/dist/commands/gh-repo.js.map +1 -0
- package/dist/commands/github-data.d.ts +67 -0
- package/dist/commands/github-data.d.ts.map +1 -0
- package/dist/commands/github-data.js +361 -0
- package/dist/commands/github-data.js.map +1 -0
- package/dist/commands/i18n.d.ts +102 -0
- package/dist/commands/i18n.d.ts.map +1 -0
- package/dist/commands/i18n.js +829 -0
- package/dist/commands/i18n.js.map +1 -0
- package/dist/commands/impact.d.ts +14 -0
- package/dist/commands/impact.d.ts.map +1 -0
- package/dist/commands/impact.js +263 -0
- package/dist/commands/impact.js.map +1 -0
- package/dist/commands/init.d.ts +53 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +429 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/issues-pr.d.ts +74 -0
- package/dist/commands/issues-pr.d.ts.map +1 -0
- package/dist/commands/issues-pr.js +417 -0
- package/dist/commands/issues-pr.js.map +1 -0
- package/dist/commands/issues.d.ts +76 -0
- package/dist/commands/issues.d.ts.map +1 -0
- package/dist/commands/issues.js +1285 -0
- package/dist/commands/issues.js.map +1 -0
- package/dist/commands/link-docs.d.ts +21 -0
- package/dist/commands/link-docs.d.ts.map +1 -0
- package/dist/commands/link-docs.js +990 -0
- package/dist/commands/link-docs.js.map +1 -0
- package/dist/commands/lint-annotations.d.ts +28 -0
- package/dist/commands/lint-annotations.d.ts.map +1 -0
- package/dist/commands/lint-annotations.js +511 -0
- package/dist/commands/lint-annotations.js.map +1 -0
- package/dist/commands/lint-code.d.ts +26 -0
- package/dist/commands/lint-code.d.ts.map +1 -0
- package/dist/commands/lint-code.js +428 -0
- package/dist/commands/lint-code.js.map +1 -0
- package/dist/commands/lint-coverage.d.ts +33 -0
- package/dist/commands/lint-coverage.d.ts.map +1 -0
- package/dist/commands/lint-coverage.js +379 -0
- package/dist/commands/lint-coverage.js.map +1 -0
- package/dist/commands/lint-docs.d.ts +23 -0
- package/dist/commands/lint-docs.d.ts.map +1 -0
- package/dist/commands/lint-docs.js +338 -0
- package/dist/commands/lint-docs.js.map +1 -0
- package/dist/commands/lint-structure.d.ts +38 -0
- package/dist/commands/lint-structure.d.ts.map +1 -0
- package/dist/commands/lint-structure.js +350 -0
- package/dist/commands/lint-structure.js.map +1 -0
- package/dist/commands/lint-tests.d.ts +25 -0
- package/dist/commands/lint-tests.d.ts.map +1 -0
- package/dist/commands/lint-tests.js +105 -0
- package/dist/commands/lint-tests.js.map +1 -0
- package/dist/commands/lint-workflow.d.ts +36 -0
- package/dist/commands/lint-workflow.d.ts.map +1 -0
- package/dist/commands/lint-workflow.js +255 -0
- package/dist/commands/lint-workflow.js.map +1 -0
- package/dist/commands/overview.d.ts +21 -0
- package/dist/commands/overview.d.ts.map +1 -0
- package/dist/commands/overview.js +1300 -0
- package/dist/commands/overview.js.map +1 -0
- package/dist/commands/packages.d.ts +107 -0
- package/dist/commands/packages.d.ts.map +1 -0
- package/dist/commands/packages.js +308 -0
- package/dist/commands/packages.js.map +1 -0
- package/dist/commands/portal-nextjs.d.ts +23 -0
- package/dist/commands/portal-nextjs.d.ts.map +1 -0
- package/dist/commands/portal-nextjs.js +336 -0
- package/dist/commands/portal-nextjs.js.map +1 -0
- package/dist/commands/portal.d.ts +24 -0
- package/dist/commands/portal.d.ts.map +1 -0
- package/dist/commands/portal.js +16 -0
- package/dist/commands/portal.js.map +1 -0
- package/dist/commands/projects.d.ts +54 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +969 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/repo-pairs.d.ts +19 -0
- package/dist/commands/repo-pairs.d.ts.map +1 -0
- package/dist/commands/repo-pairs.js +529 -0
- package/dist/commands/repo-pairs.js.map +1 -0
- package/dist/commands/repo.d.ts +18 -0
- package/dist/commands/repo.d.ts.map +1 -0
- package/dist/commands/repo.js +253 -0
- package/dist/commands/repo.js.map +1 -0
- package/dist/commands/schema.d.ts +49 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +830 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/screenshots.d.ts +203 -0
- package/dist/commands/screenshots.d.ts.map +1 -0
- package/dist/commands/screenshots.js +1234 -0
- package/dist/commands/screenshots.js.map +1 -0
- package/dist/commands/search-index.d.ts +83 -0
- package/dist/commands/search-index.d.ts.map +1 -0
- package/dist/commands/search-index.js +389 -0
- package/dist/commands/search-index.js.map +1 -0
- package/dist/commands/session.d.ts +153 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +1243 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/test-cases-types.d.ts +154 -0
- package/dist/commands/test-cases-types.d.ts.map +1 -0
- package/dist/commands/test-cases-types.js +7 -0
- package/dist/commands/test-cases-types.js.map +1 -0
- package/dist/commands/test-cases.d.ts +28 -0
- package/dist/commands/test-cases.d.ts.map +1 -0
- package/dist/commands/test-cases.js +192 -0
- package/dist/commands/test-cases.js.map +1 -0
- package/dist/commands/typedoc.d.ts +21 -0
- package/dist/commands/typedoc.d.ts.map +1 -0
- package/dist/commands/typedoc.js +192 -0
- package/dist/commands/typedoc.js.map +1 -0
- package/dist/commands/update-skills.d.ts +56 -0
- package/dist/commands/update-skills.d.ts.map +1 -0
- package/dist/commands/update-skills.js +620 -0
- package/dist/commands/update-skills.js.map +1 -0
- package/dist/generators/details-entity-pages.d.ts +40 -0
- package/dist/generators/details-entity-pages.d.ts.map +1 -0
- package/dist/generators/details-entity-pages.js +301 -0
- package/dist/generators/details-entity-pages.js.map +1 -0
- package/dist/generators/details-html.d.ts +23 -0
- package/dist/generators/details-html.d.ts.map +1 -0
- package/dist/generators/details-html.js +324 -0
- package/dist/generators/details-html.js.map +1 -0
- package/dist/generators/details-module-page.d.ts +33 -0
- package/dist/generators/details-module-page.d.ts.map +1 -0
- package/dist/generators/details-module-page.js +408 -0
- package/dist/generators/details-module-page.js.map +1 -0
- package/dist/generators/details-styles.d.ts +39 -0
- package/dist/generators/details-styles.d.ts.map +1 -0
- package/dist/generators/details-styles.js +409 -0
- package/dist/generators/details-styles.js.map +1 -0
- package/dist/generators/feature-map-html.d.ts +66 -0
- package/dist/generators/feature-map-html.d.ts.map +1 -0
- package/dist/generators/feature-map-html.js +569 -0
- package/dist/generators/feature-map-html.js.map +1 -0
- package/dist/generators/feature-map-styles.d.ts +39 -0
- package/dist/generators/feature-map-styles.d.ts.map +1 -0
- package/dist/generators/feature-map-styles.js +449 -0
- package/dist/generators/feature-map-styles.js.map +1 -0
- package/dist/generators/test-cases-hierarchy.d.ts +21 -0
- package/dist/generators/test-cases-hierarchy.d.ts.map +1 -0
- package/dist/generators/test-cases-hierarchy.js +336 -0
- package/dist/generators/test-cases-hierarchy.js.map +1 -0
- package/dist/generators/test-cases-main.d.ts +20 -0
- package/dist/generators/test-cases-main.d.ts.map +1 -0
- package/dist/generators/test-cases-main.js +439 -0
- package/dist/generators/test-cases-main.js.map +1 -0
- package/dist/generators/test-cases-styles.d.ts +64 -0
- package/dist/generators/test-cases-styles.d.ts.map +1 -0
- package/dist/generators/test-cases-styles.js +1277 -0
- package/dist/generators/test-cases-styles.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +517 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/annotation-lint.d.ts +198 -0
- package/dist/lint/annotation-lint.d.ts.map +1 -0
- package/dist/lint/annotation-lint.js +510 -0
- package/dist/lint/annotation-lint.js.map +1 -0
- package/dist/lint/annotation-types.d.ts +161 -0
- package/dist/lint/annotation-types.d.ts.map +1 -0
- package/dist/lint/annotation-types.js +31 -0
- package/dist/lint/annotation-types.js.map +1 -0
- package/dist/lint/code-types.d.ts +135 -0
- package/dist/lint/code-types.d.ts.map +1 -0
- package/dist/lint/code-types.js +25 -0
- package/dist/lint/code-types.js.map +1 -0
- package/dist/lint/coverage-types.d.ts +128 -0
- package/dist/lint/coverage-types.d.ts.map +1 -0
- package/dist/lint/coverage-types.js +24 -0
- package/dist/lint/coverage-types.js.map +1 -0
- package/dist/lint/docs-types.d.ts +214 -0
- package/dist/lint/docs-types.d.ts.map +1 -0
- package/dist/lint/docs-types.js +18 -0
- package/dist/lint/docs-types.js.map +1 -0
- package/dist/lint/formatters/index.d.ts +14 -0
- package/dist/lint/formatters/index.d.ts.map +1 -0
- package/dist/lint/formatters/index.js +28 -0
- package/dist/lint/formatters/index.js.map +1 -0
- package/dist/lint/formatters/json.d.ts +11 -0
- package/dist/lint/formatters/json.d.ts.map +1 -0
- package/dist/lint/formatters/json.js +12 -0
- package/dist/lint/formatters/json.js.map +1 -0
- package/dist/lint/formatters/summary.d.ts +11 -0
- package/dist/lint/formatters/summary.d.ts.map +1 -0
- package/dist/lint/formatters/summary.js +37 -0
- package/dist/lint/formatters/summary.js.map +1 -0
- package/dist/lint/formatters/terminal.d.ts +11 -0
- package/dist/lint/formatters/terminal.d.ts.map +1 -0
- package/dist/lint/formatters/terminal.js +99 -0
- package/dist/lint/formatters/terminal.js.map +1 -0
- package/dist/lint/index.d.ts +18 -0
- package/dist/lint/index.d.ts.map +1 -0
- package/dist/lint/index.js +103 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/rules/annotation-required.d.ts +35 -0
- package/dist/lint/rules/annotation-required.d.ts.map +1 -0
- package/dist/lint/rules/annotation-required.js +127 -0
- package/dist/lint/rules/annotation-required.js.map +1 -0
- package/dist/lint/rules/code-rules.d.ts +12 -0
- package/dist/lint/rules/code-rules.d.ts.map +1 -0
- package/dist/lint/rules/code-rules.js +11 -0
- package/dist/lint/rules/code-rules.js.map +1 -0
- package/dist/lint/rules/describe-coverage.d.ts +8 -0
- package/dist/lint/rules/describe-coverage.d.ts.map +1 -0
- package/dist/lint/rules/describe-coverage.js +43 -0
- package/dist/lint/rules/describe-coverage.js.map +1 -0
- package/dist/lint/rules/duplicate-testdoc.d.ts +8 -0
- package/dist/lint/rules/duplicate-testdoc.d.ts.map +1 -0
- package/dist/lint/rules/duplicate-testdoc.js +38 -0
- package/dist/lint/rules/duplicate-testdoc.js.map +1 -0
- package/dist/lint/rules/index.d.ts +29 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/index.js +55 -0
- package/dist/lint/rules/index.js.map +1 -0
- package/dist/lint/rules/server-action-structure.d.ts +37 -0
- package/dist/lint/rules/server-action-structure.d.ts.map +1 -0
- package/dist/lint/rules/server-action-structure.js +151 -0
- package/dist/lint/rules/server-action-structure.js.map +1 -0
- package/dist/lint/rules/skipped-test-report.d.ts +11 -0
- package/dist/lint/rules/skipped-test-report.d.ts.map +1 -0
- package/dist/lint/rules/skipped-test-report.js +31 -0
- package/dist/lint/rules/skipped-test-report.js.map +1 -0
- package/dist/lint/rules/structure-rules.d.ts +67 -0
- package/dist/lint/rules/structure-rules.d.ts.map +1 -0
- package/dist/lint/rules/structure-rules.js +615 -0
- package/dist/lint/rules/structure-rules.js.map +1 -0
- package/dist/lint/rules/testdoc-japanese.d.ts +8 -0
- package/dist/lint/rules/testdoc-japanese.d.ts.map +1 -0
- package/dist/lint/rules/testdoc-japanese.js +31 -0
- package/dist/lint/rules/testdoc-japanese.js.map +1 -0
- package/dist/lint/rules/testdoc-min-length.d.ts +8 -0
- package/dist/lint/rules/testdoc-min-length.d.ts.map +1 -0
- package/dist/lint/rules/testdoc-min-length.js +31 -0
- package/dist/lint/rules/testdoc-min-length.js.map +1 -0
- package/dist/lint/rules/testdoc-required.d.ts +8 -0
- package/dist/lint/rules/testdoc-required.d.ts.map +1 -0
- package/dist/lint/rules/testdoc-required.js +27 -0
- package/dist/lint/rules/testdoc-required.js.map +1 -0
- package/dist/lint/rules/workflow-branch-naming.d.ts +20 -0
- package/dist/lint/rules/workflow-branch-naming.d.ts.map +1 -0
- package/dist/lint/rules/workflow-branch-naming.js +85 -0
- package/dist/lint/rules/workflow-branch-naming.js.map +1 -0
- package/dist/lint/rules/workflow-commit-format.d.ts +27 -0
- package/dist/lint/rules/workflow-commit-format.d.ts.map +1 -0
- package/dist/lint/rules/workflow-commit-format.js +92 -0
- package/dist/lint/rules/workflow-commit-format.js.map +1 -0
- package/dist/lint/rules/workflow-issue-fields.d.ts +24 -0
- package/dist/lint/rules/workflow-issue-fields.d.ts.map +1 -0
- package/dist/lint/rules/workflow-issue-fields.js +89 -0
- package/dist/lint/rules/workflow-issue-fields.js.map +1 -0
- package/dist/lint/rules/workflow-main-protection.d.ts +32 -0
- package/dist/lint/rules/workflow-main-protection.d.ts.map +1 -0
- package/dist/lint/rules/workflow-main-protection.js +114 -0
- package/dist/lint/rules/workflow-main-protection.js.map +1 -0
- package/dist/lint/structure-types.d.ts +216 -0
- package/dist/lint/structure-types.d.ts.map +1 -0
- package/dist/lint/structure-types.js +96 -0
- package/dist/lint/structure-types.js.map +1 -0
- package/dist/lint/types.d.ts +154 -0
- package/dist/lint/types.d.ts.map +1 -0
- package/dist/lint/types.js +21 -0
- package/dist/lint/types.js.map +1 -0
- package/dist/lint/workflow-types.d.ts +90 -0
- package/dist/lint/workflow-types.d.ts.map +1 -0
- package/dist/lint/workflow-types.js +7 -0
- package/dist/lint/workflow-types.js.map +1 -0
- package/dist/md/analyzer/index.d.ts +46 -0
- package/dist/md/analyzer/index.d.ts.map +1 -0
- package/dist/md/analyzer/index.js +288 -0
- package/dist/md/analyzer/index.js.map +1 -0
- package/dist/md/builder/index.d.ts +91 -0
- package/dist/md/builder/index.d.ts.map +1 -0
- package/dist/md/builder/index.js +446 -0
- package/dist/md/builder/index.js.map +1 -0
- package/dist/md/cli/analyze.d.ts +11 -0
- package/dist/md/cli/analyze.d.ts.map +1 -0
- package/dist/md/cli/analyze.js +118 -0
- package/dist/md/cli/analyze.js.map +1 -0
- package/dist/md/cli/build.d.ts +11 -0
- package/dist/md/cli/build.d.ts.map +1 -0
- package/dist/md/cli/build.js +74 -0
- package/dist/md/cli/build.js.map +1 -0
- package/dist/md/cli/extract.d.ts +25 -0
- package/dist/md/cli/extract.d.ts.map +1 -0
- package/dist/md/cli/extract.js +230 -0
- package/dist/md/cli/extract.js.map +1 -0
- package/dist/md/cli/index.d.ts +3 -0
- package/dist/md/cli/index.d.ts.map +1 -0
- package/dist/md/cli/index.js +99 -0
- package/dist/md/cli/index.js.map +1 -0
- package/dist/md/cli/lint.d.ts +11 -0
- package/dist/md/cli/lint.d.ts.map +1 -0
- package/dist/md/cli/lint.js +165 -0
- package/dist/md/cli/lint.js.map +1 -0
- package/dist/md/cli/list.d.ts +16 -0
- package/dist/md/cli/list.d.ts.map +1 -0
- package/dist/md/cli/list.js +85 -0
- package/dist/md/cli/list.js.map +1 -0
- package/dist/md/cli/program.d.ts +11 -0
- package/dist/md/cli/program.d.ts.map +1 -0
- package/dist/md/cli/program.js +104 -0
- package/dist/md/cli/program.js.map +1 -0
- package/dist/md/cli/validate.d.ts +8 -0
- package/dist/md/cli/validate.d.ts.map +1 -0
- package/dist/md/cli/validate.js +82 -0
- package/dist/md/cli/validate.js.map +1 -0
- package/dist/md/constants.d.ts +69 -0
- package/dist/md/constants.d.ts.map +1 -0
- package/dist/md/constants.js +69 -0
- package/dist/md/constants.js.map +1 -0
- package/dist/md/extractor/index.d.ts +57 -0
- package/dist/md/extractor/index.d.ts.map +1 -0
- package/dist/md/extractor/index.js +359 -0
- package/dist/md/extractor/index.js.map +1 -0
- package/dist/md/index.d.ts +26 -0
- package/dist/md/index.d.ts.map +1 -0
- package/dist/md/index.js +30 -0
- package/dist/md/index.js.map +1 -0
- package/dist/md/linter/index.d.ts +20 -0
- package/dist/md/linter/index.d.ts.map +1 -0
- package/dist/md/linter/index.js +412 -0
- package/dist/md/linter/index.js.map +1 -0
- package/dist/md/linter/token-optimizer.d.ts +66 -0
- package/dist/md/linter/token-optimizer.d.ts.map +1 -0
- package/dist/md/linter/token-optimizer.js +292 -0
- package/dist/md/linter/token-optimizer.js.map +1 -0
- package/dist/md/lister/index.d.ts +42 -0
- package/dist/md/lister/index.d.ts.map +1 -0
- package/dist/md/lister/index.js +317 -0
- package/dist/md/lister/index.js.map +1 -0
- package/dist/md/parser/heading-numbers.d.ts +43 -0
- package/dist/md/parser/heading-numbers.d.ts.map +1 -0
- package/dist/md/parser/heading-numbers.js +97 -0
- package/dist/md/parser/heading-numbers.js.map +1 -0
- package/dist/md/parser/section-meta.d.ts +50 -0
- package/dist/md/parser/section-meta.d.ts.map +1 -0
- package/dist/md/parser/section-meta.js +212 -0
- package/dist/md/parser/section-meta.js.map +1 -0
- package/dist/md/parser/template.d.ts +56 -0
- package/dist/md/parser/template.d.ts.map +1 -0
- package/dist/md/parser/template.js +122 -0
- package/dist/md/parser/template.js.map +1 -0
- package/dist/md/plugins/loader.d.ts +15 -0
- package/dist/md/plugins/loader.d.ts.map +1 -0
- package/dist/md/plugins/loader.js +80 -0
- package/dist/md/plugins/loader.js.map +1 -0
- package/dist/md/plugins/normalize-headings.d.ts +43 -0
- package/dist/md/plugins/normalize-headings.d.ts.map +1 -0
- package/dist/md/plugins/normalize-headings.js +51 -0
- package/dist/md/plugins/normalize-headings.js.map +1 -0
- package/dist/md/plugins/normalize-whitespace.d.ts +46 -0
- package/dist/md/plugins/normalize-whitespace.d.ts.map +1 -0
- package/dist/md/plugins/normalize-whitespace.js +86 -0
- package/dist/md/plugins/normalize-whitespace.js.map +1 -0
- package/dist/md/plugins/remove-badges.d.ts +36 -0
- package/dist/md/plugins/remove-badges.d.ts.map +1 -0
- package/dist/md/plugins/remove-badges.js +59 -0
- package/dist/md/plugins/remove-badges.js.map +1 -0
- package/dist/md/plugins/remove-comments.d.ts +27 -0
- package/dist/md/plugins/remove-comments.d.ts.map +1 -0
- package/dist/md/plugins/remove-comments.js +40 -0
- package/dist/md/plugins/remove-comments.js.map +1 -0
- package/dist/md/plugins/remove-duplicates.d.ts +40 -0
- package/dist/md/plugins/remove-duplicates.d.ts.map +1 -0
- package/dist/md/plugins/remove-duplicates.js +72 -0
- package/dist/md/plugins/remove-duplicates.js.map +1 -0
- package/dist/md/plugins/remove-internal-links.d.ts +38 -0
- package/dist/md/plugins/remove-internal-links.d.ts.map +1 -0
- package/dist/md/plugins/remove-internal-links.js +66 -0
- package/dist/md/plugins/remove-internal-links.js.map +1 -0
- package/dist/md/plugins/strip-heading-numbers.d.ts +35 -0
- package/dist/md/plugins/strip-heading-numbers.d.ts.map +1 -0
- package/dist/md/plugins/strip-heading-numbers.js +59 -0
- package/dist/md/plugins/strip-heading-numbers.js.map +1 -0
- package/dist/md/plugins/strip-section-meta.d.ts +37 -0
- package/dist/md/plugins/strip-section-meta.d.ts.map +1 -0
- package/dist/md/plugins/strip-section-meta.js +62 -0
- package/dist/md/plugins/strip-section-meta.js.map +1 -0
- package/dist/md/types/config.d.ts +260 -0
- package/dist/md/types/config.d.ts.map +1 -0
- package/dist/md/types/config.js +156 -0
- package/dist/md/types/config.js.map +1 -0
- package/dist/md/types/document.d.ts +37 -0
- package/dist/md/types/document.d.ts.map +1 -0
- package/dist/md/types/document.js +2 -0
- package/dist/md/types/document.js.map +1 -0
- package/dist/md/types/validation.d.ts +107 -0
- package/dist/md/types/validation.d.ts.map +1 -0
- package/dist/md/types/validation.js +2 -0
- package/dist/md/types/validation.js.map +1 -0
- package/dist/md/utils/code-blocks.d.ts +136 -0
- package/dist/md/utils/code-blocks.d.ts.map +1 -0
- package/dist/md/utils/code-blocks.js +178 -0
- package/dist/md/utils/code-blocks.js.map +1 -0
- package/dist/md/utils/config.d.ts +10 -0
- package/dist/md/utils/config.d.ts.map +1 -0
- package/dist/md/utils/config.js +99 -0
- package/dist/md/utils/config.js.map +1 -0
- package/dist/md/utils/file-collector.d.ts +78 -0
- package/dist/md/utils/file-collector.d.ts.map +1 -0
- package/dist/md/utils/file-collector.js +100 -0
- package/dist/md/utils/file-collector.js.map +1 -0
- package/dist/md/utils/markdown.d.ts +18 -0
- package/dist/md/utils/markdown.d.ts.map +1 -0
- package/dist/md/utils/markdown.js +93 -0
- package/dist/md/utils/markdown.js.map +1 -0
- package/dist/md/utils/remark.d.ts +91 -0
- package/dist/md/utils/remark.d.ts.map +1 -0
- package/dist/md/utils/remark.js +125 -0
- package/dist/md/utils/remark.js.map +1 -0
- package/dist/md/utils/tokens.d.ts +9 -0
- package/dist/md/utils/tokens.d.ts.map +1 -0
- package/dist/md/utils/tokens.js +31 -0
- package/dist/md/utils/tokens.js.map +1 -0
- package/dist/md/validator/index.d.ts +40 -0
- package/dist/md/validator/index.d.ts.map +1 -0
- package/dist/md/validator/index.js +289 -0
- package/dist/md/validator/index.js.map +1 -0
- package/dist/parsers/details-jsdoc.d.ts +46 -0
- package/dist/parsers/details-jsdoc.d.ts.map +1 -0
- package/dist/parsers/details-jsdoc.js +262 -0
- package/dist/parsers/details-jsdoc.js.map +1 -0
- package/dist/parsers/details-zod.d.ts +22 -0
- package/dist/parsers/details-zod.d.ts.map +1 -0
- package/dist/parsers/details-zod.js +145 -0
- package/dist/parsers/details-zod.js.map +1 -0
- package/dist/parsers/drizzle-schema.d.ts +92 -0
- package/dist/parsers/drizzle-schema.d.ts.map +1 -0
- package/dist/parsers/drizzle-schema.js +376 -0
- package/dist/parsers/drizzle-schema.js.map +1 -0
- package/dist/parsers/feature-map-tags.d.ts +45 -0
- package/dist/parsers/feature-map-tags.d.ts.map +1 -0
- package/dist/parsers/feature-map-tags.js +292 -0
- package/dist/parsers/feature-map-tags.js.map +1 -0
- package/dist/parsers/feature-map-type-extraction.d.ts +62 -0
- package/dist/parsers/feature-map-type-extraction.d.ts.map +1 -0
- package/dist/parsers/feature-map-type-extraction.js +347 -0
- package/dist/parsers/feature-map-type-extraction.js.map +1 -0
- package/dist/parsers/feature-map-utils.d.ts +34 -0
- package/dist/parsers/feature-map-utils.d.ts.map +1 -0
- package/dist/parsers/feature-map-utils.js +101 -0
- package/dist/parsers/feature-map-utils.js.map +1 -0
- package/dist/parsers/jsdoc-common.d.ts +209 -0
- package/dist/parsers/jsdoc-common.d.ts.map +1 -0
- package/dist/parsers/jsdoc-common.js +655 -0
- package/dist/parsers/jsdoc-common.js.map +1 -0
- package/dist/parsers/jsdoc.d.ts +76 -0
- package/dist/parsers/jsdoc.d.ts.map +1 -0
- package/dist/parsers/jsdoc.js +238 -0
- package/dist/parsers/jsdoc.js.map +1 -0
- package/dist/parsers/screenshot-annotations.d.ts +96 -0
- package/dist/parsers/screenshot-annotations.d.ts.map +1 -0
- package/dist/parsers/screenshot-annotations.js +227 -0
- package/dist/parsers/screenshot-annotations.js.map +1 -0
- package/dist/parsers/test-annotations.d.ts +46 -0
- package/dist/parsers/test-annotations.d.ts.map +1 -0
- package/dist/parsers/test-annotations.js +393 -0
- package/dist/parsers/test-annotations.js.map +1 -0
- package/dist/parsers/test-categorization.d.ts +42 -0
- package/dist/parsers/test-categorization.d.ts.map +1 -0
- package/dist/parsers/test-categorization.js +182 -0
- package/dist/parsers/test-categorization.js.map +1 -0
- package/dist/parsers/zod-schema.d.ts +105 -0
- package/dist/parsers/zod-schema.d.ts.map +1 -0
- package/dist/parsers/zod-schema.js +270 -0
- package/dist/parsers/zod-schema.js.map +1 -0
- package/dist/utils/action-inference.d.ts +23 -0
- package/dist/utils/action-inference.d.ts.map +1 -0
- package/dist/utils/action-inference.js +36 -0
- package/dist/utils/action-inference.js.map +1 -0
- package/dist/utils/app-inference.d.ts +31 -0
- package/dist/utils/app-inference.d.ts.map +1 -0
- package/dist/utils/app-inference.js +41 -0
- package/dist/utils/app-inference.js.map +1 -0
- package/dist/utils/auto-infer.d.ts +93 -0
- package/dist/utils/auto-infer.d.ts.map +1 -0
- package/dist/utils/auto-infer.js +184 -0
- package/dist/utils/auto-infer.js.map +1 -0
- package/dist/utils/config.d.ts +709 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +504 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/file.d.ts +46 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +103 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/formatters.d.ts +111 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +164 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/gh-config.d.ts +99 -0
- package/dist/utils/gh-config.d.ts.map +1 -0
- package/dist/utils/gh-config.js +247 -0
- package/dist/utils/gh-config.js.map +1 -0
- package/dist/utils/github.d.ts +98 -0
- package/dist/utils/github.d.ts.map +1 -0
- package/dist/utils/github.js +295 -0
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/html.d.ts +107 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +376 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/i18n.d.ts +40 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +148 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +49 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/project-fields.d.ts +71 -0
- package/dist/utils/project-fields.d.ts.map +1 -0
- package/dist/utils/project-fields.js +318 -0
- package/dist/utils/project-fields.js.map +1 -0
- package/dist/utils/repo-pairs.d.ts +94 -0
- package/dist/utils/repo-pairs.d.ts.map +1 -0
- package/dist/utils/repo-pairs.js +196 -0
- package/dist/utils/repo-pairs.js.map +1 -0
- package/dist/utils/route-inference.d.ts +81 -0
- package/dist/utils/route-inference.d.ts.map +1 -0
- package/dist/utils/route-inference.js +137 -0
- package/dist/utils/route-inference.js.map +1 -0
- package/dist/utils/setup-check.d.ts +34 -0
- package/dist/utils/setup-check.d.ts.map +1 -0
- package/dist/utils/setup-check.js +136 -0
- package/dist/utils/setup-check.js.map +1 -0
- package/dist/utils/shirokumaignore.d.ts +55 -0
- package/dist/utils/shirokumaignore.d.ts.map +1 -0
- package/dist/utils/shirokumaignore.js +94 -0
- package/dist/utils/shirokumaignore.js.map +1 -0
- package/dist/utils/skills-repo.d.ts +353 -0
- package/dist/utils/skills-repo.d.ts.map +1 -0
- package/dist/utils/skills-repo.js +793 -0
- package/dist/utils/skills-repo.js.map +1 -0
- package/dist/utils/status-workflow.d.ts +54 -0
- package/dist/utils/status-workflow.d.ts.map +1 -0
- package/dist/utils/status-workflow.js +103 -0
- package/dist/utils/status-workflow.js.map +1 -0
- package/dist/validators/frontmatter.d.ts +41 -0
- package/dist/validators/frontmatter.d.ts.map +1 -0
- package/dist/validators/frontmatter.js +117 -0
- package/dist/validators/frontmatter.js.map +1 -0
- package/dist/validators/link-checker.d.ts +48 -0
- package/dist/validators/link-checker.d.ts.map +1 -0
- package/dist/validators/link-checker.js +108 -0
- package/dist/validators/link-checker.js.map +1 -0
- package/dist/validators/markdown-structure.d.ts +50 -0
- package/dist/validators/markdown-structure.d.ts.map +1 -0
- package/dist/validators/markdown-structure.js +253 -0
- package/dist/validators/markdown-structure.js.map +1 -0
- package/i18n/cli/en.json +155 -0
- package/i18n/cli/ja.json +155 -0
- package/i18n/discussion/en.json +191 -0
- package/i18n/discussion/ja.json +191 -0
- package/package.json +113 -0
- package/portal/app/api-tools/api-tools-client.tsx +411 -0
- package/portal/app/api-tools/api-tools-document.tsx +240 -0
- package/portal/app/api-tools/page.tsx +56 -0
- package/portal/app/api-tools/swagger-view.tsx +114 -0
- package/portal/app/apps/[appId]/[type]/[module]/[item]/item-tabs-client.tsx +71 -0
- package/portal/app/apps/[appId]/[type]/[module]/[item]/page.tsx +1422 -0
- package/portal/app/apps/[appId]/[type]/[module]/page.tsx +373 -0
- package/portal/app/apps/[appId]/feature-map/feature-map-app-document.tsx +298 -0
- package/portal/app/apps/[appId]/feature-map/page.tsx +224 -0
- package/portal/app/apps/[appId]/i18n/page.tsx +139 -0
- package/portal/app/apps/[appId]/test-cases/page.tsx +840 -0
- package/portal/app/apps/[appId]/tools/[tool]/page.tsx +351 -0
- package/portal/app/apps/[appId]/tools/api-tools-client.tsx +429 -0
- package/portal/app/apps/[appId]/tools/page.tsx +119 -0
- package/portal/app/db-schema/[db]/[table]/page.tsx +235 -0
- package/portal/app/db-schema/[db]/diagram/page.tsx +81 -0
- package/portal/app/db-schema/[db]/page.tsx +148 -0
- package/portal/app/db-schema/db-schema-document.tsx +100 -0
- package/portal/app/db-schema/diagram/client.tsx +211 -0
- package/portal/app/db-schema/diagram/page.tsx +20 -0
- package/portal/app/db-schema/page.tsx +145 -0
- package/portal/app/db-schema/table-detail-document.tsx +710 -0
- package/portal/app/db-schema/table-detail.tsx +747 -0
- package/portal/app/db-schema/table-list-document.tsx +224 -0
- package/portal/app/db-schema/table-list.tsx +247 -0
- package/portal/app/details/[type]/[module]/[item]/item-tabs-client.tsx +71 -0
- package/portal/app/details/[type]/[module]/[item]/page.tsx +1286 -0
- package/portal/app/details/[type]/[module]/page.tsx +884 -0
- package/portal/app/feature-map/feature-map-client.tsx +681 -0
- package/portal/app/feature-map/feature-map-document.tsx +313 -0
- package/portal/app/feature-map/page.tsx +438 -0
- package/portal/app/globals.css +205 -0
- package/portal/app/i18n/[...namespace]/page.tsx +190 -0
- package/portal/app/i18n/i18n-client.tsx +369 -0
- package/portal/app/i18n/page.tsx +339 -0
- package/portal/app/layout.tsx +37 -0
- package/portal/app/overview/page.tsx +65 -0
- package/portal/app/packages/[packageId]/page.tsx +201 -0
- package/portal/app/packages/page.tsx +148 -0
- package/portal/app/page.tsx +568 -0
- package/portal/app/test-cases/[file]/[line]/page.tsx +455 -0
- package/portal/app/test-cases/[file]/[line]/test-detail-document.tsx +335 -0
- package/portal/app/test-cases/[file]/page.tsx +323 -0
- package/portal/app/test-cases/[file]/test-file-document.tsx +335 -0
- package/portal/app/test-cases/page.tsx +546 -0
- package/portal/app/test-cases/test-cases-document.tsx +384 -0
- package/portal/components/code-block.tsx +57 -0
- package/portal/components/document/doc-params-table.tsx +71 -0
- package/portal/components/document/doc-section.tsx +133 -0
- package/portal/components/document/doc-table.tsx +119 -0
- package/portal/components/document/index.ts +9 -0
- package/portal/components/drawflow-er-diagram.tsx +607 -0
- package/portal/components/interactive-er-diagram.tsx +228 -0
- package/portal/components/layout/app-sidebar.tsx +490 -0
- package/portal/components/layout/er-sidebar.tsx +116 -0
- package/portal/components/layout/global-header.tsx +117 -0
- package/portal/components/layout/layout-content.tsx +48 -0
- package/portal/components/markdown-content.tsx +120 -0
- package/portal/components/mermaid-diagram.tsx +83 -0
- package/portal/components/reactflow-er-diagram.tsx +475 -0
- package/portal/components/search-dialog.tsx +268 -0
- package/portal/components/shared/coverage-score-bar.tsx +144 -0
- package/portal/components/swagger/endpoint-accordion.tsx +117 -0
- package/portal/components/swagger/index.ts +7 -0
- package/portal/components/swagger/method-badge.tsx +55 -0
- package/portal/components/swagger/params-table.tsx +78 -0
- package/portal/components/tabs-with-hash.tsx +43 -0
- package/portal/components/test/index.ts +2 -0
- package/portal/components/test/test-bdd-card.tsx +192 -0
- package/portal/components/test/test-matrix.tsx +242 -0
- package/portal/components/ui/accordion.tsx +66 -0
- package/portal/components/ui/badge.tsx +46 -0
- package/portal/components/ui/breadcrumb.tsx +109 -0
- package/portal/components/ui/button.tsx +62 -0
- package/portal/components/ui/card.tsx +92 -0
- package/portal/components/ui/collapsible.tsx +33 -0
- package/portal/components/ui/dialog.tsx +118 -0
- package/portal/components/ui/progress.tsx +28 -0
- package/portal/components/ui/scroll-area.tsx +58 -0
- package/portal/components/ui/sheet.tsx +139 -0
- package/portal/components/ui/table.tsx +116 -0
- package/portal/components/ui/tabs.tsx +66 -0
- package/portal/components.json +21 -0
- package/portal/lib/constants/test-categories.ts +186 -0
- package/portal/lib/data-loader.ts +1181 -0
- package/portal/lib/db-schema-utils.ts +182 -0
- package/portal/lib/format.ts +43 -0
- package/portal/lib/hooks/use-hash-tab.ts +144 -0
- package/portal/lib/path-utils.ts +25 -0
- package/portal/lib/search-index-generator.ts +214 -0
- package/portal/lib/search.ts +126 -0
- package/portal/lib/sidebar-context.tsx +111 -0
- package/portal/lib/types.ts +740 -0
- package/portal/lib/utils.ts +6 -0
- package/portal/next.config.ts +21 -0
- package/portal/package.json +45 -0
- package/portal/postcss.config.mjs +8 -0
- package/portal/tsconfig.json +41 -0
- package/portal/types/drawflow.d.ts +80 -0
- package/templates/README.md +73 -0
- package/templates/coverage.html +367 -0
- package/templates/dark-theme.css +443 -0
- package/templates/discussion/adr.yml.hbs +65 -0
- package/templates/discussion/handovers.yml.hbs +57 -0
- package/templates/discussion/knowledge.yml.hbs +60 -0
- package/templates/discussion/reports.yml.hbs +68 -0
- package/templates/discussion/research.yml.hbs +61 -0
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gh-projects command - GitHub Projects V2 management
|
|
3
|
+
*
|
|
4
|
+
* Subcommands:
|
|
5
|
+
* - list: List project items (excludes Done/Released by default)
|
|
6
|
+
* - get: Get item details by ID or issue number
|
|
7
|
+
* - fields: Show available field options
|
|
8
|
+
* - create: Create a new draft issue in the project
|
|
9
|
+
* - update: Update item fields
|
|
10
|
+
* - delete: Delete item from project
|
|
11
|
+
* - add-issue: Add existing issue to project
|
|
12
|
+
*
|
|
13
|
+
* Project naming convention: Project name = Repository name
|
|
14
|
+
*/
|
|
15
|
+
import { createLogger } from "../utils/logger.js";
|
|
16
|
+
import { runGhCommand, runGraphQL, getOwner, getRepoName, validateTitle, validateBody, isIssueNumber, parseIssueNumber, } from "../utils/github.js";
|
|
17
|
+
import { loadGhConfig } from "../utils/gh-config.js";
|
|
18
|
+
import { formatOutput, GH_PROJECTS_LIST_COLUMNS, } from "../utils/formatters.js";
|
|
19
|
+
/** Default statuses to exclude when listing (typically completed items) */
|
|
20
|
+
const DEFAULT_EXCLUDE_STATUSES = ["Done", "Released"];
|
|
21
|
+
/** #250 推奨ワークフロー: 有効にすべき自動化 */
|
|
22
|
+
export const RECOMMENDED_WORKFLOWS = ["Item closed", "Pull request merged"];
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// GraphQL Queries
|
|
25
|
+
// =============================================================================
|
|
26
|
+
/** プロジェクトのワークフロー一覧を取得 */
|
|
27
|
+
const GRAPHQL_QUERY_WORKFLOWS = `
|
|
28
|
+
query($projectId: ID!) {
|
|
29
|
+
node(id: $projectId) {
|
|
30
|
+
... on ProjectV2 {
|
|
31
|
+
title
|
|
32
|
+
workflows(first: 20) {
|
|
33
|
+
nodes {
|
|
34
|
+
id
|
|
35
|
+
name
|
|
36
|
+
number
|
|
37
|
+
enabled
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
const GRAPHQL_QUERY_LIST = `
|
|
45
|
+
query($projectId: ID!, $cursor: String) {
|
|
46
|
+
node(id: $projectId) {
|
|
47
|
+
... on ProjectV2 {
|
|
48
|
+
title
|
|
49
|
+
items(first: 100, after: $cursor) {
|
|
50
|
+
pageInfo { hasNextPage endCursor }
|
|
51
|
+
nodes {
|
|
52
|
+
id
|
|
53
|
+
status: fieldValueByName(name: "Status") {
|
|
54
|
+
... on ProjectV2ItemFieldSingleSelectValue { name }
|
|
55
|
+
}
|
|
56
|
+
priority: fieldValueByName(name: "Priority") {
|
|
57
|
+
... on ProjectV2ItemFieldSingleSelectValue { name }
|
|
58
|
+
}
|
|
59
|
+
type: fieldValueByName(name: "Type") {
|
|
60
|
+
... on ProjectV2ItemFieldSingleSelectValue { name }
|
|
61
|
+
}
|
|
62
|
+
size: fieldValueByName(name: "Size") {
|
|
63
|
+
... on ProjectV2ItemFieldSingleSelectValue { name }
|
|
64
|
+
}
|
|
65
|
+
content {
|
|
66
|
+
... on DraftIssue { title }
|
|
67
|
+
... on Issue { title number }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
const GRAPHQL_QUERY_ITEM = `
|
|
76
|
+
query($itemId: ID!) {
|
|
77
|
+
node(id: $itemId) {
|
|
78
|
+
... on ProjectV2Item {
|
|
79
|
+
id
|
|
80
|
+
status: fieldValueByName(name: "Status") {
|
|
81
|
+
... on ProjectV2ItemFieldSingleSelectValue { name optionId }
|
|
82
|
+
}
|
|
83
|
+
priority: fieldValueByName(name: "Priority") {
|
|
84
|
+
... on ProjectV2ItemFieldSingleSelectValue { name optionId }
|
|
85
|
+
}
|
|
86
|
+
type: fieldValueByName(name: "Type") {
|
|
87
|
+
... on ProjectV2ItemFieldSingleSelectValue { name optionId }
|
|
88
|
+
}
|
|
89
|
+
size: fieldValueByName(name: "Size") {
|
|
90
|
+
... on ProjectV2ItemFieldSingleSelectValue { name optionId }
|
|
91
|
+
}
|
|
92
|
+
content {
|
|
93
|
+
... on DraftIssue { id title body }
|
|
94
|
+
... on Issue { id title number body url }
|
|
95
|
+
}
|
|
96
|
+
project { id title }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
const GRAPHQL_QUERY_FIELDS = `
|
|
102
|
+
query($projectId: ID!) {
|
|
103
|
+
node(id: $projectId) {
|
|
104
|
+
... on ProjectV2 {
|
|
105
|
+
title
|
|
106
|
+
fields(first: 20) {
|
|
107
|
+
nodes {
|
|
108
|
+
... on ProjectV2SingleSelectField {
|
|
109
|
+
id name
|
|
110
|
+
options { id name }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
const GRAPHQL_MUTATION_CREATE = `
|
|
119
|
+
mutation($projectId: ID!, $title: String!, $body: String) {
|
|
120
|
+
addProjectV2DraftIssue(input: {projectId: $projectId, title: $title, body: $body}) {
|
|
121
|
+
projectItem { id }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
const GRAPHQL_MUTATION_UPDATE_FIELD = `
|
|
126
|
+
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {
|
|
127
|
+
updateProjectV2ItemFieldValue(input: {
|
|
128
|
+
projectId: $projectId
|
|
129
|
+
itemId: $itemId
|
|
130
|
+
fieldId: $fieldId
|
|
131
|
+
value: { singleSelectOptionId: $optionId }
|
|
132
|
+
}) { projectV2Item { id } }
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
const GRAPHQL_MUTATION_UPDATE_BODY = `
|
|
136
|
+
mutation($draftIssueId: ID!, $body: String!) {
|
|
137
|
+
updateProjectV2DraftIssue(input: {draftIssueId: $draftIssueId, body: $body}) {
|
|
138
|
+
draftIssue { id body }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
const GRAPHQL_MUTATION_UPDATE_ISSUE = `
|
|
143
|
+
mutation($id: ID!, $body: String!) {
|
|
144
|
+
updateIssue(input: {id: $id, body: $body}) {
|
|
145
|
+
issue { id number title body }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
const GRAPHQL_MUTATION_DELETE_ITEM = `
|
|
150
|
+
mutation($projectId: ID!, $itemId: ID!) {
|
|
151
|
+
deleteProjectV2Item(input: {projectId: $projectId, itemId: $itemId}) {
|
|
152
|
+
deletedItemId
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
const GRAPHQL_MUTATION_ADD_ISSUE_TO_PROJECT = `
|
|
157
|
+
mutation($projectId: ID!, $contentId: ID!) {
|
|
158
|
+
addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {
|
|
159
|
+
item { id }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
const GRAPHQL_QUERY_ISSUE_BY_NUMBER = `
|
|
164
|
+
query($owner: String!, $name: String!, $number: Int!) {
|
|
165
|
+
repository(owner: $owner, name: $name) {
|
|
166
|
+
issue(number: $number) {
|
|
167
|
+
id
|
|
168
|
+
number
|
|
169
|
+
title
|
|
170
|
+
body
|
|
171
|
+
url
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`;
|
|
176
|
+
// =============================================================================
|
|
177
|
+
// Helper Functions
|
|
178
|
+
// =============================================================================
|
|
179
|
+
/**
|
|
180
|
+
* Get project ID by name (defaults to repository name)
|
|
181
|
+
*/
|
|
182
|
+
export function getProjectId(owner, projectName) {
|
|
183
|
+
const targetName = projectName || getRepoName();
|
|
184
|
+
if (!targetName)
|
|
185
|
+
return null;
|
|
186
|
+
const result = runGhCommand(["project", "list", "--owner", owner, "--format", "json"], { silent: true });
|
|
187
|
+
if (!result.success || !result.data?.projects)
|
|
188
|
+
return null;
|
|
189
|
+
// Find project by name (repository name convention)
|
|
190
|
+
for (const project of result.data.projects) {
|
|
191
|
+
if (project.title === targetName) {
|
|
192
|
+
return project.id;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Fallback to first project if no match
|
|
196
|
+
return result.data.projects[0]?.id ?? null;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get project field definitions with option mappings
|
|
200
|
+
*/
|
|
201
|
+
function getProjectFields(projectId) {
|
|
202
|
+
const result = runGraphQL(GRAPHQL_QUERY_FIELDS, { projectId });
|
|
203
|
+
if (!result.success)
|
|
204
|
+
return {};
|
|
205
|
+
const fields = {};
|
|
206
|
+
const nodes = result.data?.data?.node?.fields?.nodes ?? [];
|
|
207
|
+
for (const node of nodes) {
|
|
208
|
+
if (node?.name && node?.options && node?.id) {
|
|
209
|
+
const options = {};
|
|
210
|
+
for (const opt of node.options) {
|
|
211
|
+
options[opt.name] = opt.id;
|
|
212
|
+
}
|
|
213
|
+
fields[node.name] = {
|
|
214
|
+
id: node.id,
|
|
215
|
+
name: node.name,
|
|
216
|
+
options,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return fields;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Fetch all project items with pagination
|
|
224
|
+
*/
|
|
225
|
+
function fetchAllItems(projectId) {
|
|
226
|
+
const allItems = [];
|
|
227
|
+
let cursor = null;
|
|
228
|
+
let projectTitle = "";
|
|
229
|
+
while (true) {
|
|
230
|
+
const result = runGraphQL(GRAPHQL_QUERY_LIST, {
|
|
231
|
+
projectId,
|
|
232
|
+
cursor: cursor ?? "null",
|
|
233
|
+
});
|
|
234
|
+
if (!result.success || !result.data?.data?.node)
|
|
235
|
+
break;
|
|
236
|
+
const node = result.data.data.node;
|
|
237
|
+
projectTitle = node.title ?? "";
|
|
238
|
+
const itemsData = node.items ?? { nodes: [], pageInfo: {} };
|
|
239
|
+
const nodes = itemsData.nodes ?? [];
|
|
240
|
+
for (const item of nodes) {
|
|
241
|
+
if (!item?.id)
|
|
242
|
+
continue;
|
|
243
|
+
allItems.push({
|
|
244
|
+
id: item.id,
|
|
245
|
+
title: item.content?.title ?? null,
|
|
246
|
+
status: item.status?.name ?? null,
|
|
247
|
+
priority: item.priority?.name ?? null,
|
|
248
|
+
type: item.type?.name ?? null,
|
|
249
|
+
size: item.size?.name ?? null,
|
|
250
|
+
issueNumber: item.content?.number ?? null,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
const pageInfo = itemsData.pageInfo ?? {};
|
|
254
|
+
if (!pageInfo.hasNextPage)
|
|
255
|
+
break;
|
|
256
|
+
cursor = pageInfo.endCursor ?? null;
|
|
257
|
+
}
|
|
258
|
+
return { title: projectTitle, items: allItems };
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Fetch a single project item by ID with full details
|
|
262
|
+
*/
|
|
263
|
+
function fetchItem(itemId) {
|
|
264
|
+
const result = runGraphQL(GRAPHQL_QUERY_ITEM, { itemId });
|
|
265
|
+
if (!result.success || !result.data?.data?.node)
|
|
266
|
+
return null;
|
|
267
|
+
const node = result.data.data.node;
|
|
268
|
+
const content = node.content ?? {};
|
|
269
|
+
const project = node.project ?? {};
|
|
270
|
+
return {
|
|
271
|
+
id: node.id ?? itemId,
|
|
272
|
+
title: content.title ?? null,
|
|
273
|
+
body: content.body ?? null,
|
|
274
|
+
status: node.status?.name ?? null,
|
|
275
|
+
statusOptionId: node.status?.optionId ?? null,
|
|
276
|
+
priority: node.priority?.name ?? null,
|
|
277
|
+
priorityOptionId: node.priority?.optionId ?? null,
|
|
278
|
+
type: node.type?.name ?? null,
|
|
279
|
+
typeOptionId: node.type?.optionId ?? null,
|
|
280
|
+
size: node.size?.name ?? null,
|
|
281
|
+
sizeOptionId: node.size?.optionId ?? null,
|
|
282
|
+
issueNumber: content.number ?? null,
|
|
283
|
+
issueUrl: content.url ?? null,
|
|
284
|
+
draftIssueId: content.number ? null : content.id ?? null,
|
|
285
|
+
project: project.id ? { id: project.id, title: project.title ?? "" } : undefined,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Find project item by issue number
|
|
290
|
+
*/
|
|
291
|
+
function findItemByIssueNumber(projectId, issueNumber) {
|
|
292
|
+
const { items } = fetchAllItems(projectId);
|
|
293
|
+
for (const item of items) {
|
|
294
|
+
if (item.issueNumber === issueNumber) {
|
|
295
|
+
return { id: item.id };
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Update a single select field on an item
|
|
302
|
+
*/
|
|
303
|
+
function updateField(projectId, itemId, fieldId, optionId) {
|
|
304
|
+
const result = runGraphQL(GRAPHQL_MUTATION_UPDATE_FIELD, {
|
|
305
|
+
projectId,
|
|
306
|
+
itemId,
|
|
307
|
+
fieldId,
|
|
308
|
+
optionId,
|
|
309
|
+
});
|
|
310
|
+
return result.success;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Set multiple fields on an item
|
|
314
|
+
*/
|
|
315
|
+
function setItemFields(projectId, itemId, fields, projectFields, logger) {
|
|
316
|
+
if (Object.keys(fields).length === 0)
|
|
317
|
+
return 0;
|
|
318
|
+
const pf = projectFields ?? getProjectFields(projectId);
|
|
319
|
+
let updatedCount = 0;
|
|
320
|
+
for (const [fieldName, value] of Object.entries(fields)) {
|
|
321
|
+
if (!pf[fieldName]) {
|
|
322
|
+
logger?.warn(`Field '${fieldName}' not found in project`);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const fieldInfo = pf[fieldName];
|
|
326
|
+
const optionId = fieldInfo.options[value];
|
|
327
|
+
if (optionId) {
|
|
328
|
+
if (updateField(projectId, itemId, fieldInfo.id, optionId)) {
|
|
329
|
+
updatedCount++;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
const available = Object.keys(fieldInfo.options).sort().join(", ");
|
|
334
|
+
logger?.error(`Invalid ${fieldName} value '${value}'`);
|
|
335
|
+
logger?.info(` Available options: ${available}`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return updatedCount;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Get issue by number
|
|
342
|
+
*/
|
|
343
|
+
function getIssueByNumber(owner, repo, number) {
|
|
344
|
+
const result = runGraphQL(GRAPHQL_QUERY_ISSUE_BY_NUMBER, {
|
|
345
|
+
owner,
|
|
346
|
+
name: repo,
|
|
347
|
+
number,
|
|
348
|
+
});
|
|
349
|
+
if (!result.success)
|
|
350
|
+
return null;
|
|
351
|
+
const issue = result.data?.data?.repository?.issue;
|
|
352
|
+
if (!issue?.id)
|
|
353
|
+
return null;
|
|
354
|
+
return {
|
|
355
|
+
id: issue.id,
|
|
356
|
+
number: issue.number ?? number,
|
|
357
|
+
title: issue.title ?? "",
|
|
358
|
+
body: issue.body ?? "",
|
|
359
|
+
url: issue.url ?? "",
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
// =============================================================================
|
|
363
|
+
// Subcommand Handlers
|
|
364
|
+
// =============================================================================
|
|
365
|
+
/**
|
|
366
|
+
* list subcommand
|
|
367
|
+
*/
|
|
368
|
+
async function cmdList(options, logger) {
|
|
369
|
+
// Load config for defaults
|
|
370
|
+
const config = loadGhConfig();
|
|
371
|
+
const owner = options.owner || getOwner();
|
|
372
|
+
if (!owner) {
|
|
373
|
+
logger.error("Could not determine repository owner");
|
|
374
|
+
return 1;
|
|
375
|
+
}
|
|
376
|
+
const projectId = getProjectId(owner);
|
|
377
|
+
if (!projectId) {
|
|
378
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
379
|
+
return 1;
|
|
380
|
+
}
|
|
381
|
+
const { title: projectTitle, items } = fetchAllItems(projectId);
|
|
382
|
+
// Apply status filter
|
|
383
|
+
// Default: exclude Done/Released unless --all or --status specified
|
|
384
|
+
let filteredItems = items;
|
|
385
|
+
if (options.status && options.status.length > 0) {
|
|
386
|
+
filteredItems = items.filter((i) => options.status.includes(i.status ?? ""));
|
|
387
|
+
}
|
|
388
|
+
else if (!options.all) {
|
|
389
|
+
filteredItems = items.filter((i) => !DEFAULT_EXCLUDE_STATUSES.includes(i.status ?? ""));
|
|
390
|
+
}
|
|
391
|
+
const output = {
|
|
392
|
+
project: { id: projectId, title: projectTitle, owner },
|
|
393
|
+
items: filteredItems.map((i) => ({
|
|
394
|
+
id: i.id,
|
|
395
|
+
title: i.title,
|
|
396
|
+
status: i.status,
|
|
397
|
+
priority: i.priority,
|
|
398
|
+
type: i.type,
|
|
399
|
+
size: i.size,
|
|
400
|
+
issue_number: i.issueNumber,
|
|
401
|
+
})),
|
|
402
|
+
total_count: filteredItems.length,
|
|
403
|
+
};
|
|
404
|
+
const outputFormat = options.format ?? "json";
|
|
405
|
+
const formatted = formatOutput(output, outputFormat, {
|
|
406
|
+
arrayKey: "items",
|
|
407
|
+
columns: GH_PROJECTS_LIST_COLUMNS,
|
|
408
|
+
});
|
|
409
|
+
console.log(formatted);
|
|
410
|
+
return 0;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* get subcommand
|
|
414
|
+
*/
|
|
415
|
+
async function cmdGet(itemIdOrNumber, options, logger) {
|
|
416
|
+
let itemId = itemIdOrNumber;
|
|
417
|
+
// Support #number notation
|
|
418
|
+
if (isIssueNumber(itemIdOrNumber)) {
|
|
419
|
+
const issueNumber = parseIssueNumber(itemIdOrNumber);
|
|
420
|
+
const owner = options.owner || getOwner();
|
|
421
|
+
const repo = getRepoName();
|
|
422
|
+
if (!owner || !repo) {
|
|
423
|
+
logger.error("Could not determine repository");
|
|
424
|
+
return 1;
|
|
425
|
+
}
|
|
426
|
+
const projectId = getProjectId(owner);
|
|
427
|
+
if (!projectId) {
|
|
428
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
429
|
+
return 1;
|
|
430
|
+
}
|
|
431
|
+
const found = findItemByIssueNumber(projectId, issueNumber);
|
|
432
|
+
if (!found) {
|
|
433
|
+
logger.error(`No project item found for Issue #${issueNumber}`);
|
|
434
|
+
return 1;
|
|
435
|
+
}
|
|
436
|
+
itemId = found.id;
|
|
437
|
+
}
|
|
438
|
+
const item = fetchItem(itemId);
|
|
439
|
+
if (!item) {
|
|
440
|
+
logger.error(`Item '${itemIdOrNumber}' not found`);
|
|
441
|
+
return 1;
|
|
442
|
+
}
|
|
443
|
+
// Convert to snake_case for JSON output (consistency with Python version)
|
|
444
|
+
const output = {
|
|
445
|
+
id: item.id,
|
|
446
|
+
title: item.title,
|
|
447
|
+
body: item.body,
|
|
448
|
+
status: item.status,
|
|
449
|
+
status_option_id: item.statusOptionId,
|
|
450
|
+
priority: item.priority,
|
|
451
|
+
priority_option_id: item.priorityOptionId,
|
|
452
|
+
type: item.type,
|
|
453
|
+
type_option_id: item.typeOptionId,
|
|
454
|
+
size: item.size,
|
|
455
|
+
size_option_id: item.sizeOptionId,
|
|
456
|
+
issue_number: item.issueNumber,
|
|
457
|
+
issue_url: item.issueUrl,
|
|
458
|
+
draft_issue_id: item.draftIssueId,
|
|
459
|
+
project: item.project,
|
|
460
|
+
};
|
|
461
|
+
console.log(JSON.stringify(output, null, 2));
|
|
462
|
+
return 0;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* fields subcommand
|
|
466
|
+
*/
|
|
467
|
+
async function cmdFields(options, logger) {
|
|
468
|
+
const owner = options.owner || getOwner();
|
|
469
|
+
if (!owner) {
|
|
470
|
+
logger.error("Could not determine repository owner");
|
|
471
|
+
return 1;
|
|
472
|
+
}
|
|
473
|
+
const projectId = getProjectId(owner);
|
|
474
|
+
if (!projectId) {
|
|
475
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
476
|
+
return 1;
|
|
477
|
+
}
|
|
478
|
+
const fields = getProjectFields(projectId);
|
|
479
|
+
console.log(JSON.stringify(fields, null, 2));
|
|
480
|
+
return 0;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* create subcommand
|
|
484
|
+
*/
|
|
485
|
+
async function cmdCreate(options, logger) {
|
|
486
|
+
// Validation
|
|
487
|
+
if (!options.title) {
|
|
488
|
+
logger.error("--title is required");
|
|
489
|
+
return 1;
|
|
490
|
+
}
|
|
491
|
+
const titleError = validateTitle(options.title);
|
|
492
|
+
if (titleError) {
|
|
493
|
+
logger.error(titleError);
|
|
494
|
+
return 1;
|
|
495
|
+
}
|
|
496
|
+
const bodyError = validateBody(options.body);
|
|
497
|
+
if (bodyError) {
|
|
498
|
+
logger.error(bodyError);
|
|
499
|
+
return 1;
|
|
500
|
+
}
|
|
501
|
+
const owner = options.owner || getOwner();
|
|
502
|
+
if (!owner) {
|
|
503
|
+
logger.error("Could not determine repository owner");
|
|
504
|
+
return 1;
|
|
505
|
+
}
|
|
506
|
+
const projectId = getProjectId(owner);
|
|
507
|
+
if (!projectId) {
|
|
508
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
509
|
+
return 1;
|
|
510
|
+
}
|
|
511
|
+
const result = runGraphQL(GRAPHQL_MUTATION_CREATE, {
|
|
512
|
+
projectId,
|
|
513
|
+
title: options.title,
|
|
514
|
+
body: options.body ?? "",
|
|
515
|
+
});
|
|
516
|
+
if (!result.success) {
|
|
517
|
+
logger.error("Failed to create item");
|
|
518
|
+
return 1;
|
|
519
|
+
}
|
|
520
|
+
const itemId = result.data?.data?.addProjectV2DraftIssue?.projectItem?.id;
|
|
521
|
+
if (!itemId) {
|
|
522
|
+
logger.error("Failed to create item");
|
|
523
|
+
return 1;
|
|
524
|
+
}
|
|
525
|
+
// Set fields if provided
|
|
526
|
+
const fields = {};
|
|
527
|
+
if (options.fieldStatus)
|
|
528
|
+
fields["Status"] = options.fieldStatus;
|
|
529
|
+
if (options.priority)
|
|
530
|
+
fields["Priority"] = options.priority;
|
|
531
|
+
if (options.type)
|
|
532
|
+
fields["Type"] = options.type;
|
|
533
|
+
if (options.size)
|
|
534
|
+
fields["Size"] = options.size;
|
|
535
|
+
if (Object.keys(fields).length > 0) {
|
|
536
|
+
setItemFields(projectId, itemId, fields, undefined, logger);
|
|
537
|
+
}
|
|
538
|
+
const item = fetchItem(itemId);
|
|
539
|
+
if (item) {
|
|
540
|
+
const output = {
|
|
541
|
+
id: item.id,
|
|
542
|
+
title: item.title,
|
|
543
|
+
body: item.body,
|
|
544
|
+
status: item.status,
|
|
545
|
+
priority: item.priority,
|
|
546
|
+
type: item.type,
|
|
547
|
+
size: item.size,
|
|
548
|
+
issue_number: item.issueNumber,
|
|
549
|
+
draft_issue_id: item.draftIssueId,
|
|
550
|
+
project: item.project,
|
|
551
|
+
};
|
|
552
|
+
console.log(JSON.stringify(output, null, 2));
|
|
553
|
+
}
|
|
554
|
+
return 0;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* update subcommand
|
|
558
|
+
*/
|
|
559
|
+
async function cmdUpdate(itemIdOrNumber, options, logger) {
|
|
560
|
+
// Validation
|
|
561
|
+
const bodyError = validateBody(options.body);
|
|
562
|
+
if (bodyError) {
|
|
563
|
+
logger.error(bodyError);
|
|
564
|
+
return 1;
|
|
565
|
+
}
|
|
566
|
+
let itemId = itemIdOrNumber;
|
|
567
|
+
const owner = options.owner || getOwner();
|
|
568
|
+
const repo = getRepoName();
|
|
569
|
+
// Support #number notation
|
|
570
|
+
if (isIssueNumber(itemIdOrNumber)) {
|
|
571
|
+
const issueNumber = parseIssueNumber(itemIdOrNumber);
|
|
572
|
+
if (!owner || !repo) {
|
|
573
|
+
logger.error("Could not determine repository");
|
|
574
|
+
return 1;
|
|
575
|
+
}
|
|
576
|
+
const projectId = getProjectId(owner);
|
|
577
|
+
if (!projectId) {
|
|
578
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
579
|
+
return 1;
|
|
580
|
+
}
|
|
581
|
+
const found = findItemByIssueNumber(projectId, issueNumber);
|
|
582
|
+
if (!found) {
|
|
583
|
+
logger.error(`No project item found for Issue #${issueNumber}`);
|
|
584
|
+
return 1;
|
|
585
|
+
}
|
|
586
|
+
itemId = found.id;
|
|
587
|
+
}
|
|
588
|
+
let item = fetchItem(itemId);
|
|
589
|
+
if (!item) {
|
|
590
|
+
logger.error(`Item '${itemIdOrNumber}' not found`);
|
|
591
|
+
return 1;
|
|
592
|
+
}
|
|
593
|
+
const projectId = item.project?.id;
|
|
594
|
+
if (!projectId) {
|
|
595
|
+
logger.error("Could not determine project ID");
|
|
596
|
+
return 1;
|
|
597
|
+
}
|
|
598
|
+
// Build fields dict from options
|
|
599
|
+
const fields = {};
|
|
600
|
+
if (options.fieldStatus)
|
|
601
|
+
fields["Status"] = options.fieldStatus;
|
|
602
|
+
if (options.priority)
|
|
603
|
+
fields["Priority"] = options.priority;
|
|
604
|
+
if (options.type)
|
|
605
|
+
fields["Type"] = options.type;
|
|
606
|
+
if (options.size)
|
|
607
|
+
fields["Size"] = options.size;
|
|
608
|
+
let updated = setItemFields(projectId, itemId, fields, undefined, logger) > 0;
|
|
609
|
+
// Update body if provided
|
|
610
|
+
if (options.body !== undefined) {
|
|
611
|
+
if (item.draftIssueId) {
|
|
612
|
+
// DraftIssue body update
|
|
613
|
+
const result = runGraphQL(GRAPHQL_MUTATION_UPDATE_BODY, {
|
|
614
|
+
draftIssueId: item.draftIssueId,
|
|
615
|
+
body: options.body,
|
|
616
|
+
});
|
|
617
|
+
if (result.success)
|
|
618
|
+
updated = true;
|
|
619
|
+
}
|
|
620
|
+
else if (item.issueNumber && owner && repo) {
|
|
621
|
+
// Issue body update
|
|
622
|
+
const issueData = getIssueByNumber(owner, repo, item.issueNumber);
|
|
623
|
+
if (issueData?.id) {
|
|
624
|
+
const result = runGraphQL(GRAPHQL_MUTATION_UPDATE_ISSUE, {
|
|
625
|
+
id: issueData.id,
|
|
626
|
+
body: options.body,
|
|
627
|
+
});
|
|
628
|
+
if (result.success)
|
|
629
|
+
updated = true;
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
logger.warn("Cannot update Issue body (Issue not found)");
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
else {
|
|
636
|
+
logger.warn("Cannot update body (unknown content type)");
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if (updated) {
|
|
640
|
+
item = fetchItem(itemId);
|
|
641
|
+
}
|
|
642
|
+
if (item) {
|
|
643
|
+
const output = {
|
|
644
|
+
id: item.id,
|
|
645
|
+
title: item.title,
|
|
646
|
+
body: item.body,
|
|
647
|
+
status: item.status,
|
|
648
|
+
status_option_id: item.statusOptionId,
|
|
649
|
+
priority: item.priority,
|
|
650
|
+
type: item.type,
|
|
651
|
+
size: item.size,
|
|
652
|
+
issue_number: item.issueNumber,
|
|
653
|
+
issue_url: item.issueUrl,
|
|
654
|
+
draft_issue_id: item.draftIssueId,
|
|
655
|
+
project: item.project,
|
|
656
|
+
};
|
|
657
|
+
console.log(JSON.stringify(output, null, 2));
|
|
658
|
+
}
|
|
659
|
+
return 0;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* delete subcommand
|
|
663
|
+
*/
|
|
664
|
+
async function cmdDelete(itemIdOrNumber, options, logger) {
|
|
665
|
+
let itemId = itemIdOrNumber;
|
|
666
|
+
const owner = options.owner || getOwner();
|
|
667
|
+
const repo = getRepoName();
|
|
668
|
+
// Support #number notation
|
|
669
|
+
if (isIssueNumber(itemIdOrNumber)) {
|
|
670
|
+
const issueNumber = parseIssueNumber(itemIdOrNumber);
|
|
671
|
+
if (!owner || !repo) {
|
|
672
|
+
logger.error("Could not determine repository");
|
|
673
|
+
return 1;
|
|
674
|
+
}
|
|
675
|
+
const projectId = getProjectId(owner);
|
|
676
|
+
if (!projectId) {
|
|
677
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
678
|
+
return 1;
|
|
679
|
+
}
|
|
680
|
+
const found = findItemByIssueNumber(projectId, issueNumber);
|
|
681
|
+
if (!found) {
|
|
682
|
+
logger.error(`No project item found for Issue #${issueNumber}`);
|
|
683
|
+
return 1;
|
|
684
|
+
}
|
|
685
|
+
itemId = found.id;
|
|
686
|
+
}
|
|
687
|
+
const item = fetchItem(itemId);
|
|
688
|
+
if (!item) {
|
|
689
|
+
logger.error(`Item '${itemIdOrNumber}' not found`);
|
|
690
|
+
return 1;
|
|
691
|
+
}
|
|
692
|
+
const projectId = item.project?.id;
|
|
693
|
+
if (!projectId) {
|
|
694
|
+
logger.error("Could not determine project ID");
|
|
695
|
+
return 1;
|
|
696
|
+
}
|
|
697
|
+
const title = item.title ?? "Unknown";
|
|
698
|
+
const issueNum = item.issueNumber;
|
|
699
|
+
// Confirmation prompt (unless --force)
|
|
700
|
+
if (!options.force) {
|
|
701
|
+
const displayName = issueNum ? `#${issueNum} ${title}` : title;
|
|
702
|
+
console.error(`About to remove from project: ${displayName}`);
|
|
703
|
+
if (issueNum) {
|
|
704
|
+
console.error(" Note: The Issue will NOT be deleted, only removed from project.");
|
|
705
|
+
}
|
|
706
|
+
// In Node.js we can't easily do interactive prompts in a portable way
|
|
707
|
+
// For now, require --force flag
|
|
708
|
+
logger.error("Use --force to confirm deletion");
|
|
709
|
+
return 1;
|
|
710
|
+
}
|
|
711
|
+
// Delete from project
|
|
712
|
+
const result = runGraphQL(GRAPHQL_MUTATION_DELETE_ITEM, { projectId, itemId });
|
|
713
|
+
if (result.success) {
|
|
714
|
+
const output = {
|
|
715
|
+
deleted: true,
|
|
716
|
+
item_id: itemId,
|
|
717
|
+
title,
|
|
718
|
+
};
|
|
719
|
+
if (issueNum) {
|
|
720
|
+
output.issue_number = issueNum;
|
|
721
|
+
output.note = "Item removed from project. Issue still exists.";
|
|
722
|
+
}
|
|
723
|
+
console.log(JSON.stringify(output, null, 2));
|
|
724
|
+
return 0;
|
|
725
|
+
}
|
|
726
|
+
else {
|
|
727
|
+
logger.error("Failed to delete item");
|
|
728
|
+
return 1;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* add-issue subcommand
|
|
733
|
+
*/
|
|
734
|
+
async function cmdAddIssue(issueNumberStr, options, logger) {
|
|
735
|
+
const owner = options.owner || getOwner();
|
|
736
|
+
const repo = getRepoName();
|
|
737
|
+
if (!owner || !repo) {
|
|
738
|
+
logger.error("Could not determine repository");
|
|
739
|
+
return 1;
|
|
740
|
+
}
|
|
741
|
+
const projectId = getProjectId(owner);
|
|
742
|
+
if (!projectId) {
|
|
743
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
744
|
+
return 1;
|
|
745
|
+
}
|
|
746
|
+
const issueNumber = parseIssueNumber(issueNumberStr);
|
|
747
|
+
// Get Issue details
|
|
748
|
+
const issue = getIssueByNumber(owner, repo, issueNumber);
|
|
749
|
+
if (!issue) {
|
|
750
|
+
logger.error(`Issue #${issueNumber} not found`);
|
|
751
|
+
return 1;
|
|
752
|
+
}
|
|
753
|
+
// Check if already in project
|
|
754
|
+
const existing = findItemByIssueNumber(projectId, issueNumber);
|
|
755
|
+
if (existing) {
|
|
756
|
+
logger.info(`Issue #${issueNumber} is already in the project`);
|
|
757
|
+
const item = fetchItem(existing.id);
|
|
758
|
+
if (item) {
|
|
759
|
+
const output = {
|
|
760
|
+
id: item.id,
|
|
761
|
+
title: item.title,
|
|
762
|
+
status: item.status,
|
|
763
|
+
priority: item.priority,
|
|
764
|
+
type: item.type,
|
|
765
|
+
size: item.size,
|
|
766
|
+
issue_number: item.issueNumber,
|
|
767
|
+
issue_url: item.issueUrl,
|
|
768
|
+
};
|
|
769
|
+
console.log(JSON.stringify(output, null, 2));
|
|
770
|
+
}
|
|
771
|
+
return 0;
|
|
772
|
+
}
|
|
773
|
+
const result = runGraphQL(GRAPHQL_MUTATION_ADD_ISSUE_TO_PROJECT, {
|
|
774
|
+
projectId,
|
|
775
|
+
contentId: issue.id,
|
|
776
|
+
});
|
|
777
|
+
if (!result.success) {
|
|
778
|
+
logger.error(`Failed to add Issue #${issueNumber} to project`);
|
|
779
|
+
return 1;
|
|
780
|
+
}
|
|
781
|
+
const itemId = result.data?.data?.addProjectV2ItemById?.item?.id;
|
|
782
|
+
if (!itemId) {
|
|
783
|
+
logger.error(`Failed to add Issue #${issueNumber} to project`);
|
|
784
|
+
return 1;
|
|
785
|
+
}
|
|
786
|
+
// Set project fields
|
|
787
|
+
const fields = {};
|
|
788
|
+
if (options.fieldStatus)
|
|
789
|
+
fields["Status"] = options.fieldStatus;
|
|
790
|
+
if (options.priority)
|
|
791
|
+
fields["Priority"] = options.priority;
|
|
792
|
+
if (options.type)
|
|
793
|
+
fields["Type"] = options.type;
|
|
794
|
+
if (options.size)
|
|
795
|
+
fields["Size"] = options.size;
|
|
796
|
+
if (Object.keys(fields).length > 0) {
|
|
797
|
+
setItemFields(projectId, itemId, fields, undefined, logger);
|
|
798
|
+
}
|
|
799
|
+
const item = fetchItem(itemId);
|
|
800
|
+
if (item) {
|
|
801
|
+
const output = {
|
|
802
|
+
id: item.id,
|
|
803
|
+
title: item.title,
|
|
804
|
+
status: item.status,
|
|
805
|
+
priority: item.priority,
|
|
806
|
+
type: item.type,
|
|
807
|
+
size: item.size,
|
|
808
|
+
issue_number: item.issueNumber,
|
|
809
|
+
issue_url: item.issueUrl,
|
|
810
|
+
};
|
|
811
|
+
console.log(JSON.stringify(output, null, 2));
|
|
812
|
+
}
|
|
813
|
+
return 0;
|
|
814
|
+
}
|
|
815
|
+
// =============================================================================
|
|
816
|
+
// Workflow helpers (#250)
|
|
817
|
+
// =============================================================================
|
|
818
|
+
/**
|
|
819
|
+
* プロジェクトのワークフロー一覧を取得する。
|
|
820
|
+
* GitHub Projects V2 のビルトイン自動化を確認するために使用。
|
|
821
|
+
*
|
|
822
|
+
* @returns ワークフロー配列。取得失敗時は空配列
|
|
823
|
+
*/
|
|
824
|
+
export function fetchWorkflows(projectId) {
|
|
825
|
+
const result = runGraphQL(GRAPHQL_QUERY_WORKFLOWS, { projectId });
|
|
826
|
+
if (!result.success)
|
|
827
|
+
return [];
|
|
828
|
+
const nodes = result.data?.data?.node?.workflows?.nodes ?? [];
|
|
829
|
+
return nodes
|
|
830
|
+
.filter((n) => !!n?.id && !!n?.name && n.number !== undefined)
|
|
831
|
+
.map((n) => ({
|
|
832
|
+
id: n.id,
|
|
833
|
+
name: n.name,
|
|
834
|
+
number: n.number,
|
|
835
|
+
enabled: n.enabled ?? false,
|
|
836
|
+
}));
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* workflows subcommand - ビルトイン自動化の状態を表示
|
|
840
|
+
*/
|
|
841
|
+
async function cmdWorkflows(options, logger) {
|
|
842
|
+
const owner = options.owner || getOwner();
|
|
843
|
+
if (!owner) {
|
|
844
|
+
logger.error("Could not determine repository owner");
|
|
845
|
+
return 1;
|
|
846
|
+
}
|
|
847
|
+
const projectId = getProjectId(owner);
|
|
848
|
+
if (!projectId) {
|
|
849
|
+
logger.error(`No project found for owner '${owner}'`);
|
|
850
|
+
return 1;
|
|
851
|
+
}
|
|
852
|
+
const workflows = fetchWorkflows(projectId);
|
|
853
|
+
if (workflows.length === 0) {
|
|
854
|
+
logger.warn("No workflows found or failed to fetch");
|
|
855
|
+
return 1;
|
|
856
|
+
}
|
|
857
|
+
// 推奨ワークフローの有効/無効をチェック
|
|
858
|
+
const disabledRecommended = workflows.filter((w) => RECOMMENDED_WORKFLOWS.includes(w.name) && !w.enabled);
|
|
859
|
+
const output = {
|
|
860
|
+
project_id: projectId,
|
|
861
|
+
workflows: workflows.map((w) => ({
|
|
862
|
+
name: w.name,
|
|
863
|
+
number: w.number,
|
|
864
|
+
enabled: w.enabled,
|
|
865
|
+
recommended: RECOMMENDED_WORKFLOWS.includes(w.name),
|
|
866
|
+
})),
|
|
867
|
+
recommendations: disabledRecommended.length > 0
|
|
868
|
+
? {
|
|
869
|
+
message: "以下の推奨ワークフローが無効です。GitHub UI から有効化してください。",
|
|
870
|
+
disabled: disabledRecommended.map((w) => w.name),
|
|
871
|
+
settings_url: `https://github.com/orgs/${owner}/projects (Settings > Workflows)`,
|
|
872
|
+
}
|
|
873
|
+
: null,
|
|
874
|
+
};
|
|
875
|
+
console.log(JSON.stringify(output, null, 2));
|
|
876
|
+
if (disabledRecommended.length > 0) {
|
|
877
|
+
logger.warn(`${disabledRecommended.length} recommended workflow(s) disabled: ${disabledRecommended.map((w) => w.name).join(", ")}`);
|
|
878
|
+
logger.info("Enable via: GitHub Project Settings > Workflows (API not supported)");
|
|
879
|
+
}
|
|
880
|
+
return 0;
|
|
881
|
+
}
|
|
882
|
+
// =============================================================================
|
|
883
|
+
// Main Command Handler
|
|
884
|
+
// =============================================================================
|
|
885
|
+
/**
|
|
886
|
+
* gh-projects command handler
|
|
887
|
+
*/
|
|
888
|
+
export async function ghProjectsCommand(action, target, options) {
|
|
889
|
+
const logger = createLogger(options.verbose);
|
|
890
|
+
// Deprecation warning (workflows subcommand is NOT deprecated)
|
|
891
|
+
if (action !== "workflows") {
|
|
892
|
+
console.error("[DEPRECATED] gh-projects item commands are deprecated. Use gh-issues instead:\n" +
|
|
893
|
+
" gh-issues fields (was: gh-projects fields)\n" +
|
|
894
|
+
" gh-issues remove (was: gh-projects delete)\n" +
|
|
895
|
+
" gh-issues update (was: gh-projects update)\n" +
|
|
896
|
+
" gh-issues create (was: gh-projects create)\n" +
|
|
897
|
+
" session start (was: gh-projects list)\n" +
|
|
898
|
+
" gh-projects workflows (project-level: NOT deprecated)\n");
|
|
899
|
+
}
|
|
900
|
+
logger.debug(`Action: ${action}`);
|
|
901
|
+
logger.debug(`Target: ${target ?? "(none)"}`);
|
|
902
|
+
logger.debug(`Owner: ${options.owner ?? "(auto)"}`);
|
|
903
|
+
let exitCode = 0;
|
|
904
|
+
switch (action) {
|
|
905
|
+
case "list":
|
|
906
|
+
exitCode = await cmdList(options, logger);
|
|
907
|
+
break;
|
|
908
|
+
case "get":
|
|
909
|
+
if (!target) {
|
|
910
|
+
logger.error("Item ID or issue number required");
|
|
911
|
+
logger.info("Usage: shirokuma-docs gh-projects get <item-id-or-number>");
|
|
912
|
+
exitCode = 1;
|
|
913
|
+
}
|
|
914
|
+
else {
|
|
915
|
+
exitCode = await cmdGet(target, options, logger);
|
|
916
|
+
}
|
|
917
|
+
break;
|
|
918
|
+
case "fields":
|
|
919
|
+
exitCode = await cmdFields(options, logger);
|
|
920
|
+
break;
|
|
921
|
+
case "create":
|
|
922
|
+
exitCode = await cmdCreate(options, logger);
|
|
923
|
+
break;
|
|
924
|
+
case "update":
|
|
925
|
+
if (!target) {
|
|
926
|
+
logger.error("Item ID or issue number required");
|
|
927
|
+
logger.info("Usage: shirokuma-docs gh-projects update <item-id-or-number> --status ...");
|
|
928
|
+
exitCode = 1;
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
exitCode = await cmdUpdate(target, options, logger);
|
|
932
|
+
}
|
|
933
|
+
break;
|
|
934
|
+
case "delete":
|
|
935
|
+
if (!target) {
|
|
936
|
+
logger.error("Item ID or issue number required");
|
|
937
|
+
logger.info("Usage: shirokuma-docs gh-projects delete <item-id-or-number> --force");
|
|
938
|
+
exitCode = 1;
|
|
939
|
+
}
|
|
940
|
+
else {
|
|
941
|
+
exitCode = await cmdDelete(target, options, logger);
|
|
942
|
+
}
|
|
943
|
+
break;
|
|
944
|
+
case "add-issue":
|
|
945
|
+
if (!target) {
|
|
946
|
+
logger.error("Issue number required");
|
|
947
|
+
logger.info("Usage: shirokuma-docs gh-projects add-issue <issue-number>");
|
|
948
|
+
exitCode = 1;
|
|
949
|
+
}
|
|
950
|
+
else {
|
|
951
|
+
exitCode = await cmdAddIssue(target, options, logger);
|
|
952
|
+
}
|
|
953
|
+
break;
|
|
954
|
+
case "workflows":
|
|
955
|
+
exitCode = await cmdWorkflows(options, logger);
|
|
956
|
+
break;
|
|
957
|
+
default:
|
|
958
|
+
logger.error(`Unknown action: ${action}`);
|
|
959
|
+
logger.info("Available actions: list, get, fields, create, update, delete, add-issue, workflows");
|
|
960
|
+
exitCode = 1;
|
|
961
|
+
}
|
|
962
|
+
if (exitCode !== 0) {
|
|
963
|
+
process.exit(exitCode);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
//# sourceMappingURL=gh-projects.js.map
|