@sk8metal/michi-cli 0.14.1 → 0.19.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/CHANGELOG.md +268 -2
- package/README.md +27 -2
- package/dist/scripts/config/config-schema.d.ts +5 -333
- package/dist/scripts/config/config-schema.d.ts.map +1 -1
- package/dist/scripts/config/config-schema.js +6 -233
- package/dist/scripts/config/config-schema.js.map +1 -1
- package/dist/scripts/config-global.d.ts.map +1 -1
- package/dist/scripts/config-global.js +3 -2
- package/dist/scripts/config-global.js.map +1 -1
- package/dist/scripts/confluence-sync.d.ts +5 -73
- package/dist/scripts/confluence-sync.d.ts.map +1 -1
- package/dist/scripts/confluence-sync.js +14 -392
- package/dist/scripts/confluence-sync.js.map +1 -1
- package/dist/scripts/constants/environments.d.ts +3 -30
- package/dist/scripts/constants/environments.d.ts.map +1 -1
- package/dist/scripts/constants/environments.js +3 -41
- package/dist/scripts/constants/environments.js.map +1 -1
- package/dist/scripts/constants/languages.d.ts +3 -20
- package/dist/scripts/constants/languages.d.ts.map +1 -1
- package/dist/scripts/constants/languages.js +3 -50
- package/dist/scripts/constants/languages.js.map +1 -1
- package/dist/scripts/constants/test-commands.d.ts +3 -33
- package/dist/scripts/constants/test-commands.d.ts.map +1 -1
- package/dist/scripts/constants/test-commands.js +3 -67
- package/dist/scripts/constants/test-commands.js.map +1 -1
- package/dist/scripts/dev-tools/mermaid-converter.d.ts.map +1 -0
- package/dist/scripts/dev-tools/mermaid-converter.js.map +1 -0
- package/dist/scripts/dev-tools/test-interactive.d.ts.map +1 -0
- package/dist/scripts/{test-interactive.js → dev-tools/test-interactive.js} +4 -3
- package/dist/scripts/dev-tools/test-interactive.js.map +1 -0
- package/dist/scripts/github-actions-client.d.ts +5 -75
- package/dist/scripts/github-actions-client.d.ts.map +1 -1
- package/dist/scripts/github-actions-client.js +4 -178
- package/dist/scripts/github-actions-client.js.map +1 -1
- package/dist/scripts/jira-sync.d.ts +3 -121
- package/dist/scripts/jira-sync.d.ts.map +1 -1
- package/dist/scripts/jira-sync.js +5 -879
- package/dist/scripts/jira-sync.js.map +1 -1
- package/dist/scripts/markdown-to-confluence.d.ts.map +1 -1
- package/dist/scripts/markdown-to-confluence.js +2 -2
- package/dist/scripts/markdown-to-confluence.js.map +1 -1
- package/dist/scripts/multi-project-estimate.d.ts.map +1 -1
- package/dist/scripts/multi-project-estimate.js +3 -2
- package/dist/scripts/multi-project-estimate.js.map +1 -1
- package/dist/scripts/phase-runner.d.ts.map +1 -1
- package/dist/scripts/phase-runner.js +34 -18
- package/dist/scripts/phase-runner.js.map +1 -1
- package/dist/scripts/pre-flight-check.d.ts.map +1 -1
- package/dist/scripts/pre-flight-check.js +27 -11
- package/dist/scripts/pre-flight-check.js.map +1 -1
- package/dist/scripts/template/multi-repo-renderer.js +2 -2
- package/dist/scripts/template/multi-repo-renderer.js.map +1 -1
- package/dist/scripts/test-execution-generator.d.ts.map +1 -1
- package/dist/scripts/test-execution-generator.js +5 -4
- package/dist/scripts/test-execution-generator.js.map +1 -1
- package/dist/scripts/utils/aidlc-parser.d.ts +5 -82
- package/dist/scripts/utils/aidlc-parser.d.ts.map +1 -1
- package/dist/scripts/utils/aidlc-parser.js +4 -204
- package/dist/scripts/utils/aidlc-parser.js.map +1 -1
- package/dist/scripts/utils/ci-generator.d.ts.map +1 -1
- package/dist/scripts/utils/ci-generator.js +4 -3
- package/dist/scripts/utils/ci-generator.js.map +1 -1
- package/dist/scripts/utils/config-loader.d.ts.map +1 -1
- package/dist/scripts/utils/config-loader.js +46 -49
- package/dist/scripts/utils/config-loader.js.map +1 -1
- package/dist/scripts/utils/config-validator.d.ts +9 -10
- package/dist/scripts/utils/config-validator.d.ts.map +1 -1
- package/dist/scripts/utils/config-validator.js +68 -70
- package/dist/scripts/utils/config-validator.js.map +1 -1
- package/dist/scripts/utils/docker-requirement-detector.d.ts.map +1 -1
- package/dist/scripts/utils/docker-requirement-detector.js +5 -4
- package/dist/scripts/utils/docker-requirement-detector.js.map +1 -1
- package/dist/scripts/utils/env-config.d.ts.map +1 -1
- package/dist/scripts/utils/env-config.js +55 -38
- package/dist/scripts/utils/env-config.js.map +1 -1
- package/dist/scripts/utils/feature-name-validator.d.ts +4 -9
- package/dist/scripts/utils/feature-name-validator.d.ts.map +1 -1
- package/dist/scripts/utils/feature-name-validator.js +12 -21
- package/dist/scripts/utils/feature-name-validator.js.map +1 -1
- package/dist/scripts/utils/interactive-helpers.d.ts +5 -29
- package/dist/scripts/utils/interactive-helpers.d.ts.map +1 -1
- package/dist/scripts/utils/interactive-helpers.js +5 -89
- package/dist/scripts/utils/interactive-helpers.js.map +1 -1
- package/dist/scripts/utils/language-detector.d.ts.map +1 -1
- package/dist/scripts/utils/language-detector.js +4 -3
- package/dist/scripts/utils/language-detector.js.map +1 -1
- package/dist/scripts/utils/markdown-parser.d.ts +6 -52
- package/dist/scripts/utils/markdown-parser.d.ts.map +1 -1
- package/dist/scripts/utils/markdown-parser.js +5 -286
- package/dist/scripts/utils/markdown-parser.js.map +1 -1
- package/dist/scripts/utils/multi-repo-validator.d.ts +9 -10
- package/dist/scripts/utils/multi-repo-validator.d.ts.map +1 -1
- package/dist/scripts/utils/multi-repo-validator.js +15 -17
- package/dist/scripts/utils/multi-repo-validator.js.map +1 -1
- package/dist/scripts/utils/project-analyzer.d.ts +120 -0
- package/dist/scripts/utils/project-analyzer.d.ts.map +1 -0
- package/dist/scripts/utils/project-analyzer.js +358 -0
- package/dist/scripts/utils/project-analyzer.js.map +1 -0
- package/dist/scripts/utils/project-detector.d.ts.map +1 -1
- package/dist/scripts/utils/project-detector.js +6 -5
- package/dist/scripts/utils/project-detector.js.map +1 -1
- package/dist/scripts/utils/project-finder.d.ts +1 -21
- package/dist/scripts/utils/project-finder.d.ts.map +1 -1
- package/dist/scripts/utils/project-finder.js +2 -121
- package/dist/scripts/utils/project-finder.js.map +1 -1
- package/dist/scripts/utils/project-meta.d.ts +4 -27
- package/dist/scripts/utils/project-meta.d.ts.map +1 -1
- package/dist/scripts/utils/project-meta.js +3 -67
- package/dist/scripts/utils/project-meta.js.map +1 -1
- package/dist/scripts/utils/safe-file-reader.d.ts +84 -0
- package/dist/scripts/utils/safe-file-reader.d.ts.map +1 -0
- package/dist/scripts/utils/safe-file-reader.js +122 -0
- package/dist/scripts/utils/safe-file-reader.js.map +1 -0
- package/dist/scripts/utils/security-validator.d.ts +8 -19
- package/dist/scripts/utils/security-validator.d.ts.map +1 -1
- package/dist/scripts/utils/security-validator.js +28 -58
- package/dist/scripts/utils/security-validator.js.map +1 -1
- package/dist/scripts/utils/spec-archiver.d.ts.map +1 -1
- package/dist/scripts/utils/spec-archiver.js +7 -6
- package/dist/scripts/utils/spec-archiver.js.map +1 -1
- package/dist/scripts/utils/spec-updater.d.ts.map +1 -1
- package/dist/scripts/utils/spec-updater.js +10 -7
- package/dist/scripts/utils/spec-updater.js.map +1 -1
- package/dist/scripts/utils/tasks-converter.js +2 -2
- package/dist/scripts/utils/tasks-converter.js.map +1 -1
- package/dist/scripts/utils/tasks-format-validator.js +4 -4
- package/dist/scripts/utils/tasks-format-validator.js.map +1 -1
- package/dist/scripts/utils/template-applier.d.ts.map +1 -1
- package/dist/scripts/utils/template-applier.js +4 -3
- package/dist/scripts/utils/template-applier.js.map +1 -1
- package/dist/scripts/utils/types/validation.d.ts +57 -0
- package/dist/scripts/utils/types/validation.d.ts.map +1 -0
- package/dist/scripts/utils/types/validation.js +50 -0
- package/dist/scripts/utils/types/validation.js.map +1 -0
- package/dist/scripts/validate-phase.d.ts +6 -1
- package/dist/scripts/validate-phase.d.ts.map +1 -1
- package/dist/scripts/validate-phase.js +42 -20
- package/dist/scripts/validate-phase.js.map +1 -1
- package/dist/scripts/workflow-orchestrator.d.ts +4 -40
- package/dist/scripts/workflow-orchestrator.d.ts.map +1 -1
- package/dist/scripts/workflow-orchestrator.js +7 -194
- package/dist/scripts/workflow-orchestrator.js.map +1 -1
- package/dist/src/application/interfaces/config-provider.d.ts +89 -0
- package/dist/src/application/interfaces/config-provider.d.ts.map +1 -0
- package/dist/src/application/interfaces/config-provider.js +8 -0
- package/dist/src/application/interfaces/config-provider.js.map +1 -0
- package/dist/src/application/interfaces/external-api.d.ts +80 -0
- package/dist/src/application/interfaces/external-api.d.ts.map +1 -0
- package/dist/src/application/interfaces/external-api.js +8 -0
- package/dist/src/application/interfaces/external-api.js.map +1 -0
- package/dist/src/application/interfaces/spec-repository.d.ts +52 -0
- package/dist/src/application/interfaces/spec-repository.d.ts.map +1 -0
- package/dist/src/application/interfaces/spec-repository.js +8 -0
- package/dist/src/application/interfaces/spec-repository.js.map +1 -0
- package/dist/src/application/services/spec-service.d.ts +49 -0
- package/dist/src/application/services/spec-service.d.ts.map +1 -0
- package/dist/src/application/services/spec-service.js +94 -0
- package/dist/src/application/services/spec-service.js.map +1 -0
- package/dist/src/application/services/workflow-service.d.ts +58 -0
- package/dist/src/application/services/workflow-service.d.ts.map +1 -0
- package/dist/src/application/services/workflow-service.js +125 -0
- package/dist/src/application/services/workflow-service.js.map +1 -0
- package/dist/src/application/templates/processor.d.ts +31 -0
- package/dist/src/application/templates/processor.d.ts.map +1 -0
- package/dist/src/application/templates/processor.js +58 -0
- package/dist/src/application/templates/processor.js.map +1 -0
- package/dist/src/application/use-cases/spec/archive-spec.d.ts +34 -0
- package/dist/src/application/use-cases/spec/archive-spec.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/archive-spec.js +56 -0
- package/dist/src/application/use-cases/spec/archive-spec.js.map +1 -0
- package/dist/src/application/use-cases/spec/generate-design.d.ts +34 -0
- package/dist/src/application/use-cases/spec/generate-design.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/generate-design.js +58 -0
- package/dist/src/application/use-cases/spec/generate-design.js.map +1 -0
- package/dist/src/application/use-cases/spec/generate-requirements.d.ts +34 -0
- package/dist/src/application/use-cases/spec/generate-requirements.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/generate-requirements.js +58 -0
- package/dist/src/application/use-cases/spec/generate-requirements.js.map +1 -0
- package/dist/src/application/use-cases/spec/generate-tasks.d.ts +34 -0
- package/dist/src/application/use-cases/spec/generate-tasks.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/generate-tasks.js +58 -0
- package/dist/src/application/use-cases/spec/generate-tasks.js.map +1 -0
- package/dist/src/application/use-cases/spec/init-spec.d.ts +48 -0
- package/dist/src/application/use-cases/spec/init-spec.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/init-spec.js +121 -0
- package/dist/src/application/use-cases/spec/init-spec.js.map +1 -0
- package/dist/src/cli.d.ts +6 -7
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +6 -745
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/config-validate.js +2 -2
- package/dist/src/commands/init.d.ts +6 -21
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +5 -508
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/migrate.js +4 -3
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/spec-archive.d.ts +6 -13
- package/dist/src/commands/spec-archive.d.ts.map +1 -1
- package/dist/src/commands/spec-archive.js +5 -36
- package/dist/src/commands/spec-archive.js.map +1 -1
- package/dist/src/commands/spec-list.d.ts +6 -11
- package/dist/src/commands/spec-list.d.ts.map +1 -1
- package/dist/src/commands/spec-list.js +5 -51
- package/dist/src/commands/spec-list.js.map +1 -1
- package/dist/src/domain/constants/approval.d.ts +18 -0
- package/dist/src/domain/constants/approval.d.ts.map +1 -0
- package/dist/src/domain/constants/approval.js +23 -0
- package/dist/src/domain/constants/approval.js.map +1 -0
- package/dist/src/domain/constants/environments.d.ts +33 -0
- package/dist/src/domain/constants/environments.d.ts.map +1 -0
- package/dist/src/domain/constants/environments.js +44 -0
- package/dist/src/domain/constants/environments.js.map +1 -0
- package/dist/src/domain/constants/index.d.ts +12 -0
- package/dist/src/domain/constants/index.d.ts.map +1 -0
- package/dist/src/domain/constants/index.js +18 -0
- package/dist/src/domain/constants/index.js.map +1 -0
- package/dist/src/domain/constants/languages.d.ts +23 -0
- package/dist/src/domain/constants/languages.d.ts.map +1 -0
- package/dist/src/domain/constants/languages.js +53 -0
- package/dist/src/domain/constants/languages.js.map +1 -0
- package/dist/src/domain/constants/phases.d.ts +32 -0
- package/dist/src/domain/constants/phases.d.ts.map +1 -0
- package/dist/src/domain/constants/phases.js +52 -0
- package/dist/src/domain/constants/phases.js.map +1 -0
- package/dist/src/domain/constants/test-commands.d.ts +36 -0
- package/dist/src/domain/constants/test-commands.d.ts.map +1 -0
- package/dist/src/domain/constants/test-commands.js +70 -0
- package/dist/src/domain/constants/test-commands.js.map +1 -0
- package/dist/src/domain/constants/validation-rules.d.ts +32 -0
- package/dist/src/domain/constants/validation-rules.d.ts.map +1 -0
- package/dist/src/domain/constants/validation-rules.js +51 -0
- package/dist/src/domain/constants/validation-rules.js.map +1 -0
- package/dist/src/domain/entities/spec.d.ts +66 -0
- package/dist/src/domain/entities/spec.d.ts.map +1 -0
- package/dist/src/domain/entities/spec.js +112 -0
- package/dist/src/domain/entities/spec.js.map +1 -0
- package/dist/src/domain/entities/task.d.ts +43 -0
- package/dist/src/domain/entities/task.d.ts.map +1 -0
- package/dist/src/domain/entities/task.js +65 -0
- package/dist/src/domain/entities/task.js.map +1 -0
- package/dist/src/domain/services/spec-validator.d.ts +46 -0
- package/dist/src/domain/services/spec-validator.d.ts.map +1 -0
- package/dist/src/domain/services/spec-validator.js +99 -0
- package/dist/src/domain/services/spec-validator.js.map +1 -0
- package/dist/src/domain/value-objects/feature-name.d.ts +24 -0
- package/dist/src/domain/value-objects/feature-name.d.ts.map +1 -0
- package/dist/src/domain/value-objects/feature-name.js +36 -0
- package/dist/src/domain/value-objects/feature-name.js.map +1 -0
- package/dist/src/domain/value-objects/index.d.ts +7 -0
- package/dist/src/domain/value-objects/index.d.ts.map +1 -0
- package/dist/src/domain/value-objects/index.js +7 -0
- package/dist/src/domain/value-objects/index.js.map +1 -0
- package/dist/src/infrastructure/config/index.d.ts +5 -0
- package/dist/src/infrastructure/config/index.d.ts.map +1 -0
- package/dist/src/infrastructure/config/index.js +6 -0
- package/dist/src/infrastructure/config/index.js.map +1 -0
- package/dist/src/infrastructure/config/schema.d.ts +337 -0
- package/dist/src/infrastructure/config/schema.d.ts.map +1 -0
- package/dist/src/infrastructure/config/schema.js +237 -0
- package/dist/src/infrastructure/config/schema.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.d.ts +14 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.js +102 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.d.ts +23 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.js +192 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.d.ts +48 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.js +531 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.d.ts +10 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.js +12 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.d.ts +13 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.js +129 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.d.ts +113 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.js +5 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.d.ts +15 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.js +141 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.d.ts +50 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.js +226 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.d.ts +12 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.js +16 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.d.ts +49 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.js +165 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.d.ts +14 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.js +110 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.d.ts +32 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.js +284 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.d.ts +114 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.js +7 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/client.d.ts +25 -0
- package/dist/src/infrastructure/external-apis/github/client.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/client.js +109 -0
- package/dist/src/infrastructure/external-apis/github/client.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/index.d.ts +7 -0
- package/dist/src/infrastructure/external-apis/github/index.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/index.js +8 -0
- package/dist/src/infrastructure/external-apis/github/index.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/types.d.ts +69 -0
- package/dist/src/infrastructure/external-apis/github/types.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/types.js +5 -0
- package/dist/src/infrastructure/external-apis/github/types.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/utils.d.ts +18 -0
- package/dist/src/infrastructure/external-apis/github/utils.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/utils.js +84 -0
- package/dist/src/infrastructure/external-apis/github/utils.js.map +1 -0
- package/dist/src/infrastructure/filesystem/index.d.ts +6 -0
- package/dist/src/infrastructure/filesystem/index.d.ts.map +1 -0
- package/dist/src/infrastructure/filesystem/index.js +5 -0
- package/dist/src/infrastructure/filesystem/index.js.map +1 -0
- package/dist/src/infrastructure/filesystem/project-meta.d.ts +32 -0
- package/dist/src/infrastructure/filesystem/project-meta.d.ts.map +1 -0
- package/dist/src/infrastructure/filesystem/project-meta.js +75 -0
- package/dist/src/infrastructure/filesystem/project-meta.js.map +1 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.d.ts +86 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.d.ts.map +1 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.js +208 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.js.map +1 -0
- package/dist/src/infrastructure/parsers/index.d.ts +8 -0
- package/dist/src/infrastructure/parsers/index.d.ts.map +1 -0
- package/dist/src/infrastructure/parsers/index.js +6 -0
- package/dist/src/infrastructure/parsers/index.js.map +1 -0
- package/dist/src/infrastructure/parsers/markdown-parser.d.ts +51 -0
- package/dist/src/infrastructure/parsers/markdown-parser.d.ts.map +1 -0
- package/dist/src/infrastructure/parsers/markdown-parser.js +253 -0
- package/dist/src/infrastructure/parsers/markdown-parser.js.map +1 -0
- package/dist/src/presentation/cli/config.d.ts +12 -0
- package/dist/src/presentation/cli/config.d.ts.map +1 -0
- package/dist/src/presentation/cli/config.js +22 -0
- package/dist/src/presentation/cli/config.js.map +1 -0
- package/dist/src/presentation/cli/version.d.ts +10 -0
- package/dist/src/presentation/cli/version.d.ts.map +1 -0
- package/dist/src/presentation/cli/version.js +41 -0
- package/dist/src/presentation/cli/version.js.map +1 -0
- package/dist/src/presentation/cli.d.ts +22 -0
- package/dist/src/presentation/cli.d.ts.map +1 -0
- package/dist/src/presentation/cli.js +85 -0
- package/dist/src/presentation/cli.js.map +1 -0
- package/dist/src/presentation/commands/config/register.d.ts +11 -0
- package/dist/src/presentation/commands/config/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/config/register.js +44 -0
- package/dist/src/presentation/commands/config/register.js.map +1 -0
- package/dist/src/presentation/commands/confluence/register.d.ts +11 -0
- package/dist/src/presentation/commands/confluence/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/confluence/register.js +32 -0
- package/dist/src/presentation/commands/confluence/register.js.map +1 -0
- package/dist/src/presentation/commands/confluence/sync.d.ts +17 -0
- package/dist/src/presentation/commands/confluence/sync.d.ts.map +1 -0
- package/dist/src/presentation/commands/confluence/sync.js +25 -0
- package/dist/src/presentation/commands/confluence/sync.js.map +1 -0
- package/dist/src/presentation/commands/init/handler.d.ts +10 -0
- package/dist/src/presentation/commands/init/handler.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/handler.js +64 -0
- package/dist/src/presentation/commands/init/handler.js.map +1 -0
- package/dist/src/presentation/commands/init/prompts.d.ts +41 -0
- package/dist/src/presentation/commands/init/prompts.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/prompts.js +119 -0
- package/dist/src/presentation/commands/init/prompts.js.map +1 -0
- package/dist/src/presentation/commands/init/register.d.ts +11 -0
- package/dist/src/presentation/commands/init/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/register.js +141 -0
- package/dist/src/presentation/commands/init/register.js.map +1 -0
- package/dist/src/presentation/commands/init/setup.d.ts +26 -0
- package/dist/src/presentation/commands/init/setup.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/setup.js +196 -0
- package/dist/src/presentation/commands/init/setup.js.map +1 -0
- package/dist/src/presentation/commands/init/templates.d.ts +19 -0
- package/dist/src/presentation/commands/init/templates.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/templates.js +140 -0
- package/dist/src/presentation/commands/init/templates.js.map +1 -0
- package/dist/src/presentation/commands/init/validation.d.ts +21 -0
- package/dist/src/presentation/commands/init/validation.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/validation.js +65 -0
- package/dist/src/presentation/commands/init/validation.js.map +1 -0
- package/dist/src/presentation/commands/jira/register.d.ts +11 -0
- package/dist/src/presentation/commands/jira/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/jira/register.js +75 -0
- package/dist/src/presentation/commands/jira/register.js.map +1 -0
- package/dist/src/presentation/commands/jira/sync.d.ts +29 -0
- package/dist/src/presentation/commands/jira/sync.d.ts.map +1 -0
- package/dist/src/presentation/commands/jira/sync.js +37 -0
- package/dist/src/presentation/commands/jira/sync.js.map +1 -0
- package/dist/src/{commands/multi-repo-add-repo.d.ts → presentation/commands/multi-repo/add-repo.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/add-repo.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-add-repo.js → presentation/commands/multi-repo/add-repo.js} +4 -4
- package/dist/src/presentation/commands/multi-repo/add-repo.js.map +1 -0
- package/dist/src/{commands/multi-repo-ci-status.d.ts → presentation/commands/multi-repo/ci-status.d.ts} +2 -2
- package/dist/src/presentation/commands/multi-repo/ci-status.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-ci-status.js → presentation/commands/multi-repo/ci-status.js} +95 -81
- package/dist/src/presentation/commands/multi-repo/ci-status.js.map +1 -0
- package/dist/src/{commands/multi-repo-confluence-sync.d.ts → presentation/commands/multi-repo/confluence-sync.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/confluence-sync.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-confluence-sync.js → presentation/commands/multi-repo/confluence-sync.js} +7 -6
- package/dist/src/presentation/commands/multi-repo/confluence-sync.js.map +1 -0
- package/dist/src/{commands/multi-repo-init.d.ts → presentation/commands/multi-repo/init.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/init.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-init.js → presentation/commands/multi-repo/init.js} +6 -6
- package/dist/src/presentation/commands/multi-repo/init.js.map +1 -0
- package/dist/src/{commands/multi-repo-list.d.ts → presentation/commands/multi-repo/list.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/list.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-list.js → presentation/commands/multi-repo/list.js} +2 -2
- package/dist/src/presentation/commands/multi-repo/list.js.map +1 -0
- package/dist/src/presentation/commands/multi-repo/register.d.ts +12 -0
- package/dist/src/presentation/commands/multi-repo/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/multi-repo/register.js +249 -0
- package/dist/src/presentation/commands/multi-repo/register.js.map +1 -0
- package/dist/src/{commands/multi-repo-test.d.ts → presentation/commands/multi-repo/test.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/test.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-test.js → presentation/commands/multi-repo/test.js} +4 -4
- package/dist/src/presentation/commands/multi-repo/test.js.map +1 -0
- package/dist/src/presentation/commands/phase/register.d.ts +11 -0
- package/dist/src/presentation/commands/phase/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/phase/register.js +97 -0
- package/dist/src/presentation/commands/phase/register.js.map +1 -0
- package/dist/src/presentation/commands/spec/archive.d.ts +17 -0
- package/dist/src/presentation/commands/spec/archive.d.ts.map +1 -0
- package/dist/src/presentation/commands/spec/archive.js +40 -0
- package/dist/src/presentation/commands/spec/archive.js.map +1 -0
- package/dist/src/presentation/commands/spec/list.d.ts +15 -0
- package/dist/src/presentation/commands/spec/list.d.ts.map +1 -0
- package/dist/src/presentation/commands/spec/list.js +55 -0
- package/dist/src/presentation/commands/spec/list.js.map +1 -0
- package/dist/src/presentation/commands/spec/register.d.ts +11 -0
- package/dist/src/presentation/commands/spec/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/spec/register.js +45 -0
- package/dist/src/presentation/commands/spec/register.js.map +1 -0
- package/dist/src/presentation/commands/workflow/orchestrator.d.ts +50 -0
- package/dist/src/presentation/commands/workflow/orchestrator.d.ts.map +1 -0
- package/dist/src/presentation/commands/workflow/orchestrator.js +174 -0
- package/dist/src/presentation/commands/workflow/orchestrator.js.map +1 -0
- package/dist/src/presentation/commands/workflow/register.d.ts +11 -0
- package/dist/src/presentation/commands/workflow/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/workflow/register.js +58 -0
- package/dist/src/presentation/commands/workflow/register.js.map +1 -0
- package/dist/src/presentation/formatters/error-formatter.d.ts +79 -0
- package/dist/src/presentation/formatters/error-formatter.d.ts.map +1 -0
- package/dist/src/presentation/formatters/error-formatter.js +150 -0
- package/dist/src/presentation/formatters/error-formatter.js.map +1 -0
- package/dist/src/presentation/formatters/index.d.ts +8 -0
- package/dist/src/presentation/formatters/index.d.ts.map +1 -0
- package/dist/src/presentation/formatters/index.js +11 -0
- package/dist/src/presentation/formatters/index.js.map +1 -0
- package/dist/src/presentation/formatters/output-formatter.d.ts +98 -0
- package/dist/src/presentation/formatters/output-formatter.d.ts.map +1 -0
- package/dist/src/presentation/formatters/output-formatter.js +165 -0
- package/dist/src/presentation/formatters/output-formatter.js.map +1 -0
- package/dist/src/presentation/formatters/progress-formatter.d.ts +121 -0
- package/dist/src/presentation/formatters/progress-formatter.d.ts.map +1 -0
- package/dist/src/presentation/formatters/progress-formatter.js +235 -0
- package/dist/src/presentation/formatters/progress-formatter.js.map +1 -0
- package/dist/src/presentation/interactive/confirmation.d.ts +24 -0
- package/dist/src/presentation/interactive/confirmation.d.ts.map +1 -0
- package/dist/src/presentation/interactive/confirmation.js +54 -0
- package/dist/src/presentation/interactive/confirmation.js.map +1 -0
- package/dist/src/presentation/interactive/index.d.ts +8 -0
- package/dist/src/presentation/interactive/index.d.ts.map +1 -0
- package/dist/src/presentation/interactive/index.js +11 -0
- package/dist/src/presentation/interactive/index.js.map +1 -0
- package/dist/src/presentation/interactive/prompts.d.ts +31 -0
- package/dist/src/presentation/interactive/prompts.d.ts.map +1 -0
- package/dist/src/presentation/interactive/prompts.js +71 -0
- package/dist/src/presentation/interactive/prompts.js.map +1 -0
- package/dist/src/presentation/interactive/selection.d.ts +31 -0
- package/dist/src/presentation/interactive/selection.d.ts.map +1 -0
- package/dist/src/presentation/interactive/selection.js +138 -0
- package/dist/src/presentation/interactive/selection.js.map +1 -0
- package/dist/src/shared/types/errors.d.ts +132 -0
- package/dist/src/shared/types/errors.d.ts.map +1 -0
- package/dist/src/shared/types/errors.js +61 -0
- package/dist/src/shared/types/errors.js.map +1 -0
- package/dist/src/shared/types/result.d.ts +53 -0
- package/dist/src/shared/types/result.d.ts.map +1 -0
- package/dist/src/shared/types/result.js +42 -0
- package/dist/src/shared/types/result.js.map +1 -0
- package/dist/test-confluence-auth.d.ts +6 -0
- package/dist/test-confluence-auth.d.ts.map +1 -0
- package/dist/test-confluence-auth.js +128 -0
- package/dist/test-confluence-auth.js.map +1 -0
- package/docs/MIGRATION.md +513 -0
- package/docs/architecture.md +774 -0
- package/docs/guides/comprehensive-verification-guide.md +1926 -0
- package/docs/onion-architecture-phase0-complete.md +91 -0
- package/package.json +6 -6
- package/scripts/README.md +148 -0
- package/scripts/__tests__/jira-transitions.test.ts +44 -30
- package/scripts/__tests__/mermaid-converter.test.ts +2 -2
- package/scripts/__tests__/multi-repo-validator.test.ts +62 -62
- package/scripts/__tests__/spec-archiver.test.ts +12 -0
- package/scripts/__tests__/validate-phase.test.ts +6 -6
- package/scripts/build/README.md +24 -0
- package/scripts/{copy-static-assets.js → build/copy-static-assets.js} +1 -1
- package/scripts/{set-permissions.js → build/set-permissions.js} +1 -1
- package/scripts/config/config-schema.ts +43 -302
- package/scripts/config-global.ts +3 -2
- package/scripts/confluence-sync.ts +17 -538
- package/scripts/constants/environments.ts +3 -53
- package/scripts/constants/languages.ts +3 -68
- package/scripts/constants/test-commands.ts +3 -94
- package/scripts/dev-tools/README.md +22 -0
- package/scripts/{test-interactive.ts → dev-tools/test-interactive.ts} +4 -3
- package/scripts/github-actions-client.ts +18 -256
- package/scripts/jira-sync.ts +5 -1270
- package/scripts/markdown-to-confluence.ts +5 -5
- package/scripts/multi-project-estimate.ts +3 -2
- package/scripts/phase-runner.ts +41 -19
- package/scripts/pre-flight-check.ts +27 -11
- package/scripts/template/__tests__/multi-repo-renderer.test.ts +12 -0
- package/scripts/template/multi-repo-renderer.ts +2 -2
- package/scripts/test-execution-generator.ts +5 -4
- package/scripts/utils/__tests__/config-validator.test.ts +19 -19
- package/scripts/utils/__tests__/feature-name-validator.test.ts +13 -13
- package/scripts/utils/__tests__/multi-repo-validator.test.ts +34 -34
- package/scripts/utils/__tests__/project-analyzer.test.ts +542 -0
- package/scripts/utils/__tests__/safe-file-reader.test.ts +208 -0
- package/scripts/utils/__tests__/security-validator.test.ts +33 -33
- package/scripts/utils/__tests__/validation-result.test.ts +112 -0
- package/scripts/utils/aidlc-parser.ts +18 -287
- package/scripts/utils/ci-generator.ts +4 -3
- package/scripts/utils/config-loader.ts +54 -50
- package/scripts/utils/config-validator.ts +89 -80
- package/scripts/utils/docker-requirement-detector.ts +5 -4
- package/scripts/utils/env-config.ts +59 -40
- package/scripts/utils/feature-name-validator.ts +25 -40
- package/scripts/utils/interactive-helpers.ts +24 -132
- package/scripts/utils/language-detector.ts +4 -3
- package/scripts/utils/markdown-parser.ts +18 -373
- package/scripts/utils/multi-repo-validator.ts +27 -28
- package/scripts/utils/project-analyzer.ts +429 -0
- package/scripts/utils/project-detector.ts +6 -5
- package/scripts/utils/project-finder.ts +2 -154
- package/scripts/utils/project-meta.ts +8 -91
- package/scripts/utils/safe-file-reader.ts +158 -0
- package/scripts/utils/security-validator.ts +42 -78
- package/scripts/utils/spec-archiver.ts +7 -6
- package/scripts/utils/spec-updater.ts +12 -6
- package/scripts/utils/tasks-converter.ts +2 -2
- package/scripts/utils/tasks-format-validator.ts +4 -4
- package/scripts/utils/template-applier.ts +4 -3
- package/scripts/utils/types/validation.ts +92 -0
- package/scripts/validate-phase.ts +51 -23
- package/scripts/workflow-orchestrator.ts +16 -251
- package/dist/scripts/mermaid-converter.d.ts.map +0 -1
- package/dist/scripts/mermaid-converter.js.map +0 -1
- package/dist/scripts/resource-dashboard.d.ts +0 -7
- package/dist/scripts/resource-dashboard.d.ts.map +0 -1
- package/dist/scripts/resource-dashboard.js +0 -157
- package/dist/scripts/resource-dashboard.js.map +0 -1
- package/dist/scripts/test-interactive.d.ts.map +0 -1
- package/dist/scripts/test-interactive.js.map +0 -1
- package/dist/scripts/test-new-features.d.ts +0 -5
- package/dist/scripts/test-new-features.d.ts.map +0 -1
- package/dist/scripts/test-new-features.js +0 -148
- package/dist/scripts/test-new-features.js.map +0 -1
- package/dist/scripts/test-spec-generator.d.ts +0 -29
- package/dist/scripts/test-spec-generator.d.ts.map +0 -1
- package/dist/scripts/test-spec-generator.js +0 -493
- package/dist/scripts/test-spec-generator.js.map +0 -1
- package/dist/scripts/utils/confluence-approval.d.ts +0 -46
- package/dist/scripts/utils/confluence-approval.d.ts.map +0 -1
- package/dist/scripts/utils/confluence-approval.js +0 -120
- package/dist/scripts/utils/confluence-approval.js.map +0 -1
- package/dist/scripts/utils/template-finder.d.ts +0 -37
- package/dist/scripts/utils/template-finder.d.ts.map +0 -1
- package/dist/scripts/utils/template-finder.js +0 -58
- package/dist/scripts/utils/template-finder.js.map +0 -1
- package/dist/src/commands/multi-repo-add-repo.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-add-repo.js.map +0 -1
- package/dist/src/commands/multi-repo-ci-status.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-ci-status.js.map +0 -1
- package/dist/src/commands/multi-repo-confluence-sync.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-confluence-sync.js.map +0 -1
- package/dist/src/commands/multi-repo-init.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-init.js.map +0 -1
- package/dist/src/commands/multi-repo-list.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-list.js.map +0 -1
- package/dist/src/commands/multi-repo-test.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-test.js.map +0 -1
- package/dist/src/commands/setup-existing.d.ts +0 -22
- package/dist/src/commands/setup-existing.d.ts.map +0 -1
- package/dist/src/commands/setup-existing.js +0 -606
- package/dist/src/commands/setup-existing.js.map +0 -1
- package/scripts/__tests__/setup-existing-project.test.ts +0 -244
- package/scripts/resource-dashboard.ts +0 -189
- package/scripts/test-new-features.ts +0 -171
- package/scripts/test-spec-generator.ts +0 -570
- package/scripts/utils/confluence-approval.ts +0 -169
- package/scripts/utils/template-finder.ts +0 -69
- /package/dist/scripts/{mermaid-converter.d.ts → dev-tools/mermaid-converter.d.ts} +0 -0
- /package/dist/scripts/{mermaid-converter.js → dev-tools/mermaid-converter.js} +0 -0
- /package/dist/scripts/{test-interactive.d.ts → dev-tools/test-interactive.d.ts} +0 -0
- /package/scripts/{mermaid-converter.ts → dev-tools/mermaid-converter.ts} +0 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProjectAnalyzer クラス
|
|
3
|
+
* project-finder, project-detector, language-detector の統合
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { safeReadFileOrThrow } from './safe-file-reader.js';
|
|
8
|
+
import { resolve, join, dirname } from 'path';
|
|
9
|
+
import type { Result } from './types/validation.js';
|
|
10
|
+
import { success, failure } from './types/validation.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Project detection error types
|
|
14
|
+
*/
|
|
15
|
+
export type ProjectError =
|
|
16
|
+
| { type: 'FileNotFound'; path: string }
|
|
17
|
+
| { type: 'InvalidJSON'; path: string; cause: string }
|
|
18
|
+
| { type: 'MissingField'; field: string }
|
|
19
|
+
| { type: 'Unknown'; message: string };
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Programming language types
|
|
23
|
+
*/
|
|
24
|
+
export type Language = 'nodejs' | 'java' | 'php' | 'python' | 'go' | 'rust' | 'unknown';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Project information (from project-detector)
|
|
28
|
+
*/
|
|
29
|
+
export interface ProjectInfo {
|
|
30
|
+
language: Language;
|
|
31
|
+
buildTool: string;
|
|
32
|
+
testFramework?: string;
|
|
33
|
+
hasCI: boolean;
|
|
34
|
+
hasDependencies: boolean;
|
|
35
|
+
packageManager?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Project metadata (from project-meta)
|
|
40
|
+
*/
|
|
41
|
+
export interface ProjectMetadata {
|
|
42
|
+
projectId: string;
|
|
43
|
+
projectName: string;
|
|
44
|
+
jiraProjectKey: string;
|
|
45
|
+
confluenceLabels: string[];
|
|
46
|
+
status: 'active' | 'inactive' | 'completed';
|
|
47
|
+
team: string[];
|
|
48
|
+
stakeholders: string[];
|
|
49
|
+
repository: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* ProjectAnalyzer class
|
|
55
|
+
* Unified interface for project detection utilities
|
|
56
|
+
*/
|
|
57
|
+
export class ProjectAnalyzer {
|
|
58
|
+
/**
|
|
59
|
+
* Find project root directory
|
|
60
|
+
* Searches for .git or projects/ directory
|
|
61
|
+
*
|
|
62
|
+
* @param startPath - Starting directory (default: process.cwd())
|
|
63
|
+
* @returns Result<string, ProjectError> - Project root path or error
|
|
64
|
+
*/
|
|
65
|
+
findProjectRoot(startPath: string = process.cwd()): Result<string, ProjectError> {
|
|
66
|
+
try {
|
|
67
|
+
let currentDir = resolve(startPath);
|
|
68
|
+
const root = resolve('/');
|
|
69
|
+
|
|
70
|
+
while (currentDir !== root && currentDir !== dirname(currentDir)) {
|
|
71
|
+
// Check for .git directory or projects/ directory
|
|
72
|
+
if (existsSync(join(currentDir, '.git')) || existsSync(join(currentDir, 'projects'))) {
|
|
73
|
+
return success(currentDir);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const parentDir = dirname(currentDir);
|
|
77
|
+
if (parentDir === currentDir) {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
currentDir = parentDir;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// If no repository root found, return starting directory
|
|
84
|
+
return success(resolve(startPath));
|
|
85
|
+
} catch (error) {
|
|
86
|
+
return failure([{
|
|
87
|
+
type: 'Unknown',
|
|
88
|
+
message: error instanceof Error ? error.message : String(error)
|
|
89
|
+
}]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Detect programming language from project files
|
|
95
|
+
*
|
|
96
|
+
* @param projectRoot - Project root directory (default: process.cwd())
|
|
97
|
+
* @returns Result<Language, ProjectError> - Detected language or error
|
|
98
|
+
*/
|
|
99
|
+
detectLanguage(projectRoot: string = process.cwd()): Result<Language, ProjectError> {
|
|
100
|
+
try {
|
|
101
|
+
// Node.js/TypeScript
|
|
102
|
+
if (existsSync(join(projectRoot, 'package.json'))) {
|
|
103
|
+
return success('nodejs' as Language);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Java
|
|
107
|
+
if (existsSync(join(projectRoot, 'build.gradle')) ||
|
|
108
|
+
existsSync(join(projectRoot, 'build.gradle.kts')) ||
|
|
109
|
+
existsSync(join(projectRoot, 'pom.xml'))) {
|
|
110
|
+
return success('java' as Language);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// PHP
|
|
114
|
+
if (existsSync(join(projectRoot, 'composer.json'))) {
|
|
115
|
+
return success('php' as Language);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Python
|
|
119
|
+
if (existsSync(join(projectRoot, 'requirements.txt')) ||
|
|
120
|
+
existsSync(join(projectRoot, 'pyproject.toml')) ||
|
|
121
|
+
existsSync(join(projectRoot, 'setup.py'))) {
|
|
122
|
+
return success('python' as Language);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Go
|
|
126
|
+
if (existsSync(join(projectRoot, 'go.mod'))) {
|
|
127
|
+
return success('go' as Language);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Rust
|
|
131
|
+
if (existsSync(join(projectRoot, 'Cargo.toml'))) {
|
|
132
|
+
return success('rust' as Language);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Unknown
|
|
136
|
+
return success('unknown' as Language);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
return failure([{
|
|
139
|
+
type: 'Unknown',
|
|
140
|
+
message: error instanceof Error ? error.message : String(error)
|
|
141
|
+
}]);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Get project metadata from .kiro/project.json
|
|
147
|
+
*
|
|
148
|
+
* @param projectRoot - Project root directory (default: process.cwd())
|
|
149
|
+
* @returns Result<ProjectMetadata, ProjectError> - Project metadata or error
|
|
150
|
+
*/
|
|
151
|
+
getProjectMetadata(projectRoot: string = process.cwd()): Result<ProjectMetadata, ProjectError> {
|
|
152
|
+
const projectJsonPath = resolve(projectRoot, '.kiro/project.json');
|
|
153
|
+
|
|
154
|
+
if (!existsSync(projectJsonPath)) {
|
|
155
|
+
return failure([{
|
|
156
|
+
type: 'FileNotFound',
|
|
157
|
+
path: projectJsonPath
|
|
158
|
+
}]);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
try {
|
|
162
|
+
const content = safeReadFileOrThrow(projectJsonPath, 'utf-8');
|
|
163
|
+
const meta = JSON.parse(content) as ProjectMetadata;
|
|
164
|
+
|
|
165
|
+
// Validate required fields
|
|
166
|
+
const requiredFields: (keyof ProjectMetadata)[] = [
|
|
167
|
+
'projectId',
|
|
168
|
+
'projectName',
|
|
169
|
+
'jiraProjectKey',
|
|
170
|
+
'confluenceLabels'
|
|
171
|
+
];
|
|
172
|
+
|
|
173
|
+
for (const field of requiredFields) {
|
|
174
|
+
if (!meta[field]) {
|
|
175
|
+
return failure([{
|
|
176
|
+
type: 'MissingField',
|
|
177
|
+
field: String(field)
|
|
178
|
+
}]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Validate projectId against path traversal attacks
|
|
183
|
+
if (!this.validateProjectId(meta.projectId)) {
|
|
184
|
+
return failure([{
|
|
185
|
+
type: 'Unknown',
|
|
186
|
+
message: 'Invalid projectId: must contain only alphanumeric characters, hyphens, and underscores'
|
|
187
|
+
}]);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return success(meta);
|
|
191
|
+
} catch (error) {
|
|
192
|
+
if (error instanceof SyntaxError) {
|
|
193
|
+
return failure([{
|
|
194
|
+
type: 'InvalidJSON',
|
|
195
|
+
path: projectJsonPath,
|
|
196
|
+
cause: error.message
|
|
197
|
+
}]);
|
|
198
|
+
}
|
|
199
|
+
return failure([{
|
|
200
|
+
type: 'Unknown',
|
|
201
|
+
message: error instanceof Error ? error.message : String(error)
|
|
202
|
+
}]);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Validate project ID against path traversal attacks
|
|
208
|
+
* Security: Prevents malicious project IDs like "../tmp/evil"
|
|
209
|
+
*
|
|
210
|
+
* @param projectId - Project ID to validate
|
|
211
|
+
* @returns true if valid, false otherwise
|
|
212
|
+
*/
|
|
213
|
+
private validateProjectId(projectId: string): boolean {
|
|
214
|
+
// Reject empty or whitespace-only IDs
|
|
215
|
+
if (!projectId.trim() || /^\s+$/.test(projectId)) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
// Reject path traversal attempts (.. / \)
|
|
219
|
+
if (projectId.includes('..') || projectId.includes('/') || projectId.includes('\\')) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
// Only allow alphanumeric, hyphens, and underscores
|
|
223
|
+
return /^[A-Za-z0-9_-]+$/.test(projectId);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get comprehensive project information
|
|
228
|
+
* Combines language detection with detailed project info
|
|
229
|
+
*
|
|
230
|
+
* @param projectRoot - Project root directory (default: process.cwd())
|
|
231
|
+
* @returns Result<ProjectInfo, ProjectError> - Detailed project information or error
|
|
232
|
+
*/
|
|
233
|
+
getProjectInfo(projectRoot: string = process.cwd()): Result<ProjectInfo, ProjectError> {
|
|
234
|
+
try {
|
|
235
|
+
// Node.js/TypeScript
|
|
236
|
+
if (existsSync(join(projectRoot, 'package.json'))) {
|
|
237
|
+
return this.detectNodeJsProject(projectRoot);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Java
|
|
241
|
+
if (existsSync(join(projectRoot, 'build.gradle')) ||
|
|
242
|
+
existsSync(join(projectRoot, 'build.gradle.kts'))) {
|
|
243
|
+
return this.detectJavaProject(projectRoot, 'gradle');
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (existsSync(join(projectRoot, 'pom.xml'))) {
|
|
247
|
+
return this.detectJavaProject(projectRoot, 'maven');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// PHP
|
|
251
|
+
if (existsSync(join(projectRoot, 'composer.json'))) {
|
|
252
|
+
return this.detectPHPProject(projectRoot);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Python
|
|
256
|
+
if (existsSync(join(projectRoot, 'requirements.txt')) ||
|
|
257
|
+
existsSync(join(projectRoot, 'pyproject.toml')) ||
|
|
258
|
+
existsSync(join(projectRoot, 'setup.py'))) {
|
|
259
|
+
return this.detectPythonProject(projectRoot);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Go
|
|
263
|
+
if (existsSync(join(projectRoot, 'go.mod'))) {
|
|
264
|
+
return this.detectGoProject(projectRoot);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Rust
|
|
268
|
+
if (existsSync(join(projectRoot, 'Cargo.toml'))) {
|
|
269
|
+
return this.detectRustProject(projectRoot);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Unknown
|
|
273
|
+
return success({
|
|
274
|
+
language: 'unknown',
|
|
275
|
+
buildTool: 'unknown',
|
|
276
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
277
|
+
hasDependencies: false
|
|
278
|
+
});
|
|
279
|
+
} catch (error) {
|
|
280
|
+
return failure([{
|
|
281
|
+
type: 'Unknown',
|
|
282
|
+
message: error instanceof Error ? error.message : String(error)
|
|
283
|
+
}]);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Detect Node.js project
|
|
289
|
+
*/
|
|
290
|
+
private detectNodeJsProject(projectRoot: string): Result<ProjectInfo, ProjectError> {
|
|
291
|
+
try {
|
|
292
|
+
const packageJson = JSON.parse(safeReadFileOrThrow(join(projectRoot, 'package.json'), 'utf-8'));
|
|
293
|
+
|
|
294
|
+
// Detect package manager
|
|
295
|
+
let packageManager = 'npm';
|
|
296
|
+
if (existsSync(join(projectRoot, 'pnpm-lock.yaml'))) {
|
|
297
|
+
packageManager = 'pnpm';
|
|
298
|
+
} else if (existsSync(join(projectRoot, 'yarn.lock'))) {
|
|
299
|
+
packageManager = 'yarn';
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Detect test framework
|
|
303
|
+
let testFramework: string | undefined;
|
|
304
|
+
const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
|
|
305
|
+
if (deps['vitest']) {
|
|
306
|
+
testFramework = 'vitest';
|
|
307
|
+
} else if (deps['jest']) {
|
|
308
|
+
testFramework = 'jest';
|
|
309
|
+
} else if (deps['mocha']) {
|
|
310
|
+
testFramework = 'mocha';
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return success({
|
|
314
|
+
language: 'nodejs',
|
|
315
|
+
buildTool: packageManager,
|
|
316
|
+
testFramework,
|
|
317
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
318
|
+
hasDependencies: true,
|
|
319
|
+
packageManager
|
|
320
|
+
});
|
|
321
|
+
} catch (error) {
|
|
322
|
+
return failure([{
|
|
323
|
+
type: 'InvalidJSON',
|
|
324
|
+
path: join(projectRoot, 'package.json'),
|
|
325
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
326
|
+
}]);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Detect Java project
|
|
332
|
+
*/
|
|
333
|
+
private detectJavaProject(projectRoot: string, buildTool: 'gradle' | 'maven'): Result<ProjectInfo, ProjectError> {
|
|
334
|
+
return success({
|
|
335
|
+
language: 'java',
|
|
336
|
+
buildTool,
|
|
337
|
+
testFramework: 'junit',
|
|
338
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
339
|
+
hasDependencies: true
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Detect PHP project
|
|
345
|
+
*/
|
|
346
|
+
private detectPHPProject(projectRoot: string): Result<ProjectInfo, ProjectError> {
|
|
347
|
+
try {
|
|
348
|
+
const composerJson = JSON.parse(safeReadFileOrThrow(join(projectRoot, 'composer.json'), 'utf-8'));
|
|
349
|
+
|
|
350
|
+
// Detect test framework
|
|
351
|
+
let testFramework: string | undefined;
|
|
352
|
+
const deps = { ...composerJson.require, ...composerJson['require-dev'] };
|
|
353
|
+
if (deps['phpunit/phpunit']) {
|
|
354
|
+
testFramework = 'phpunit';
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return success({
|
|
358
|
+
language: 'php',
|
|
359
|
+
buildTool: 'composer',
|
|
360
|
+
testFramework,
|
|
361
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
362
|
+
hasDependencies: true
|
|
363
|
+
});
|
|
364
|
+
} catch (error) {
|
|
365
|
+
return failure([{
|
|
366
|
+
type: 'InvalidJSON',
|
|
367
|
+
path: join(projectRoot, 'composer.json'),
|
|
368
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
369
|
+
}]);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Detect Python project
|
|
375
|
+
*/
|
|
376
|
+
private detectPythonProject(projectRoot: string): Result<ProjectInfo, ProjectError> {
|
|
377
|
+
let buildTool = 'pip';
|
|
378
|
+
let testFramework: string | undefined;
|
|
379
|
+
|
|
380
|
+
if (existsSync(join(projectRoot, 'pyproject.toml'))) {
|
|
381
|
+
buildTool = 'poetry or uv';
|
|
382
|
+
const pyproject = safeReadFileOrThrow(join(projectRoot, 'pyproject.toml'), 'utf-8');
|
|
383
|
+
if (pyproject.includes('pytest')) {
|
|
384
|
+
testFramework = 'pytest';
|
|
385
|
+
} else if (pyproject.includes('unittest')) {
|
|
386
|
+
testFramework = 'unittest';
|
|
387
|
+
}
|
|
388
|
+
} else if (existsSync(join(projectRoot, 'requirements.txt'))) {
|
|
389
|
+
const requirements = safeReadFileOrThrow(join(projectRoot, 'requirements.txt'), 'utf-8');
|
|
390
|
+
if (requirements.includes('pytest')) {
|
|
391
|
+
testFramework = 'pytest';
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return success({
|
|
396
|
+
language: 'python',
|
|
397
|
+
buildTool,
|
|
398
|
+
testFramework,
|
|
399
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
400
|
+
hasDependencies: true
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Detect Go project
|
|
406
|
+
*/
|
|
407
|
+
private detectGoProject(projectRoot: string): Result<ProjectInfo, ProjectError> {
|
|
408
|
+
return success({
|
|
409
|
+
language: 'go',
|
|
410
|
+
buildTool: 'go',
|
|
411
|
+
testFramework: 'testing',
|
|
412
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
413
|
+
hasDependencies: true
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Detect Rust project
|
|
419
|
+
*/
|
|
420
|
+
private detectRustProject(projectRoot: string): Result<ProjectInfo, ProjectError> {
|
|
421
|
+
return success({
|
|
422
|
+
language: 'rust',
|
|
423
|
+
buildTool: 'cargo',
|
|
424
|
+
testFramework: 'cargo-test',
|
|
425
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
426
|
+
hasDependencies: true
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* 既存ファイルからプロジェクト情報を自動検出
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { existsSync
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { safeReadFileOrThrow } from './safe-file-reader.js';
|
|
7
8
|
|
|
8
9
|
export interface ProjectInfo {
|
|
9
10
|
language: 'nodejs' | 'java' | 'php' | 'python' | 'go' | 'rust' | 'other';
|
|
@@ -67,7 +68,7 @@ export function detectProject(projectRoot: string = process.cwd()): ProjectInfo
|
|
|
67
68
|
* Node.jsプロジェクトを検出
|
|
68
69
|
*/
|
|
69
70
|
function detectNodeJsProject(projectRoot: string): ProjectInfo {
|
|
70
|
-
const packageJson = JSON.parse(
|
|
71
|
+
const packageJson = JSON.parse(safeReadFileOrThrow(`${projectRoot}/package.json`, 'utf-8'));
|
|
71
72
|
|
|
72
73
|
// パッケージマネージャーを検出
|
|
73
74
|
let packageManager = 'npm';
|
|
@@ -115,7 +116,7 @@ function detectJavaProject(projectRoot: string, buildTool: 'gradle' | 'maven'):
|
|
|
115
116
|
* PHPプロジェクトを検出
|
|
116
117
|
*/
|
|
117
118
|
function detectPHPProject(projectRoot: string): ProjectInfo {
|
|
118
|
-
const composerJson = JSON.parse(
|
|
119
|
+
const composerJson = JSON.parse(safeReadFileOrThrow(`${projectRoot}/composer.json`, 'utf-8'));
|
|
119
120
|
|
|
120
121
|
// テストフレームワークを検出
|
|
121
122
|
let testFramework: string | undefined;
|
|
@@ -142,14 +143,14 @@ function detectPythonProject(projectRoot: string): ProjectInfo {
|
|
|
142
143
|
|
|
143
144
|
if (existsSync(`${projectRoot}/pyproject.toml`)) {
|
|
144
145
|
buildTool = 'poetry or uv';
|
|
145
|
-
const pyproject =
|
|
146
|
+
const pyproject = safeReadFileOrThrow(`${projectRoot}/pyproject.toml`, 'utf-8');
|
|
146
147
|
if (pyproject.includes('pytest')) {
|
|
147
148
|
testFramework = 'pytest';
|
|
148
149
|
} else if (pyproject.includes('unittest')) {
|
|
149
150
|
testFramework = 'unittest';
|
|
150
151
|
}
|
|
151
152
|
} else if (existsSync(`${projectRoot}/requirements.txt`)) {
|
|
152
|
-
const requirements =
|
|
153
|
+
const requirements = safeReadFileOrThrow(`${projectRoot}/requirements.txt`, 'utf-8');
|
|
153
154
|
if (requirements.includes('pytest')) {
|
|
154
155
|
testFramework = 'pytest';
|
|
155
156
|
}
|
|
@@ -1,78 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* プロジェクト検出ユーティリティ
|
|
3
|
-
*
|
|
4
|
-
* 複数プロジェクトが存在する場合、選択機能を提供
|
|
3
|
+
* リポジトリルートを検出
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
|
-
import { existsSync
|
|
6
|
+
import { existsSync } from 'fs';
|
|
8
7
|
import { resolve, join, dirname } from 'path';
|
|
9
|
-
import { readFileSync } from 'fs';
|
|
10
|
-
import type { ProjectMetadata } from './project-meta.js';
|
|
11
|
-
|
|
12
|
-
export interface ProjectLocation {
|
|
13
|
-
path: string;
|
|
14
|
-
projectId: string;
|
|
15
|
-
projectName: string;
|
|
16
|
-
jiraProjectKey: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 指定されたディレクトリに.kiro/project.jsonが存在するか確認
|
|
21
|
-
*/
|
|
22
|
-
function hasProjectJson(dir: string): boolean {
|
|
23
|
-
const projectJsonPath = join(dir, '.kiro', 'project.json');
|
|
24
|
-
return existsSync(projectJsonPath);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* プロジェクトメタデータを読み込む
|
|
29
|
-
*/
|
|
30
|
-
function loadProjectMetadata(dir: string): ProjectMetadata | null {
|
|
31
|
-
const projectJsonPath = join(dir, '.kiro', 'project.json');
|
|
32
|
-
|
|
33
|
-
if (!existsSync(projectJsonPath)) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
const content = readFileSync(projectJsonPath, 'utf-8');
|
|
39
|
-
const meta = JSON.parse(content) as ProjectMetadata;
|
|
40
|
-
return meta;
|
|
41
|
-
} catch {
|
|
42
|
-
// パースエラーなどは無視
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 現在のディレクトリから親ディレクトリを遡って.kiro/project.jsonを検索
|
|
49
|
-
*/
|
|
50
|
-
export function findCurrentProject(startDir: string = process.cwd()): ProjectLocation | null {
|
|
51
|
-
let currentDir = resolve(startDir);
|
|
52
|
-
const root = resolve('/');
|
|
53
|
-
|
|
54
|
-
while (currentDir !== root && currentDir !== dirname(currentDir)) {
|
|
55
|
-
if (hasProjectJson(currentDir)) {
|
|
56
|
-
const meta = loadProjectMetadata(currentDir);
|
|
57
|
-
if (meta) {
|
|
58
|
-
return {
|
|
59
|
-
path: currentDir,
|
|
60
|
-
projectId: meta.projectId,
|
|
61
|
-
projectName: meta.projectName,
|
|
62
|
-
jiraProjectKey: meta.jiraProjectKey
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const parentDir = dirname(currentDir);
|
|
68
|
-
if (parentDir === currentDir) {
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
currentDir = parentDir;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
8
|
|
|
77
9
|
/**
|
|
78
10
|
* リポジトリルートを検出
|
|
@@ -98,87 +30,3 @@ export function findRepositoryRoot(startDir: string = process.cwd()): string {
|
|
|
98
30
|
// リポジトリルートが見つからない場合、現在のディレクトリを返す
|
|
99
31
|
return resolve(startDir);
|
|
100
32
|
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* リポジトリルートからprojects/配下の全プロジェクトを検索
|
|
104
|
-
* 統一されたディレクトリ構成: すべてのプロジェクトはprojects/{project-id}/配下に配置
|
|
105
|
-
*/
|
|
106
|
-
export function findAllProjects(
|
|
107
|
-
searchDir?: string
|
|
108
|
-
): ProjectLocation[] {
|
|
109
|
-
const projects: ProjectLocation[] = [];
|
|
110
|
-
|
|
111
|
-
// リポジトリルートを検出
|
|
112
|
-
const repoRoot = searchDir ? findRepositoryRoot(searchDir) : findRepositoryRoot();
|
|
113
|
-
const projectsDir = join(repoRoot, 'projects');
|
|
114
|
-
|
|
115
|
-
// projects/ディレクトリが存在しない場合は空配列を返す
|
|
116
|
-
if (!existsSync(projectsDir)) {
|
|
117
|
-
return projects;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
try {
|
|
121
|
-
// projects/配下のディレクトリを取得
|
|
122
|
-
const entries = readdirSync(projectsDir, { withFileTypes: true });
|
|
123
|
-
|
|
124
|
-
for (const entry of entries) {
|
|
125
|
-
// 隠しディレクトリはスキップ
|
|
126
|
-
if (entry.name.startsWith('.')) {
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (entry.isDirectory()) {
|
|
131
|
-
const projectDir = join(projectsDir, entry.name);
|
|
132
|
-
// プロジェクトディレクトリに.kiro/project.jsonがあるか確認
|
|
133
|
-
if (hasProjectJson(projectDir)) {
|
|
134
|
-
const meta = loadProjectMetadata(projectDir);
|
|
135
|
-
if (meta) {
|
|
136
|
-
projects.push({
|
|
137
|
-
path: projectDir,
|
|
138
|
-
projectId: meta.projectId,
|
|
139
|
-
projectName: meta.projectName,
|
|
140
|
-
jiraProjectKey: meta.jiraProjectKey
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
} catch {
|
|
147
|
-
// アクセス権限エラーなどは無視
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return projects;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* 複数プロジェクトから選択する(対話的)
|
|
155
|
-
*/
|
|
156
|
-
export async function selectProject(
|
|
157
|
-
projects: ProjectLocation[],
|
|
158
|
-
question: (prompt: string) => Promise<string>
|
|
159
|
-
): Promise<ProjectLocation | null> {
|
|
160
|
-
if (projects.length === 0) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (projects.length === 1) {
|
|
165
|
-
return projects[0];
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
console.log('\n📋 複数のプロジェクトが見つかりました:');
|
|
169
|
-
projects.forEach((project, index) => {
|
|
170
|
-
console.log(` ${index + 1}. ${project.projectName} (${project.projectId}) - ${project.path}`);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
const answer = await question(`\n選択してください [1-${projects.length}]: `);
|
|
174
|
-
const index = parseInt(answer.trim(), 10) - 1;
|
|
175
|
-
|
|
176
|
-
if (index >= 0 && index < projects.length) {
|
|
177
|
-
return projects[index];
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// 無効な入力の場合は最初のプロジェクトを返す
|
|
181
|
-
console.log('⚠️ 無効な選択です。最初のプロジェクトを使用します。');
|
|
182
|
-
return projects[0];
|
|
183
|
-
}
|
|
184
|
-
|