@codefast/cli 0.3.13-canary.0 → 0.3.13-canary.2
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/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/{bin.mjs → bin.js} +1 -4
- package/dist/commands/arrange.d.ts +3 -0
- package/dist/commands/arrange.d.ts.map +1 -0
- package/dist/commands/arrange.js +129 -0
- package/dist/commands/mirror.d.ts +4 -0
- package/dist/commands/mirror.d.ts.map +1 -0
- package/dist/commands/mirror.js +75 -0
- package/dist/commands/tag.d.ts +3 -0
- package/dist/commands/tag.d.ts.map +1 -0
- package/dist/commands/tag.js +41 -0
- package/dist/lib/arrange/application/analyze.d.ts +17 -0
- package/dist/lib/arrange/application/analyze.d.ts.map +1 -0
- package/dist/lib/arrange/application/analyze.js +24 -0
- package/dist/lib/arrange/application/group-file-preview.d.ts +17 -0
- package/dist/lib/arrange/application/group-file-preview.d.ts.map +1 -0
- package/dist/lib/arrange/application/group-file-preview.js +46 -0
- package/dist/lib/arrange/application/group-file.d.ts +5 -0
- package/dist/lib/arrange/application/group-file.d.ts.map +1 -0
- package/dist/lib/arrange/application/group-file.js +40 -0
- package/dist/lib/arrange/application/ports/domain-source-parser.port.d.ts +5 -0
- package/dist/lib/arrange/application/ports/domain-source-parser.port.d.ts.map +1 -0
- package/dist/lib/arrange/application/ports/file-walker.port.d.ts +5 -0
- package/dist/lib/arrange/application/ports/file-walker.port.d.ts.map +1 -0
- package/dist/lib/arrange/application/requests/analyze-directory.request.d.ts +6 -0
- package/dist/lib/arrange/application/requests/analyze-directory.request.d.ts.map +1 -0
- package/dist/lib/arrange/application/requests/analyze-directory.request.js +4 -0
- package/dist/lib/arrange/application/requests/arrange-sync.request.d.ts +18 -0
- package/dist/lib/arrange/application/requests/arrange-sync.request.d.ts.map +1 -0
- package/dist/lib/arrange/application/requests/arrange-sync.request.js +15 -0
- package/dist/lib/arrange/application/run-target.d.ts +19 -0
- package/dist/lib/arrange/application/run-target.d.ts.map +1 -0
- package/dist/lib/arrange/application/run-target.js +85 -0
- package/dist/lib/arrange/domain/arrange-analyze.service.d.ts +12 -0
- package/dist/lib/arrange/domain/arrange-analyze.service.d.ts.map +1 -0
- package/dist/lib/arrange/domain/arrange-analyze.service.js +116 -0
- package/dist/lib/arrange/domain/arrange-grouping.service.d.ts +53 -0
- package/dist/lib/arrange/domain/arrange-grouping.service.d.ts.map +1 -0
- package/dist/lib/arrange/domain/arrange-grouping.service.js +106 -0
- package/dist/lib/arrange/domain/ast/ast-helpers.d.ts +28 -0
- package/dist/lib/arrange/domain/ast/ast-helpers.d.ts.map +1 -0
- package/dist/lib/arrange/domain/ast/ast-helpers.js +130 -0
- package/dist/lib/arrange/domain/ast/ast-node.model.d.ts +179 -0
- package/dist/lib/arrange/domain/ast/ast-node.model.d.ts.map +1 -0
- package/dist/lib/arrange/domain/ast/ast-node.model.js +210 -0
- package/dist/lib/arrange/domain/ast/collectors-cn.d.ts +7 -0
- package/dist/lib/arrange/domain/ast/collectors-cn.d.ts.map +1 -0
- package/dist/lib/arrange/domain/ast/collectors-cn.js +70 -0
- package/dist/lib/arrange/domain/ast/collectors-jsx.d.ts +4 -0
- package/dist/lib/arrange/domain/ast/collectors-jsx.d.ts.map +1 -0
- package/dist/lib/arrange/domain/ast/collectors-jsx.js +21 -0
- package/dist/lib/arrange/domain/ast/collectors-tv.d.ts +13 -0
- package/dist/lib/arrange/domain/ast/collectors-tv.d.ts.map +1 -0
- package/dist/lib/arrange/domain/ast/collectors-tv.js +302 -0
- package/dist/lib/arrange/domain/ast/targets.d.ts +8 -0
- package/dist/lib/arrange/domain/ast/targets.d.ts.map +1 -0
- package/dist/lib/arrange/domain/ast/targets.js +147 -0
- package/dist/lib/arrange/domain/constants.d.ts +68 -0
- package/dist/lib/arrange/domain/constants.d.ts.map +1 -0
- package/dist/lib/arrange/domain/constants.js +180 -0
- package/dist/lib/arrange/domain/errors.d.ts +14 -0
- package/dist/lib/arrange/domain/errors.d.ts.map +1 -0
- package/dist/lib/arrange/domain/errors.js +16 -0
- package/dist/lib/arrange/domain/grouping.d.ts +41 -0
- package/dist/lib/arrange/domain/grouping.d.ts.map +1 -0
- package/dist/lib/arrange/domain/grouping.js +307 -0
- package/dist/lib/arrange/domain/imports.d.ts +7 -0
- package/dist/lib/arrange/domain/imports.d.ts.map +1 -0
- package/dist/lib/arrange/domain/imports.js +80 -0
- package/dist/lib/arrange/domain/source-text-formatters.d.ts +16 -0
- package/dist/lib/arrange/domain/source-text-formatters.d.ts.map +1 -0
- package/dist/lib/arrange/domain/source-text-formatters.js +55 -0
- package/dist/lib/arrange/domain/tokenizer.d.ts +45 -0
- package/dist/lib/arrange/domain/tokenizer.d.ts.map +1 -0
- package/dist/lib/arrange/domain/tokenizer.js +466 -0
- package/dist/lib/arrange/domain/types.d.ts +112 -0
- package/dist/lib/arrange/domain/types.d.ts.map +1 -0
- package/dist/lib/arrange/domain/types.js +7 -0
- package/dist/lib/arrange/index.d.ts +45 -0
- package/dist/lib/arrange/index.d.ts.map +1 -0
- package/dist/lib/arrange/index.js +41 -0
- package/dist/lib/arrange/infra/arrange-sync-cli-options.d.ts +14 -0
- package/dist/lib/arrange/infra/arrange-sync-cli-options.d.ts.map +1 -0
- package/dist/lib/arrange/infra/domain-source-parser.adapter.d.ts +11 -0
- package/dist/lib/arrange/infra/domain-source-parser.adapter.d.ts.map +1 -0
- package/dist/lib/arrange/infra/domain-source-parser.adapter.js +19 -0
- package/dist/lib/arrange/infra/ensure-cn-import.d.ts +3 -0
- package/dist/lib/arrange/infra/ensure-cn-import.d.ts.map +1 -0
- package/dist/lib/arrange/infra/ensure-cn-import.js +6 -0
- package/dist/lib/arrange/infra/file-walker.adapter.d.ts +8 -0
- package/dist/lib/arrange/infra/file-walker.adapter.d.ts.map +1 -0
- package/dist/lib/arrange/infra/file-walker.adapter.js +17 -0
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.d.ts +8 -0
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.d.ts.map +1 -0
- package/dist/lib/arrange/infra/merge-cn-literal-pool-for-test.js +25 -0
- package/dist/lib/arrange/infra/ts-ast-translator.d.ts +10 -0
- package/dist/lib/arrange/infra/ts-ast-translator.d.ts.map +1 -0
- package/dist/lib/arrange/infra/ts-ast-translator.js +363 -0
- package/dist/lib/arrange/presentation/formatters.d.ts +3 -0
- package/dist/lib/arrange/presentation/formatters.d.ts.map +1 -0
- package/dist/lib/arrange/presentation/formatters.js +2 -0
- package/dist/lib/arrange/presentation/report.d.ts +4 -0
- package/dist/lib/arrange/presentation/report.d.ts.map +1 -0
- package/dist/lib/arrange/presentation/report.js +37 -0
- package/dist/lib/config/domain/schema.d.ts +50 -0
- package/dist/lib/config/domain/schema.d.ts.map +1 -0
- package/dist/lib/config/domain/schema.js +43 -0
- package/dist/lib/config/index.d.ts +4 -0
- package/dist/lib/config/index.d.ts.map +1 -0
- package/dist/lib/config/index.js +2 -0
- package/dist/lib/config/infra/loader.d.ts +11 -0
- package/dist/lib/config/infra/loader.d.ts.map +1 -0
- package/dist/lib/config/infra/loader.js +90 -0
- package/dist/lib/core/application/architecture-boundaries.d.ts +19 -0
- package/dist/lib/core/application/architecture-boundaries.d.ts.map +1 -0
- package/dist/lib/core/application/architecture-boundaries.js +263 -0
- package/dist/lib/core/application/ports/cli-io.port.d.ts +27 -0
- package/dist/lib/core/application/ports/cli-io.port.d.ts.map +1 -0
- package/dist/lib/core/application/schema-parse.d.ts +8 -0
- package/dist/lib/core/application/schema-parse.d.ts.map +1 -0
- package/dist/lib/core/application/schema-parse.js +20 -0
- package/dist/lib/core/application/utils/caught-unknown-message.d.ts +6 -0
- package/dist/lib/core/application/utils/caught-unknown-message.d.ts.map +1 -0
- package/dist/lib/core/application/utils/caught-unknown-message.js +34 -0
- package/dist/lib/core/application/utils/verbose-diagnostics.d.ts +5 -0
- package/dist/lib/core/application/utils/verbose-diagnostics.d.ts.map +1 -0
- package/dist/lib/core/application/utils/verbose-diagnostics.js +7 -0
- package/dist/lib/core/domain/errors.d.ts +11 -0
- package/dist/lib/core/domain/errors.d.ts.map +1 -0
- package/dist/lib/core/domain/errors.js +9 -0
- package/dist/lib/core/domain/result.d.ts +15 -0
- package/dist/lib/core/domain/result.d.ts.map +1 -0
- package/dist/lib/core/domain/result.js +9 -0
- package/dist/lib/core/infra/container.d.ts +34 -0
- package/dist/lib/core/infra/container.d.ts.map +1 -0
- package/dist/lib/core/infra/container.js +65 -0
- package/dist/lib/core/infra/logging-decorator.d.ts +12 -0
- package/dist/lib/core/infra/logging-decorator.d.ts.map +1 -0
- package/dist/lib/core/infra/logging-decorator.js +75 -0
- package/dist/lib/core/presentation/cli-executor.d.ts +33 -0
- package/dist/lib/core/presentation/cli-executor.d.ts.map +1 -0
- package/dist/lib/core/presentation/cli-executor.js +73 -0
- package/dist/lib/core/presentation/create-command-handler.d.ts +20 -0
- package/dist/lib/core/presentation/create-command-handler.d.ts.map +1 -0
- package/dist/lib/core/presentation/create-command-handler.js +70 -0
- package/dist/lib/core/presentation/format-app-error.d.ts +6 -0
- package/dist/lib/core/presentation/format-app-error.d.ts.map +1 -0
- package/dist/lib/core/presentation/format-app-error.js +19 -0
- package/dist/lib/infra/caught-unknown-message.d.ts +2 -0
- package/dist/lib/infra/caught-unknown-message.d.ts.map +1 -0
- package/dist/lib/infra/caught-unknown-message.js +1 -0
- package/dist/lib/infra/config-reporter.d.ts +4 -0
- package/dist/lib/infra/config-reporter.d.ts.map +1 -0
- package/dist/lib/infra/config-reporter.js +9 -0
- package/dist/lib/infra/fs-contract.d.ts +2 -0
- package/dist/lib/infra/fs-contract.d.ts.map +1 -0
- package/dist/lib/infra/fs-contract.js +1 -0
- package/dist/lib/infra/node-io.d.ts +4 -0
- package/dist/lib/infra/node-io.d.ts.map +1 -0
- package/dist/lib/infra/node-io.js +27 -0
- package/dist/lib/infra/workspace/repo-root.d.ts +7 -0
- package/dist/lib/infra/workspace/repo-root.d.ts.map +1 -0
- package/dist/lib/infra/workspace/repo-root.js +23 -0
- package/dist/lib/mirror/application/engine.d.ts +10 -0
- package/dist/lib/mirror/application/engine.d.ts.map +1 -0
- package/dist/lib/mirror/application/engine.js +271 -0
- package/dist/lib/mirror/application/ports/file-system-service.port.d.ts +6 -0
- package/dist/lib/mirror/application/ports/file-system-service.port.d.ts.map +1 -0
- package/dist/lib/mirror/application/ports/file-system-service.port.js +1 -0
- package/dist/lib/mirror/application/ports/mirror-sync-reporter.port.d.ts +27 -0
- package/dist/lib/mirror/application/ports/mirror-sync-reporter.port.d.ts.map +1 -0
- package/dist/lib/mirror/application/ports/mirror-sync-reporter.port.js +1 -0
- package/dist/lib/mirror/application/ports/package-repository.port.d.ts +16 -0
- package/dist/lib/mirror/application/ports/package-repository.port.d.ts.map +1 -0
- package/dist/lib/mirror/application/ports/package-repository.port.js +1 -0
- package/dist/lib/mirror/application/ports/workspace-service.port.d.ts +7 -0
- package/dist/lib/mirror/application/ports/workspace-service.port.d.ts.map +1 -0
- package/dist/lib/mirror/application/ports/workspace-service.port.js +1 -0
- package/dist/lib/mirror/application/requests/mirror-sync.request.d.ts +10 -0
- package/dist/lib/mirror/application/requests/mirror-sync.request.d.ts.map +1 -0
- package/dist/lib/mirror/application/requests/mirror-sync.request.js +8 -0
- package/dist/lib/mirror/application/sync.d.ts +19 -0
- package/dist/lib/mirror/application/sync.d.ts.map +1 -0
- package/dist/lib/mirror/application/sync.js +168 -0
- package/dist/lib/mirror/domain/constants.d.ts +6 -0
- package/dist/lib/mirror/domain/constants.d.ts.map +1 -0
- package/dist/lib/mirror/domain/constants.js +5 -0
- package/dist/lib/mirror/domain/errors.d.ts +10 -0
- package/dist/lib/mirror/domain/errors.d.ts.map +1 -0
- package/dist/lib/mirror/domain/errors.js +12 -0
- package/dist/lib/mirror/domain/types.d.ts +65 -0
- package/dist/lib/mirror/domain/types.d.ts.map +1 -0
- package/dist/lib/mirror/domain/types.js +1 -0
- package/dist/lib/mirror/index.d.ts +6 -0
- package/dist/lib/mirror/index.d.ts.map +1 -0
- package/dist/lib/mirror/index.js +1 -0
- package/dist/lib/mirror/infra/dirent-list.d.ts +9 -0
- package/dist/lib/mirror/infra/dirent-list.d.ts.map +1 -0
- package/dist/lib/mirror/infra/dirent-list.js +13 -0
- package/dist/lib/mirror/infra/file-system-service.adapter.d.ts +7 -0
- package/dist/lib/mirror/infra/file-system-service.adapter.d.ts.map +1 -0
- package/dist/lib/mirror/infra/file-system-service.adapter.js +47 -0
- package/dist/lib/mirror/infra/mirror-sync-cli-options.d.ts +14 -0
- package/dist/lib/mirror/infra/mirror-sync-cli-options.d.ts.map +1 -0
- package/dist/lib/mirror/infra/mirror-sync-cli-options.js +1 -0
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.d.ts +3 -0
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.d.ts.map +1 -0
- package/dist/lib/mirror/infra/mirror-sync-reporter.adapter.js +13 -0
- package/dist/lib/mirror/infra/package-filter.d.ts +8 -0
- package/dist/lib/mirror/infra/package-filter.d.ts.map +1 -0
- package/dist/lib/mirror/infra/package-filter.js +33 -0
- package/dist/lib/mirror/infra/package-repository.adapter.d.ts +17 -0
- package/dist/lib/mirror/infra/package-repository.adapter.d.ts.map +1 -0
- package/dist/lib/mirror/infra/package-repository.adapter.js +17 -0
- package/dist/lib/mirror/infra/path-normalizer.d.ts +2 -0
- package/dist/lib/mirror/infra/path-normalizer.d.ts.map +1 -0
- package/dist/lib/mirror/infra/path-normalizer.js +4 -0
- package/dist/lib/mirror/infra/update-pkg.d.ts +19 -0
- package/dist/lib/mirror/infra/update-pkg.d.ts.map +1 -0
- package/dist/lib/mirror/infra/update-pkg.js +156 -0
- package/dist/lib/mirror/infra/workspace-packages.d.ts +26 -0
- package/dist/lib/mirror/infra/workspace-packages.d.ts.map +1 -0
- package/dist/lib/mirror/infra/workspace-packages.js +170 -0
- package/dist/lib/mirror/infra/workspace-service.adapter.d.ts +8 -0
- package/dist/lib/mirror/infra/workspace-service.adapter.d.ts.map +1 -0
- package/dist/lib/mirror/infra/workspace-service.adapter.js +10 -0
- package/dist/lib/mirror/presentation/reporter.d.ts +25 -0
- package/dist/lib/mirror/presentation/reporter.d.ts.map +1 -0
- package/dist/lib/mirror/presentation/reporter.js +140 -0
- package/dist/lib/shared/source-code/domain/text-edit.d.ts +14 -0
- package/dist/lib/shared/source-code/domain/text-edit.d.ts.map +1 -0
- package/dist/lib/shared/source-code/domain/text-edit.js +30 -0
- package/dist/lib/shared/source-code/infra/tsx-file-walk.d.ts +4 -0
- package/dist/lib/shared/source-code/infra/tsx-file-walk.d.ts.map +1 -0
- package/dist/lib/shared/source-code/infra/tsx-file-walk.js +37 -0
- package/dist/lib/tag/application/engine.d.ts +23 -0
- package/dist/lib/tag/application/engine.d.ts.map +1 -0
- package/dist/lib/tag/application/engine.js +357 -0
- package/dist/lib/tag/application/ports/target-resolver.port.d.ts +6 -0
- package/dist/lib/tag/application/ports/target-resolver.port.d.ts.map +1 -0
- package/dist/lib/tag/application/ports/target-resolver.port.js +1 -0
- package/dist/lib/tag/application/ports/typescript-tree-walk.port.d.ts +6 -0
- package/dist/lib/tag/application/ports/typescript-tree-walk.port.d.ts.map +1 -0
- package/dist/lib/tag/application/ports/typescript-tree-walk.port.js +1 -0
- package/dist/lib/tag/application/requests/tag-sync.request.d.ts +10 -0
- package/dist/lib/tag/application/requests/tag-sync.request.d.ts.map +1 -0
- package/dist/lib/tag/application/requests/tag-sync.request.js +8 -0
- package/dist/lib/tag/domain/types.d.ts +56 -0
- package/dist/lib/tag/domain/types.d.ts.map +1 -0
- package/dist/lib/tag/domain/types.js +1 -0
- package/dist/lib/tag/index.d.ts +14 -0
- package/dist/lib/tag/index.d.ts.map +1 -0
- package/dist/lib/tag/index.js +10 -0
- package/dist/lib/tag/infra/tag-sync-cli-options.d.ts +14 -0
- package/dist/lib/tag/infra/tag-sync-cli-options.d.ts.map +1 -0
- package/dist/lib/tag/infra/tag-sync-cli-options.js +1 -0
- package/dist/lib/tag/infra/tag-target-resolver.adapter.d.ts +3 -0
- package/dist/lib/tag/infra/tag-target-resolver.adapter.d.ts.map +1 -0
- package/dist/lib/tag/infra/tag-target-resolver.adapter.js +4 -0
- package/dist/lib/tag/infra/target-resolver.d.ts +4 -0
- package/dist/lib/tag/infra/target-resolver.d.ts.map +1 -0
- package/dist/lib/tag/infra/target-resolver.js +200 -0
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.d.ts +3 -0
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.d.ts.map +1 -0
- package/dist/lib/tag/infra/typescript-tree-walk.adapter.js +4 -0
- package/dist/lib/tag/presentation/colors.d.ts +8 -0
- package/dist/lib/tag/presentation/colors.d.ts.map +1 -0
- package/dist/lib/tag/presentation/colors.js +9 -0
- package/dist/lib/tag/presentation/tag-presenter.d.ts +20 -0
- package/dist/lib/tag/presentation/tag-presenter.d.ts.map +1 -0
- package/dist/lib/tag/presentation/tag-presenter.js +92 -0
- package/dist/program.d.ts +4 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +40 -0
- package/package.json +8 -5
- package/dist/analyze-DvtJ3j9m.mjs +0 -92
- package/dist/arrange-Bbh62DrU.mjs +0 -107
- package/dist/arrange-BqP2DI3w.mjs +0 -8
- package/dist/ast-helpers-MDRYuIAk.mjs +0 -115
- package/dist/caught-unknown-message-CRhkDWO7.mjs +0 -20
- package/dist/collectors-cn-BS8TTQ8O.mjs +0 -61
- package/dist/collectors-jsx-D9tL2ZPM.mjs +0 -20
- package/dist/collectors-tv-D2PXZaRt.mjs +0 -170
- package/dist/colors-BjdkCfGK.mjs +0 -12
- package/dist/commands/arrange.mjs +0 -2
- package/dist/commands/mirror.mjs +0 -2
- package/dist/commands/mirror.test.mjs +0 -48
- package/dist/commands/tag.mjs +0 -2
- package/dist/config-DVia_f9a.mjs +0 -3
- package/dist/config-reporter-SCcWDZc1.mjs +0 -10
- package/dist/constants-AtPhF-Ct.mjs +0 -169
- package/dist/constants-Bq5wdyLC.mjs +0 -8
- package/dist/dirent-list-BSDeRG5i.mjs +0 -14
- package/dist/engine-CcWEHSCq.mjs +0 -287
- package/dist/engine-DRTdkc5u.mjs +0 -236
- package/dist/errors-CFH4w6ic.mjs +0 -15
- package/dist/errors-CpU1ogfA.mjs +0 -19
- package/dist/formatters-DGE8jJ53.mjs +0 -52
- package/dist/group-file-ClW7XdD6.mjs +0 -113
- package/dist/grouping-c1grpCQT.mjs +0 -235
- package/dist/imports-DSVq1xhB.mjs +0 -54
- package/dist/lib/arrange/application/analyze.mjs +0 -2
- package/dist/lib/arrange/application/analyze.test.mjs +0 -171
- package/dist/lib/arrange/application/group-file.mjs +0 -2
- package/dist/lib/arrange/application/group-file.test.mjs +0 -273
- package/dist/lib/arrange/application/run-target.mjs +0 -2
- package/dist/lib/arrange/application/run-target.test.mjs +0 -97
- package/dist/lib/arrange/domain/ast/ast-helpers.mjs +0 -2
- package/dist/lib/arrange/domain/ast/ast-helpers.test.mjs +0 -148
- package/dist/lib/arrange/domain/ast/collectors-cn.mjs +0 -2
- package/dist/lib/arrange/domain/ast/collectors-cn.test.mjs +0 -58
- package/dist/lib/arrange/domain/ast/collectors-jsx.mjs +0 -2
- package/dist/lib/arrange/domain/ast/collectors-jsx.test.mjs +0 -20
- package/dist/lib/arrange/domain/ast/collectors-tv.mjs +0 -2
- package/dist/lib/arrange/domain/ast/collectors-tv.test.mjs +0 -145
- package/dist/lib/arrange/domain/ast/targets.mjs +0 -2
- package/dist/lib/arrange/domain/ast/targets.test.mjs +0 -50
- package/dist/lib/arrange/domain/constants.mjs +0 -2
- package/dist/lib/arrange/domain/errors.mjs +0 -2
- package/dist/lib/arrange/domain/grouping.mjs +0 -2
- package/dist/lib/arrange/domain/grouping.test.mjs +0 -186
- package/dist/lib/arrange/domain/imports.mjs +0 -2
- package/dist/lib/arrange/domain/imports.test.mjs +0 -48
- package/dist/lib/arrange/domain/tokenizer.mjs +0 -2
- package/dist/lib/arrange/domain/tokenizer.test.mjs +0 -165
- package/dist/lib/arrange/index.mjs +0 -16
- package/dist/lib/arrange/infra/walk.mjs +0 -2
- package/dist/lib/arrange/infra/walk.test.mjs +0 -50
- package/dist/lib/arrange/presentation/formatters.mjs +0 -2
- package/dist/lib/arrange/presentation/formatters.test.mjs +0 -73
- package/dist/lib/arrange/presentation/report.mjs +0 -2
- package/dist/lib/config/domain/schema.mjs +0 -2
- package/dist/lib/config/index.mjs +0 -4
- package/dist/lib/config/infra/loader.mjs +0 -2
- package/dist/lib/config/infra/loader.test.mjs +0 -116
- package/dist/lib/infra/caught-unknown-message.mjs +0 -2
- package/dist/lib/infra/config-reporter.mjs +0 -2
- package/dist/lib/infra/node-io.mjs +0 -2
- package/dist/lib/infra/workspace/repo-root.mjs +0 -2
- package/dist/lib/infra/workspace/repo-root.test.mjs +0 -45
- package/dist/lib/mirror/application/engine.mjs +0 -2
- package/dist/lib/mirror/application/sync.mjs +0 -2
- package/dist/lib/mirror/application/sync.test.mjs +0 -482
- package/dist/lib/mirror/domain/constants.mjs +0 -2
- package/dist/lib/mirror/domain/errors.mjs +0 -2
- package/dist/lib/mirror/index.mjs +0 -3
- package/dist/lib/mirror/infra/dirent-list.mjs +0 -2
- package/dist/lib/mirror/infra/dirent-list.test.mjs +0 -18
- package/dist/lib/mirror/infra/package-filter.mjs +0 -2
- package/dist/lib/mirror/infra/package-filter.test.mjs +0 -32
- package/dist/lib/mirror/infra/path-normalizer.mjs +0 -2
- package/dist/lib/mirror/infra/update-pkg.mjs +0 -2
- package/dist/lib/mirror/infra/workspace-packages.mjs +0 -2
- package/dist/lib/mirror/infra/workspace-packages.test.mjs +0 -167
- package/dist/lib/mirror/presentation/reporter.mjs +0 -2
- package/dist/lib/tag/application/engine.mjs +0 -2
- package/dist/lib/tag/application/engine.test.mjs +0 -159
- package/dist/lib/tag/index.mjs +0 -5
- package/dist/lib/tag/infra/target-resolver.mjs +0 -2
- package/dist/lib/tag/presentation/colors.mjs +0 -2
- package/dist/lib/tag/presentation/tag-presenter.mjs +0 -2
- package/dist/lib/tag/presentation/tag-presenter.test.mjs +0 -29
- package/dist/loader-DpN-zl5g.mjs +0 -78
- package/dist/mirror-CbGiLXKT.mjs +0 -2
- package/dist/mirror-DqJE3ejL.mjs +0 -66
- package/dist/node-io-DFRbHO6m.mjs +0 -30
- package/dist/package-filter-C_8ryqvz.mjs +0 -26
- package/dist/path-normalizer-D4ceBO3l.mjs +0 -7
- package/dist/program-DR-H4tH3.mjs +0 -34
- package/dist/program.mjs +0 -2
- package/dist/repo-root-HmtIEm6J.mjs +0 -22
- package/dist/report-DYxvw34T.mjs +0 -24
- package/dist/reporter-CwIe_tAM.mjs +0 -108
- package/dist/run-target-CJWrqNT4.mjs +0 -65
- package/dist/schema-Or8RAARd.mjs +0 -25
- package/dist/sync-e1Sp-shi.mjs +0 -157
- package/dist/tag-Cd9JujU5.mjs +0 -2
- package/dist/tag-hEKVZ_-7.mjs +0 -58
- package/dist/tag-presenter-Cs66UBsH.mjs +0 -63
- package/dist/target-resolver-CR3FXMTy.mjs +0 -170
- package/dist/targets-pCTslnFh.mjs +0 -106
- package/dist/tokenizer-CeZx73Zu.mjs +0 -216
- package/dist/update-pkg-CnGfjWBy.mjs +0 -37
- package/dist/walk-DjgQn66n.mjs +0 -33
- package/dist/workspace-packages-K2NYTHJq.mjs +0 -159
- /package/dist/lib/arrange/{domain/types.mjs → application/ports/domain-source-parser.port.js} +0 -0
- /package/dist/lib/{infra/fs-contract.mjs → arrange/application/ports/file-walker.port.js} +0 -0
- /package/dist/lib/{mirror/domain/types.mjs → arrange/infra/arrange-sync-cli-options.js} +0 -0
- /package/dist/lib/{tag/domain/types.mjs → core/application/ports/cli-io.port.js} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { t as createNodeCliFs } from "../../../node-io-DFRbHO6m.mjs";
|
|
2
|
-
import { i as workspacePatternToPackageJsonGlob, n as parsePnpmWorkspaceDocument, r as splitWorkspacePackageEntries, t as findWorkspacePackageRelPaths } from "../../../workspace-packages-K2NYTHJq.mjs";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import os from "node:os";
|
|
6
|
-
//#region src/lib/mirror/infra/workspace-packages.test.ts
|
|
7
|
-
function createTestLogger() {
|
|
8
|
-
const lines = [];
|
|
9
|
-
return {
|
|
10
|
-
lines,
|
|
11
|
-
out: (line) => {
|
|
12
|
-
lines.push(line);
|
|
13
|
-
},
|
|
14
|
-
err: (line) => {
|
|
15
|
-
lines.push(`[err] ${line}`);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
describe("splitWorkspacePackageEntries", () => {
|
|
20
|
-
it("splits include and exclude entries", () => {
|
|
21
|
-
expect(splitWorkspacePackageEntries([
|
|
22
|
-
"packages/*",
|
|
23
|
-
"!packages/playground",
|
|
24
|
-
"apps/*"
|
|
25
|
-
])).toEqual({
|
|
26
|
-
include: ["packages/*", "apps/*"],
|
|
27
|
-
exclude: ["packages/playground"]
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
it("ignores non-strings", () => {
|
|
31
|
-
expect(splitWorkspacePackageEntries([
|
|
32
|
-
"a",
|
|
33
|
-
1,
|
|
34
|
-
null,
|
|
35
|
-
"b"
|
|
36
|
-
])).toEqual({
|
|
37
|
-
include: ["a", "b"],
|
|
38
|
-
exclude: []
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe("parsePnpmWorkspaceDocument", () => {
|
|
43
|
-
it("throws on non-object root", () => {
|
|
44
|
-
expect(() => parsePnpmWorkspaceDocument([])).toThrow(/root must be a mapping/);
|
|
45
|
-
expect(() => parsePnpmWorkspaceDocument("x")).toThrow(/root must be a mapping/);
|
|
46
|
-
});
|
|
47
|
-
it("throws when packages is not an array", () => {
|
|
48
|
-
expect(() => parsePnpmWorkspaceDocument({ packages: "nope" })).toThrow(/must be an array/);
|
|
49
|
-
});
|
|
50
|
-
it("marks missing packages key", () => {
|
|
51
|
-
expect(parsePnpmWorkspaceDocument({ catalog: {} })).toEqual({
|
|
52
|
-
include: [],
|
|
53
|
-
exclude: [],
|
|
54
|
-
hasPackagesKey: false,
|
|
55
|
-
isEmptyPackagesArray: false
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
it("marks explicit empty array", () => {
|
|
59
|
-
expect(parsePnpmWorkspaceDocument({ packages: [] })).toEqual({
|
|
60
|
-
include: [],
|
|
61
|
-
exclude: [],
|
|
62
|
-
hasPackagesKey: true,
|
|
63
|
-
isEmptyPackagesArray: true
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
describe("workspacePatternToPackageJsonGlob", () => {
|
|
68
|
-
it("appends /package.json with POSIX slashes", () => {
|
|
69
|
-
expect(workspacePatternToPackageJsonGlob("packages/*")).toBe("packages/*/package.json");
|
|
70
|
-
expect(workspacePatternToPackageJsonGlob("packages/**")).toBe("packages/**/package.json");
|
|
71
|
-
expect(workspacePatternToPackageJsonGlob("apps/*")).toBe("apps/*/package.json");
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
describe("findWorkspacePackageRelPaths", () => {
|
|
75
|
-
const cliFs = createNodeCliFs();
|
|
76
|
-
it("falls back to packages/* when pnpm-workspace.yaml is missing", async () => {
|
|
77
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "ws-missing-"));
|
|
78
|
-
const logger = createTestLogger();
|
|
79
|
-
try {
|
|
80
|
-
fs.mkdirSync(path.join(root, "packages", "a"), { recursive: true });
|
|
81
|
-
fs.writeFileSync(path.join(root, "packages", "a", "package.json"), "{}", "utf8");
|
|
82
|
-
const { relPaths, multiSource } = await findWorkspacePackageRelPaths(root, cliFs, logger);
|
|
83
|
-
expect(relPaths).toEqual(["packages/a"]);
|
|
84
|
-
expect(multiSource).toBe("default-patterns");
|
|
85
|
-
} finally {
|
|
86
|
-
fs.rmSync(root, {
|
|
87
|
-
recursive: true,
|
|
88
|
-
force: true
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
it("reads globs from pnpm-workspace.yaml", async () => {
|
|
93
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "ws-yaml-"));
|
|
94
|
-
const logger = createTestLogger();
|
|
95
|
-
try {
|
|
96
|
-
fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), `packages:
|
|
97
|
-
- 'tooling/*'
|
|
98
|
-
- 'packages/*'
|
|
99
|
-
`, "utf8");
|
|
100
|
-
fs.mkdirSync(path.join(root, "tooling", "eslint"), { recursive: true });
|
|
101
|
-
fs.writeFileSync(path.join(root, "tooling", "eslint", "package.json"), "{}", "utf8");
|
|
102
|
-
fs.mkdirSync(path.join(root, "packages", "ui"), { recursive: true });
|
|
103
|
-
fs.writeFileSync(path.join(root, "packages", "ui", "package.json"), "{}", "utf8");
|
|
104
|
-
const { relPaths, multiSource } = await findWorkspacePackageRelPaths(root, cliFs, logger);
|
|
105
|
-
expect(relPaths).toEqual(["packages/ui", "tooling/eslint"]);
|
|
106
|
-
expect(multiSource).toBe("pnpm-workspace-yaml");
|
|
107
|
-
} finally {
|
|
108
|
-
fs.rmSync(root, {
|
|
109
|
-
recursive: true,
|
|
110
|
-
force: true
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
it("applies negated workspace patterns", async () => {
|
|
115
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "ws-neg-"));
|
|
116
|
-
const logger = createTestLogger();
|
|
117
|
-
try {
|
|
118
|
-
fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), `packages:
|
|
119
|
-
- 'packages/*'
|
|
120
|
-
- '!packages/skip'
|
|
121
|
-
`, "utf8");
|
|
122
|
-
for (const name of ["keep", "skip"]) {
|
|
123
|
-
fs.mkdirSync(path.join(root, "packages", name), { recursive: true });
|
|
124
|
-
fs.writeFileSync(path.join(root, "packages", name, "package.json"), "{}", "utf8");
|
|
125
|
-
}
|
|
126
|
-
const { relPaths, multiSource } = await findWorkspacePackageRelPaths(root, cliFs, logger);
|
|
127
|
-
expect(relPaths).toEqual(["packages/keep"]);
|
|
128
|
-
expect(multiSource).toBe("pnpm-workspace-yaml");
|
|
129
|
-
} finally {
|
|
130
|
-
fs.rmSync(root, {
|
|
131
|
-
recursive: true,
|
|
132
|
-
force: true
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
it("returns empty paths when packages is an explicit empty array", async () => {
|
|
137
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "ws-empty-arr-"));
|
|
138
|
-
const logger = createTestLogger();
|
|
139
|
-
try {
|
|
140
|
-
fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), `packages: []
|
|
141
|
-
`, "utf8");
|
|
142
|
-
const { relPaths, multiSource } = await findWorkspacePackageRelPaths(root, cliFs, logger);
|
|
143
|
-
expect(relPaths).toEqual([]);
|
|
144
|
-
expect(multiSource).toBe("declared-empty");
|
|
145
|
-
} finally {
|
|
146
|
-
fs.rmSync(root, {
|
|
147
|
-
recursive: true,
|
|
148
|
-
force: true
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
it("rejects invalid YAML document when file exists", async () => {
|
|
153
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "ws-bad-yaml-"));
|
|
154
|
-
const logger = createTestLogger();
|
|
155
|
-
try {
|
|
156
|
-
fs.writeFileSync(path.join(root, "pnpm-workspace.yaml"), "{ not yaml", "utf8");
|
|
157
|
-
await expect(findWorkspacePackageRelPaths(root, cliFs, logger)).rejects.toThrow(/Failed to parse pnpm-workspace.yaml/);
|
|
158
|
-
} finally {
|
|
159
|
-
fs.rmSync(root, {
|
|
160
|
-
recursive: true,
|
|
161
|
-
force: true
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
//#endregion
|
|
167
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as mirrorBanner, c as mirrorNoPackages, d as mirrorSummarySeparator, f as printMirrorConfigWarnings, i as logSkippedWorkspacePackage, l as mirrorProcessingMode, n as logPackageError, o as mirrorFatalError, r as logPackageSuccess, s as mirrorGlobWarning, t as configureMirrorColors, u as mirrorSummary } from "../../../reporter-CwIe_tAM.mjs";
|
|
2
|
-
export { configureMirrorColors, logPackageError, logPackageSuccess, logSkippedWorkspacePackage, mirrorBanner, mirrorFatalError, mirrorGlobWarning, mirrorNoPackages, mirrorProcessingMode, mirrorSummary, mirrorSummarySeparator, printMirrorConfigWarnings };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { t as createNodeCliFs } from "../../../node-io-DFRbHO6m.mjs";
|
|
2
|
-
import { n as runTagOnTarget, r as runTagSync, t as resolveNearestPackageVersion } from "../../../engine-CcWEHSCq.mjs";
|
|
3
|
-
import "../../../tag-Cd9JujU5.mjs";
|
|
4
|
-
import fs from "node:fs";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import os from "node:os";
|
|
7
|
-
//#region src/lib/tag/application/engine.test.ts
|
|
8
|
-
const tagFs = createNodeCliFs();
|
|
9
|
-
function withTempPackage(fileName, source, fn) {
|
|
10
|
-
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "tag-engine-"));
|
|
11
|
-
const srcDir = path.join(rootDir, "src");
|
|
12
|
-
const sourceFile = path.join(srcDir, fileName);
|
|
13
|
-
try {
|
|
14
|
-
fs.mkdirSync(srcDir, { recursive: true });
|
|
15
|
-
fs.writeFileSync(path.join(rootDir, "package.json"), "{\"name\":\"demo\",\"version\":\"1.2.3\"}", "utf8");
|
|
16
|
-
fs.writeFileSync(sourceFile, source, "utf8");
|
|
17
|
-
fn({
|
|
18
|
-
rootDir,
|
|
19
|
-
sourceFile
|
|
20
|
-
});
|
|
21
|
-
} finally {
|
|
22
|
-
fs.rmSync(rootDir, {
|
|
23
|
-
recursive: true,
|
|
24
|
-
force: true
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
describe("resolveNearestPackageVersion", () => {
|
|
29
|
-
it("loads version from nearest package.json", () => {
|
|
30
|
-
withTempPackage("index.ts", "export const foo = 1;\n", ({ sourceFile }) => {
|
|
31
|
-
expect(resolveNearestPackageVersion(sourceFile, tagFs)).toBe("1.2.3");
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe("runTagOnTarget", () => {
|
|
36
|
-
it("adds @since for exported declarations and preserves existing @since tags", () => {
|
|
37
|
-
withTempPackage("index.ts", `/** Existing docs */
|
|
38
|
-
export function a() {
|
|
39
|
-
return 1;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** @since 0.0.1 */
|
|
43
|
-
export const b = 2;
|
|
44
|
-
|
|
45
|
-
const c = 3;
|
|
46
|
-
export { c };
|
|
47
|
-
`, ({ sourceFile, rootDir }) => {
|
|
48
|
-
const result = runTagOnTarget(path.join(rootDir, "src"), { write: true }, tagFs);
|
|
49
|
-
const after = fs.readFileSync(sourceFile, "utf8");
|
|
50
|
-
expect(result.version).toBe("1.2.3");
|
|
51
|
-
expect(result.filesChanged).toBe(1);
|
|
52
|
-
expect(result.taggedDeclarations).toBe(2);
|
|
53
|
-
expect(after).toContain("* @since 1.2.3");
|
|
54
|
-
expect(after).toContain("/** @since 0.0.1 */");
|
|
55
|
-
expect(after).toContain("/**\n * @since 1.2.3\n */\nconst c = 3;");
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
it("normalizes single-line JSDoc to multiline before appending @since", () => {
|
|
59
|
-
withTempPackage("types.ts", `/** String or no-substitution template literal used as a Tailwind class blob. */
|
|
60
|
-
export type TailwindClassBlob = string;
|
|
61
|
-
`, ({ sourceFile, rootDir }) => {
|
|
62
|
-
runTagOnTarget(path.join(rootDir, "src"), { write: true }, tagFs);
|
|
63
|
-
const after = fs.readFileSync(sourceFile, "utf8");
|
|
64
|
-
expect(after).toContain(`/**
|
|
65
|
-
* String or no-substitution template literal used as a Tailwind class blob.
|
|
66
|
-
*
|
|
67
|
-
* @since 1.2.3
|
|
68
|
-
*/`);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
it("supports dry-run mode without changing files", () => {
|
|
72
|
-
const before = "export interface User { id: string }\n";
|
|
73
|
-
withTempPackage("types.ts", before, ({ sourceFile, rootDir }) => {
|
|
74
|
-
const result = runTagOnTarget(path.join(rootDir, "src"), { write: false }, tagFs);
|
|
75
|
-
const after = fs.readFileSync(sourceFile, "utf8");
|
|
76
|
-
expect(result.filesChanged).toBe(1);
|
|
77
|
-
expect(result.taggedDeclarations).toBe(1);
|
|
78
|
-
expect(after).toBe(before);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
describe("runTagSync", () => {
|
|
83
|
-
it("auto-discovers workspace package src directories when no target is provided", async () => {
|
|
84
|
-
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "tag-workspace-"));
|
|
85
|
-
const packageOneDir = path.join(rootDir, "packages", "one");
|
|
86
|
-
const packageTwoDir = path.join(rootDir, "packages", "two");
|
|
87
|
-
const packageOneSrcDir = path.join(packageOneDir, "src");
|
|
88
|
-
const packageTwoSrcDir = path.join(packageTwoDir, "src");
|
|
89
|
-
try {
|
|
90
|
-
fs.mkdirSync(packageOneSrcDir, { recursive: true });
|
|
91
|
-
fs.mkdirSync(packageTwoSrcDir, { recursive: true });
|
|
92
|
-
fs.writeFileSync(path.join(rootDir, "pnpm-workspace.yaml"), "packages:\n - 'packages/*'\n", "utf8");
|
|
93
|
-
fs.writeFileSync(path.join(packageOneDir, "package.json"), "{\"name\":\"one\",\"version\":\"1.0.0\"}", "utf8");
|
|
94
|
-
fs.writeFileSync(path.join(packageTwoDir, "package.json"), "{\"name\":\"two\",\"version\":\"2.0.0\"}", "utf8");
|
|
95
|
-
fs.writeFileSync(path.join(packageOneSrcDir, "index.ts"), "export const one = 1;\n", "utf8");
|
|
96
|
-
fs.writeFileSync(path.join(packageTwoSrcDir, "index.ts"), "export const two = 2;\n", "utf8");
|
|
97
|
-
const startedTargets = [];
|
|
98
|
-
const completedTargets = [];
|
|
99
|
-
const runResult = await runTagSync({
|
|
100
|
-
rootDir,
|
|
101
|
-
write: true,
|
|
102
|
-
fs: tagFs,
|
|
103
|
-
listener: {
|
|
104
|
-
onTargetStarted: (target) => startedTargets.push(target.rootRelativeTargetPath),
|
|
105
|
-
onTargetCompleted: (target) => completedTargets.push(target.rootRelativeTargetPath)
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
expect(runResult.selectedTargets.length).toBe(2);
|
|
109
|
-
expect(runResult.targetResults.every((entry) => entry.runError === null)).toBe(true);
|
|
110
|
-
expect(fs.readFileSync(path.join(packageOneSrcDir, "index.ts"), "utf8")).toContain("* @since 1.0.0");
|
|
111
|
-
expect(fs.readFileSync(path.join(packageTwoSrcDir, "index.ts"), "utf8")).toContain("* @since 2.0.0");
|
|
112
|
-
expect(runResult.versionSummary).toBe("mixed");
|
|
113
|
-
expect(runResult.distinctVersions).toEqual(["1.0.0", "2.0.0"]);
|
|
114
|
-
expect(runResult.skippedPackages).toEqual([]);
|
|
115
|
-
expect(runResult.filesChanged).toBe(2);
|
|
116
|
-
expect(startedTargets.sort((left, right) => left.localeCompare(right))).toEqual(["packages/one/src", "packages/two/src"]);
|
|
117
|
-
expect(completedTargets.sort((left, right) => left.localeCompare(right))).toEqual(["packages/one/src", "packages/two/src"]);
|
|
118
|
-
} finally {
|
|
119
|
-
fs.rmSync(rootDir, {
|
|
120
|
-
recursive: true,
|
|
121
|
-
force: true
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
it("skips workspace packages listed in skipPackages", async () => {
|
|
126
|
-
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "tag-workspace-skip-"));
|
|
127
|
-
const packageOneDir = path.join(rootDir, "packages", "one");
|
|
128
|
-
const packageTwoDir = path.join(rootDir, "packages", "two");
|
|
129
|
-
const packageOneSrcDir = path.join(packageOneDir, "src");
|
|
130
|
-
const packageTwoSrcDir = path.join(packageTwoDir, "src");
|
|
131
|
-
try {
|
|
132
|
-
fs.mkdirSync(packageOneSrcDir, { recursive: true });
|
|
133
|
-
fs.mkdirSync(packageTwoSrcDir, { recursive: true });
|
|
134
|
-
fs.writeFileSync(path.join(rootDir, "pnpm-workspace.yaml"), "packages:\n - 'packages/*'\n", "utf8");
|
|
135
|
-
fs.writeFileSync(path.join(packageOneDir, "package.json"), "{\"name\":\"@scope/one\",\"version\":\"1.0.0\"}", "utf8");
|
|
136
|
-
fs.writeFileSync(path.join(packageTwoDir, "package.json"), "{\"name\":\"@scope/two\",\"version\":\"2.0.0\"}", "utf8");
|
|
137
|
-
fs.writeFileSync(path.join(packageOneSrcDir, "index.ts"), "export const one = 1;\n", "utf8");
|
|
138
|
-
fs.writeFileSync(path.join(packageTwoSrcDir, "index.ts"), "export const two = 2;\n", "utf8");
|
|
139
|
-
const runResult = await runTagSync({
|
|
140
|
-
rootDir,
|
|
141
|
-
write: true,
|
|
142
|
-
fs: tagFs,
|
|
143
|
-
skipPackages: ["@scope/two"]
|
|
144
|
-
});
|
|
145
|
-
expect(runResult.skippedPackages).toEqual(["@scope/two"]);
|
|
146
|
-
expect(runResult.selectedTargets).toHaveLength(1);
|
|
147
|
-
expect(runResult.selectedTargets[0]?.packageName).toBe("@scope/one");
|
|
148
|
-
expect(fs.readFileSync(path.join(packageOneSrcDir, "index.ts"), "utf8")).toContain("* @since 1.0.0");
|
|
149
|
-
expect(fs.readFileSync(path.join(packageTwoSrcDir, "index.ts"), "utf8")).not.toContain("* @since 2.0.0");
|
|
150
|
-
} finally {
|
|
151
|
-
fs.rmSync(rootDir, {
|
|
152
|
-
recursive: true,
|
|
153
|
-
force: true
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
//#endregion
|
|
159
|
-
export {};
|
package/dist/lib/tag/index.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { n as createNodeCliLogger, t as createNodeCliFs } from "../../node-io-DFRbHO6m.mjs";
|
|
2
|
-
import { n as runTagOnTarget, r as runTagSync, t as resolveNearestPackageVersion } from "../../engine-CcWEHSCq.mjs";
|
|
3
|
-
import { a as formatWarningsAndErrors, i as formatTargetTable, n as formatProgress, r as formatSummary, t as createTagProgressListener } from "../../tag-presenter-Cs66UBsH.mjs";
|
|
4
|
-
import "../../tag-Cd9JujU5.mjs";
|
|
5
|
-
export { createNodeCliFs, createNodeCliLogger, createTagProgressListener, formatProgress, formatSummary, formatTargetTable, formatWarningsAndErrors, resolveNearestPackageVersion, runTagOnTarget, runTagSync };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as formatWarningsAndErrors, i as formatTargetTable, n as formatProgress, r as formatSummary, t as createTagProgressListener } from "../../../tag-presenter-Cs66UBsH.mjs";
|
|
2
|
-
export { createTagProgressListener, formatProgress, formatSummary, formatTargetTable, formatWarningsAndErrors };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { i as formatTargetTable } from "../../../tag-presenter-Cs66UBsH.mjs";
|
|
2
|
-
//#region src/lib/tag/presentation/tag-presenter.test.ts
|
|
3
|
-
describe("formatTargetTable", () => {
|
|
4
|
-
it("aligns columns using longest package and path values", () => {
|
|
5
|
-
const lines = formatTargetTable([{
|
|
6
|
-
packageName: "@codefast/core",
|
|
7
|
-
packageDir: "/repo/packages/core",
|
|
8
|
-
rootRelativeTargetPath: "packages/core/src",
|
|
9
|
-
targetPath: "/repo/packages/core/src",
|
|
10
|
-
source: "workspace-package-selected-src"
|
|
11
|
-
}, {
|
|
12
|
-
packageName: "@codefast/benchmark-tailwind-variants",
|
|
13
|
-
packageDir: "/repo/benchmarks/tailwind-variants",
|
|
14
|
-
rootRelativeTargetPath: "benchmarks/tailwind-variants/src",
|
|
15
|
-
targetPath: "/repo/benchmarks/tailwind-variants/src",
|
|
16
|
-
source: "workspace-package-selected-src"
|
|
17
|
-
}], "/repo").split("\n");
|
|
18
|
-
const headerLine = lines[3];
|
|
19
|
-
const firstDataLine = lines[5];
|
|
20
|
-
const secondDataLine = lines[6];
|
|
21
|
-
const pathHeaderIndex = headerLine.indexOf("path");
|
|
22
|
-
const firstPathIndex = firstDataLine.indexOf("packages/core/src");
|
|
23
|
-
const secondPathIndex = secondDataLine.indexOf("benchmarks/tailwind-variants/src");
|
|
24
|
-
expect(firstPathIndex).toBe(pathHeaderIndex);
|
|
25
|
-
expect(secondPathIndex).toBe(pathHeaderIndex);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
//#endregion
|
|
29
|
-
export {};
|
package/dist/loader-DpN-zl5g.mjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { n as codefastConfigSchema } from "./schema-Or8RAARd.mjs";
|
|
2
|
-
import process from "node:process";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import jiti from "jiti";
|
|
5
|
-
import { ZodError } from "zod";
|
|
6
|
-
//#region src/lib/config/infra/loader.ts
|
|
7
|
-
const CONFIG_JS_PRIORITY = [
|
|
8
|
-
"codefast.config.mjs",
|
|
9
|
-
"codefast.config.js",
|
|
10
|
-
"codefast.config.cjs"
|
|
11
|
-
];
|
|
12
|
-
const CONFIG_JSON = "codefast.config.json";
|
|
13
|
-
const cachedLoads = /* @__PURE__ */ new Map();
|
|
14
|
-
function formatZodError(error, filePath) {
|
|
15
|
-
const formatted = error.issues.map((issue) => {
|
|
16
|
-
return ` - ${issue.path.length > 0 ? issue.path.join(".") : "<root>"}: ${issue.message}`;
|
|
17
|
-
}).join("\n");
|
|
18
|
-
return `Invalid config schema in ${path.basename(filePath)}:\n${formatted}`;
|
|
19
|
-
}
|
|
20
|
-
function parseLoadedConfig(raw, filePath) {
|
|
21
|
-
try {
|
|
22
|
-
return codefastConfigSchema.parse(raw);
|
|
23
|
-
} catch (caughtError) {
|
|
24
|
-
if (caughtError instanceof ZodError) throw new Error(formatZodError(caughtError, filePath));
|
|
25
|
-
throw caughtError;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function listConfigCandidates(startDir, fs) {
|
|
29
|
-
const candidates = [];
|
|
30
|
-
let current = path.resolve(startDir);
|
|
31
|
-
while (true) {
|
|
32
|
-
for (const name of CONFIG_JS_PRIORITY) {
|
|
33
|
-
const candidate = path.join(current, name);
|
|
34
|
-
if (fs.existsSync(candidate)) candidates.push(candidate);
|
|
35
|
-
}
|
|
36
|
-
const jsonCandidate = path.join(current, CONFIG_JSON);
|
|
37
|
-
if (fs.existsSync(jsonCandidate)) candidates.push(jsonCandidate);
|
|
38
|
-
const parent = path.dirname(current);
|
|
39
|
-
if (parent === current) break;
|
|
40
|
-
current = parent;
|
|
41
|
-
}
|
|
42
|
-
return candidates;
|
|
43
|
-
}
|
|
44
|
-
async function readConfigFromPath(filePath, fs) {
|
|
45
|
-
if (path.extname(filePath) === ".json") {
|
|
46
|
-
const content = await fs.readFile(filePath, "utf8");
|
|
47
|
-
return parseLoadedConfig(JSON.parse(content), filePath);
|
|
48
|
-
}
|
|
49
|
-
const moduleConfig = jiti(process.cwd(), {
|
|
50
|
-
interopDefault: true,
|
|
51
|
-
moduleCache: false
|
|
52
|
-
})(filePath);
|
|
53
|
-
return parseLoadedConfig(typeof moduleConfig === "object" && moduleConfig !== null && "default" in moduleConfig ? moduleConfig.default : moduleConfig, filePath);
|
|
54
|
-
}
|
|
55
|
-
async function loadOnce(fs, startDir) {
|
|
56
|
-
const warnings = [];
|
|
57
|
-
const configPaths = listConfigCandidates(startDir, fs);
|
|
58
|
-
if (configPaths.length === 0) return {
|
|
59
|
-
config: {},
|
|
60
|
-
warnings
|
|
61
|
-
};
|
|
62
|
-
const configPath = configPaths[0];
|
|
63
|
-
return {
|
|
64
|
-
config: await readConfigFromPath(configPath, fs),
|
|
65
|
-
warnings,
|
|
66
|
-
configPath
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
async function loadConfig(fs, startDir = process.cwd()) {
|
|
70
|
-
const cacheKey = path.resolve(startDir);
|
|
71
|
-
if (!cachedLoads.has(cacheKey)) cachedLoads.set(cacheKey, loadOnce(fs, cacheKey));
|
|
72
|
-
return cachedLoads.get(cacheKey);
|
|
73
|
-
}
|
|
74
|
-
function resetConfigLoaderCacheForTests() {
|
|
75
|
-
cachedLoads.clear();
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
export { resetConfigLoaderCacheForTests as n, loadConfig as t };
|
package/dist/mirror-CbGiLXKT.mjs
DELETED
package/dist/mirror-DqJE3ejL.mjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { t as messageFromCaughtUnknown } from "./caught-unknown-message-CRhkDWO7.mjs";
|
|
2
|
-
import { t as loadConfig } from "./loader-DpN-zl5g.mjs";
|
|
3
|
-
import "./config-DVia_f9a.mjs";
|
|
4
|
-
import { t as printConfigSchemaWarnings } from "./config-reporter-SCcWDZc1.mjs";
|
|
5
|
-
import { n as createNodeCliLogger, t as createNodeCliFs } from "./node-io-DFRbHO6m.mjs";
|
|
6
|
-
import { t as findRepoRoot } from "./repo-root-HmtIEm6J.mjs";
|
|
7
|
-
import { t as runMirrorSync } from "./sync-e1Sp-shi.mjs";
|
|
8
|
-
import "./mirror-CbGiLXKT.mjs";
|
|
9
|
-
import process from "node:process";
|
|
10
|
-
import { realpathSync } from "node:fs";
|
|
11
|
-
import path from "node:path";
|
|
12
|
-
//#region src/commands/mirror.ts
|
|
13
|
-
function tryRealpath(entryPath) {
|
|
14
|
-
try {
|
|
15
|
-
return realpathSync.native(entryPath);
|
|
16
|
-
} catch {
|
|
17
|
-
return path.resolve(entryPath);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function normalizePath(relPath) {
|
|
21
|
-
return relPath.split(path.sep).join("/").replace(/\\/g, "/");
|
|
22
|
-
}
|
|
23
|
-
function packageArgToRelative(rootDir, arg) {
|
|
24
|
-
if (!arg) return void 0;
|
|
25
|
-
const rootReal = tryRealpath(path.resolve(rootDir));
|
|
26
|
-
const cwdReal = tryRealpath(process.cwd());
|
|
27
|
-
const targetReal = tryRealpath(path.isAbsolute(arg) ? path.resolve(arg) : path.resolve(cwdReal, arg));
|
|
28
|
-
const normalized = normalizePath(path.relative(rootReal, targetReal));
|
|
29
|
-
if (normalized.startsWith("..") || path.isAbsolute(normalized) || normalized === "" || normalized === ".") throw new Error(`Package path must be a subdirectory under monorepo root: ${rootDir}`);
|
|
30
|
-
return normalized;
|
|
31
|
-
}
|
|
32
|
-
function registerMirrorCommand(program) {
|
|
33
|
-
program.command("mirror").description("Keep package manifests aligned with what you ship").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).action(async function(pkg, options) {
|
|
34
|
-
const globals = this.optsWithGlobals();
|
|
35
|
-
const fs = createNodeCliFs();
|
|
36
|
-
const logger = createNodeCliLogger();
|
|
37
|
-
const rootDir = findRepoRoot(fs);
|
|
38
|
-
let packageFilter;
|
|
39
|
-
try {
|
|
40
|
-
packageFilter = packageArgToRelative(rootDir, pkg);
|
|
41
|
-
} catch (caughtPathError) {
|
|
42
|
-
this.error(messageFromCaughtUnknown(caughtPathError));
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
let mirrorConfig = {};
|
|
46
|
-
try {
|
|
47
|
-
const { config, warnings } = await loadConfig(fs, rootDir);
|
|
48
|
-
printConfigSchemaWarnings(logger, warnings);
|
|
49
|
-
mirrorConfig = config.mirror ?? {};
|
|
50
|
-
} catch (caughtConfigError) {
|
|
51
|
-
this.error(messageFromCaughtUnknown(caughtConfigError));
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
process.exitCode = await runMirrorSync({
|
|
55
|
-
rootDir,
|
|
56
|
-
config: mirrorConfig,
|
|
57
|
-
verbose: options.verbose,
|
|
58
|
-
noColor: globals.color === false,
|
|
59
|
-
packageFilter,
|
|
60
|
-
fs,
|
|
61
|
-
logger
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { registerMirrorCommand as n, packageArgToRelative as t };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import process from "node:process";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import fsPromises from "node:fs/promises";
|
|
4
|
-
//#region src/lib/infra/node-io.ts
|
|
5
|
-
function createNodeCliFs() {
|
|
6
|
-
return {
|
|
7
|
-
existsSync: fs.existsSync,
|
|
8
|
-
statSync: fs.statSync,
|
|
9
|
-
readFileSync: fs.readFileSync,
|
|
10
|
-
writeFileSync: fs.writeFileSync,
|
|
11
|
-
readdirSync: fs.readdirSync,
|
|
12
|
-
readFile: (p, enc) => fsPromises.readFile(p, enc),
|
|
13
|
-
writeFile: (p, data, enc) => fsPromises.writeFile(p, data, enc),
|
|
14
|
-
readdir: (p, opts) => fsPromises.readdir(p, opts),
|
|
15
|
-
rename: (oldPath, newPath) => fsPromises.rename(oldPath, newPath),
|
|
16
|
-
unlink: (p) => fsPromises.unlink(p)
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function createNodeCliLogger() {
|
|
20
|
-
return {
|
|
21
|
-
out: (line) => {
|
|
22
|
-
process.stdout.write(`${line}\n`);
|
|
23
|
-
},
|
|
24
|
-
err: (line) => {
|
|
25
|
-
process.stderr.write(`${line}\n`);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { createNodeCliLogger as n, createNodeCliFs as t };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { t as normalizePath } from "./path-normalizer-D4ceBO3l.mjs";
|
|
2
|
-
import { realpathSync } from "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
//#region src/lib/mirror/infra/package-filter.ts
|
|
5
|
-
function tryRealpath(entryPath) {
|
|
6
|
-
try {
|
|
7
|
-
return realpathSync.native(entryPath);
|
|
8
|
-
} catch {
|
|
9
|
-
return path.resolve(entryPath);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Resolve `packageFilter` to a POSIX-ish path relative to `rootDir`, without using
|
|
14
|
-
* `process.cwd()`. Use for programmatic `runMirrorSync` calls.
|
|
15
|
-
*
|
|
16
|
-
* @throws If the resolved path is not a strict subdirectory of `rootDir`.
|
|
17
|
-
*/
|
|
18
|
-
function resolvePackageFilterUnderRoot(rootDir, packageFilter) {
|
|
19
|
-
const rootReal = tryRealpath(path.resolve(rootDir));
|
|
20
|
-
const resolved = path.isAbsolute(packageFilter) ? tryRealpath(path.resolve(packageFilter)) : tryRealpath(path.join(rootReal, packageFilter));
|
|
21
|
-
const normalized = normalizePath(path.relative(rootReal, resolved));
|
|
22
|
-
if (normalized.startsWith("..") || path.isAbsolute(normalized) || normalized === "" || normalized === ".") throw new Error(`Package path must be a subdirectory under monorepo root: ${rootDir}`);
|
|
23
|
-
return normalized;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { resolvePackageFilterUnderRoot as t };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { t as registerArrangeCommand } from "./arrange-Bbh62DrU.mjs";
|
|
2
|
-
import { n as registerMirrorCommand } from "./mirror-DqJE3ejL.mjs";
|
|
3
|
-
import { t as registerTagCommand } from "./tag-hEKVZ_-7.mjs";
|
|
4
|
-
import process from "node:process";
|
|
5
|
-
import { readFileSync } from "node:fs";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { Command } from "commander";
|
|
9
|
-
//#region src/program.ts
|
|
10
|
-
function readVersion() {
|
|
11
|
-
try {
|
|
12
|
-
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const raw = readFileSync(path.join(dir, "..", "package.json"), "utf-8");
|
|
14
|
-
const pkgVersion = JSON.parse(raw).version;
|
|
15
|
-
return typeof pkgVersion === "string" && pkgVersion.length > 0 ? pkgVersion : "unknown";
|
|
16
|
-
} catch {
|
|
17
|
-
return "unknown";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function createProgram() {
|
|
21
|
-
const program = new Command();
|
|
22
|
-
program.name("codefast").description("Codefast monorepo developer CLI").version(readVersion()).option("--no-color", "Disable ANSI color output").configureHelp({ sortSubcommands: true }).showHelpAfterError("(use --help for usage)");
|
|
23
|
-
registerMirrorCommand(program);
|
|
24
|
-
registerArrangeCommand(program);
|
|
25
|
-
registerTagCommand(program);
|
|
26
|
-
return program;
|
|
27
|
-
}
|
|
28
|
-
async function runCli(argv) {
|
|
29
|
-
await createProgram().parseAsync(argv, { from: "node" });
|
|
30
|
-
const code = process.exitCode ?? 0;
|
|
31
|
-
return typeof code === "number" ? code : Number(code) || 0;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { runCli as n, createProgram as t };
|
package/dist/program.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
//#region src/lib/infra/workspace/repo-root.ts
|
|
4
|
-
/**
|
|
5
|
-
* Resolve the monorepo root (directory containing `pnpm-workspace.yaml`).
|
|
6
|
-
* Tries the compiled package location first, then `process.cwd()`.
|
|
7
|
-
*/
|
|
8
|
-
function findRepoRoot(fs) {
|
|
9
|
-
const candidates = [path.dirname(fileURLToPath(import.meta.url)), process.cwd()];
|
|
10
|
-
for (const start of candidates) {
|
|
11
|
-
let dir = path.resolve(start);
|
|
12
|
-
for (;;) {
|
|
13
|
-
if (fs.existsSync(path.join(dir, "pnpm-workspace.yaml"))) return dir;
|
|
14
|
-
const parent = path.dirname(dir);
|
|
15
|
-
if (parent === dir) break;
|
|
16
|
-
dir = parent;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
throw new Error(`Could not locate monorepo root (missing pnpm-workspace.yaml). Searched from: ${candidates.join(", ")}`);
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { findRepoRoot as t };
|