agent-ide 0.2.0 → 0.4.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/README.md +29 -355
- package/dist/application/events/event-bus.d.ts.map +1 -1
- package/dist/application/events/event-bus.js.map +1 -1
- package/dist/application/index.d.ts +3 -1
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +10 -5
- package/dist/application/index.js.map +1 -1
- package/dist/application/services/cache-coordinator.service.d.ts.map +1 -1
- package/dist/application/services/cache-coordinator.service.js.map +1 -1
- package/dist/application/services/error-handler.service.d.ts.map +1 -1
- package/dist/application/services/error-handler.service.js.map +1 -1
- package/dist/application/services/module-coordinator.service.d.ts +5 -14
- package/dist/application/services/module-coordinator.service.d.ts.map +1 -1
- package/dist/application/services/module-coordinator.service.js +15 -108
- package/dist/application/services/module-coordinator.service.js.map +1 -1
- package/dist/application/services/session-manager.service.d.ts.map +1 -1
- package/dist/application/services/session-manager.service.js.map +1 -1
- package/dist/application/services/workflow-engine.service.d.ts +1 -1
- package/dist/application/services/workflow-engine.service.d.ts.map +1 -1
- package/dist/application/services/workflow-engine.service.js.map +1 -1
- package/dist/application/state/state-manager.d.ts +3 -3
- package/dist/application/state/state-manager.d.ts.map +1 -1
- package/dist/application/state/state-manager.js +3 -3
- package/dist/application/state/state-manager.js.map +1 -1
- package/dist/application/types.d.ts.map +1 -1
- package/dist/application/workflows/analysis-workflow.d.ts +1 -1
- package/dist/application/workflows/analysis-workflow.d.ts.map +1 -1
- package/dist/application/workflows/analysis-workflow.js +1 -1
- package/dist/application/workflows/analysis-workflow.js.map +1 -1
- package/dist/application/workflows/base-workflow.d.ts.map +1 -1
- package/dist/application/workflows/base-workflow.js.map +1 -1
- package/dist/application/workflows/index.d.ts +2 -2
- package/dist/application/workflows/index.d.ts.map +1 -1
- package/dist/application/workflows/index.js +2 -2
- package/dist/application/workflows/index.js.map +1 -1
- package/dist/application/workflows/refactor-workflow.d.ts +1 -1
- package/dist/application/workflows/refactor-workflow.d.ts.map +1 -1
- package/dist/application/workflows/refactor-workflow.js +1 -1
- package/dist/application/workflows/refactor-workflow.js.map +1 -1
- package/dist/core/change-signature/change-signature-service.d.ts +94 -0
- package/dist/core/change-signature/change-signature-service.d.ts.map +1 -0
- package/dist/core/change-signature/change-signature-service.js +544 -0
- package/dist/core/change-signature/change-signature-service.js.map +1 -0
- package/dist/core/change-signature/index.d.ts +10 -0
- package/dist/core/change-signature/index.d.ts.map +1 -0
- package/dist/core/change-signature/index.js +12 -0
- package/dist/core/change-signature/index.js.map +1 -0
- package/dist/core/change-signature/signature-parser.d.ts +76 -0
- package/dist/core/change-signature/signature-parser.d.ts.map +1 -0
- package/dist/core/change-signature/signature-parser.js +387 -0
- package/dist/core/change-signature/signature-parser.js.map +1 -0
- package/dist/core/change-signature/types.d.ts +244 -0
- package/dist/core/change-signature/types.d.ts.map +1 -0
- package/dist/core/change-signature/types.js +73 -0
- package/dist/core/change-signature/types.js.map +1 -0
- package/dist/core/dependency/cycle-detector.d.ts +1 -1
- package/dist/core/dependency/cycle-detector.d.ts.map +1 -1
- package/dist/core/dependency/cycle-detector.js +1 -1
- package/dist/core/dependency/cycle-detector.js.map +1 -1
- package/dist/core/dependency/dependency-analyzer.d.ts +3 -1
- package/dist/core/dependency/dependency-analyzer.d.ts.map +1 -1
- package/dist/core/dependency/dependency-analyzer.js +25 -24
- package/dist/core/dependency/dependency-analyzer.js.map +1 -1
- package/dist/core/dependency/types.d.ts.map +1 -1
- package/dist/core/indexing/file-index.d.ts.map +1 -1
- package/dist/core/indexing/file-index.js +1 -1
- package/dist/core/indexing/file-index.js.map +1 -1
- package/dist/core/indexing/index-engine.d.ts +3 -1
- package/dist/core/indexing/index-engine.d.ts.map +1 -1
- package/dist/core/indexing/index-engine.js +25 -17
- package/dist/core/indexing/index-engine.js.map +1 -1
- package/dist/core/indexing/index.d.ts +1 -9
- package/dist/core/indexing/index.d.ts.map +1 -1
- package/dist/core/indexing/index.js +2 -12
- package/dist/core/indexing/index.js.map +1 -1
- package/dist/core/indexing/symbol-index.d.ts.map +1 -1
- package/dist/core/indexing/types.d.ts +12 -0
- package/dist/core/indexing/types.d.ts.map +1 -1
- package/dist/core/indexing/types.js +12 -0
- package/dist/core/indexing/types.js.map +1 -1
- package/dist/core/move-file/import-resolver.d.ts.map +1 -0
- package/dist/core/{move → move-file}/import-resolver.js +9 -10
- package/dist/core/move-file/import-resolver.js.map +1 -0
- package/dist/core/{move → move-file}/index.d.ts +2 -2
- package/dist/core/move-file/index.d.ts.map +1 -0
- package/dist/core/{move → move-file}/index.js +2 -2
- package/dist/core/move-file/index.js.map +1 -0
- package/dist/core/{move → move-file}/move-service.d.ts +3 -1
- package/dist/core/move-file/move-service.d.ts.map +1 -0
- package/dist/core/{move → move-file}/move-service.js +66 -84
- package/dist/core/move-file/move-service.js.map +1 -0
- package/dist/core/move-file/types.d.ts.map +1 -0
- package/dist/core/move-file/types.js.map +1 -0
- package/dist/core/move-member/index.d.ts +10 -0
- package/dist/core/move-member/index.d.ts.map +1 -0
- package/dist/core/move-member/index.js +12 -0
- package/dist/core/move-member/index.js.map +1 -0
- package/dist/core/move-member/member-extractor.d.ts +96 -0
- package/dist/core/move-member/member-extractor.d.ts.map +1 -0
- package/dist/core/move-member/member-extractor.js +439 -0
- package/dist/core/move-member/member-extractor.js.map +1 -0
- package/dist/core/move-member/move-member-service.d.ts +87 -0
- package/dist/core/move-member/move-member-service.d.ts.map +1 -0
- package/dist/core/move-member/move-member-service.js +412 -0
- package/dist/core/move-member/move-member-service.js.map +1 -0
- package/dist/core/move-member/types.d.ts +182 -0
- package/dist/core/move-member/types.d.ts.map +1 -0
- package/dist/core/move-member/types.js +75 -0
- package/dist/core/move-member/types.js.map +1 -0
- package/dist/core/rename/index.d.ts +3 -3
- package/dist/core/rename/index.d.ts.map +1 -1
- package/dist/core/rename/index.js +5 -3
- package/dist/core/rename/index.js.map +1 -1
- package/dist/core/rename/reference-updater.d.ts +3 -1
- package/dist/core/rename/reference-updater.d.ts.map +1 -1
- package/dist/core/rename/reference-updater.js +9 -6
- package/dist/core/rename/reference-updater.js.map +1 -1
- package/dist/core/rename/rename-engine.d.ts +3 -1
- package/dist/core/rename/rename-engine.d.ts.map +1 -1
- package/dist/core/rename/rename-engine.js +8 -5
- package/dist/core/rename/rename-engine.js.map +1 -1
- package/dist/core/rename/scope-analyzer.d.ts.map +1 -1
- package/dist/core/rename/scope-analyzer.js.map +1 -1
- package/dist/core/rename/types.d.ts.map +1 -1
- package/dist/core/shared/call-hierarchy-analyzer.d.ts +102 -0
- package/dist/core/shared/call-hierarchy-analyzer.d.ts.map +1 -0
- package/dist/core/shared/call-hierarchy-analyzer.js +328 -0
- package/dist/core/shared/call-hierarchy-analyzer.js.map +1 -0
- package/dist/core/shared/index.d.ts +7 -0
- package/dist/core/shared/index.d.ts.map +1 -0
- package/dist/core/shared/index.js +7 -0
- package/dist/core/shared/index.js.map +1 -0
- package/dist/core/shared/symbol-finder.d.ts +154 -0
- package/dist/core/shared/symbol-finder.d.ts.map +1 -0
- package/dist/core/shared/symbol-finder.js +433 -0
- package/dist/core/shared/symbol-finder.js.map +1 -0
- package/dist/core/snapshot/index.d.ts +3 -19
- package/dist/core/snapshot/index.d.ts.map +1 -1
- package/dist/core/snapshot/index.js +2 -23
- package/dist/core/snapshot/index.js.map +1 -1
- package/dist/core/snapshot/snapshot-generator.d.ts +66 -0
- package/dist/core/snapshot/snapshot-generator.d.ts.map +1 -0
- package/dist/core/snapshot/snapshot-generator.js +258 -0
- package/dist/core/snapshot/snapshot-generator.js.map +1 -0
- package/dist/core/snapshot/types.d.ts +41 -190
- package/dist/core/snapshot/types.d.ts.map +1 -1
- package/dist/core/snapshot/types.js +13 -67
- package/dist/core/snapshot/types.js.map +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -1
- package/dist/infrastructure/cache/cache-manager.js +1 -1
- package/dist/infrastructure/cache/cache-manager.js.map +1 -1
- package/dist/infrastructure/cache/memory-cache.js +1 -1
- package/dist/infrastructure/cache/memory-cache.js.map +1 -1
- package/dist/infrastructure/cache/strategies.d.ts +1 -1
- package/dist/infrastructure/cache/strategies.d.ts.map +1 -1
- package/dist/infrastructure/cache/strategies.js +1 -1
- package/dist/infrastructure/cache/strategies.js.map +1 -1
- package/dist/infrastructure/formatters/diff-generator.d.ts +11 -0
- package/dist/infrastructure/formatters/diff-generator.d.ts.map +1 -0
- package/dist/infrastructure/formatters/diff-generator.js +227 -0
- package/dist/infrastructure/formatters/diff-generator.js.map +1 -0
- package/dist/infrastructure/formatters/index.d.ts +11 -0
- package/dist/infrastructure/formatters/index.d.ts.map +1 -0
- package/dist/infrastructure/formatters/index.js +13 -0
- package/dist/infrastructure/formatters/index.js.map +1 -0
- package/dist/infrastructure/formatters/preview-converter.d.ts +85 -0
- package/dist/infrastructure/formatters/preview-converter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/preview-converter.js +209 -0
- package/dist/infrastructure/formatters/preview-converter.js.map +1 -0
- package/dist/infrastructure/formatters/preview-formatter.d.ts +61 -0
- package/dist/infrastructure/formatters/preview-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/preview-formatter.js +208 -0
- package/dist/infrastructure/formatters/preview-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/query-formatter.d.ts +83 -0
- package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/query-formatter.js +349 -0
- package/dist/infrastructure/formatters/query-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/query-types.d.ts +238 -0
- package/dist/infrastructure/formatters/query-types.d.ts.map +1 -0
- package/dist/infrastructure/formatters/query-types.js +29 -0
- package/dist/infrastructure/formatters/query-types.js.map +1 -0
- package/dist/infrastructure/formatters/types.d.ts +163 -0
- package/dist/infrastructure/formatters/types.d.ts.map +1 -0
- package/dist/infrastructure/formatters/types.js +27 -0
- package/dist/infrastructure/formatters/types.js.map +1 -0
- package/dist/infrastructure/parser/base.d.ts +1 -33
- package/dist/infrastructure/parser/base.d.ts.map +1 -1
- package/dist/infrastructure/parser/base.js +1 -65
- package/dist/infrastructure/parser/base.js.map +1 -1
- package/dist/infrastructure/parser/index.d.ts +0 -2
- package/dist/infrastructure/parser/index.d.ts.map +1 -1
- package/dist/infrastructure/parser/index.js +1 -2
- package/dist/infrastructure/parser/index.js.map +1 -1
- package/dist/infrastructure/parser/interface.d.ts +2 -59
- package/dist/infrastructure/parser/interface.d.ts.map +1 -1
- package/dist/infrastructure/parser/interface.js +1 -11
- package/dist/infrastructure/parser/interface.js.map +1 -1
- package/dist/infrastructure/parser/registry.d.ts +1 -1
- package/dist/infrastructure/parser/registry.d.ts.map +1 -1
- package/dist/infrastructure/parser/registry.js +1 -1
- package/dist/infrastructure/parser/registry.js.map +1 -1
- package/dist/infrastructure/parser/types.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.d.ts +2 -1
- package/dist/infrastructure/storage/file-system.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.interface.d.ts +69 -0
- package/dist/infrastructure/storage/file-system.interface.d.ts.map +1 -0
- package/dist/infrastructure/storage/file-system.interface.js +6 -0
- package/dist/infrastructure/storage/file-system.interface.js.map +1 -0
- package/dist/infrastructure/storage/file-system.js.map +1 -1
- package/dist/infrastructure/storage/index.d.ts +2 -4
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/infrastructure/storage/index.js +1 -8
- package/dist/infrastructure/storage/index.js.map +1 -1
- package/dist/infrastructure/storage/mem-file-system.d.ts +44 -0
- package/dist/infrastructure/storage/mem-file-system.d.ts.map +1 -0
- package/dist/infrastructure/storage/mem-file-system.js +105 -0
- package/dist/infrastructure/storage/mem-file-system.js.map +1 -0
- package/dist/interfaces/cli/cli.d.ts +13 -94
- package/dist/interfaces/cli/cli.d.ts.map +1 -1
- package/dist/interfaces/cli/cli.js +47 -2450
- package/dist/interfaces/cli/cli.js.map +1 -1
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.js +161 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.js.map +1 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/change-signature.command.js +290 -0
- package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -0
- package/dist/interfaces/cli/commands/cycles.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/cycles.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/cycles.command.js +87 -0
- package/dist/interfaces/cli/commands/cycles.command.js.map +1 -0
- package/dist/interfaces/cli/commands/find-references.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/find-references.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/find-references.command.js +122 -0
- package/dist/interfaces/cli/commands/find-references.command.js.map +1 -0
- package/dist/interfaces/cli/commands/impact.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/impact.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/impact.command.js +98 -0
- package/dist/interfaces/cli/commands/impact.command.js.map +1 -0
- package/dist/interfaces/cli/commands/index.d.ts +14 -0
- package/dist/interfaces/cli/commands/index.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/index.js +15 -0
- package/dist/interfaces/cli/commands/index.js.map +1 -0
- package/dist/interfaces/cli/commands/move-member.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/move-member.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move-member.command.js +185 -0
- package/dist/interfaces/cli/commands/move-member.command.js.map +1 -0
- package/dist/interfaces/cli/commands/move.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/move.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move.command.js +212 -0
- package/dist/interfaces/cli/commands/move.command.js.map +1 -0
- package/dist/interfaces/cli/commands/rename.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/rename.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/rename.command.js +258 -0
- package/dist/interfaces/cli/commands/rename.command.js.map +1 -0
- package/dist/interfaces/cli/commands/snapshot.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/snapshot.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/snapshot.command.js +68 -0
- package/dist/interfaces/cli/commands/snapshot.command.js.map +1 -0
- package/dist/interfaces/cli/commands/types.d.ts +18 -0
- package/dist/interfaces/cli/commands/types.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/types.js +5 -0
- package/dist/interfaces/cli/commands/types.js.map +1 -0
- package/dist/interfaces/cli/index.d.ts +1 -1
- package/dist/interfaces/cli/index.d.ts.map +1 -1
- package/dist/interfaces/cli/index.js +1 -1
- package/dist/interfaces/cli/index.js.map +1 -1
- package/dist/interfaces/cli/preview-output-handler.d.ts +53 -0
- package/dist/interfaces/cli/preview-output-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/preview-output-handler.js +73 -0
- package/dist/interfaces/cli/preview-output-handler.js.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts +79 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.js +149 -0
- package/dist/interfaces/cli/unified-output-handler.js.map +1 -0
- package/dist/plugins/javascript/index.d.ts +2 -2
- package/dist/plugins/javascript/index.d.ts.map +1 -1
- package/dist/plugins/javascript/index.js +1 -1
- package/dist/plugins/javascript/index.js.map +1 -1
- package/dist/plugins/javascript/types.d.ts.map +1 -1
- package/dist/plugins/javascript/types.js.map +1 -1
- package/dist/plugins/python/dependency-analyzer.d.ts +86 -0
- package/dist/plugins/python/dependency-analyzer.d.ts.map +1 -0
- package/dist/plugins/python/dependency-analyzer.js +252 -0
- package/dist/plugins/python/dependency-analyzer.js.map +1 -0
- package/dist/plugins/python/index.d.ts +9 -0
- package/dist/plugins/python/index.d.ts.map +1 -0
- package/dist/plugins/python/index.js +14 -0
- package/dist/plugins/python/index.js.map +1 -0
- package/dist/plugins/python/parser.d.ts +117 -0
- package/dist/plugins/python/parser.d.ts.map +1 -0
- package/dist/plugins/python/parser.js +414 -0
- package/dist/plugins/python/parser.js.map +1 -0
- package/dist/plugins/python/symbol-extractor.d.ts +108 -0
- package/dist/plugins/python/symbol-extractor.d.ts.map +1 -0
- package/dist/plugins/python/symbol-extractor.js +389 -0
- package/dist/plugins/python/symbol-extractor.js.map +1 -0
- package/dist/plugins/python/tree-sitter-bridge.d.ts +57 -0
- package/dist/plugins/python/tree-sitter-bridge.d.ts.map +1 -0
- package/dist/plugins/python/tree-sitter-bridge.js +267 -0
- package/dist/plugins/python/tree-sitter-bridge.js.map +1 -0
- package/dist/plugins/python/types.d.ts +179 -0
- package/dist/plugins/python/types.d.ts.map +1 -0
- package/dist/plugins/python/types.js +252 -0
- package/dist/plugins/python/types.js.map +1 -0
- package/dist/plugins/swift/dependency-analyzer.d.ts +1 -1
- package/dist/plugins/swift/dependency-analyzer.d.ts.map +1 -1
- package/dist/plugins/swift/dependency-analyzer.js +1 -1
- package/dist/plugins/swift/dependency-analyzer.js.map +1 -1
- package/dist/plugins/swift/parser.d.ts +4 -0
- package/dist/plugins/swift/parser.d.ts.map +1 -1
- package/dist/plugins/swift/parser.js +24 -6
- package/dist/plugins/swift/parser.js.map +1 -1
- package/dist/plugins/swift/symbol-extractor.d.ts +1 -1
- package/dist/plugins/swift/symbol-extractor.d.ts.map +1 -1
- package/dist/plugins/swift/symbol-extractor.js.map +1 -1
- package/dist/plugins/swift/types.d.ts.map +1 -1
- package/dist/plugins/swift/types.js.map +1 -1
- package/dist/plugins/typescript/parser.d.ts +4 -37
- package/dist/plugins/typescript/parser.d.ts.map +1 -1
- package/dist/plugins/typescript/parser.js +29 -331
- package/dist/plugins/typescript/parser.js.map +1 -1
- package/dist/plugins/typescript/symbol-extractor.d.ts.map +1 -1
- package/dist/plugins/typescript/symbol-extractor.js +12 -0
- package/dist/plugins/typescript/symbol-extractor.js.map +1 -1
- package/dist/plugins/typescript/types.d.ts.map +1 -1
- package/dist/plugins/typescript/types.js +10 -0
- package/dist/plugins/typescript/types.js.map +1 -1
- package/dist/shared/errors/config-error.d.ts +1 -1
- package/dist/shared/errors/config-error.d.ts.map +1 -1
- package/dist/shared/errors/config-error.js +1 -1
- package/dist/shared/errors/config-error.js.map +1 -1
- package/dist/shared/errors/file-error.d.ts +1 -1
- package/dist/shared/errors/file-error.d.ts.map +1 -1
- package/dist/shared/errors/file-error.js +1 -1
- package/dist/shared/errors/file-error.js.map +1 -1
- package/dist/shared/errors/index.d.ts +1 -1
- package/dist/shared/errors/index.d.ts.map +1 -1
- package/dist/shared/errors/index.js +4 -4
- package/dist/shared/errors/index.js.map +1 -1
- package/dist/shared/errors/parser-error.d.ts +1 -1
- package/dist/shared/errors/parser-error.d.ts.map +1 -1
- package/dist/shared/errors/parser-error.js +1 -1
- package/dist/shared/errors/parser-error.js.map +1 -1
- package/dist/shared/errors/validation-error.d.ts +1 -1
- package/dist/shared/errors/validation-error.d.ts.map +1 -1
- package/dist/shared/errors/validation-error.js +1 -1
- package/dist/shared/errors/validation-error.js.map +1 -1
- package/dist/shared/types/ast.d.ts +1 -1
- package/dist/shared/types/ast.d.ts.map +1 -1
- package/dist/shared/types/ast.js +1 -1
- package/dist/shared/types/ast.js.map +1 -1
- package/dist/shared/types/symbol.d.ts +3 -2
- package/dist/shared/types/symbol.d.ts.map +1 -1
- package/dist/shared/types/symbol.js +1 -0
- package/dist/shared/types/symbol.js.map +1 -1
- package/dist/shared/utils/index.d.ts +5 -5
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +5 -5
- package/dist/shared/utils/index.js.map +1 -1
- package/package.json +9 -8
- package/dist/core/analysis/index.d.ts +0 -6
- package/dist/core/analysis/index.d.ts.map +0 -1
- package/dist/core/analysis/index.js +0 -7
- package/dist/core/analysis/index.js.map +0 -1
- package/dist/core/analysis/quality-metrics.d.ts +0 -158
- package/dist/core/analysis/quality-metrics.d.ts.map +0 -1
- package/dist/core/analysis/quality-metrics.js +0 -442
- package/dist/core/analysis/quality-metrics.js.map +0 -1
- package/dist/core/indexing/file-watcher.d.ts +0 -110
- package/dist/core/indexing/file-watcher.d.ts.map +0 -1
- package/dist/core/indexing/file-watcher.js +0 -280
- package/dist/core/indexing/file-watcher.js.map +0 -1
- package/dist/core/move/import-resolver.d.ts.map +0 -1
- package/dist/core/move/import-resolver.js.map +0 -1
- package/dist/core/move/index.d.ts.map +0 -1
- package/dist/core/move/index.js.map +0 -1
- package/dist/core/move/move-service.d.ts.map +0 -1
- package/dist/core/move/move-service.js.map +0 -1
- package/dist/core/move/types.d.ts.map +0 -1
- package/dist/core/move/types.js.map +0 -1
- package/dist/core/refactor/design-patterns.d.ts +0 -178
- package/dist/core/refactor/design-patterns.d.ts.map +0 -1
- package/dist/core/refactor/design-patterns.js +0 -656
- package/dist/core/refactor/design-patterns.js.map +0 -1
- package/dist/core/refactor/extract-function.d.ts +0 -197
- package/dist/core/refactor/extract-function.d.ts.map +0 -1
- package/dist/core/refactor/extract-function.js +0 -730
- package/dist/core/refactor/extract-function.js.map +0 -1
- package/dist/core/refactor/index.d.ts +0 -8
- package/dist/core/refactor/index.d.ts.map +0 -1
- package/dist/core/refactor/index.js +0 -11
- package/dist/core/refactor/index.js.map +0 -1
- package/dist/core/refactor/inline-function.d.ts +0 -175
- package/dist/core/refactor/inline-function.d.ts.map +0 -1
- package/dist/core/refactor/inline-function.js +0 -425
- package/dist/core/refactor/inline-function.js.map +0 -1
- package/dist/core/refactor/swift-extractor.d.ts +0 -98
- package/dist/core/refactor/swift-extractor.d.ts.map +0 -1
- package/dist/core/refactor/swift-extractor.js +0 -283
- package/dist/core/refactor/swift-extractor.js.map +0 -1
- package/dist/core/search/engines/text-engine.d.ts +0 -52
- package/dist/core/search/engines/text-engine.d.ts.map +0 -1
- package/dist/core/search/engines/text-engine.js +0 -376
- package/dist/core/search/engines/text-engine.js.map +0 -1
- package/dist/core/search/index.d.ts +0 -10
- package/dist/core/search/index.d.ts.map +0 -1
- package/dist/core/search/index.js +0 -11
- package/dist/core/search/index.js.map +0 -1
- package/dist/core/search/service.d.ts +0 -105
- package/dist/core/search/service.d.ts.map +0 -1
- package/dist/core/search/service.js +0 -384
- package/dist/core/search/service.js.map +0 -1
- package/dist/core/search/types.d.ts +0 -357
- package/dist/core/search/types.d.ts.map +0 -1
- package/dist/core/search/types.js +0 -47
- package/dist/core/search/types.js.map +0 -1
- package/dist/core/shit-score/grading.d.ts +0 -39
- package/dist/core/shit-score/grading.d.ts.map +0 -1
- package/dist/core/shit-score/grading.js +0 -253
- package/dist/core/shit-score/grading.js.map +0 -1
- package/dist/core/shit-score/index.d.ts +0 -9
- package/dist/core/shit-score/index.d.ts.map +0 -1
- package/dist/core/shit-score/index.js +0 -8
- package/dist/core/shit-score/index.js.map +0 -1
- package/dist/core/shit-score/score-calculator.d.ts +0 -75
- package/dist/core/shit-score/score-calculator.d.ts.map +0 -1
- package/dist/core/shit-score/score-calculator.js +0 -240
- package/dist/core/shit-score/score-calculator.js.map +0 -1
- package/dist/core/shit-score/shit-score-analyzer.d.ts +0 -84
- package/dist/core/shit-score/shit-score-analyzer.d.ts.map +0 -1
- package/dist/core/shit-score/shit-score-analyzer.js +0 -595
- package/dist/core/shit-score/shit-score-analyzer.js.map +0 -1
- package/dist/core/shit-score/types.d.ts +0 -231
- package/dist/core/shit-score/types.d.ts.map +0 -1
- package/dist/core/shit-score/types.js +0 -73
- package/dist/core/shit-score/types.js.map +0 -1
- package/dist/core/snapshot/code-compressor.d.ts +0 -39
- package/dist/core/snapshot/code-compressor.d.ts.map +0 -1
- package/dist/core/snapshot/code-compressor.js +0 -211
- package/dist/core/snapshot/code-compressor.js.map +0 -1
- package/dist/core/snapshot/config.d.ts +0 -60
- package/dist/core/snapshot/config.d.ts.map +0 -1
- package/dist/core/snapshot/config.js +0 -136
- package/dist/core/snapshot/config.js.map +0 -1
- package/dist/core/snapshot/snapshot-differ.d.ts +0 -54
- package/dist/core/snapshot/snapshot-differ.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-differ.js +0 -262
- package/dist/core/snapshot/snapshot-differ.js.map +0 -1
- package/dist/core/snapshot/snapshot-engine.d.ts +0 -94
- package/dist/core/snapshot/snapshot-engine.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-engine.js +0 -492
- package/dist/core/snapshot/snapshot-engine.js.map +0 -1
- package/dist/infrastructure/parser/factory.d.ts +0 -141
- package/dist/infrastructure/parser/factory.d.ts.map +0 -1
- package/dist/infrastructure/parser/factory.js +0 -306
- package/dist/infrastructure/parser/factory.js.map +0 -1
- package/dist/infrastructure/storage/file-watcher.d.ts +0 -84
- package/dist/infrastructure/storage/file-watcher.d.ts.map +0 -1
- package/dist/infrastructure/storage/file-watcher.js +0 -249
- package/dist/infrastructure/storage/file-watcher.js.map +0 -1
- package/dist/infrastructure/storage/path-utils.d.ts +0 -96
- package/dist/infrastructure/storage/path-utils.d.ts.map +0 -1
- package/dist/infrastructure/storage/path-utils.js +0 -272
- package/dist/infrastructure/storage/path-utils.js.map +0 -1
- package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts +0 -41
- package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/complexity-analyzer.js +0 -206
- package/dist/plugins/swift/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/plugins/swift/analyzers/duplication-detector.d.ts +0 -89
- package/dist/plugins/swift/analyzers/duplication-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/duplication-detector.js +0 -271
- package/dist/plugins/swift/analyzers/duplication-detector.js.map +0 -1
- package/dist/plugins/swift/analyzers/error-handling-checker.d.ts +0 -34
- package/dist/plugins/swift/analyzers/error-handling-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/error-handling-checker.js +0 -135
- package/dist/plugins/swift/analyzers/error-handling-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/naming-checker.d.ts +0 -47
- package/dist/plugins/swift/analyzers/naming-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/naming-checker.js +0 -161
- package/dist/plugins/swift/analyzers/naming-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/pattern-detector.d.ts +0 -78
- package/dist/plugins/swift/analyzers/pattern-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/pattern-detector.js +0 -247
- package/dist/plugins/swift/analyzers/pattern-detector.js.map +0 -1
- package/dist/plugins/swift/analyzers/security-checker.d.ts +0 -38
- package/dist/plugins/swift/analyzers/security-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/security-checker.js +0 -135
- package/dist/plugins/swift/analyzers/security-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts +0 -26
- package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/test-coverage-checker.js +0 -63
- package/dist/plugins/swift/analyzers/test-coverage-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/type-safety-checker.d.ts +0 -41
- package/dist/plugins/swift/analyzers/type-safety-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/type-safety-checker.js +0 -121
- package/dist/plugins/swift/analyzers/type-safety-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts +0 -38
- package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/unused-symbol-detector.js +0 -211
- package/dist/plugins/swift/analyzers/unused-symbol-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts +0 -39
- package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/complexity-analyzer.js +0 -196
- package/dist/plugins/typescript/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/plugins/typescript/analyzers/duplication-detector.d.ts +0 -181
- package/dist/plugins/typescript/analyzers/duplication-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/duplication-detector.js +0 -695
- package/dist/plugins/typescript/analyzers/duplication-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts +0 -26
- package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/error-handling-checker.js +0 -84
- package/dist/plugins/typescript/analyzers/error-handling-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/naming-checker.d.ts +0 -30
- package/dist/plugins/typescript/analyzers/naming-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/naming-checker.js +0 -116
- package/dist/plugins/typescript/analyzers/naming-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/pattern-detector.d.ts +0 -80
- package/dist/plugins/typescript/analyzers/pattern-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/pattern-detector.js +0 -267
- package/dist/plugins/typescript/analyzers/pattern-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/security-checker.d.ts +0 -34
- package/dist/plugins/typescript/analyzers/security-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/security-checker.js +0 -126
- package/dist/plugins/typescript/analyzers/security-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts +0 -22
- package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/test-coverage-checker.js +0 -62
- package/dist/plugins/typescript/analyzers/test-coverage-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts +0 -32
- package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/type-safety-checker.js +0 -86
- package/dist/plugins/typescript/analyzers/type-safety-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts +0 -47
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.js +0 -152
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.js.map +0 -1
- /package/dist/core/{move → move-file}/import-resolver.d.ts +0 -0
- /package/dist/core/{move → move-file}/types.d.ts +0 -0
- /package/dist/core/{move → move-file}/types.js +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Impact 命令
|
|
3
|
+
* 影響分析(從 deps impact 攤平而來)
|
|
4
|
+
*/
|
|
5
|
+
import { DependencyAnalyzer } from '../../../core/dependency/dependency-analyzer.js';
|
|
6
|
+
import { DependencyGraph } from '../../../core/dependency/dependency-graph.js';
|
|
7
|
+
import { CycleDetector } from '../../../core/dependency/cycle-detector.js';
|
|
8
|
+
import { QueryCommand } from '../../../infrastructure/formatters/index.js';
|
|
9
|
+
import { createUnifiedOutputHandler, parseOutputFormat, OutputFormat } from '../../cli/unified-output-handler.js';
|
|
10
|
+
/**
|
|
11
|
+
* 設定 impact 命令
|
|
12
|
+
*/
|
|
13
|
+
export function setupImpactCommand(program, context) {
|
|
14
|
+
program
|
|
15
|
+
.command('impact')
|
|
16
|
+
.description('分析檔案影響範圍')
|
|
17
|
+
.requiredOption('-f, --file <file>', '要分析的檔案')
|
|
18
|
+
.option('-p, --path <path>', '專案路徑', '.')
|
|
19
|
+
.option('--format <format>', '輸出格式 (json|summary)', 'summary')
|
|
20
|
+
.action(async (options) => {
|
|
21
|
+
await handleImpactCommand(options, context);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 處理 impact 命令
|
|
26
|
+
*/
|
|
27
|
+
async function handleImpactCommand(options, context) {
|
|
28
|
+
const outputHandler = createUnifiedOutputHandler();
|
|
29
|
+
let format;
|
|
30
|
+
try {
|
|
31
|
+
format = parseOutputFormat(options.format, false);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
outputHandler.outputError('不支援的輸出格式。可用格式: json, summary', OutputFormat.Summary);
|
|
35
|
+
process.exitCode = 1;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (format !== OutputFormat.Json) {
|
|
39
|
+
console.log('💥 影響分析...');
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const analyzePath = options.path || process.cwd();
|
|
43
|
+
const targetFile = options.file;
|
|
44
|
+
// 初始化依賴分析器
|
|
45
|
+
const dependencyAnalyzer = new DependencyAnalyzer(context.fileSystem);
|
|
46
|
+
// 分析專案依賴
|
|
47
|
+
const projectDeps = await dependencyAnalyzer.analyzeProject(analyzePath);
|
|
48
|
+
// 獲取統計資訊
|
|
49
|
+
const stats = dependencyAnalyzer.getStats();
|
|
50
|
+
// 建立依賴圖
|
|
51
|
+
const graph = new DependencyGraph();
|
|
52
|
+
for (const fileDep of projectDeps.fileDependencies) {
|
|
53
|
+
graph.addNode(fileDep.filePath);
|
|
54
|
+
for (const dep of fileDep.dependencies) {
|
|
55
|
+
graph.addDependency(fileDep.filePath, dep.path);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// 使用 CycleDetector 檢測循環依賴
|
|
59
|
+
const cycleDetector = new CycleDetector();
|
|
60
|
+
const cycles = cycleDetector.detectCycles(graph);
|
|
61
|
+
// 轉換 cycles 為 CycleInfo
|
|
62
|
+
const cycleInfos = cycles.map(c => ({
|
|
63
|
+
cycle: [...c.cycle],
|
|
64
|
+
length: c.length
|
|
65
|
+
}));
|
|
66
|
+
// 取得影響分析資訊
|
|
67
|
+
const dependents = graph.getDependents(targetFile);
|
|
68
|
+
const dependencies = graph.getDependencies(targetFile);
|
|
69
|
+
const result = {
|
|
70
|
+
command: QueryCommand.Deps,
|
|
71
|
+
success: true,
|
|
72
|
+
cycles: cycleInfos,
|
|
73
|
+
summary: {
|
|
74
|
+
totalScanned: stats.totalFiles,
|
|
75
|
+
issuesFound: cycles.length,
|
|
76
|
+
totalFiles: stats.totalFiles,
|
|
77
|
+
totalDependencies: stats.totalDependencies,
|
|
78
|
+
cyclesFound: cycles.length
|
|
79
|
+
},
|
|
80
|
+
impact: {
|
|
81
|
+
targetFile,
|
|
82
|
+
dependents,
|
|
83
|
+
dependencies,
|
|
84
|
+
totalAffected: dependents.length
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
outputHandler.outputQuery(result, format);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
91
|
+
outputHandler.outputError(`依賴分析失敗: ${errorMessage}`, format);
|
|
92
|
+
process.exitCode = 1;
|
|
93
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=impact.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/impact.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAmC,MAAM,qCAAqC,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAUxH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,OAAuB;IAC1E,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,UAAU,CAAC;SACvB,cAAc,CAAC,mBAAmB,EAAE,QAAQ,CAAC;SAC7C,MAAM,CAAC,mBAAmB,EAAE,MAAM,EAAE,GAAG,CAAC;SACxC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EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,aAAa,CAAC,WAAW,CAAC,WAAW,YAAY,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI 命令模組導出
|
|
3
|
+
*/
|
|
4
|
+
export type { CommandContext, CommandSetup } from './types.js';
|
|
5
|
+
export { setupMoveCommand } from './move.command.js';
|
|
6
|
+
export { setupMoveMemberCommand } from './move-member.command.js';
|
|
7
|
+
export { setupRenameCommand } from './rename.command.js';
|
|
8
|
+
export { setupChangeSignatureCommand } from './change-signature.command.js';
|
|
9
|
+
export { setupCyclesCommand } from './cycles.command.js';
|
|
10
|
+
export { setupImpactCommand } from './impact.command.js';
|
|
11
|
+
export { setupSnapshotCommand } from './snapshot.command.js';
|
|
12
|
+
export { setupFindReferencesCommand } from './find-references.command.js';
|
|
13
|
+
export { setupCallHierarchyCommand } from './call-hierarchy.command.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAG5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI 命令模組導出
|
|
3
|
+
*/
|
|
4
|
+
// Transform 命令
|
|
5
|
+
export { setupMoveCommand } from './move.command.js';
|
|
6
|
+
export { setupMoveMemberCommand } from './move-member.command.js';
|
|
7
|
+
export { setupRenameCommand } from './rename.command.js';
|
|
8
|
+
export { setupChangeSignatureCommand } from './change-signature.command.js';
|
|
9
|
+
// Query 命令
|
|
10
|
+
export { setupCyclesCommand } from './cycles.command.js';
|
|
11
|
+
export { setupImpactCommand } from './impact.command.js';
|
|
12
|
+
export { setupSnapshotCommand } from './snapshot.command.js';
|
|
13
|
+
export { setupFindReferencesCommand } from './find-references.command.js';
|
|
14
|
+
export { setupCallHierarchyCommand } from './call-hierarchy.command.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAe;AACf,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,WAAW;AACX,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move Member 命令
|
|
3
|
+
* 移動程式碼成員(方法、函式、類別等)到新位置
|
|
4
|
+
*/
|
|
5
|
+
import type { Command } from 'commander';
|
|
6
|
+
import type { CommandContext } from '../../cli/commands/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* 設定 move-member 命令
|
|
9
|
+
*/
|
|
10
|
+
export declare function setupMoveMemberCommand(program: Command, context: CommandContext): void;
|
|
11
|
+
//# sourceMappingURL=move-member.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-member.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/move-member.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAgBxE;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAkBtF"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move Member 命令
|
|
3
|
+
* 移動程式碼成員(方法、函式、類別等)到新位置
|
|
4
|
+
*/
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { MoveMemberService, MoveTargetType, MemberType } from '../../../core/move-member/index.js';
|
|
7
|
+
import { ParserRegistry } from '../../../infrastructure/parser/registry.js';
|
|
8
|
+
import { createUnifiedOutputHandler, parseOutputFormat, OutputFormat } from '../../cli/unified-output-handler.js';
|
|
9
|
+
/**
|
|
10
|
+
* 設定 move-member 命令
|
|
11
|
+
*/
|
|
12
|
+
export function setupMoveMemberCommand(program, context) {
|
|
13
|
+
program
|
|
14
|
+
.command('move-member <sourceFile> <memberName>')
|
|
15
|
+
.description('移動程式碼成員到新位置')
|
|
16
|
+
.option('-p, --path <path>', '專案根目錄路徑', process.cwd())
|
|
17
|
+
.option('-t, --type <type>', '成員類型 (method|property|function|class|interface|type|constant|enum)')
|
|
18
|
+
.option('-c, --class <name>', '來源類別名稱(若為類別成員)')
|
|
19
|
+
.option('--target-file <file>', '目標檔案路徑')
|
|
20
|
+
.option('--target-class <name>', '目標類別名稱(移動到類別內)')
|
|
21
|
+
.option('--new-file', '建立新檔案')
|
|
22
|
+
.option('--keep-reexport', '保留原位置的 re-export')
|
|
23
|
+
.option('--update-refs', '更新所有引用(預設為 true)', true)
|
|
24
|
+
.option('--no-update-refs', '不更新引用')
|
|
25
|
+
.option('--dry-run', '預覽變更而不執行')
|
|
26
|
+
.option('--format <format>', '輸出格式 (diff|json|summary)', 'diff')
|
|
27
|
+
.action(async (sourceFile, memberName, options) => {
|
|
28
|
+
await handleMoveMemberCommand(sourceFile, memberName, options, context);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 處理 move-member 命令
|
|
33
|
+
*/
|
|
34
|
+
async function handleMoveMemberCommand(sourceFile, memberName, options, context) {
|
|
35
|
+
const outputHandler = createUnifiedOutputHandler();
|
|
36
|
+
let format;
|
|
37
|
+
try {
|
|
38
|
+
format = parseOutputFormat(options.format, true);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
outputHandler.outputError('不支援的輸出格式。可用格式: json, summary, diff', OutputFormat.Summary);
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const isJsonFormat = format === OutputFormat.Json;
|
|
46
|
+
try {
|
|
47
|
+
// 驗證必要參數
|
|
48
|
+
if (!options.targetFile) {
|
|
49
|
+
outputHandler.outputError('必須指定目標檔案 (--target-file)', format);
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// 解析檔案路徑
|
|
54
|
+
const projectRoot = options.path || process.cwd();
|
|
55
|
+
const sourceFilePath = path.resolve(projectRoot, sourceFile);
|
|
56
|
+
const targetFilePath = path.resolve(projectRoot, options.targetFile);
|
|
57
|
+
// 解析成員類型
|
|
58
|
+
const memberType = options.type ? parseMemberType(options.type) : undefined;
|
|
59
|
+
// 決定目標類型
|
|
60
|
+
let targetType = MoveTargetType.ExistingFile;
|
|
61
|
+
if (options.newFile) {
|
|
62
|
+
targetType = MoveTargetType.NewFile;
|
|
63
|
+
}
|
|
64
|
+
else if (options.targetClass) {
|
|
65
|
+
targetType = MoveTargetType.ExistingClass;
|
|
66
|
+
}
|
|
67
|
+
if (!isJsonFormat) {
|
|
68
|
+
console.log(`📦 移動成員: ${memberName}`);
|
|
69
|
+
console.log(`📁 來源: ${path.relative(projectRoot, sourceFilePath)}`);
|
|
70
|
+
console.log(`📁 目標: ${path.relative(projectRoot, targetFilePath)}`);
|
|
71
|
+
}
|
|
72
|
+
// 取得 ParserRegistry(單例)
|
|
73
|
+
const parserRegistry = ParserRegistry.getInstance();
|
|
74
|
+
// 建立服務
|
|
75
|
+
const moveMemberService = new MoveMemberService(parserRegistry, context.fileSystem);
|
|
76
|
+
// 執行 Move Member
|
|
77
|
+
const result = await moveMemberService.moveMember({
|
|
78
|
+
sourceFile: sourceFilePath,
|
|
79
|
+
memberName,
|
|
80
|
+
memberType,
|
|
81
|
+
sourceClassName: options.class,
|
|
82
|
+
target: {
|
|
83
|
+
type: targetType,
|
|
84
|
+
filePath: targetFilePath,
|
|
85
|
+
className: options.targetClass
|
|
86
|
+
},
|
|
87
|
+
projectRoot,
|
|
88
|
+
preview: options.dryRun,
|
|
89
|
+
updateReferences: options.updateRefs,
|
|
90
|
+
keepReexport: options.keepReexport
|
|
91
|
+
});
|
|
92
|
+
if (result.success) {
|
|
93
|
+
if (isJsonFormat) {
|
|
94
|
+
console.log(JSON.stringify({
|
|
95
|
+
success: true,
|
|
96
|
+
member: {
|
|
97
|
+
name: result.member.name,
|
|
98
|
+
type: result.member.type,
|
|
99
|
+
className: result.member.className
|
|
100
|
+
},
|
|
101
|
+
sourceFileChange: {
|
|
102
|
+
filePath: result.sourceFileChange.filePath
|
|
103
|
+
},
|
|
104
|
+
targetFileChange: {
|
|
105
|
+
filePath: result.targetFileChange.filePath,
|
|
106
|
+
isNewFile: result.targetFileChange.isNewFile
|
|
107
|
+
},
|
|
108
|
+
referenceUpdates: result.referenceUpdates.length,
|
|
109
|
+
executed: result.executed,
|
|
110
|
+
stats: result.stats
|
|
111
|
+
}, null, 2));
|
|
112
|
+
}
|
|
113
|
+
else if (format === OutputFormat.Diff) {
|
|
114
|
+
printDiffOutput(result, projectRoot);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
printSummaryOutput(result, projectRoot);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
outputHandler.outputError(result.error || '未知錯誤', format);
|
|
122
|
+
process.exitCode = 1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
127
|
+
outputHandler.outputError(errorMsg, format);
|
|
128
|
+
process.exitCode = 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 解析成員類型
|
|
133
|
+
*/
|
|
134
|
+
function parseMemberType(typeStr) {
|
|
135
|
+
const typeMap = {
|
|
136
|
+
'method': MemberType.Method,
|
|
137
|
+
'property': MemberType.Property,
|
|
138
|
+
'function': MemberType.Function,
|
|
139
|
+
'class': MemberType.Class,
|
|
140
|
+
'interface': MemberType.Interface,
|
|
141
|
+
'type': MemberType.TypeAlias,
|
|
142
|
+
'constant': MemberType.Constant,
|
|
143
|
+
'enum': MemberType.Enum
|
|
144
|
+
};
|
|
145
|
+
return typeMap[typeStr.toLowerCase()];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 印出 diff 輸出
|
|
149
|
+
*/
|
|
150
|
+
function printDiffOutput(result, projectRoot) {
|
|
151
|
+
console.log('\n📝 來源檔案變更:');
|
|
152
|
+
console.log(`--- ${path.relative(projectRoot, result.sourceFileChange.filePath)}`);
|
|
153
|
+
console.log('(成員已移除)');
|
|
154
|
+
console.log('\n📝 目標檔案變更:');
|
|
155
|
+
console.log(`+++ ${path.relative(projectRoot, result.targetFileChange.filePath)}`);
|
|
156
|
+
if (result.targetFileChange.isNewFile) {
|
|
157
|
+
console.log('(新檔案)');
|
|
158
|
+
}
|
|
159
|
+
console.log('(成員已加入)');
|
|
160
|
+
if (result.referenceUpdates.length > 0) {
|
|
161
|
+
console.log(`\n📞 引用更新: ${result.referenceUpdates.length} 個`);
|
|
162
|
+
for (const update of result.referenceUpdates.slice(0, 5)) {
|
|
163
|
+
console.log(` - ${path.relative(projectRoot, update.filePath)}`);
|
|
164
|
+
}
|
|
165
|
+
if (result.referenceUpdates.length > 5) {
|
|
166
|
+
console.log(` ... 還有 ${result.referenceUpdates.length - 5} 個`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
console.log('\n' + (result.executed ? '✅ 變更已執行' : '🔍 預覽模式'));
|
|
170
|
+
console.log(`📊 統計: ${result.stats.referencesUpdated} 個引用, ${result.stats.filesAffected} 個檔案`);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 印出摘要輸出
|
|
174
|
+
*/
|
|
175
|
+
function printSummaryOutput(result, projectRoot) {
|
|
176
|
+
console.log('\n✅ 成員移動成功!');
|
|
177
|
+
console.log(`📦 成員: ${result.member.name} (${result.member.type})`);
|
|
178
|
+
console.log(`📁 從: ${path.relative(projectRoot, result.sourceFileChange.filePath)}`);
|
|
179
|
+
console.log(`📁 到: ${path.relative(projectRoot, result.targetFileChange.filePath)}`);
|
|
180
|
+
console.log(`📊 更新了 ${result.stats.referencesUpdated} 個引用,影響 ${result.stats.filesAffected} 個檔案`);
|
|
181
|
+
if (!result.executed) {
|
|
182
|
+
console.log('\n🔍 預覽模式 - 執行時移除 --dry-run');
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=move-member.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-member.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/move-member.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAiBxH;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,OAAuB;IAC9E,OAAO;SACJ,OAAO,CAAC,uCAAuC,CAAC;SAChD,WAAW,CAAC,aAAa,CAAC;SAC1B,MAAM,CAAC,mBAAmB,EAAE,SAAS,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;SACrD,MAAM,CAAC,mBAAmB,EAAE,oEAAoE,CAAC;SACjG,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;SAC9C,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC;SACxC,MAAM,CAAC,uBAAuB,EAAE,gBAAgB,CAAC;SACjD,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC;SAC7B,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;SAC7C,MAAM,CAAC,eAAe,E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AAG,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,KAAK,CAAC,iBAAiB,WAAW,MAAM,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,CAAC;IAEjG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move 命令
|
|
3
|
+
* 移動檔案或目錄並更新 import 路徑
|
|
4
|
+
*/
|
|
5
|
+
import type { Command } from 'commander';
|
|
6
|
+
import type { CommandContext } from '../../cli/commands/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* 設定 move 命令
|
|
9
|
+
*/
|
|
10
|
+
export declare function setupMoveCommand(program: Command, context: CommandContext): void;
|
|
11
|
+
//# sourceMappingURL=move.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/move.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAYxE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CA4BhF"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move 命令
|
|
3
|
+
* 移動檔案或目錄並更新 import 路徑
|
|
4
|
+
*/
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { MoveService } from '../../../core/move-file/move-service.js';
|
|
7
|
+
import { convertMovePreview } from '../../../infrastructure/formatters/index.js';
|
|
8
|
+
import { createUnifiedOutputHandler, parseOutputFormat, OutputFormat } from '../../cli/unified-output-handler.js';
|
|
9
|
+
/**
|
|
10
|
+
* 設定 move 命令
|
|
11
|
+
*/
|
|
12
|
+
export function setupMoveCommand(program, context) {
|
|
13
|
+
program
|
|
14
|
+
.command('move [source] [target]')
|
|
15
|
+
.description('移動檔案或目錄')
|
|
16
|
+
.option('-s, --source <path>', '來源路徑')
|
|
17
|
+
.option('-t, --target <path>', '目標路徑')
|
|
18
|
+
.option('-p, --path <path>', '專案根目錄路徑', process.cwd())
|
|
19
|
+
.option('--update-imports', '自動更新 import 路徑', true)
|
|
20
|
+
.option('--dry-run', '預覽變更而不執行')
|
|
21
|
+
.option('--format <format>', '輸出格式 (diff|json|summary)', 'diff')
|
|
22
|
+
.action(async (sourceArg, targetArg, options) => {
|
|
23
|
+
// 支援兩種語法:
|
|
24
|
+
// 1. move <source> <target> (位置參數)
|
|
25
|
+
// 2. move --source <source> --target <target> (選項參數)
|
|
26
|
+
const source = sourceArg || options.source;
|
|
27
|
+
const target = targetArg || options.target;
|
|
28
|
+
if (!source || !target) {
|
|
29
|
+
const outputHandler = createUnifiedOutputHandler();
|
|
30
|
+
const format = options.format === 'json' ? OutputFormat.Json : OutputFormat.Summary;
|
|
31
|
+
outputHandler.outputError('必須指定來源和目標路徑。使用方式: agent-ide move <source> <target> 或 --source <source> --target <target>', format);
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
await handleMoveCommand(source, target, options, context);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 處理 move 命令
|
|
43
|
+
*/
|
|
44
|
+
async function handleMoveCommand(source, target, options, context) {
|
|
45
|
+
const outputHandler = createUnifiedOutputHandler();
|
|
46
|
+
let format;
|
|
47
|
+
try {
|
|
48
|
+
format = parseOutputFormat(options.format, true);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
outputHandler.outputError('不支援的輸出格式。可用格式: json, summary, diff', OutputFormat.Summary);
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const isJsonFormat = format === OutputFormat.Json;
|
|
56
|
+
if (!isJsonFormat) {
|
|
57
|
+
console.log(` ${source} ${target}`);
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
// 檢查源檔案是否存在
|
|
61
|
+
const sourceExists = await context.fileSystem.exists(source);
|
|
62
|
+
if (!sourceExists) {
|
|
63
|
+
outputHandler.outputError(`源檔案找不到: ${source}`, format);
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// 檢查源和目標是否相同
|
|
71
|
+
const normalizedSource = path.resolve(source);
|
|
72
|
+
const normalizedTarget = path.resolve(target);
|
|
73
|
+
if (normalizedSource === normalizedTarget) {
|
|
74
|
+
// 源和目標相同時,視為 no-op,成功返回
|
|
75
|
+
if (isJsonFormat) {
|
|
76
|
+
console.log(JSON.stringify({ success: true, message: 'Source and target are identical. No changes made.', changes: [] }));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
console.log(' Source and target are identical. No changes made.');
|
|
80
|
+
}
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
// 讀取 tsconfig.json 路徑別名
|
|
84
|
+
const pathAliases = await loadPathAliases(options.path || process.cwd(), context);
|
|
85
|
+
// 建立移動服務
|
|
86
|
+
const moveService = new MoveService(context.fileSystem, {
|
|
87
|
+
pathAliases,
|
|
88
|
+
supportedExtensions: ['.ts', '.tsx', '.js', '.jsx', '.vue', '.swift'],
|
|
89
|
+
includeNodeModules: false
|
|
90
|
+
});
|
|
91
|
+
const moveOperation = {
|
|
92
|
+
source: normalizedSource,
|
|
93
|
+
target: normalizedTarget,
|
|
94
|
+
updateImports: options.updateImports
|
|
95
|
+
};
|
|
96
|
+
const moveOptions = {
|
|
97
|
+
preview: options.dryRun,
|
|
98
|
+
projectRoot: options.path || process.cwd()
|
|
99
|
+
};
|
|
100
|
+
// 執行移動操作
|
|
101
|
+
const result = await moveService.moveFile(moveOperation, moveOptions);
|
|
102
|
+
if (result.success) {
|
|
103
|
+
// Dry-run 模式:使用 PreviewFormatter 輸出
|
|
104
|
+
if (options.dryRun) {
|
|
105
|
+
await handleDryRunOutput(normalizedSource, normalizedTarget, result, format, outputHandler, context);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// 實際執行模式
|
|
109
|
+
printSuccess(source, target, result, isJsonFormat);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
outputHandler.outputError(result.error || '移動失敗', format);
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
121
|
+
outputHandler.outputError(errorMsg, format);
|
|
122
|
+
process.exitCode = 1;
|
|
123
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 處理 dry-run 輸出
|
|
130
|
+
*/
|
|
131
|
+
async function handleDryRunOutput(source, target, result, format, outputHandler, context) {
|
|
132
|
+
// 讀取受影響檔案的原始內容
|
|
133
|
+
const originalContents = new Map();
|
|
134
|
+
const affectedFiles = new Set(result.pathUpdates.map((u) => u.filePath));
|
|
135
|
+
for (const filePath of affectedFiles) {
|
|
136
|
+
try {
|
|
137
|
+
const content = await context.fileSystem.readFile(filePath, 'utf-8');
|
|
138
|
+
originalContents.set(filePath, content);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// 忽略無法讀取的檔案
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// 轉換為統一的 PreviewInput 格式
|
|
145
|
+
const previewInput = convertMovePreview(source, target, result.pathUpdates, originalContents);
|
|
146
|
+
// 使用統一輸出處理器
|
|
147
|
+
outputHandler.outputMutation(previewInput, format);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* 印出成功訊息
|
|
151
|
+
*/
|
|
152
|
+
function printSuccess(source, target, result, isJsonFormat) {
|
|
153
|
+
if (isJsonFormat) {
|
|
154
|
+
console.log(JSON.stringify({
|
|
155
|
+
success: true,
|
|
156
|
+
source: result.source,
|
|
157
|
+
target: result.target,
|
|
158
|
+
moved: result.moved,
|
|
159
|
+
pathUpdates: result.pathUpdates,
|
|
160
|
+
message: result.message
|
|
161
|
+
}, null, 2));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
console.log(' 移動成功!');
|
|
165
|
+
console.log(` 統計: ${result.pathUpdates.length} 個 import 需要更新`);
|
|
166
|
+
if (result.pathUpdates.length > 0) {
|
|
167
|
+
console.log(' 影響的檔案:');
|
|
168
|
+
const fileGroups = new Map();
|
|
169
|
+
result.pathUpdates.forEach((update) => {
|
|
170
|
+
if (!fileGroups.has(update.filePath)) {
|
|
171
|
+
fileGroups.set(update.filePath, []);
|
|
172
|
+
}
|
|
173
|
+
fileGroups.get(update.filePath).push(update);
|
|
174
|
+
});
|
|
175
|
+
for (const [filePath, updates] of fileGroups) {
|
|
176
|
+
console.log(` ${path.relative(process.cwd(), filePath)}:`);
|
|
177
|
+
updates.forEach((update) => {
|
|
178
|
+
console.log(` 第 ${update.line} 行: "${path.basename(source)}" "${path.basename(target)}"`);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* 讀取 tsconfig.json 路徑別名
|
|
186
|
+
*/
|
|
187
|
+
async function loadPathAliases(projectRoot, context) {
|
|
188
|
+
const pathAliases = {};
|
|
189
|
+
try {
|
|
190
|
+
const tsconfigPath = path.join(projectRoot, 'tsconfig.json');
|
|
191
|
+
const tsconfigContent = await context.fileSystem.readFile(tsconfigPath, 'utf-8');
|
|
192
|
+
const tsconfig = JSON.parse(tsconfigContent);
|
|
193
|
+
if (tsconfig.compilerOptions?.paths) {
|
|
194
|
+
const baseUrl = tsconfig.compilerOptions.baseUrl || '.';
|
|
195
|
+
const basePath = path.resolve(projectRoot, baseUrl);
|
|
196
|
+
for (const [alias, paths] of Object.entries(tsconfig.compilerOptions.paths)) {
|
|
197
|
+
if (Array.isArray(paths) && paths.length > 0) {
|
|
198
|
+
// 移除 /* 後綴
|
|
199
|
+
const cleanAlias = alias.replace(/\/\*$/, '');
|
|
200
|
+
const cleanPath = paths[0].replace(/\/\*$/, '');
|
|
201
|
+
// 轉換為絕對路徑
|
|
202
|
+
pathAliases[cleanAlias] = path.resolve(basePath, cleanPath);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// tsconfig.json 不存在或解析失敗,使用空的路徑別名
|
|
209
|
+
}
|
|
210
|
+
return pathAliases;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=move.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/move.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,M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AAQ,CAAC,YAAY,EAAE,OAAO,CAAW,CAAC;QAC3F,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAE7C,IAAI,QAAQ,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,OAAO,IAAI,GAAG,CAAC;YACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAEpD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5E,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC7C,WAAW;oBACX,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAC9C,MAAM,SAAS,GAAI,KAAK,CAAC,CAAC,CAAY,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;oBAC5D,UAAU;oBACV,WAAW,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,kCAAkC;IACpC,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rename 命令
|
|
3
|
+
* 重新命名程式碼元素
|
|
4
|
+
*/
|
|
5
|
+
import type { Command } from 'commander';
|
|
6
|
+
import type { CommandContext } from '../../cli/commands/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* 設定 rename 命令
|
|
9
|
+
*/
|
|
10
|
+
export declare function setupRenameCommand(program: Command, context: CommandContext): void;
|
|
11
|
+
//# sourceMappingURL=rename.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/rename.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAcxE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAelF"}
|