@codefast/cli 0.3.13-canary.2 → 0.3.13-canary.4
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 +30 -4
- package/dist/{bin.js → bin.mjs} +4 -1
- package/dist/commands/arrange.mjs +325 -0
- package/dist/commands/mirror.mjs +267 -0
- package/dist/commands/tag.mjs +283 -0
- package/dist/lib/arrange/application/arrange-analyze-json.format.mjs +10 -0
- package/dist/lib/arrange/application/arrange-group-json.format.mjs +11 -0
- package/dist/lib/arrange/application/arrange-sync-cli-result.mjs +7 -0
- package/dist/lib/arrange/application/arrange-sync-json.format.mjs +12 -0
- package/dist/lib/arrange/application/services/arrange-file-processor.service.mjs +242 -0
- package/dist/lib/arrange/application/services/arrange-target-scanner.service.mjs +237 -0
- package/dist/lib/arrange/application/use-cases/analyze-directory.use-case.mjs +258 -0
- package/dist/lib/arrange/application/use-cases/group-file.use-case.mjs +35 -0
- package/dist/lib/arrange/application/use-cases/run-arrange-sync.use-case.mjs +283 -0
- package/dist/lib/arrange/application/use-cases/suggest-cn-groups.use-case.mjs +233 -0
- package/dist/lib/arrange/arrange.feature.module.mjs +19 -0
- package/dist/lib/arrange/arrange.module.mjs +27 -0
- package/dist/lib/arrange/arrange.presentation.module.mjs +13 -0
- package/dist/lib/arrange/contracts/tokens.mjs +14 -0
- package/dist/lib/arrange/domain/arrange-analyze.service.mjs +95 -0
- package/dist/lib/arrange/domain/arrange-grouping.service.mjs +100 -0
- package/dist/lib/arrange/domain/ast/ast-helpers.helper.mjs +89 -0
- package/dist/lib/arrange/domain/ast/ast-node.model.mjs +181 -0
- package/dist/lib/arrange/domain/ast/collectors-cn.collector.mjs +52 -0
- package/dist/lib/arrange/domain/ast/collectors-jsx.collector.mjs +20 -0
- package/dist/lib/arrange/domain/ast/collectors-tv.collector.mjs +174 -0
- package/dist/lib/arrange/domain/ast/targets.model.mjs +110 -0
- package/dist/lib/arrange/domain/constants.domain.mjs +154 -0
- package/dist/lib/arrange/domain/errors.domain.mjs +18 -0
- package/dist/lib/arrange/domain/grouping.domain.mjs +306 -0
- package/dist/lib/arrange/domain/imports.domain.mjs +55 -0
- package/dist/lib/arrange/domain/source-text-formatters.formatter.mjs +54 -0
- package/dist/lib/arrange/domain/tokenizer.util.mjs +209 -0
- package/dist/lib/arrange/infra/domain-source-parser.adapter.mjs +240 -0
- package/dist/lib/arrange/infra/ensure-cn-import.adapter.mjs +8 -0
- package/dist/lib/arrange/infra/file-walker.adapter.mjs +239 -0
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.test-helper.mjs +18 -0
- package/dist/lib/arrange/infra/ts-ast-translator.adapter.mjs +355 -0
- package/dist/lib/arrange/presentation/arrange-cli-schema.presenter.mjs +29 -0
- package/dist/lib/arrange/presentation/arrange-sync.presenter.mjs +12 -0
- package/dist/lib/arrange/presentation/formatters.presenter.mjs +2 -0
- package/dist/lib/arrange/presentation/group-file-preview.presenter.mjs +275 -0
- package/dist/lib/arrange/presentation/prepare-arrange.orchestrator.mjs +258 -0
- package/dist/lib/arrange/presentation/present-analyze-cli.presenter.mjs +7 -0
- package/dist/lib/arrange/presentation/present-analyze-report.presenter.mjs +233 -0
- package/dist/lib/arrange/presentation/report.presenter.mjs +24 -0
- package/dist/lib/arrange/presentation/resolve-arrange-cli-target.presenter.mjs +21 -0
- package/dist/lib/config/application/use-cases/load-config.use-case.mjs +17 -0
- package/dist/lib/config/contracts/tokens.mjs +5 -0
- package/dist/lib/config/infra/config-schema.adapter.mjs +25 -0
- package/dist/lib/config/infra/loader.adapter.mjs +84 -0
- package/dist/lib/core/application/architecture-boundaries.policy.mjs +311 -0
- package/dist/lib/core/application/ports/path.port.mjs +1 -0
- package/dist/lib/core/application/schema-parse.util.mjs +17 -0
- package/dist/lib/core/application/utils/caught-unknown-message.util.mjs +19 -0
- package/dist/lib/core/application/utils/verbose-diagnostics.util.mjs +9 -0
- package/dist/lib/core/contracts/presentation.contract.mjs +1 -0
- package/dist/lib/core/contracts/tokens.mjs +5 -0
- package/dist/lib/core/core.module.mjs +9 -0
- package/dist/lib/core/domain/cli-exit-codes.domain.mjs +11 -0
- package/dist/lib/core/domain/errors.domain.mjs +16 -0
- package/dist/lib/core/domain/result.model.mjs +23 -0
- package/dist/lib/core/infra/composition-root.mjs +21 -0
- package/dist/lib/core/infra/infra.module.mjs +23 -0
- package/dist/lib/core/infra/logging-decorator.adapter.mjs +62 -0
- package/dist/lib/core/infra/path.adapter.mjs +13 -0
- package/dist/lib/core/operational/contracts/tokens.mjs +7 -0
- package/dist/lib/core/presentation/cli-executor.presenter.mjs +57 -0
- package/dist/lib/core/presentation/command.interface.mjs +1 -0
- package/dist/lib/core/presentation/format-app-error.presenter.mjs +17 -0
- package/dist/lib/core/presentation/global-cli-options.presenter.mjs +9 -0
- package/dist/lib/core/presentation/load-codefast-config.presenter.mjs +18 -0
- package/dist/lib/core/presentation/parse-cli-schema.presenter.mjs +7 -0
- package/dist/lib/core/presentation/presentation.module.mjs +11 -0
- package/dist/lib/core/presentation/try-load-codefast-config.presenter.mjs +245 -0
- package/dist/lib/infra/config-reporter.adapter.mjs +9 -0
- package/dist/lib/infra/fs-contract.port.mjs +1 -0
- package/dist/lib/infra/node-io.adapter.mjs +266 -0
- package/dist/lib/infra/workspace/repo-root.adapter.mjs +21 -0
- package/dist/lib/kernel/di/command.token.mjs +5 -0
- package/dist/lib/mirror/application/mirror-sync-json.format.mjs +12 -0
- package/dist/lib/mirror/application/ports/file-system-service.port.mjs +1 -0
- package/dist/lib/mirror/application/ports/mirror-sync-reporter.port.mjs +1 -0
- package/dist/lib/mirror/application/ports/package-repository.port.mjs +1 -0
- package/dist/lib/mirror/application/ports/sync-workspace-package.port.mjs +1 -0
- package/dist/lib/mirror/application/ports/workspace-service.port.mjs +1 -0
- package/dist/lib/mirror/application/requests/mirror-sync.request.mjs +1 -0
- package/dist/lib/mirror/application/services/sync-workspace-package.service.mjs +351 -0
- package/dist/lib/mirror/application/use-cases/generate-mirror-exports.use-case.mjs +219 -0
- package/dist/lib/mirror/application/use-cases/run-mirror-sync.use-case.mjs +302 -0
- package/dist/lib/mirror/contracts/models.mjs +1 -0
- package/dist/lib/mirror/contracts/presentation.contract.mjs +1 -0
- package/dist/lib/mirror/contracts/tokens.mjs +11 -0
- package/dist/lib/mirror/contracts/use-cases.contract.mjs +1 -0
- package/dist/lib/mirror/domain/constants.domain.mjs +16 -0
- package/dist/lib/mirror/domain/errors.domain.mjs +15 -0
- package/dist/lib/mirror/domain/types.domain.mjs +1 -0
- package/dist/lib/mirror/infra/dirent-list.adapter.mjs +13 -0
- package/dist/lib/mirror/infra/file-system-service.adapter.mjs +256 -0
- package/dist/lib/mirror/infra/mirror-sync-cli-options.adapter.mjs +1 -0
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.mjs +236 -0
- package/dist/lib/mirror/infra/package-filter.adapter.mjs +25 -0
- package/dist/lib/mirror/infra/package-repository.adapter.mjs +235 -0
- package/dist/lib/mirror/infra/path-normalizer.adapter.mjs +7 -0
- package/dist/lib/mirror/infra/update-pkg.adapter.mjs +102 -0
- package/dist/lib/mirror/infra/workspace-packages.adapter.mjs +154 -0
- package/dist/lib/mirror/infra/workspace-service.adapter.mjs +232 -0
- package/dist/lib/mirror/mirror.feature.module.mjs +19 -0
- package/dist/lib/mirror/mirror.module.mjs +23 -0
- package/dist/lib/mirror/mirror.presentation.module.mjs +11 -0
- package/dist/lib/mirror/presentation/mirror-cli-schema.presenter.mjs +12 -0
- package/dist/lib/mirror/presentation/prepare-mirror.orchestrator.mjs +263 -0
- package/dist/lib/mirror/presentation/reporter.presenter.mjs +111 -0
- package/dist/lib/mirror/presentation/resolve-mirror-package-arg.presenter.mjs +20 -0
- package/dist/lib/shared/source-code/domain/text-edit.model.mjs +28 -0
- package/dist/lib/shared/source-code/infra/tsx-file-walk.adapter.mjs +33 -0
- package/dist/lib/tag/application/ports/tag-since-writer.port.mjs +1 -0
- package/dist/lib/tag/application/ports/tag-version-resolver.port.mjs +1 -0
- package/dist/lib/tag/application/ports/target-resolver.port.mjs +1 -0
- package/dist/lib/tag/application/ports/typescript-tree-walk.port.mjs +1 -0
- package/dist/lib/tag/application/requests/tag-sync.request.mjs +1 -0
- package/dist/lib/tag/application/tag-sync-cli-result.mjs +11 -0
- package/dist/lib/tag/application/tag-sync-json.format.mjs +14 -0
- package/dist/lib/tag/application/use-cases/run-tag-sync.use-case.mjs +398 -0
- package/dist/lib/tag/contracts/models.mjs +1 -0
- package/dist/lib/tag/contracts/presentation.contract.mjs +1 -0
- package/dist/lib/tag/contracts/tokens.mjs +12 -0
- package/dist/lib/tag/contracts/use-cases.contract.mjs +1 -0
- package/dist/lib/tag/domain/types.domain.mjs +1 -0
- package/dist/lib/tag/infra/tag-since-writer.adapter.mjs +343 -0
- package/dist/lib/tag/infra/tag-sync-cli-options.adapter.mjs +1 -0
- package/dist/lib/tag/infra/tag-target-candidates.adapter.mjs +170 -0
- package/dist/lib/tag/infra/tag-target-resolver.adapter.mjs +226 -0
- package/dist/lib/tag/infra/tag-version-resolver.adapter.mjs +247 -0
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.mjs +226 -0
- package/dist/lib/tag/presentation/colors.presenter.mjs +12 -0
- package/dist/lib/tag/presentation/create-tag-progress-listener.presenter.mjs +228 -0
- package/dist/lib/tag/presentation/prepare-tag.orchestrator.mjs +264 -0
- package/dist/lib/tag/presentation/present-tag-sync-result.presenter.mjs +233 -0
- package/dist/lib/tag/presentation/resolve-tag-cli-target.presenter.mjs +9 -0
- package/dist/lib/tag/presentation/resolve-tag-workspace-root.presenter.mjs +12 -0
- package/dist/lib/tag/presentation/tag-cli-schema.presenter.mjs +12 -0
- package/dist/lib/tag/presentation/tag-sync.presenter.mjs +78 -0
- package/dist/lib/tag/tag.feature.module.mjs +19 -0
- package/dist/lib/tag/tag.module.mjs +21 -0
- package/dist/lib/tag/tag.presentation.module.mjs +15 -0
- package/dist/program.mjs +39 -0
- package/package.json +16 -19
- package/dist/bin.d.ts +0 -3
- package/dist/bin.d.ts.map +0 -1
- package/dist/commands/arrange.d.ts +0 -3
- package/dist/commands/arrange.d.ts.map +0 -1
- package/dist/commands/arrange.js +0 -129
- package/dist/commands/mirror.d.ts +0 -4
- package/dist/commands/mirror.d.ts.map +0 -1
- package/dist/commands/mirror.js +0 -75
- package/dist/commands/tag.d.ts +0 -3
- package/dist/commands/tag.d.ts.map +0 -1
- package/dist/commands/tag.js +0 -41
- package/dist/lib/arrange/application/analyze.d.ts +0 -17
- package/dist/lib/arrange/application/analyze.d.ts.map +0 -1
- package/dist/lib/arrange/application/analyze.js +0 -24
- package/dist/lib/arrange/application/group-file-preview.d.ts +0 -17
- package/dist/lib/arrange/application/group-file-preview.d.ts.map +0 -1
- package/dist/lib/arrange/application/group-file-preview.js +0 -46
- package/dist/lib/arrange/application/group-file.d.ts +0 -5
- package/dist/lib/arrange/application/group-file.d.ts.map +0 -1
- package/dist/lib/arrange/application/group-file.js +0 -40
- package/dist/lib/arrange/application/ports/domain-source-parser.port.d.ts +0 -5
- package/dist/lib/arrange/application/ports/domain-source-parser.port.d.ts.map +0 -1
- package/dist/lib/arrange/application/ports/file-walker.port.d.ts +0 -5
- package/dist/lib/arrange/application/ports/file-walker.port.d.ts.map +0 -1
- package/dist/lib/arrange/application/requests/analyze-directory.request.d.ts +0 -6
- package/dist/lib/arrange/application/requests/analyze-directory.request.d.ts.map +0 -1
- package/dist/lib/arrange/application/requests/analyze-directory.request.js +0 -4
- package/dist/lib/arrange/application/requests/arrange-sync.request.d.ts +0 -18
- package/dist/lib/arrange/application/requests/arrange-sync.request.d.ts.map +0 -1
- package/dist/lib/arrange/application/requests/arrange-sync.request.js +0 -15
- package/dist/lib/arrange/application/run-target.d.ts +0 -19
- package/dist/lib/arrange/application/run-target.d.ts.map +0 -1
- package/dist/lib/arrange/application/run-target.js +0 -85
- package/dist/lib/arrange/domain/arrange-analyze.service.d.ts +0 -12
- package/dist/lib/arrange/domain/arrange-analyze.service.d.ts.map +0 -1
- package/dist/lib/arrange/domain/arrange-analyze.service.js +0 -116
- package/dist/lib/arrange/domain/arrange-grouping.service.d.ts +0 -53
- package/dist/lib/arrange/domain/arrange-grouping.service.d.ts.map +0 -1
- package/dist/lib/arrange/domain/arrange-grouping.service.js +0 -106
- package/dist/lib/arrange/domain/ast/ast-helpers.d.ts +0 -28
- package/dist/lib/arrange/domain/ast/ast-helpers.d.ts.map +0 -1
- package/dist/lib/arrange/domain/ast/ast-helpers.js +0 -130
- package/dist/lib/arrange/domain/ast/ast-node.model.d.ts +0 -179
- package/dist/lib/arrange/domain/ast/ast-node.model.d.ts.map +0 -1
- package/dist/lib/arrange/domain/ast/ast-node.model.js +0 -210
- package/dist/lib/arrange/domain/ast/collectors-cn.d.ts +0 -7
- package/dist/lib/arrange/domain/ast/collectors-cn.d.ts.map +0 -1
- package/dist/lib/arrange/domain/ast/collectors-cn.js +0 -70
- package/dist/lib/arrange/domain/ast/collectors-jsx.d.ts +0 -4
- package/dist/lib/arrange/domain/ast/collectors-jsx.d.ts.map +0 -1
- package/dist/lib/arrange/domain/ast/collectors-jsx.js +0 -21
- package/dist/lib/arrange/domain/ast/collectors-tv.d.ts +0 -13
- package/dist/lib/arrange/domain/ast/collectors-tv.d.ts.map +0 -1
- package/dist/lib/arrange/domain/ast/collectors-tv.js +0 -302
- package/dist/lib/arrange/domain/ast/targets.d.ts +0 -8
- package/dist/lib/arrange/domain/ast/targets.d.ts.map +0 -1
- package/dist/lib/arrange/domain/ast/targets.js +0 -147
- package/dist/lib/arrange/domain/constants.d.ts +0 -68
- package/dist/lib/arrange/domain/constants.d.ts.map +0 -1
- package/dist/lib/arrange/domain/constants.js +0 -180
- package/dist/lib/arrange/domain/errors.d.ts +0 -14
- package/dist/lib/arrange/domain/errors.d.ts.map +0 -1
- package/dist/lib/arrange/domain/errors.js +0 -16
- package/dist/lib/arrange/domain/grouping.d.ts +0 -41
- package/dist/lib/arrange/domain/grouping.d.ts.map +0 -1
- package/dist/lib/arrange/domain/grouping.js +0 -307
- package/dist/lib/arrange/domain/imports.d.ts +0 -7
- package/dist/lib/arrange/domain/imports.d.ts.map +0 -1
- package/dist/lib/arrange/domain/imports.js +0 -80
- package/dist/lib/arrange/domain/source-text-formatters.d.ts +0 -16
- package/dist/lib/arrange/domain/source-text-formatters.d.ts.map +0 -1
- package/dist/lib/arrange/domain/source-text-formatters.js +0 -55
- package/dist/lib/arrange/domain/tokenizer.d.ts +0 -45
- package/dist/lib/arrange/domain/tokenizer.d.ts.map +0 -1
- package/dist/lib/arrange/domain/tokenizer.js +0 -466
- package/dist/lib/arrange/domain/types.d.ts +0 -112
- package/dist/lib/arrange/domain/types.d.ts.map +0 -1
- package/dist/lib/arrange/domain/types.js +0 -7
- package/dist/lib/arrange/index.d.ts +0 -45
- package/dist/lib/arrange/index.d.ts.map +0 -1
- package/dist/lib/arrange/index.js +0 -41
- package/dist/lib/arrange/infra/arrange-sync-cli-options.d.ts +0 -14
- package/dist/lib/arrange/infra/arrange-sync-cli-options.d.ts.map +0 -1
- package/dist/lib/arrange/infra/domain-source-parser.adapter.d.ts +0 -11
- package/dist/lib/arrange/infra/domain-source-parser.adapter.d.ts.map +0 -1
- package/dist/lib/arrange/infra/domain-source-parser.adapter.js +0 -19
- package/dist/lib/arrange/infra/ensure-cn-import.d.ts +0 -3
- package/dist/lib/arrange/infra/ensure-cn-import.d.ts.map +0 -1
- package/dist/lib/arrange/infra/ensure-cn-import.js +0 -6
- package/dist/lib/arrange/infra/file-walker.adapter.d.ts +0 -8
- package/dist/lib/arrange/infra/file-walker.adapter.d.ts.map +0 -1
- package/dist/lib/arrange/infra/file-walker.adapter.js +0 -17
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.d.ts +0 -8
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.d.ts.map +0 -1
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.js +0 -25
- package/dist/lib/arrange/infra/ts-ast-translator.d.ts +0 -10
- package/dist/lib/arrange/infra/ts-ast-translator.d.ts.map +0 -1
- package/dist/lib/arrange/infra/ts-ast-translator.js +0 -363
- package/dist/lib/arrange/presentation/formatters.d.ts +0 -3
- package/dist/lib/arrange/presentation/formatters.d.ts.map +0 -1
- package/dist/lib/arrange/presentation/formatters.js +0 -2
- package/dist/lib/arrange/presentation/report.d.ts +0 -4
- package/dist/lib/arrange/presentation/report.d.ts.map +0 -1
- package/dist/lib/arrange/presentation/report.js +0 -37
- package/dist/lib/config/domain/schema.d.ts +0 -50
- package/dist/lib/config/domain/schema.d.ts.map +0 -1
- package/dist/lib/config/domain/schema.js +0 -43
- package/dist/lib/config/index.d.ts +0 -4
- package/dist/lib/config/index.d.ts.map +0 -1
- package/dist/lib/config/index.js +0 -2
- package/dist/lib/config/infra/loader.d.ts +0 -11
- package/dist/lib/config/infra/loader.d.ts.map +0 -1
- package/dist/lib/config/infra/loader.js +0 -90
- package/dist/lib/core/application/architecture-boundaries.d.ts +0 -19
- package/dist/lib/core/application/architecture-boundaries.d.ts.map +0 -1
- package/dist/lib/core/application/architecture-boundaries.js +0 -263
- package/dist/lib/core/application/ports/cli-io.port.d.ts +0 -27
- package/dist/lib/core/application/ports/cli-io.port.d.ts.map +0 -1
- package/dist/lib/core/application/schema-parse.d.ts +0 -8
- package/dist/lib/core/application/schema-parse.d.ts.map +0 -1
- package/dist/lib/core/application/schema-parse.js +0 -20
- package/dist/lib/core/application/utils/caught-unknown-message.d.ts +0 -6
- package/dist/lib/core/application/utils/caught-unknown-message.d.ts.map +0 -1
- package/dist/lib/core/application/utils/caught-unknown-message.js +0 -34
- package/dist/lib/core/application/utils/verbose-diagnostics.d.ts +0 -5
- package/dist/lib/core/application/utils/verbose-diagnostics.d.ts.map +0 -1
- package/dist/lib/core/application/utils/verbose-diagnostics.js +0 -7
- package/dist/lib/core/domain/errors.d.ts +0 -11
- package/dist/lib/core/domain/errors.d.ts.map +0 -1
- package/dist/lib/core/domain/errors.js +0 -9
- package/dist/lib/core/domain/result.d.ts +0 -15
- package/dist/lib/core/domain/result.d.ts.map +0 -1
- package/dist/lib/core/domain/result.js +0 -9
- package/dist/lib/core/infra/container.d.ts +0 -34
- package/dist/lib/core/infra/container.d.ts.map +0 -1
- package/dist/lib/core/infra/container.js +0 -65
- package/dist/lib/core/infra/logging-decorator.d.ts +0 -12
- package/dist/lib/core/infra/logging-decorator.d.ts.map +0 -1
- package/dist/lib/core/infra/logging-decorator.js +0 -75
- package/dist/lib/core/presentation/cli-executor.d.ts +0 -33
- package/dist/lib/core/presentation/cli-executor.d.ts.map +0 -1
- package/dist/lib/core/presentation/cli-executor.js +0 -73
- package/dist/lib/core/presentation/create-command-handler.d.ts +0 -20
- package/dist/lib/core/presentation/create-command-handler.d.ts.map +0 -1
- package/dist/lib/core/presentation/create-command-handler.js +0 -70
- package/dist/lib/core/presentation/format-app-error.d.ts +0 -6
- package/dist/lib/core/presentation/format-app-error.d.ts.map +0 -1
- package/dist/lib/core/presentation/format-app-error.js +0 -19
- package/dist/lib/infra/caught-unknown-message.d.ts +0 -2
- package/dist/lib/infra/caught-unknown-message.d.ts.map +0 -1
- package/dist/lib/infra/caught-unknown-message.js +0 -1
- package/dist/lib/infra/config-reporter.d.ts +0 -4
- package/dist/lib/infra/config-reporter.d.ts.map +0 -1
- package/dist/lib/infra/config-reporter.js +0 -9
- package/dist/lib/infra/fs-contract.d.ts +0 -2
- package/dist/lib/infra/fs-contract.d.ts.map +0 -1
- package/dist/lib/infra/node-io.d.ts +0 -4
- package/dist/lib/infra/node-io.d.ts.map +0 -1
- package/dist/lib/infra/node-io.js +0 -27
- package/dist/lib/infra/workspace/repo-root.d.ts +0 -7
- package/dist/lib/infra/workspace/repo-root.d.ts.map +0 -1
- package/dist/lib/infra/workspace/repo-root.js +0 -23
- package/dist/lib/mirror/application/engine.d.ts +0 -10
- package/dist/lib/mirror/application/engine.d.ts.map +0 -1
- package/dist/lib/mirror/application/engine.js +0 -271
- package/dist/lib/mirror/application/ports/file-system-service.port.d.ts +0 -6
- package/dist/lib/mirror/application/ports/file-system-service.port.d.ts.map +0 -1
- package/dist/lib/mirror/application/ports/mirror-sync-reporter.port.d.ts +0 -27
- package/dist/lib/mirror/application/ports/mirror-sync-reporter.port.d.ts.map +0 -1
- package/dist/lib/mirror/application/ports/package-repository.port.d.ts +0 -16
- package/dist/lib/mirror/application/ports/package-repository.port.d.ts.map +0 -1
- package/dist/lib/mirror/application/ports/workspace-service.port.d.ts +0 -7
- package/dist/lib/mirror/application/ports/workspace-service.port.d.ts.map +0 -1
- package/dist/lib/mirror/application/requests/mirror-sync.request.d.ts +0 -10
- package/dist/lib/mirror/application/requests/mirror-sync.request.d.ts.map +0 -1
- package/dist/lib/mirror/application/requests/mirror-sync.request.js +0 -8
- package/dist/lib/mirror/application/sync.d.ts +0 -19
- package/dist/lib/mirror/application/sync.d.ts.map +0 -1
- package/dist/lib/mirror/application/sync.js +0 -168
- package/dist/lib/mirror/domain/constants.d.ts +0 -6
- package/dist/lib/mirror/domain/constants.d.ts.map +0 -1
- package/dist/lib/mirror/domain/constants.js +0 -5
- package/dist/lib/mirror/domain/errors.d.ts +0 -10
- package/dist/lib/mirror/domain/errors.d.ts.map +0 -1
- package/dist/lib/mirror/domain/errors.js +0 -12
- package/dist/lib/mirror/domain/types.d.ts +0 -65
- package/dist/lib/mirror/domain/types.d.ts.map +0 -1
- package/dist/lib/mirror/index.d.ts +0 -6
- package/dist/lib/mirror/index.d.ts.map +0 -1
- package/dist/lib/mirror/index.js +0 -1
- package/dist/lib/mirror/infra/dirent-list.d.ts +0 -9
- package/dist/lib/mirror/infra/dirent-list.d.ts.map +0 -1
- package/dist/lib/mirror/infra/dirent-list.js +0 -13
- package/dist/lib/mirror/infra/file-system-service.adapter.d.ts +0 -7
- package/dist/lib/mirror/infra/file-system-service.adapter.d.ts.map +0 -1
- package/dist/lib/mirror/infra/file-system-service.adapter.js +0 -47
- package/dist/lib/mirror/infra/mirror-sync-cli-options.d.ts +0 -14
- package/dist/lib/mirror/infra/mirror-sync-cli-options.d.ts.map +0 -1
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.d.ts +0 -3
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.d.ts.map +0 -1
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.js +0 -13
- package/dist/lib/mirror/infra/package-filter.d.ts +0 -8
- package/dist/lib/mirror/infra/package-filter.d.ts.map +0 -1
- package/dist/lib/mirror/infra/package-filter.js +0 -33
- package/dist/lib/mirror/infra/package-repository.adapter.d.ts +0 -17
- package/dist/lib/mirror/infra/package-repository.adapter.d.ts.map +0 -1
- package/dist/lib/mirror/infra/package-repository.adapter.js +0 -17
- package/dist/lib/mirror/infra/path-normalizer.d.ts +0 -2
- package/dist/lib/mirror/infra/path-normalizer.d.ts.map +0 -1
- package/dist/lib/mirror/infra/path-normalizer.js +0 -4
- package/dist/lib/mirror/infra/update-pkg.d.ts +0 -19
- package/dist/lib/mirror/infra/update-pkg.d.ts.map +0 -1
- package/dist/lib/mirror/infra/update-pkg.js +0 -156
- package/dist/lib/mirror/infra/workspace-packages.d.ts +0 -26
- package/dist/lib/mirror/infra/workspace-packages.d.ts.map +0 -1
- package/dist/lib/mirror/infra/workspace-packages.js +0 -170
- package/dist/lib/mirror/infra/workspace-service.adapter.d.ts +0 -8
- package/dist/lib/mirror/infra/workspace-service.adapter.d.ts.map +0 -1
- package/dist/lib/mirror/infra/workspace-service.adapter.js +0 -10
- package/dist/lib/mirror/presentation/reporter.d.ts +0 -25
- package/dist/lib/mirror/presentation/reporter.d.ts.map +0 -1
- package/dist/lib/mirror/presentation/reporter.js +0 -140
- package/dist/lib/shared/source-code/domain/text-edit.d.ts +0 -14
- package/dist/lib/shared/source-code/domain/text-edit.d.ts.map +0 -1
- package/dist/lib/shared/source-code/domain/text-edit.js +0 -30
- package/dist/lib/shared/source-code/infra/tsx-file-walk.d.ts +0 -4
- package/dist/lib/shared/source-code/infra/tsx-file-walk.d.ts.map +0 -1
- package/dist/lib/shared/source-code/infra/tsx-file-walk.js +0 -37
- package/dist/lib/tag/application/engine.d.ts +0 -23
- package/dist/lib/tag/application/engine.d.ts.map +0 -1
- package/dist/lib/tag/application/engine.js +0 -357
- package/dist/lib/tag/application/ports/target-resolver.port.d.ts +0 -6
- package/dist/lib/tag/application/ports/target-resolver.port.d.ts.map +0 -1
- package/dist/lib/tag/application/ports/typescript-tree-walk.port.d.ts +0 -6
- package/dist/lib/tag/application/ports/typescript-tree-walk.port.d.ts.map +0 -1
- package/dist/lib/tag/application/requests/tag-sync.request.d.ts +0 -10
- package/dist/lib/tag/application/requests/tag-sync.request.d.ts.map +0 -1
- package/dist/lib/tag/application/requests/tag-sync.request.js +0 -8
- package/dist/lib/tag/domain/types.d.ts +0 -56
- package/dist/lib/tag/domain/types.d.ts.map +0 -1
- package/dist/lib/tag/index.d.ts +0 -14
- package/dist/lib/tag/index.d.ts.map +0 -1
- package/dist/lib/tag/index.js +0 -10
- package/dist/lib/tag/infra/tag-sync-cli-options.d.ts +0 -14
- package/dist/lib/tag/infra/tag-sync-cli-options.d.ts.map +0 -1
- package/dist/lib/tag/infra/tag-target-resolver.adapter.d.ts +0 -3
- package/dist/lib/tag/infra/tag-target-resolver.adapter.d.ts.map +0 -1
- package/dist/lib/tag/infra/tag-target-resolver.adapter.js +0 -4
- package/dist/lib/tag/infra/target-resolver.d.ts +0 -4
- package/dist/lib/tag/infra/target-resolver.d.ts.map +0 -1
- package/dist/lib/tag/infra/target-resolver.js +0 -200
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.d.ts +0 -3
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.d.ts.map +0 -1
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.js +0 -4
- package/dist/lib/tag/presentation/colors.d.ts +0 -8
- package/dist/lib/tag/presentation/colors.d.ts.map +0 -1
- package/dist/lib/tag/presentation/colors.js +0 -9
- package/dist/lib/tag/presentation/tag-presenter.d.ts +0 -20
- package/dist/lib/tag/presentation/tag-presenter.d.ts.map +0 -1
- package/dist/lib/tag/presentation/tag-presenter.js +0 -92
- package/dist/program.d.ts +0 -4
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js +0 -40
- /package/dist/lib/arrange/application/ports/{domain-source-parser.port.js → domain-source-parser.port.mjs} +0 -0
- /package/dist/lib/arrange/application/ports/{file-walker.port.js → file-walker.port.mjs} +0 -0
- /package/dist/lib/arrange/{infra/arrange-sync-cli-options.js → application/ports/group-file-preview.port.mjs} +0 -0
- /package/dist/lib/{core/application/ports/cli-io.port.js → arrange/application/requests/analyze-directory.request.mjs} +0 -0
- /package/dist/lib/{infra/fs-contract.js → arrange/application/requests/arrange-sync.request.mjs} +0 -0
- /package/dist/lib/{mirror/application/ports/file-system-service.port.js → arrange/application/requests/suggest-groups.request.mjs} +0 -0
- /package/dist/lib/{mirror/application/ports/mirror-sync-reporter.port.js → arrange/contracts/models.mjs} +0 -0
- /package/dist/lib/{mirror/application/ports/package-repository.port.js → arrange/contracts/presentation.contract.mjs} +0 -0
- /package/dist/lib/{mirror/application/ports/workspace-service.port.js → arrange/contracts/services.contract.mjs} +0 -0
- /package/dist/lib/{mirror/domain/types.js → arrange/contracts/use-cases.contract.mjs} +0 -0
- /package/dist/lib/{mirror/infra/mirror-sync-cli-options.js → arrange/domain/types.domain.mjs} +0 -0
- /package/dist/lib/{tag/application/ports/target-resolver.port.js → arrange/infra/arrange-sync-cli-options.adapter.mjs} +0 -0
- /package/dist/lib/{tag/application/ports/typescript-tree-walk.port.js → config/application/ports/config-loader.port.mjs} +0 -0
- /package/dist/lib/{tag/domain/types.js → config/domain/schema.domain.mjs} +0 -0
- /package/dist/lib/{tag/infra/tag-sync-cli-options.js → core/application/ports/cli-io.port.mjs} +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import "../lib/core/domain/cli-exit-codes.domain.mjs";
|
|
2
|
+
import { CliLoggerToken } from "../lib/core/operational/contracts/tokens.mjs";
|
|
3
|
+
import { parseWithCliSchema } from "../lib/core/presentation/parse-cli-schema.presenter.mjs";
|
|
4
|
+
import { consumeCliAppError, runCliResultAsync } from "../lib/core/presentation/cli-executor.presenter.mjs";
|
|
5
|
+
import { PrepareMirrorOrchestratorToken, RunMirrorSyncUseCaseToken } from "../lib/mirror/contracts/tokens.mjs";
|
|
6
|
+
import { mirrorSyncRunRequestSchema } from "../lib/mirror/presentation/mirror-cli-schema.presenter.mjs";
|
|
7
|
+
import process from "node:process";
|
|
8
|
+
import { inject, injectable } from "@codefast/di";
|
|
9
|
+
//#region src/commands/mirror.ts
|
|
10
|
+
function toPrimitive(input, hint) {
|
|
11
|
+
if (typeof input !== "object" || input === null) return input;
|
|
12
|
+
var prim = input[Symbol.toPrimitive];
|
|
13
|
+
if (prim !== void 0) {
|
|
14
|
+
var res = prim.call(input, hint || "default");
|
|
15
|
+
if (typeof res !== "object") return res;
|
|
16
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
17
|
+
}
|
|
18
|
+
return (hint === "string" ? String : Number)(input);
|
|
19
|
+
}
|
|
20
|
+
function toPropertyKey(arg) {
|
|
21
|
+
var key = toPrimitive(arg, "string");
|
|
22
|
+
return typeof key === "symbol" ? key : String(key);
|
|
23
|
+
}
|
|
24
|
+
function checkInRHS(value) {
|
|
25
|
+
if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null"));
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function setFunctionName(fn, name, prefix) {
|
|
29
|
+
if (typeof name === "symbol") {
|
|
30
|
+
name = name.description;
|
|
31
|
+
name = name ? "[" + name + "]" : "";
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
Object.defineProperty(fn, "name", {
|
|
35
|
+
configurable: true,
|
|
36
|
+
value: prefix ? prefix + " " + name : name
|
|
37
|
+
});
|
|
38
|
+
} catch (_) {}
|
|
39
|
+
return fn;
|
|
40
|
+
}
|
|
41
|
+
function _apply_decs_2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
|
42
|
+
var symbolMetadata = Symbol.metadata || Symbol.for("Symbol.metadata");
|
|
43
|
+
var defineProperty = Object.defineProperty;
|
|
44
|
+
var create = Object.create;
|
|
45
|
+
var metadata;
|
|
46
|
+
var existingNonFields = [create(null), create(null)];
|
|
47
|
+
var hasClassDecs = classDecs.length;
|
|
48
|
+
var _;
|
|
49
|
+
function createRunInitializers(initializers, useStaticThis, hasValue) {
|
|
50
|
+
return function(thisArg, value) {
|
|
51
|
+
if (useStaticThis) {
|
|
52
|
+
value = thisArg;
|
|
53
|
+
thisArg = targetClass;
|
|
54
|
+
}
|
|
55
|
+
for (var i = 0; i < initializers.length; i++) value = initializers[i].apply(thisArg, hasValue ? [value] : []);
|
|
56
|
+
return hasValue ? value : thisArg;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
|
60
|
+
if (typeof fn !== "function") {
|
|
61
|
+
if (throwUndefined || fn !== void 0) throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
|
62
|
+
}
|
|
63
|
+
return fn;
|
|
64
|
+
}
|
|
65
|
+
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
|
|
66
|
+
function assertInstanceIfPrivate(target) {
|
|
67
|
+
if (!hasPrivateBrand(target)) throw new TypeError("Attempted to access private element on non-instance");
|
|
68
|
+
}
|
|
69
|
+
var decs = [].concat(decInfo[0]);
|
|
70
|
+
var decVal = decInfo[3];
|
|
71
|
+
var isClass = !ret;
|
|
72
|
+
var isAccessor = kind === 1;
|
|
73
|
+
var isGetter = kind === 3;
|
|
74
|
+
var isSetter = kind === 4;
|
|
75
|
+
var isMethod = kind === 2;
|
|
76
|
+
function bindPropCall(name, useStaticThis, before) {
|
|
77
|
+
return function(_this, value) {
|
|
78
|
+
if (useStaticThis) {
|
|
79
|
+
value = _this;
|
|
80
|
+
_this = Class;
|
|
81
|
+
}
|
|
82
|
+
if (before) before(_this);
|
|
83
|
+
return desc[name].call(_this, value);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
var desc1 = {};
|
|
87
|
+
var init = [];
|
|
88
|
+
var key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
|
|
89
|
+
if (!isClass) {
|
|
90
|
+
if (isPrivate) {
|
|
91
|
+
if (isField || isAccessor) desc1 = {
|
|
92
|
+
get: setFunctionName(function() {
|
|
93
|
+
return decVal(this);
|
|
94
|
+
}, name, "get"),
|
|
95
|
+
set: function(value) {
|
|
96
|
+
decInfo[4](this, value);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
else desc1[key] = decVal;
|
|
100
|
+
if (!isField) setFunctionName(desc1[key], name, isMethod ? "" : key);
|
|
101
|
+
} else if (!isField) desc1 = Object.getOwnPropertyDescriptor(Class, name);
|
|
102
|
+
if (!isField && !isPrivate) {
|
|
103
|
+
_ = existingNonFields[+isStatic][name];
|
|
104
|
+
if (_ && (_ ^ kind) !== 7) throw new Error("Decorating two elements with the same name (" + desc1[key].name + ") is not supported yet");
|
|
105
|
+
existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
var newValue = Class;
|
|
109
|
+
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
|
110
|
+
var dec = assertCallable(decs[i], "A decorator", "be", true);
|
|
111
|
+
var decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
|
112
|
+
var decoratorFinishedRef = {};
|
|
113
|
+
var ctx = {
|
|
114
|
+
kind: [
|
|
115
|
+
"field",
|
|
116
|
+
"accessor",
|
|
117
|
+
"method",
|
|
118
|
+
"getter",
|
|
119
|
+
"setter",
|
|
120
|
+
"class"
|
|
121
|
+
][kind],
|
|
122
|
+
name,
|
|
123
|
+
metadata,
|
|
124
|
+
addInitializer: (function(decoratorFinishedRef, initializer) {
|
|
125
|
+
if (decoratorFinishedRef.v) throw new TypeError("attempted to call addInitializer after decoration was finished");
|
|
126
|
+
assertCallable(initializer, "An initializer", "be", true);
|
|
127
|
+
initializers.push(initializer);
|
|
128
|
+
}).bind(null, decoratorFinishedRef)
|
|
129
|
+
};
|
|
130
|
+
if (isClass) {
|
|
131
|
+
_ = dec.call(decThis, newValue, ctx);
|
|
132
|
+
decoratorFinishedRef.v = 1;
|
|
133
|
+
if (assertCallable(_, "class decorators", "return")) newValue = _;
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
ctx.static = isStatic;
|
|
137
|
+
ctx.private = isPrivate;
|
|
138
|
+
_ = ctx.access = { has: isPrivate ? hasPrivateBrand.bind() : function(target) {
|
|
139
|
+
return name in target;
|
|
140
|
+
} };
|
|
141
|
+
if (!isSetter) _.get = isPrivate ? isMethod ? function(_this) {
|
|
142
|
+
assertInstanceIfPrivate(_this);
|
|
143
|
+
return desc1.value;
|
|
144
|
+
} : bindPropCall("get", 0, assertInstanceIfPrivate) : function(target) {
|
|
145
|
+
return target[name];
|
|
146
|
+
};
|
|
147
|
+
if (!isMethod && !isGetter) _.set = isPrivate ? bindPropCall("set", 0, assertInstanceIfPrivate) : function(target, value) {
|
|
148
|
+
target[name] = value;
|
|
149
|
+
};
|
|
150
|
+
newValue = dec.call(decThis, isAccessor ? {
|
|
151
|
+
get: desc1.get,
|
|
152
|
+
set: desc1.set
|
|
153
|
+
} : desc1[key], ctx);
|
|
154
|
+
decoratorFinishedRef.v = 1;
|
|
155
|
+
if (isAccessor) {
|
|
156
|
+
if (typeof newValue === "object" && newValue) {
|
|
157
|
+
if (_ = assertCallable(newValue.get, "accessor.get")) desc1.get = _;
|
|
158
|
+
if (_ = assertCallable(newValue.set, "accessor.set")) desc1.set = _;
|
|
159
|
+
if (_ = assertCallable(newValue.init, "accessor.init")) init.unshift(_);
|
|
160
|
+
} else if (newValue !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
|
|
161
|
+
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) if (isField) init.unshift(newValue);
|
|
162
|
+
else desc1[key] = newValue;
|
|
163
|
+
}
|
|
164
|
+
if (kind < 2) ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
|
|
165
|
+
if (!isField && !isClass) if (isPrivate) if (isAccessor) ret.splice(-1, 0, bindPropCall("get", isStatic), bindPropCall("set", isStatic));
|
|
166
|
+
else ret.push(isMethod ? desc1[key] : assertCallable.call.bind(desc1[key]));
|
|
167
|
+
else defineProperty(Class, name, desc1);
|
|
168
|
+
return newValue;
|
|
169
|
+
}
|
|
170
|
+
function applyMemberDecs() {
|
|
171
|
+
var ret = [];
|
|
172
|
+
var protoInitializers;
|
|
173
|
+
var staticInitializers;
|
|
174
|
+
var pushInitializers = function(initializers) {
|
|
175
|
+
if (initializers) ret.push(createRunInitializers(initializers));
|
|
176
|
+
};
|
|
177
|
+
var applyMemberDecsOfKind = function(isStatic, isField) {
|
|
178
|
+
for (var i = 0; i < memberDecs.length; i++) {
|
|
179
|
+
var decInfo = memberDecs[i];
|
|
180
|
+
var kind = decInfo[1];
|
|
181
|
+
var kindOnly = kind & 7;
|
|
182
|
+
if ((kind & 8) == isStatic && !kindOnly == isField) {
|
|
183
|
+
var name = decInfo[2];
|
|
184
|
+
var isPrivate = !!decInfo[3];
|
|
185
|
+
var decoratorsHaveThis = kind & 16;
|
|
186
|
+
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : toPropertyKey(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function(_) {
|
|
187
|
+
return checkInRHS(_) === targetClass;
|
|
188
|
+
} : instanceBrand);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
applyMemberDecsOfKind(8, 0);
|
|
193
|
+
applyMemberDecsOfKind(0, 0);
|
|
194
|
+
applyMemberDecsOfKind(8, 1);
|
|
195
|
+
applyMemberDecsOfKind(0, 1);
|
|
196
|
+
pushInitializers(protoInitializers);
|
|
197
|
+
pushInitializers(staticInitializers);
|
|
198
|
+
return ret;
|
|
199
|
+
}
|
|
200
|
+
function defineMetadata(Class) {
|
|
201
|
+
return defineProperty(Class, symbolMetadata, {
|
|
202
|
+
configurable: true,
|
|
203
|
+
enumerable: true,
|
|
204
|
+
value: metadata
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
if (parentClass !== void 0) metadata = parentClass[symbolMetadata];
|
|
208
|
+
metadata = create(metadata == null ? null : metadata);
|
|
209
|
+
_ = applyMemberDecs();
|
|
210
|
+
if (!hasClassDecs) defineMetadata(targetClass);
|
|
211
|
+
return {
|
|
212
|
+
e: _,
|
|
213
|
+
get c() {
|
|
214
|
+
var initializers = [];
|
|
215
|
+
return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
let _dec, _initClass;
|
|
220
|
+
_dec = injectable([
|
|
221
|
+
inject(CliLoggerToken),
|
|
222
|
+
inject(PrepareMirrorOrchestratorToken),
|
|
223
|
+
inject(RunMirrorSyncUseCaseToken)
|
|
224
|
+
]);
|
|
225
|
+
let _MirrorCommand;
|
|
226
|
+
(class {
|
|
227
|
+
logger;
|
|
228
|
+
prepareMirrorSync;
|
|
229
|
+
runMirrorSync;
|
|
230
|
+
static {
|
|
231
|
+
({c: [_MirrorCommand, _initClass]} = _apply_decs_2311(this, [_dec], []));
|
|
232
|
+
}
|
|
233
|
+
constructor(logger, prepareMirrorSync, runMirrorSync) {
|
|
234
|
+
this.logger = logger;
|
|
235
|
+
this.prepareMirrorSync = prepareMirrorSync;
|
|
236
|
+
this.runMirrorSync = runMirrorSync;
|
|
237
|
+
}
|
|
238
|
+
name = "mirror";
|
|
239
|
+
description = "Keep package manifests aligned with what you ship";
|
|
240
|
+
register(program) {
|
|
241
|
+
program.command(this.name).description(this.description).command("sync").description("Write package.json exports from dist/ for workspace packages").argument("[package]", "Optional package path relative to repo root (e.g. packages/ui)").option("-v, --verbose", "Print extra diagnostics", false).option("--json", "Print one JSON summary on stdout (suppresses human progress)", false).action(this.execute.bind(this));
|
|
242
|
+
}
|
|
243
|
+
async execute(pkg, options, command) {
|
|
244
|
+
const prelude = await this.prepareMirrorSync.execute({
|
|
245
|
+
currentWorkingDirectory: process.cwd(),
|
|
246
|
+
packageArg: pkg,
|
|
247
|
+
globalCliRaw: command.optsWithGlobals()
|
|
248
|
+
});
|
|
249
|
+
if (!consumeCliAppError(this.logger, prelude)) return;
|
|
250
|
+
const { rootDir, config, packageFilter, globals } = prelude.value;
|
|
251
|
+
const parsed = parseWithCliSchema(mirrorSyncRunRequestSchema, {
|
|
252
|
+
rootDir,
|
|
253
|
+
config: config.mirror ?? {},
|
|
254
|
+
verbose: options.verbose,
|
|
255
|
+
json: options.json,
|
|
256
|
+
noColor: globals.color === false,
|
|
257
|
+
packageFilter
|
|
258
|
+
});
|
|
259
|
+
if (!consumeCliAppError(this.logger, parsed)) return;
|
|
260
|
+
await runCliResultAsync(this.logger, this.runMirrorSync.execute(parsed.value), (stats) => stats.packagesErrored > 0 ? 1 : 0);
|
|
261
|
+
}
|
|
262
|
+
static {
|
|
263
|
+
_initClass();
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
//#endregion
|
|
267
|
+
export { _MirrorCommand as MirrorCommand };
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { CliLoggerToken } from "../lib/core/operational/contracts/tokens.mjs";
|
|
2
|
+
import { parseWithCliSchema } from "../lib/core/presentation/parse-cli-schema.presenter.mjs";
|
|
3
|
+
import { consumeCliAppError } from "../lib/core/presentation/cli-executor.presenter.mjs";
|
|
4
|
+
import { exitCodeForTagSyncResult } from "../lib/tag/application/tag-sync-cli-result.mjs";
|
|
5
|
+
import { formatTagSyncJsonOutput } from "../lib/tag/application/tag-sync-json.format.mjs";
|
|
6
|
+
import { CreateTagProgressListenerPresenterToken, PrepareTagOrchestratorToken, PresentTagSyncResultPresenterToken, RunTagSyncUseCaseToken } from "../lib/tag/contracts/tokens.mjs";
|
|
7
|
+
import { tagSyncRunRequestSchema } from "../lib/tag/presentation/tag-cli-schema.presenter.mjs";
|
|
8
|
+
import process from "node:process";
|
|
9
|
+
import { inject, injectable } from "@codefast/di";
|
|
10
|
+
//#region src/commands/tag.ts
|
|
11
|
+
function toPrimitive(input, hint) {
|
|
12
|
+
if (typeof input !== "object" || input === null) return input;
|
|
13
|
+
var prim = input[Symbol.toPrimitive];
|
|
14
|
+
if (prim !== void 0) {
|
|
15
|
+
var res = prim.call(input, hint || "default");
|
|
16
|
+
if (typeof res !== "object") return res;
|
|
17
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18
|
+
}
|
|
19
|
+
return (hint === "string" ? String : Number)(input);
|
|
20
|
+
}
|
|
21
|
+
function toPropertyKey(arg) {
|
|
22
|
+
var key = toPrimitive(arg, "string");
|
|
23
|
+
return typeof key === "symbol" ? key : String(key);
|
|
24
|
+
}
|
|
25
|
+
function checkInRHS(value) {
|
|
26
|
+
if (Object(value) !== value) throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null"));
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
function setFunctionName(fn, name, prefix) {
|
|
30
|
+
if (typeof name === "symbol") {
|
|
31
|
+
name = name.description;
|
|
32
|
+
name = name ? "[" + name + "]" : "";
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
Object.defineProperty(fn, "name", {
|
|
36
|
+
configurable: true,
|
|
37
|
+
value: prefix ? prefix + " " + name : name
|
|
38
|
+
});
|
|
39
|
+
} catch (_) {}
|
|
40
|
+
return fn;
|
|
41
|
+
}
|
|
42
|
+
function _apply_decs_2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
|
|
43
|
+
var symbolMetadata = Symbol.metadata || Symbol.for("Symbol.metadata");
|
|
44
|
+
var defineProperty = Object.defineProperty;
|
|
45
|
+
var create = Object.create;
|
|
46
|
+
var metadata;
|
|
47
|
+
var existingNonFields = [create(null), create(null)];
|
|
48
|
+
var hasClassDecs = classDecs.length;
|
|
49
|
+
var _;
|
|
50
|
+
function createRunInitializers(initializers, useStaticThis, hasValue) {
|
|
51
|
+
return function(thisArg, value) {
|
|
52
|
+
if (useStaticThis) {
|
|
53
|
+
value = thisArg;
|
|
54
|
+
thisArg = targetClass;
|
|
55
|
+
}
|
|
56
|
+
for (var i = 0; i < initializers.length; i++) value = initializers[i].apply(thisArg, hasValue ? [value] : []);
|
|
57
|
+
return hasValue ? value : thisArg;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function assertCallable(fn, hint1, hint2, throwUndefined) {
|
|
61
|
+
if (typeof fn !== "function") {
|
|
62
|
+
if (throwUndefined || fn !== void 0) throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
|
|
63
|
+
}
|
|
64
|
+
return fn;
|
|
65
|
+
}
|
|
66
|
+
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
|
|
67
|
+
function assertInstanceIfPrivate(target) {
|
|
68
|
+
if (!hasPrivateBrand(target)) throw new TypeError("Attempted to access private element on non-instance");
|
|
69
|
+
}
|
|
70
|
+
var decs = [].concat(decInfo[0]);
|
|
71
|
+
var decVal = decInfo[3];
|
|
72
|
+
var isClass = !ret;
|
|
73
|
+
var isAccessor = kind === 1;
|
|
74
|
+
var isGetter = kind === 3;
|
|
75
|
+
var isSetter = kind === 4;
|
|
76
|
+
var isMethod = kind === 2;
|
|
77
|
+
function bindPropCall(name, useStaticThis, before) {
|
|
78
|
+
return function(_this, value) {
|
|
79
|
+
if (useStaticThis) {
|
|
80
|
+
value = _this;
|
|
81
|
+
_this = Class;
|
|
82
|
+
}
|
|
83
|
+
if (before) before(_this);
|
|
84
|
+
return desc[name].call(_this, value);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
var desc1 = {};
|
|
88
|
+
var init = [];
|
|
89
|
+
var key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
|
|
90
|
+
if (!isClass) {
|
|
91
|
+
if (isPrivate) {
|
|
92
|
+
if (isField || isAccessor) desc1 = {
|
|
93
|
+
get: setFunctionName(function() {
|
|
94
|
+
return decVal(this);
|
|
95
|
+
}, name, "get"),
|
|
96
|
+
set: function(value) {
|
|
97
|
+
decInfo[4](this, value);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
else desc1[key] = decVal;
|
|
101
|
+
if (!isField) setFunctionName(desc1[key], name, isMethod ? "" : key);
|
|
102
|
+
} else if (!isField) desc1 = Object.getOwnPropertyDescriptor(Class, name);
|
|
103
|
+
if (!isField && !isPrivate) {
|
|
104
|
+
_ = existingNonFields[+isStatic][name];
|
|
105
|
+
if (_ && (_ ^ kind) !== 7) throw new Error("Decorating two elements with the same name (" + desc1[key].name + ") is not supported yet");
|
|
106
|
+
existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
var newValue = Class;
|
|
110
|
+
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
|
|
111
|
+
var dec = assertCallable(decs[i], "A decorator", "be", true);
|
|
112
|
+
var decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
|
|
113
|
+
var decoratorFinishedRef = {};
|
|
114
|
+
var ctx = {
|
|
115
|
+
kind: [
|
|
116
|
+
"field",
|
|
117
|
+
"accessor",
|
|
118
|
+
"method",
|
|
119
|
+
"getter",
|
|
120
|
+
"setter",
|
|
121
|
+
"class"
|
|
122
|
+
][kind],
|
|
123
|
+
name,
|
|
124
|
+
metadata,
|
|
125
|
+
addInitializer: (function(decoratorFinishedRef, initializer) {
|
|
126
|
+
if (decoratorFinishedRef.v) throw new TypeError("attempted to call addInitializer after decoration was finished");
|
|
127
|
+
assertCallable(initializer, "An initializer", "be", true);
|
|
128
|
+
initializers.push(initializer);
|
|
129
|
+
}).bind(null, decoratorFinishedRef)
|
|
130
|
+
};
|
|
131
|
+
if (isClass) {
|
|
132
|
+
_ = dec.call(decThis, newValue, ctx);
|
|
133
|
+
decoratorFinishedRef.v = 1;
|
|
134
|
+
if (assertCallable(_, "class decorators", "return")) newValue = _;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
ctx.static = isStatic;
|
|
138
|
+
ctx.private = isPrivate;
|
|
139
|
+
_ = ctx.access = { has: isPrivate ? hasPrivateBrand.bind() : function(target) {
|
|
140
|
+
return name in target;
|
|
141
|
+
} };
|
|
142
|
+
if (!isSetter) _.get = isPrivate ? isMethod ? function(_this) {
|
|
143
|
+
assertInstanceIfPrivate(_this);
|
|
144
|
+
return desc1.value;
|
|
145
|
+
} : bindPropCall("get", 0, assertInstanceIfPrivate) : function(target) {
|
|
146
|
+
return target[name];
|
|
147
|
+
};
|
|
148
|
+
if (!isMethod && !isGetter) _.set = isPrivate ? bindPropCall("set", 0, assertInstanceIfPrivate) : function(target, value) {
|
|
149
|
+
target[name] = value;
|
|
150
|
+
};
|
|
151
|
+
newValue = dec.call(decThis, isAccessor ? {
|
|
152
|
+
get: desc1.get,
|
|
153
|
+
set: desc1.set
|
|
154
|
+
} : desc1[key], ctx);
|
|
155
|
+
decoratorFinishedRef.v = 1;
|
|
156
|
+
if (isAccessor) {
|
|
157
|
+
if (typeof newValue === "object" && newValue) {
|
|
158
|
+
if (_ = assertCallable(newValue.get, "accessor.get")) desc1.get = _;
|
|
159
|
+
if (_ = assertCallable(newValue.set, "accessor.set")) desc1.set = _;
|
|
160
|
+
if (_ = assertCallable(newValue.init, "accessor.init")) init.unshift(_);
|
|
161
|
+
} else if (newValue !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
|
|
162
|
+
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) if (isField) init.unshift(newValue);
|
|
163
|
+
else desc1[key] = newValue;
|
|
164
|
+
}
|
|
165
|
+
if (kind < 2) ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
|
|
166
|
+
if (!isField && !isClass) if (isPrivate) if (isAccessor) ret.splice(-1, 0, bindPropCall("get", isStatic), bindPropCall("set", isStatic));
|
|
167
|
+
else ret.push(isMethod ? desc1[key] : assertCallable.call.bind(desc1[key]));
|
|
168
|
+
else defineProperty(Class, name, desc1);
|
|
169
|
+
return newValue;
|
|
170
|
+
}
|
|
171
|
+
function applyMemberDecs() {
|
|
172
|
+
var ret = [];
|
|
173
|
+
var protoInitializers;
|
|
174
|
+
var staticInitializers;
|
|
175
|
+
var pushInitializers = function(initializers) {
|
|
176
|
+
if (initializers) ret.push(createRunInitializers(initializers));
|
|
177
|
+
};
|
|
178
|
+
var applyMemberDecsOfKind = function(isStatic, isField) {
|
|
179
|
+
for (var i = 0; i < memberDecs.length; i++) {
|
|
180
|
+
var decInfo = memberDecs[i];
|
|
181
|
+
var kind = decInfo[1];
|
|
182
|
+
var kindOnly = kind & 7;
|
|
183
|
+
if ((kind & 8) == isStatic && !kindOnly == isField) {
|
|
184
|
+
var name = decInfo[2];
|
|
185
|
+
var isPrivate = !!decInfo[3];
|
|
186
|
+
var decoratorsHaveThis = kind & 16;
|
|
187
|
+
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : toPropertyKey(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function(_) {
|
|
188
|
+
return checkInRHS(_) === targetClass;
|
|
189
|
+
} : instanceBrand);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
applyMemberDecsOfKind(8, 0);
|
|
194
|
+
applyMemberDecsOfKind(0, 0);
|
|
195
|
+
applyMemberDecsOfKind(8, 1);
|
|
196
|
+
applyMemberDecsOfKind(0, 1);
|
|
197
|
+
pushInitializers(protoInitializers);
|
|
198
|
+
pushInitializers(staticInitializers);
|
|
199
|
+
return ret;
|
|
200
|
+
}
|
|
201
|
+
function defineMetadata(Class) {
|
|
202
|
+
return defineProperty(Class, symbolMetadata, {
|
|
203
|
+
configurable: true,
|
|
204
|
+
enumerable: true,
|
|
205
|
+
value: metadata
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
if (parentClass !== void 0) metadata = parentClass[symbolMetadata];
|
|
209
|
+
metadata = create(metadata == null ? null : metadata);
|
|
210
|
+
_ = applyMemberDecs();
|
|
211
|
+
if (!hasClassDecs) defineMetadata(targetClass);
|
|
212
|
+
return {
|
|
213
|
+
e: _,
|
|
214
|
+
get c() {
|
|
215
|
+
var initializers = [];
|
|
216
|
+
return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
let _dec, _initClass;
|
|
221
|
+
_dec = injectable([
|
|
222
|
+
inject(CliLoggerToken),
|
|
223
|
+
inject(PrepareTagOrchestratorToken),
|
|
224
|
+
inject(RunTagSyncUseCaseToken),
|
|
225
|
+
inject(CreateTagProgressListenerPresenterToken),
|
|
226
|
+
inject(PresentTagSyncResultPresenterToken)
|
|
227
|
+
]);
|
|
228
|
+
let _TagCommand;
|
|
229
|
+
(class {
|
|
230
|
+
logger;
|
|
231
|
+
prepareTagSync;
|
|
232
|
+
runTagSync;
|
|
233
|
+
createProgressListener;
|
|
234
|
+
presentSyncCliResult;
|
|
235
|
+
static {
|
|
236
|
+
({c: [_TagCommand, _initClass]} = _apply_decs_2311(this, [_dec], []));
|
|
237
|
+
}
|
|
238
|
+
constructor(logger, prepareTagSync, runTagSync, createProgressListener, presentSyncCliResult) {
|
|
239
|
+
this.logger = logger;
|
|
240
|
+
this.prepareTagSync = prepareTagSync;
|
|
241
|
+
this.runTagSync = runTagSync;
|
|
242
|
+
this.createProgressListener = createProgressListener;
|
|
243
|
+
this.presentSyncCliResult = presentSyncCliResult;
|
|
244
|
+
}
|
|
245
|
+
name = "tag";
|
|
246
|
+
description = "Add @since <version> JSDoc tags to exported declarations";
|
|
247
|
+
register(program) {
|
|
248
|
+
program.command(this.name).alias("annotate").description(this.description).argument("[target]", "Directory or file to annotate (default: auto-discover workspace packages)").option("--dry-run", "Show summary without writing files", false).option("--json", "Print one JSON summary on stdout (suppresses human progress)", false).action(this.execute.bind(this));
|
|
249
|
+
}
|
|
250
|
+
async execute(target, options, command) {
|
|
251
|
+
const prelude = await this.prepareTagSync.execute({
|
|
252
|
+
currentWorkingDirectory: process.cwd(),
|
|
253
|
+
rawTarget: target,
|
|
254
|
+
globalCliRaw: command.optsWithGlobals()
|
|
255
|
+
});
|
|
256
|
+
if (!consumeCliAppError(this.logger, prelude)) return;
|
|
257
|
+
const { rootDir, config, resolvedTargetPath } = prelude.value;
|
|
258
|
+
const tagConfig = config.tag ?? {};
|
|
259
|
+
const parsed = parseWithCliSchema(tagSyncRunRequestSchema, {
|
|
260
|
+
rootDir,
|
|
261
|
+
write: !options.dryRun,
|
|
262
|
+
json: options.json,
|
|
263
|
+
targetPath: resolvedTargetPath,
|
|
264
|
+
skipPackages: tagConfig.skipPackages,
|
|
265
|
+
config: tagConfig
|
|
266
|
+
});
|
|
267
|
+
if (!consumeCliAppError(this.logger, parsed)) return;
|
|
268
|
+
const tagOutcome = await this.runTagSync.execute({
|
|
269
|
+
...parsed.value,
|
|
270
|
+
listener: parsed.value.json ? void 0 : this.createProgressListener.create((line) => this.logger.out(line))
|
|
271
|
+
});
|
|
272
|
+
if (!consumeCliAppError(this.logger, tagOutcome)) return;
|
|
273
|
+
if (parsed.value.json) {
|
|
274
|
+
this.logger.out(formatTagSyncJsonOutput(tagOutcome.value, rootDir));
|
|
275
|
+
process.exitCode = exitCodeForTagSyncResult(tagOutcome.value);
|
|
276
|
+
} else process.exitCode = this.presentSyncCliResult.present(tagOutcome.value, rootDir);
|
|
277
|
+
}
|
|
278
|
+
static {
|
|
279
|
+
_initClass();
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
//#endregion
|
|
283
|
+
export { _TagCommand as TagCommand };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/lib/arrange/application/arrange-analyze-json.format.ts
|
|
2
|
+
function formatArrangeAnalyzeJsonOutput(analyzeRootPath, report) {
|
|
3
|
+
return JSON.stringify({
|
|
4
|
+
schemaVersion: 1,
|
|
5
|
+
analyzeRootPath,
|
|
6
|
+
report
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { formatArrangeAnalyzeJsonOutput };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/lib/arrange/application/arrange-group-json.format.ts
|
|
2
|
+
function formatArrangeGroupJsonOutput(output) {
|
|
3
|
+
const payload = {
|
|
4
|
+
schemaVersion: 1,
|
|
5
|
+
primaryLine: output.primaryLine,
|
|
6
|
+
bucketsCommentLine: output.bucketsCommentLine
|
|
7
|
+
};
|
|
8
|
+
return JSON.stringify(payload);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { formatArrangeGroupJsonOutput };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "../../core/domain/cli-exit-codes.domain.mjs";
|
|
2
|
+
//#region src/lib/arrange/application/arrange-sync-cli-result.ts
|
|
3
|
+
function exitCodeForArrangeSyncResult(result) {
|
|
4
|
+
return result.hookError !== null ? 1 : 0;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { exitCodeForArrangeSyncResult };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/lib/arrange/application/arrange-sync-json.format.ts
|
|
2
|
+
function formatArrangeSyncJsonOutput(result, write) {
|
|
3
|
+
const payload = {
|
|
4
|
+
schemaVersion: 1,
|
|
5
|
+
ok: result.hookError === null,
|
|
6
|
+
write,
|
|
7
|
+
result
|
|
8
|
+
};
|
|
9
|
+
return JSON.stringify(payload);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { formatArrangeSyncJsonOutput };
|