@sk8metal/michi-cli 0.14.1 → 0.20.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 +98 -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/config/env-wizard.d.ts +9 -0
- package/dist/src/presentation/interactive/config/env-wizard.d.ts.map +1 -0
- package/dist/src/presentation/interactive/config/env-wizard.js +193 -0
- package/dist/src/presentation/interactive/config/env-wizard.js.map +1 -0
- package/dist/src/presentation/interactive/config/index.d.ts +5 -0
- package/dist/src/presentation/interactive/config/index.d.ts.map +1 -0
- package/dist/src/presentation/interactive/config/index.js +5 -0
- package/dist/src/presentation/interactive/config/index.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 +30 -0
- package/dist/src/presentation/interactive/prompts.d.ts.map +1 -0
- package/dist/src/presentation/interactive/prompts.js +69 -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/guides/interactive-config.md +285 -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,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProjectAnalyzer クラス
|
|
3
|
+
* project-finder, project-detector, language-detector の統合
|
|
4
|
+
*/
|
|
5
|
+
import { existsSync } from 'fs';
|
|
6
|
+
import { safeReadFileOrThrow } from './safe-file-reader.js';
|
|
7
|
+
import { resolve, join, dirname } from 'path';
|
|
8
|
+
import { success, failure } from './types/validation.js';
|
|
9
|
+
/**
|
|
10
|
+
* ProjectAnalyzer class
|
|
11
|
+
* Unified interface for project detection utilities
|
|
12
|
+
*/
|
|
13
|
+
export class ProjectAnalyzer {
|
|
14
|
+
/**
|
|
15
|
+
* Find project root directory
|
|
16
|
+
* Searches for .git or projects/ directory
|
|
17
|
+
*
|
|
18
|
+
* @param startPath - Starting directory (default: process.cwd())
|
|
19
|
+
* @returns Result<string, ProjectError> - Project root path or error
|
|
20
|
+
*/
|
|
21
|
+
findProjectRoot(startPath = process.cwd()) {
|
|
22
|
+
try {
|
|
23
|
+
let currentDir = resolve(startPath);
|
|
24
|
+
const root = resolve('/');
|
|
25
|
+
while (currentDir !== root && currentDir !== dirname(currentDir)) {
|
|
26
|
+
// Check for .git directory or projects/ directory
|
|
27
|
+
if (existsSync(join(currentDir, '.git')) || existsSync(join(currentDir, 'projects'))) {
|
|
28
|
+
return success(currentDir);
|
|
29
|
+
}
|
|
30
|
+
const parentDir = dirname(currentDir);
|
|
31
|
+
if (parentDir === currentDir) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
currentDir = parentDir;
|
|
35
|
+
}
|
|
36
|
+
// If no repository root found, return starting directory
|
|
37
|
+
return success(resolve(startPath));
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return failure([{
|
|
41
|
+
type: 'Unknown',
|
|
42
|
+
message: error instanceof Error ? error.message : String(error)
|
|
43
|
+
}]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Detect programming language from project files
|
|
48
|
+
*
|
|
49
|
+
* @param projectRoot - Project root directory (default: process.cwd())
|
|
50
|
+
* @returns Result<Language, ProjectError> - Detected language or error
|
|
51
|
+
*/
|
|
52
|
+
detectLanguage(projectRoot = process.cwd()) {
|
|
53
|
+
try {
|
|
54
|
+
// Node.js/TypeScript
|
|
55
|
+
if (existsSync(join(projectRoot, 'package.json'))) {
|
|
56
|
+
return success('nodejs');
|
|
57
|
+
}
|
|
58
|
+
// Java
|
|
59
|
+
if (existsSync(join(projectRoot, 'build.gradle')) ||
|
|
60
|
+
existsSync(join(projectRoot, 'build.gradle.kts')) ||
|
|
61
|
+
existsSync(join(projectRoot, 'pom.xml'))) {
|
|
62
|
+
return success('java');
|
|
63
|
+
}
|
|
64
|
+
// PHP
|
|
65
|
+
if (existsSync(join(projectRoot, 'composer.json'))) {
|
|
66
|
+
return success('php');
|
|
67
|
+
}
|
|
68
|
+
// Python
|
|
69
|
+
if (existsSync(join(projectRoot, 'requirements.txt')) ||
|
|
70
|
+
existsSync(join(projectRoot, 'pyproject.toml')) ||
|
|
71
|
+
existsSync(join(projectRoot, 'setup.py'))) {
|
|
72
|
+
return success('python');
|
|
73
|
+
}
|
|
74
|
+
// Go
|
|
75
|
+
if (existsSync(join(projectRoot, 'go.mod'))) {
|
|
76
|
+
return success('go');
|
|
77
|
+
}
|
|
78
|
+
// Rust
|
|
79
|
+
if (existsSync(join(projectRoot, 'Cargo.toml'))) {
|
|
80
|
+
return success('rust');
|
|
81
|
+
}
|
|
82
|
+
// Unknown
|
|
83
|
+
return success('unknown');
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return failure([{
|
|
87
|
+
type: 'Unknown',
|
|
88
|
+
message: error instanceof Error ? error.message : String(error)
|
|
89
|
+
}]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get project metadata from .kiro/project.json
|
|
94
|
+
*
|
|
95
|
+
* @param projectRoot - Project root directory (default: process.cwd())
|
|
96
|
+
* @returns Result<ProjectMetadata, ProjectError> - Project metadata or error
|
|
97
|
+
*/
|
|
98
|
+
getProjectMetadata(projectRoot = process.cwd()) {
|
|
99
|
+
const projectJsonPath = resolve(projectRoot, '.kiro/project.json');
|
|
100
|
+
if (!existsSync(projectJsonPath)) {
|
|
101
|
+
return failure([{
|
|
102
|
+
type: 'FileNotFound',
|
|
103
|
+
path: projectJsonPath
|
|
104
|
+
}]);
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
const content = safeReadFileOrThrow(projectJsonPath, 'utf-8');
|
|
108
|
+
const meta = JSON.parse(content);
|
|
109
|
+
// Validate required fields
|
|
110
|
+
const requiredFields = [
|
|
111
|
+
'projectId',
|
|
112
|
+
'projectName',
|
|
113
|
+
'jiraProjectKey',
|
|
114
|
+
'confluenceLabels'
|
|
115
|
+
];
|
|
116
|
+
for (const field of requiredFields) {
|
|
117
|
+
if (!meta[field]) {
|
|
118
|
+
return failure([{
|
|
119
|
+
type: 'MissingField',
|
|
120
|
+
field: String(field)
|
|
121
|
+
}]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Validate projectId against path traversal attacks
|
|
125
|
+
if (!this.validateProjectId(meta.projectId)) {
|
|
126
|
+
return failure([{
|
|
127
|
+
type: 'Unknown',
|
|
128
|
+
message: 'Invalid projectId: must contain only alphanumeric characters, hyphens, and underscores'
|
|
129
|
+
}]);
|
|
130
|
+
}
|
|
131
|
+
return success(meta);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error instanceof SyntaxError) {
|
|
135
|
+
return failure([{
|
|
136
|
+
type: 'InvalidJSON',
|
|
137
|
+
path: projectJsonPath,
|
|
138
|
+
cause: error.message
|
|
139
|
+
}]);
|
|
140
|
+
}
|
|
141
|
+
return failure([{
|
|
142
|
+
type: 'Unknown',
|
|
143
|
+
message: error instanceof Error ? error.message : String(error)
|
|
144
|
+
}]);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Validate project ID against path traversal attacks
|
|
149
|
+
* Security: Prevents malicious project IDs like "../tmp/evil"
|
|
150
|
+
*
|
|
151
|
+
* @param projectId - Project ID to validate
|
|
152
|
+
* @returns true if valid, false otherwise
|
|
153
|
+
*/
|
|
154
|
+
validateProjectId(projectId) {
|
|
155
|
+
// Reject empty or whitespace-only IDs
|
|
156
|
+
if (!projectId.trim() || /^\s+$/.test(projectId)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
// Reject path traversal attempts (.. / \)
|
|
160
|
+
if (projectId.includes('..') || projectId.includes('/') || projectId.includes('\\')) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
// Only allow alphanumeric, hyphens, and underscores
|
|
164
|
+
return /^[A-Za-z0-9_-]+$/.test(projectId);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get comprehensive project information
|
|
168
|
+
* Combines language detection with detailed project info
|
|
169
|
+
*
|
|
170
|
+
* @param projectRoot - Project root directory (default: process.cwd())
|
|
171
|
+
* @returns Result<ProjectInfo, ProjectError> - Detailed project information or error
|
|
172
|
+
*/
|
|
173
|
+
getProjectInfo(projectRoot = process.cwd()) {
|
|
174
|
+
try {
|
|
175
|
+
// Node.js/TypeScript
|
|
176
|
+
if (existsSync(join(projectRoot, 'package.json'))) {
|
|
177
|
+
return this.detectNodeJsProject(projectRoot);
|
|
178
|
+
}
|
|
179
|
+
// Java
|
|
180
|
+
if (existsSync(join(projectRoot, 'build.gradle')) ||
|
|
181
|
+
existsSync(join(projectRoot, 'build.gradle.kts'))) {
|
|
182
|
+
return this.detectJavaProject(projectRoot, 'gradle');
|
|
183
|
+
}
|
|
184
|
+
if (existsSync(join(projectRoot, 'pom.xml'))) {
|
|
185
|
+
return this.detectJavaProject(projectRoot, 'maven');
|
|
186
|
+
}
|
|
187
|
+
// PHP
|
|
188
|
+
if (existsSync(join(projectRoot, 'composer.json'))) {
|
|
189
|
+
return this.detectPHPProject(projectRoot);
|
|
190
|
+
}
|
|
191
|
+
// Python
|
|
192
|
+
if (existsSync(join(projectRoot, 'requirements.txt')) ||
|
|
193
|
+
existsSync(join(projectRoot, 'pyproject.toml')) ||
|
|
194
|
+
existsSync(join(projectRoot, 'setup.py'))) {
|
|
195
|
+
return this.detectPythonProject(projectRoot);
|
|
196
|
+
}
|
|
197
|
+
// Go
|
|
198
|
+
if (existsSync(join(projectRoot, 'go.mod'))) {
|
|
199
|
+
return this.detectGoProject(projectRoot);
|
|
200
|
+
}
|
|
201
|
+
// Rust
|
|
202
|
+
if (existsSync(join(projectRoot, 'Cargo.toml'))) {
|
|
203
|
+
return this.detectRustProject(projectRoot);
|
|
204
|
+
}
|
|
205
|
+
// Unknown
|
|
206
|
+
return success({
|
|
207
|
+
language: 'unknown',
|
|
208
|
+
buildTool: 'unknown',
|
|
209
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
210
|
+
hasDependencies: false
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
return failure([{
|
|
215
|
+
type: 'Unknown',
|
|
216
|
+
message: error instanceof Error ? error.message : String(error)
|
|
217
|
+
}]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Detect Node.js project
|
|
222
|
+
*/
|
|
223
|
+
detectNodeJsProject(projectRoot) {
|
|
224
|
+
try {
|
|
225
|
+
const packageJson = JSON.parse(safeReadFileOrThrow(join(projectRoot, 'package.json'), 'utf-8'));
|
|
226
|
+
// Detect package manager
|
|
227
|
+
let packageManager = 'npm';
|
|
228
|
+
if (existsSync(join(projectRoot, 'pnpm-lock.yaml'))) {
|
|
229
|
+
packageManager = 'pnpm';
|
|
230
|
+
}
|
|
231
|
+
else if (existsSync(join(projectRoot, 'yarn.lock'))) {
|
|
232
|
+
packageManager = 'yarn';
|
|
233
|
+
}
|
|
234
|
+
// Detect test framework
|
|
235
|
+
let testFramework;
|
|
236
|
+
const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
|
|
237
|
+
if (deps['vitest']) {
|
|
238
|
+
testFramework = 'vitest';
|
|
239
|
+
}
|
|
240
|
+
else if (deps['jest']) {
|
|
241
|
+
testFramework = 'jest';
|
|
242
|
+
}
|
|
243
|
+
else if (deps['mocha']) {
|
|
244
|
+
testFramework = 'mocha';
|
|
245
|
+
}
|
|
246
|
+
return success({
|
|
247
|
+
language: 'nodejs',
|
|
248
|
+
buildTool: packageManager,
|
|
249
|
+
testFramework,
|
|
250
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
251
|
+
hasDependencies: true,
|
|
252
|
+
packageManager
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
return failure([{
|
|
257
|
+
type: 'InvalidJSON',
|
|
258
|
+
path: join(projectRoot, 'package.json'),
|
|
259
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
260
|
+
}]);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Detect Java project
|
|
265
|
+
*/
|
|
266
|
+
detectJavaProject(projectRoot, buildTool) {
|
|
267
|
+
return success({
|
|
268
|
+
language: 'java',
|
|
269
|
+
buildTool,
|
|
270
|
+
testFramework: 'junit',
|
|
271
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
272
|
+
hasDependencies: true
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Detect PHP project
|
|
277
|
+
*/
|
|
278
|
+
detectPHPProject(projectRoot) {
|
|
279
|
+
try {
|
|
280
|
+
const composerJson = JSON.parse(safeReadFileOrThrow(join(projectRoot, 'composer.json'), 'utf-8'));
|
|
281
|
+
// Detect test framework
|
|
282
|
+
let testFramework;
|
|
283
|
+
const deps = { ...composerJson.require, ...composerJson['require-dev'] };
|
|
284
|
+
if (deps['phpunit/phpunit']) {
|
|
285
|
+
testFramework = 'phpunit';
|
|
286
|
+
}
|
|
287
|
+
return success({
|
|
288
|
+
language: 'php',
|
|
289
|
+
buildTool: 'composer',
|
|
290
|
+
testFramework,
|
|
291
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
292
|
+
hasDependencies: true
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
return failure([{
|
|
297
|
+
type: 'InvalidJSON',
|
|
298
|
+
path: join(projectRoot, 'composer.json'),
|
|
299
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
300
|
+
}]);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Detect Python project
|
|
305
|
+
*/
|
|
306
|
+
detectPythonProject(projectRoot) {
|
|
307
|
+
let buildTool = 'pip';
|
|
308
|
+
let testFramework;
|
|
309
|
+
if (existsSync(join(projectRoot, 'pyproject.toml'))) {
|
|
310
|
+
buildTool = 'poetry or uv';
|
|
311
|
+
const pyproject = safeReadFileOrThrow(join(projectRoot, 'pyproject.toml'), 'utf-8');
|
|
312
|
+
if (pyproject.includes('pytest')) {
|
|
313
|
+
testFramework = 'pytest';
|
|
314
|
+
}
|
|
315
|
+
else if (pyproject.includes('unittest')) {
|
|
316
|
+
testFramework = 'unittest';
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else if (existsSync(join(projectRoot, 'requirements.txt'))) {
|
|
320
|
+
const requirements = safeReadFileOrThrow(join(projectRoot, 'requirements.txt'), 'utf-8');
|
|
321
|
+
if (requirements.includes('pytest')) {
|
|
322
|
+
testFramework = 'pytest';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return success({
|
|
326
|
+
language: 'python',
|
|
327
|
+
buildTool,
|
|
328
|
+
testFramework,
|
|
329
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
330
|
+
hasDependencies: true
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Detect Go project
|
|
335
|
+
*/
|
|
336
|
+
detectGoProject(projectRoot) {
|
|
337
|
+
return success({
|
|
338
|
+
language: 'go',
|
|
339
|
+
buildTool: 'go',
|
|
340
|
+
testFramework: 'testing',
|
|
341
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
342
|
+
hasDependencies: true
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Detect Rust project
|
|
347
|
+
*/
|
|
348
|
+
detectRustProject(projectRoot) {
|
|
349
|
+
return success({
|
|
350
|
+
language: 'rust',
|
|
351
|
+
buildTool: 'cargo',
|
|
352
|
+
testFramework: 'cargo-test',
|
|
353
|
+
hasCI: existsSync(join(projectRoot, '.github/workflows')),
|
|
354
|
+
hasDependencies: true
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=project-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-analyzer.js","sourceRoot":"","sources":["../../../scripts/utils/project-analyzer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OA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E,kBAAkB,CAAC,EAAE,OAAO,CAAC,CAAC;YACzF,IAAI,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACpC,aAAa,GAAG,QAAQ,CAAC;YAC3B,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;YACb,QAAQ,EAAE,QAAQ;YAClB,SAAS;YACT,aAAa;YACb,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;YACzD,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,WAAmB;QACzC,OAAO,OAAO,CAAC;YACb,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,SAAS;YACxB,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;YACzD,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,WAAmB;QAC3C,OAAO,OAAO,CAAC;YACb,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,OAAO;YAClB,aAAa,EAAE,YAAY;YAC3B,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;YACzD,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../../scripts/utils/project-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"project-detector.d.ts","sourceRoot":"","sources":["../../../scripts/utils/project-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,GAAE,MAAsB,GAAG,WAAW,CA4C9E"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* プロジェクト検出ユーティリティ
|
|
3
3
|
* 既存ファイルからプロジェクト情報を自動検出
|
|
4
4
|
*/
|
|
5
|
-
import { existsSync
|
|
5
|
+
import { existsSync } from 'fs';
|
|
6
|
+
import { safeReadFileOrThrow } from './safe-file-reader.js';
|
|
6
7
|
/**
|
|
7
8
|
* プロジェクト情報を自動検出
|
|
8
9
|
*/
|
|
@@ -48,7 +49,7 @@ export function detectProject(projectRoot = process.cwd()) {
|
|
|
48
49
|
* Node.jsプロジェクトを検出
|
|
49
50
|
*/
|
|
50
51
|
function detectNodeJsProject(projectRoot) {
|
|
51
|
-
const packageJson = JSON.parse(
|
|
52
|
+
const packageJson = JSON.parse(safeReadFileOrThrow(`${projectRoot}/package.json`, 'utf-8'));
|
|
52
53
|
// パッケージマネージャーを検出
|
|
53
54
|
let packageManager = 'npm';
|
|
54
55
|
if (existsSync(`${projectRoot}/pnpm-lock.yaml`)) {
|
|
@@ -94,7 +95,7 @@ function detectJavaProject(projectRoot, buildTool) {
|
|
|
94
95
|
* PHPプロジェクトを検出
|
|
95
96
|
*/
|
|
96
97
|
function detectPHPProject(projectRoot) {
|
|
97
|
-
const composerJson = JSON.parse(
|
|
98
|
+
const composerJson = JSON.parse(safeReadFileOrThrow(`${projectRoot}/composer.json`, 'utf-8'));
|
|
98
99
|
// テストフレームワークを検出
|
|
99
100
|
let testFramework;
|
|
100
101
|
const deps = { ...composerJson.require, ...composerJson['require-dev'] };
|
|
@@ -117,7 +118,7 @@ function detectPythonProject(projectRoot) {
|
|
|
117
118
|
let testFramework;
|
|
118
119
|
if (existsSync(`${projectRoot}/pyproject.toml`)) {
|
|
119
120
|
buildTool = 'poetry or uv';
|
|
120
|
-
const pyproject =
|
|
121
|
+
const pyproject = safeReadFileOrThrow(`${projectRoot}/pyproject.toml`, 'utf-8');
|
|
121
122
|
if (pyproject.includes('pytest')) {
|
|
122
123
|
testFramework = 'pytest';
|
|
123
124
|
}
|
|
@@ -126,7 +127,7 @@ function detectPythonProject(projectRoot) {
|
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
else if (existsSync(`${projectRoot}/requirements.txt`)) {
|
|
129
|
-
const requirements =
|
|
130
|
+
const requirements = safeReadFileOrThrow(`${projectRoot}/requirements.txt`, 'utf-8');
|
|
130
131
|
if (requirements.includes('pytest')) {
|
|
131
132
|
testFramework = 'pytest';
|
|
132
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-detector.js","sourceRoot":"","sources":["../../../scripts/utils/project-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"project-detector.js","sourceRoot":"","sources":["../../../scripts/utils/project-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAW5D;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,cAAsB,OAAO,CAAC,GAAG,EAAE;IAC/D,qBAAqB;IACrB,IAAI,UAAU,CAAC,GAAG,WAAW,eAAe,CAAC,EAAE,CAAC;QAC9C,OAAO,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO;IACP,IAAI,UAAU,CAAC,GAAG,WAAW,eAAe,CAAC,IAAI,UAAU,CAAC,GAAG,WAAW,mBAAmB,CAAC,EAAE,CAAC;QAC/F,OAAO,iBAAi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AC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,WAAmB;IAC1C,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,SAAS;QACxB,KAAK,EAAE,UAAU,CAAC,GAAG,WAAW,oBAAoB,CAAC;QACrD,eAAe,EAAE,IAAI;KACtB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,OAAO;QACL,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,YAAY;QAC3B,KAAK,EAAE,UAAU,CAAC,GAAG,WAAW,oBAAoB,CAAC;QACrD,eAAe,EAAE,IAAI;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* プロジェクト検出ユーティリティ
|
|
3
|
-
*
|
|
4
|
-
* 複数プロジェクトが存在する場合、選択機能を提供
|
|
5
|
-
*/
|
|
6
|
-
export interface ProjectLocation {
|
|
7
|
-
path: string;
|
|
8
|
-
projectId: string;
|
|
9
|
-
projectName: string;
|
|
10
|
-
jiraProjectKey: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* 現在のディレクトリから親ディレクトリを遡って.kiro/project.jsonを検索
|
|
3
|
+
* リポジトリルートを検出
|
|
14
4
|
*/
|
|
15
|
-
export declare function findCurrentProject(startDir?: string): ProjectLocation | null;
|
|
16
5
|
/**
|
|
17
6
|
* リポジトリルートを検出
|
|
18
7
|
* .gitディレクトリまたはprojects/ディレクトリの存在から判断
|
|
19
8
|
*/
|
|
20
9
|
export declare function findRepositoryRoot(startDir?: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* リポジトリルートからprojects/配下の全プロジェクトを検索
|
|
23
|
-
* 統一されたディレクトリ構成: すべてのプロジェクトはprojects/{project-id}/配下に配置
|
|
24
|
-
*/
|
|
25
|
-
export declare function findAllProjects(searchDir?: string): ProjectLocation[];
|
|
26
|
-
/**
|
|
27
|
-
* 複数プロジェクトから選択する(対話的)
|
|
28
|
-
*/
|
|
29
|
-
export declare function selectProject(projects: ProjectLocation[], question: (prompt: string) => Promise<string>): Promise<ProjectLocation | null>;
|
|
30
10
|
//# sourceMappingURL=project-finder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-finder.d.ts","sourceRoot":"","sources":["../../../scripts/utils/project-finder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project-finder.d.ts","sourceRoot":"","sources":["../../../scripts/utils/project-finder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAmB3E"}
|
|
@@ -1,62 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* プロジェクト検出ユーティリティ
|
|
3
|
-
*
|
|
4
|
-
* 複数プロジェクトが存在する場合、選択機能を提供
|
|
3
|
+
* リポジトリルートを検出
|
|
5
4
|
*/
|
|
6
|
-
import { existsSync
|
|
5
|
+
import { existsSync } from 'fs';
|
|
7
6
|
import { resolve, join, dirname } from 'path';
|
|
8
|
-
import { readFileSync } from 'fs';
|
|
9
|
-
/**
|
|
10
|
-
* 指定されたディレクトリに.kiro/project.jsonが存在するか確認
|
|
11
|
-
*/
|
|
12
|
-
function hasProjectJson(dir) {
|
|
13
|
-
const projectJsonPath = join(dir, '.kiro', 'project.json');
|
|
14
|
-
return existsSync(projectJsonPath);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* プロジェクトメタデータを読み込む
|
|
18
|
-
*/
|
|
19
|
-
function loadProjectMetadata(dir) {
|
|
20
|
-
const projectJsonPath = join(dir, '.kiro', 'project.json');
|
|
21
|
-
if (!existsSync(projectJsonPath)) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
const content = readFileSync(projectJsonPath, 'utf-8');
|
|
26
|
-
const meta = JSON.parse(content);
|
|
27
|
-
return meta;
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
// パースエラーなどは無視
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* 現在のディレクトリから親ディレクトリを遡って.kiro/project.jsonを検索
|
|
36
|
-
*/
|
|
37
|
-
export function findCurrentProject(startDir = process.cwd()) {
|
|
38
|
-
let currentDir = resolve(startDir);
|
|
39
|
-
const root = resolve('/');
|
|
40
|
-
while (currentDir !== root && currentDir !== dirname(currentDir)) {
|
|
41
|
-
if (hasProjectJson(currentDir)) {
|
|
42
|
-
const meta = loadProjectMetadata(currentDir);
|
|
43
|
-
if (meta) {
|
|
44
|
-
return {
|
|
45
|
-
path: currentDir,
|
|
46
|
-
projectId: meta.projectId,
|
|
47
|
-
projectName: meta.projectName,
|
|
48
|
-
jiraProjectKey: meta.jiraProjectKey
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const parentDir = dirname(currentDir);
|
|
53
|
-
if (parentDir === currentDir) {
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
currentDir = parentDir;
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
7
|
/**
|
|
61
8
|
* リポジトリルートを検出
|
|
62
9
|
* .gitディレクトリまたはprojects/ディレクトリの存在から判断
|
|
@@ -78,70 +25,4 @@ export function findRepositoryRoot(startDir = process.cwd()) {
|
|
|
78
25
|
// リポジトリルートが見つからない場合、現在のディレクトリを返す
|
|
79
26
|
return resolve(startDir);
|
|
80
27
|
}
|
|
81
|
-
/**
|
|
82
|
-
* リポジトリルートからprojects/配下の全プロジェクトを検索
|
|
83
|
-
* 統一されたディレクトリ構成: すべてのプロジェクトはprojects/{project-id}/配下に配置
|
|
84
|
-
*/
|
|
85
|
-
export function findAllProjects(searchDir) {
|
|
86
|
-
const projects = [];
|
|
87
|
-
// リポジトリルートを検出
|
|
88
|
-
const repoRoot = searchDir ? findRepositoryRoot(searchDir) : findRepositoryRoot();
|
|
89
|
-
const projectsDir = join(repoRoot, 'projects');
|
|
90
|
-
// projects/ディレクトリが存在しない場合は空配列を返す
|
|
91
|
-
if (!existsSync(projectsDir)) {
|
|
92
|
-
return projects;
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
// projects/配下のディレクトリを取得
|
|
96
|
-
const entries = readdirSync(projectsDir, { withFileTypes: true });
|
|
97
|
-
for (const entry of entries) {
|
|
98
|
-
// 隠しディレクトリはスキップ
|
|
99
|
-
if (entry.name.startsWith('.')) {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
if (entry.isDirectory()) {
|
|
103
|
-
const projectDir = join(projectsDir, entry.name);
|
|
104
|
-
// プロジェクトディレクトリに.kiro/project.jsonがあるか確認
|
|
105
|
-
if (hasProjectJson(projectDir)) {
|
|
106
|
-
const meta = loadProjectMetadata(projectDir);
|
|
107
|
-
if (meta) {
|
|
108
|
-
projects.push({
|
|
109
|
-
path: projectDir,
|
|
110
|
-
projectId: meta.projectId,
|
|
111
|
-
projectName: meta.projectName,
|
|
112
|
-
jiraProjectKey: meta.jiraProjectKey
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
// アクセス権限エラーなどは無視
|
|
121
|
-
}
|
|
122
|
-
return projects;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* 複数プロジェクトから選択する(対話的)
|
|
126
|
-
*/
|
|
127
|
-
export async function selectProject(projects, question) {
|
|
128
|
-
if (projects.length === 0) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
if (projects.length === 1) {
|
|
132
|
-
return projects[0];
|
|
133
|
-
}
|
|
134
|
-
console.log('\n📋 複数のプロジェクトが見つかりました:');
|
|
135
|
-
projects.forEach((project, index) => {
|
|
136
|
-
console.log(` ${index + 1}. ${project.projectName} (${project.projectId}) - ${project.path}`);
|
|
137
|
-
});
|
|
138
|
-
const answer = await question(`\n選択してください [1-${projects.length}]: `);
|
|
139
|
-
const index = parseInt(answer.trim(), 10) - 1;
|
|
140
|
-
if (index >= 0 && index < projects.length) {
|
|
141
|
-
return projects[index];
|
|
142
|
-
}
|
|
143
|
-
// 無効な入力の場合は最初のプロジェクトを返す
|
|
144
|
-
console.log('⚠️ 無効な選択です。最初のプロジェクトを使用します。');
|
|
145
|
-
return projects[0];
|
|
146
|
-
}
|
|
147
28
|
//# sourceMappingURL=project-finder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-finder.js","sourceRoot":"","sources":["../../../scripts/utils/project-finder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project-finder.js","sourceRoot":"","sources":["../../../scripts/utils/project-finder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IACjE,IAAI,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1B,OAAO,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACjE,kDAAkD;QAClD,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;YACrF,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC7B,MAAM;QACR,CAAC;QACD,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,iCAAiC;IACjC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|