@next-vibe/checker 1.0.11 → 1.0.13
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/vibe-runtime.js +26 -22
- package/.dist/bin/vibe-runtime.js.map +5 -5
- package/.dist/oxlint-plugins/i18n.js +4 -0
- package/.dist/oxlint-plugins/i18n.js.map +1 -0
- package/.dist/oxlint-plugins/jsx-capitalization.js +4 -0
- package/.dist/oxlint-plugins/jsx-capitalization.js.map +1 -0
- package/.dist/oxlint-plugins/restricted-syntax.js +4 -0
- package/.dist/oxlint-plugins/restricted-syntax.js.map +1 -0
- package/check.config.ts +4 -12
- package/package.json +2 -9
- package/src/app/api/[locale]/LICENSE +674 -0
- package/src/app/api/[locale]/i18n/de/index.ts +13 -0
- package/src/app/api/[locale]/i18n/en/index.ts +12 -0
- package/src/app/api/[locale]/i18n/pl/index.ts +11 -0
- package/src/app/api/[locale]/shared/i18n/de/index.ts +85 -0
- package/src/app/api/[locale]/shared/i18n/en/index.ts +83 -0
- package/src/app/api/[locale]/shared/i18n/pl/index.ts +85 -0
- package/src/app/api/[locale]/shared/stats-filtering.ts +202 -0
- package/src/app/api/[locale]/shared/types/common.schema.ts +55 -0
- package/src/app/api/[locale]/shared/types/response.schema.ts +372 -0
- package/src/app/api/[locale]/shared/types/stats-filtering.schema.ts +375 -0
- package/src/app/api/[locale]/shared/types/utils.ts +190 -0
- package/src/app/api/[locale]/shared/utils/base64.ts +49 -0
- package/src/app/api/[locale]/shared/utils/env-util.ts +40 -0
- package/src/app/api/[locale]/shared/utils/i18n/de/index.ts +21 -0
- package/src/app/api/[locale]/shared/utils/i18n/en/index.ts +19 -0
- package/src/app/api/[locale]/shared/utils/i18n/pl/index.ts +21 -0
- package/src/app/api/[locale]/shared/utils/index.ts +11 -0
- package/src/app/api/[locale]/shared/utils/object-path.ts +41 -0
- package/src/app/api/[locale]/shared/utils/object.test.ts +82 -0
- package/src/app/api/[locale]/shared/utils/object.ts +75 -0
- package/src/app/api/[locale]/shared/utils/parse-error.ts +134 -0
- package/src/app/api/[locale]/shared/utils/parse-json.ts +70 -0
- package/src/app/api/[locale]/shared/utils/time.ts +53 -0
- package/src/app/api/[locale]/shared/utils/validation.ts +127 -0
- package/src/app/api/[locale]/shared/utils/zod-required-fields.ts +116 -0
- package/src/app/api/[locale]/system/builder/definition.ts +1942 -0
- package/src/app/api/[locale]/system/builder/enum.ts +78 -0
- package/src/app/api/[locale]/system/builder/i18n/de/index.ts +677 -0
- package/src/app/api/[locale]/system/builder/i18n/en/index.ts +665 -0
- package/src/app/api/[locale]/system/builder/i18n/pl/index.ts +668 -0
- package/src/app/api/[locale]/system/builder/repository/build-executor.test.ts +182 -0
- package/src/app/api/[locale]/system/builder/repository/build-executor.ts +583 -0
- package/src/app/api/[locale]/system/builder/repository/bun-compiler.ts +261 -0
- package/src/app/api/[locale]/system/builder/repository/bundle-analyzer.ts +197 -0
- package/src/app/api/[locale]/system/builder/repository/config-loader.ts +159 -0
- package/src/app/api/[locale]/system/builder/repository/config-validator.ts +97 -0
- package/src/app/api/[locale]/system/builder/repository/constants.ts +125 -0
- package/src/app/api/[locale]/system/builder/repository/error-suggester.ts +75 -0
- package/src/app/api/[locale]/system/builder/repository/file-copier.ts +98 -0
- package/src/app/api/[locale]/system/builder/repository/folder-cleaner.ts +80 -0
- package/src/app/api/[locale]/system/builder/repository/index.ts +2 -0
- package/src/app/api/[locale]/system/builder/repository/npm-package-generator.ts +146 -0
- package/src/app/api/[locale]/system/builder/repository/output-formatter.ts +104 -0
- package/src/app/api/[locale]/system/builder/repository/profile-service.ts +79 -0
- package/src/app/api/[locale]/system/builder/repository/report-generator.ts +125 -0
- package/src/app/api/[locale]/system/builder/repository/vite-compiler.ts +291 -0
- package/src/app/api/[locale]/system/builder/route.ts +21 -0
- package/src/app/api/[locale]/system/builder/test-files/file1.ts +2 -0
- package/src/app/api/[locale]/system/builder/test-files/file2.tsx +10 -0
- package/src/app/api/[locale]/system/builder/test-files/file3.tsx +16 -0
- package/src/app/api/[locale]/system/builder/test-files/folderToCopy/fileInFolder.ts +2 -0
- package/src/app/api/[locale]/system/builder/test-files/test-config.ts +38 -0
- package/src/app/api/[locale]/system/builder/test-files/test-delete-config.ts +8 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/package.json +24 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/src/constants.ts +6 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/src/greet.ts +18 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/src/index.ts +7 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/src/utils/calculate.ts +27 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/tsconfig.json +19 -0
- package/src/app/api/[locale]/system/builder/test-files/test-project/tsconfig.tsbuildinfo +1 -0
- package/src/app/api/[locale]/system/builder/test-files/test3.css +1 -0
- package/src/app/api/[locale]/system/check/config/repository.ts +886 -0
- package/src/app/api/[locale]/system/check/config/shared.ts +396 -0
- package/src/app/api/[locale]/system/check/config/types.ts +616 -0
- package/src/app/api/[locale]/system/check/config/utils.ts +171 -0
- package/src/app/api/[locale]/system/check/i18n/de/index.ts +15 -0
- package/src/app/api/[locale]/system/check/i18n/en/index.ts +14 -0
- package/src/app/api/[locale]/system/check/i18n/pl/index.ts +15 -0
- package/src/app/api/[locale]/system/check/lint/definition.ts +414 -0
- package/src/app/api/[locale]/system/check/lint/enum.ts +37 -0
- package/src/app/api/[locale]/system/check/lint/i18n/de/index.ts +164 -0
- package/src/app/api/[locale]/system/check/lint/i18n/en/index.ts +162 -0
- package/src/app/api/[locale]/system/check/lint/i18n/pl/index.ts +164 -0
- package/src/app/api/[locale]/system/check/lint/repository.ts +753 -0
- package/src/app/api/[locale]/system/check/lint/route.ts +21 -0
- package/src/app/api/[locale]/system/check/oxlint/README.md +190 -0
- package/src/app/api/[locale]/system/check/oxlint/definition.ts +414 -0
- package/src/app/api/[locale]/system/check/oxlint/enum.ts +37 -0
- package/src/app/api/[locale]/system/check/oxlint/i18n/de/index.ts +171 -0
- package/src/app/api/[locale]/system/check/oxlint/i18n/en/index.ts +168 -0
- package/src/app/api/[locale]/system/check/oxlint/i18n/pl/index.ts +172 -0
- package/src/app/api/[locale]/system/check/oxlint/plugins/i18n/src/index.ts +372 -0
- package/src/app/api/[locale]/system/check/oxlint/plugins/jsx-capitalization/README.md +246 -0
- package/src/app/api/[locale]/system/check/oxlint/plugins/jsx-capitalization/src/index.ts +583 -0
- package/src/app/api/[locale]/system/check/oxlint/plugins/restricted-syntax/src/index.ts +500 -0
- package/src/app/api/[locale]/system/check/oxlint/plugins/restricted-syntax/test.tsx +74 -0
- package/src/app/api/[locale]/system/check/oxlint/plugins/shared/config-loader.ts +305 -0
- package/src/app/api/[locale]/system/check/oxlint/repository.ts +959 -0
- package/src/app/api/[locale]/system/check/oxlint/route.ts +21 -0
- package/src/app/api/[locale]/system/check/oxlint/types.ts +193 -0
- package/src/app/api/[locale]/system/check/test-project/bun.lock +532 -0
- package/src/app/api/[locale]/system/check/test-project/check.config.ts +981 -0
- package/src/app/api/[locale]/system/check/test-project/package.json +12 -0
- package/src/app/api/[locale]/system/check/test-project/src/constants.ts +6 -0
- package/src/app/api/[locale]/system/check/test-project/src/greet.ts +18 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/a11y-issues.tsx +107 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/eslint-issues.tsx +37 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/general-issues.ts +137 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/i18n-issues.tsx +129 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/jsx-capitalization-issues.tsx +131 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/nextjs-issues.tsx +95 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/promise-issues.ts +76 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/react-issues.tsx +95 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/restricted-syntax-issues.tsx +61 -0
- package/src/app/api/[locale]/system/check/test-project/src/test-issues/typescript-issues.ts +80 -0
- package/src/app/api/[locale]/system/check/test-project/src/utils/calculate.ts +27 -0
- package/src/app/api/[locale]/system/check/test-project/tsconfig.json +34 -0
- package/src/app/api/[locale]/system/check/test-project/tsconfig.tsbuildinfo +1 -0
- package/src/app/api/[locale]/system/check/typecheck/definition.ts +369 -0
- package/src/app/api/[locale]/system/check/typecheck/enum.ts +37 -0
- package/src/app/api/[locale]/system/check/typecheck/i18n/de/index.ts +159 -0
- package/src/app/api/[locale]/system/check/typecheck/i18n/en/index.ts +150 -0
- package/src/app/api/[locale]/system/check/typecheck/i18n/pl/index.ts +155 -0
- package/src/app/api/[locale]/system/check/typecheck/repository.ts +919 -0
- package/src/app/api/[locale]/system/check/typecheck/route.ts +22 -0
- package/src/app/api/[locale]/system/check/typecheck/utils.ts +168 -0
- package/src/app/api/[locale]/system/check/vibe-check/definition.ts +568 -0
- package/src/app/api/[locale]/system/check/vibe-check/enum.ts +69 -0
- package/src/app/api/[locale]/system/check/vibe-check/i18n/de/index.ts +192 -0
- package/src/app/api/[locale]/system/check/vibe-check/i18n/en/index.ts +189 -0
- package/src/app/api/[locale]/system/check/vibe-check/i18n/pl/index.ts +192 -0
- package/src/app/api/[locale]/system/check/vibe-check/repository.ts +545 -0
- package/src/app/api/[locale]/system/check/vibe-check/route.test.ts +1142 -0
- package/src/app/api/[locale]/system/check/vibe-check/route.ts +21 -0
- package/src/app/api/[locale]/system/generated/endpoint.ts +313 -0
- package/src/app/api/[locale]/system/generated/endpoints.ts +156 -0
- package/src/app/api/[locale]/system/generated/route-handlers.ts +224 -0
- package/src/app/api/[locale]/system/generators/endpoint/definition.ts +193 -0
- package/src/app/api/[locale]/system/generators/endpoint/i18n/de/index.ts +48 -0
- package/src/app/api/[locale]/system/generators/endpoint/i18n/en/index.ts +48 -0
- package/src/app/api/[locale]/system/generators/endpoint/i18n/pl/index.ts +50 -0
- package/src/app/api/[locale]/system/generators/endpoint/repository.ts +291 -0
- package/src/app/api/[locale]/system/generators/endpoint/route.ts +21 -0
- package/src/app/api/[locale]/system/generators/endpoints/definition.ts +246 -0
- package/src/app/api/[locale]/system/generators/endpoints/i18n/de/index.ts +54 -0
- package/src/app/api/[locale]/system/generators/endpoints/i18n/en/index.ts +52 -0
- package/src/app/api/[locale]/system/generators/endpoints/i18n/pl/index.ts +54 -0
- package/src/app/api/[locale]/system/generators/endpoints/options-repository.ts +463 -0
- package/src/app/api/[locale]/system/generators/endpoints/repository.ts +383 -0
- package/src/app/api/[locale]/system/generators/endpoints/route.ts +18 -0
- package/src/app/api/[locale]/system/generators/endpoints-index/definition.ts +194 -0
- package/src/app/api/[locale]/system/generators/endpoints-index/i18n/de/index.ts +71 -0
- package/src/app/api/[locale]/system/generators/endpoints-index/i18n/en/index.ts +69 -0
- package/src/app/api/[locale]/system/generators/endpoints-index/i18n/pl/index.ts +71 -0
- package/src/app/api/[locale]/system/generators/endpoints-index/repository.ts +294 -0
- package/src/app/api/[locale]/system/generators/endpoints-index/route.ts +18 -0
- package/src/app/api/[locale]/system/generators/generate-all/definition.ts +355 -0
- package/src/app/api/[locale]/system/generators/generate-all/i18n/de/index.ts +96 -0
- package/src/app/api/[locale]/system/generators/generate-all/i18n/en/index.ts +94 -0
- package/src/app/api/[locale]/system/generators/generate-all/i18n/pl/index.ts +96 -0
- package/src/app/api/[locale]/system/generators/generate-all/repository.ts +257 -0
- package/src/app/api/[locale]/system/generators/generate-all/route.ts +20 -0
- package/src/app/api/[locale]/system/generators/i18n/de/index.ts +15 -0
- package/src/app/api/[locale]/system/generators/i18n/en/index.ts +14 -0
- package/src/app/api/[locale]/system/generators/i18n/pl/index.ts +15 -0
- package/src/app/api/[locale]/system/generators/route-handlers/definition.ts +198 -0
- package/src/app/api/[locale]/system/generators/route-handlers/i18n/de/index.ts +48 -0
- package/src/app/api/[locale]/system/generators/route-handlers/i18n/en/index.ts +48 -0
- package/src/app/api/[locale]/system/generators/route-handlers/i18n/pl/index.ts +50 -0
- package/src/app/api/[locale]/system/generators/route-handlers/repository.ts +277 -0
- package/src/app/api/[locale]/system/generators/route-handlers/route.ts +17 -0
- package/src/app/api/[locale]/system/generators/shared/utils.ts +233 -0
- package/src/app/api/[locale]/system/help/definition.ts +445 -0
- package/src/app/api/[locale]/system/help/i18n/de/index.ts +267 -0
- package/src/app/api/[locale]/system/help/i18n/en/index.ts +262 -0
- package/src/app/api/[locale]/system/help/i18n/pl/index.ts +265 -0
- package/src/app/api/[locale]/system/help/interactive/definition.ts +125 -0
- package/src/app/api/[locale]/system/help/interactive/i18n/de/index.ts +22 -0
- package/src/app/api/[locale]/system/help/interactive/i18n/en/index.ts +19 -0
- package/src/app/api/[locale]/system/help/interactive/i18n/pl/index.ts +22 -0
- package/src/app/api/[locale]/system/help/interactive/repository.ts +1025 -0
- package/src/app/api/[locale]/system/help/interactive/route.ts +53 -0
- package/src/app/api/[locale]/system/help/list/definition.ts +372 -0
- package/src/app/api/[locale]/system/help/list/repository.ts +110 -0
- package/src/app/api/[locale]/system/help/list/route.ts +21 -0
- package/src/app/api/[locale]/system/help/repository.ts +212 -0
- package/src/app/api/[locale]/system/help/route.ts +16 -0
- package/src/app/api/[locale]/system/i18n/de/index.ts +68 -0
- package/src/app/api/[locale]/system/i18n/en/index.ts +65 -0
- package/src/app/api/[locale]/system/i18n/pl/index.ts +66 -0
- package/src/app/api/[locale]/system/release-tool/definition.ts +3104 -0
- package/src/app/api/[locale]/system/release-tool/i18n/de/index.ts +813 -0
- package/src/app/api/[locale]/system/release-tool/i18n/en/index.ts +797 -0
- package/src/app/api/[locale]/system/release-tool/i18n/pl/index.ts +810 -0
- package/src/app/api/[locale]/system/release-tool/repository/asset-zipper.ts +128 -0
- package/src/app/api/[locale]/system/release-tool/repository/changelog-generator.ts +212 -0
- package/src/app/api/[locale]/system/release-tool/repository/ci-detector.ts +566 -0
- package/src/app/api/[locale]/system/release-tool/repository/config.ts +113 -0
- package/src/app/api/[locale]/system/release-tool/repository/constants.ts +407 -0
- package/src/app/api/[locale]/system/release-tool/repository/dependency-manager.ts +527 -0
- package/src/app/api/[locale]/system/release-tool/repository/git-service.ts +403 -0
- package/src/app/api/[locale]/system/release-tool/repository/hook-runner.ts +100 -0
- package/src/app/api/[locale]/system/release-tool/repository/index.ts +1 -0
- package/src/app/api/[locale]/system/release-tool/repository/notification-service.ts +638 -0
- package/src/app/api/[locale]/system/release-tool/repository/package-service.ts +169 -0
- package/src/app/api/[locale]/system/release-tool/repository/publisher.ts +253 -0
- package/src/app/api/[locale]/system/release-tool/repository/quality-runner.ts +428 -0
- package/src/app/api/[locale]/system/release-tool/repository/release-creator.ts +293 -0
- package/src/app/api/[locale]/system/release-tool/repository/release-executor.ts +1198 -0
- package/src/app/api/[locale]/system/release-tool/repository/snyk-service.ts +136 -0
- package/src/app/api/[locale]/system/release-tool/repository/utils.ts +642 -0
- package/src/app/api/[locale]/system/release-tool/repository/validation.ts +288 -0
- package/src/app/api/[locale]/system/release-tool/repository/version-service.ts +297 -0
- package/src/app/api/[locale]/system/release-tool/route.ts +21 -0
- package/src/app/api/[locale]/system/unified-interface/README.md +328 -0
- package/src/app/api/[locale]/system/unified-interface/cli/README.md +349 -0
- package/src/app/api/[locale]/system/unified-interface/cli/auth/cli-handler.ts +95 -0
- package/src/app/api/[locale]/system/unified-interface/cli/auth/cli-user.ts +146 -0
- package/src/app/api/[locale]/system/unified-interface/cli/auth/session-file.ts +266 -0
- package/src/app/api/[locale]/system/unified-interface/cli/env.ts +26 -0
- package/src/app/api/[locale]/system/unified-interface/cli/i18n/de/index.ts +157 -0
- package/src/app/api/[locale]/system/unified-interface/cli/i18n/en/index.ts +155 -0
- package/src/app/api/[locale]/system/unified-interface/cli/i18n/pl/index.ts +158 -0
- package/src/app/api/[locale]/system/unified-interface/cli/runtime/debug.ts +595 -0
- package/src/app/api/[locale]/system/unified-interface/cli/runtime/entry-point.ts +129 -0
- package/src/app/api/[locale]/system/unified-interface/cli/runtime/environment.ts +155 -0
- package/src/app/api/[locale]/system/unified-interface/cli/runtime/execution-errors.ts +452 -0
- package/src/app/api/[locale]/system/unified-interface/cli/runtime/parsing.ts +297 -0
- package/src/app/api/[locale]/system/unified-interface/cli/runtime/route-executor.ts +859 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/i18n/de/index.ts +12 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/i18n/en/index.ts +11 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/i18n/pl/index.ts +12 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/install/definition.ts +262 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/install/i18n/de/index.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/install/i18n/en/index.ts +52 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/install/i18n/pl/index.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/install/repository.ts +421 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/install/route.ts +25 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/status/definition.ts +181 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/status/i18n/de/index.ts +61 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/status/i18n/en/index.ts +59 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/status/i18n/pl/index.ts +61 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/status/repository.ts +195 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/status/route.ts +22 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/definition.ts +188 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/i18n/de/index.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/i18n/en/index.ts +52 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/i18n/pl/index.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/repository.ts +209 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/uninstall/route.ts +24 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/update/definition.ts +200 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/update/i18n/de/index.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/update/i18n/en/index.ts +52 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/update/i18n/pl/index.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/update/repository.ts +113 -0
- package/src/app/api/[locale]/system/unified-interface/cli/setup/update/route.ts +22 -0
- package/src/app/api/[locale]/system/unified-interface/cli/vibe-runtime.ts +304 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/core/base-renderer.ts +270 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/core/registry.ts +309 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/core/types.ts +126 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/i18n/de/index.ts +67 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/i18n/en/index.ts +65 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/i18n/pl/index.ts +67 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/accordion.ts +74 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/avatar.ts +39 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/badge.ts +54 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-output.ts +298 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-quality-files.ts +89 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-quality-list.ts +298 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/code-quality-summary.ts +96 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/container.ts +186 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-card.ts +65 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-cards.ts +570 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-list.ts +80 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/data-table.ts +385 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/editable-text.ts +99 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/empty-state.ts +55 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/errors.ts +67 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/grouped-list.ts +729 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/link-card.ts +87 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/link-list.ts +112 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/link.ts +59 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/loading.ts +50 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/markdown.ts +131 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/metric.ts +291 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/section.ts +120 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/stats-grid.ts +149 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/tabs.ts +61 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/text.ts +78 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/implementations/title.ts +42 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/renderers/response-renderer.ts +418 -0
- package/src/app/api/[locale]/system/unified-interface/cli/widgets/renderers/schema-handler.ts +534 -0
- package/src/app/api/[locale]/system/unified-interface/i18n/de/index.ts +42 -0
- package/src/app/api/[locale]/system/unified-interface/i18n/en/index.ts +40 -0
- package/src/app/api/[locale]/system/unified-interface/i18n/pl/index.ts +43 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/README.md +114 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/converter.ts +146 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/i18n/de/index.ts +182 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/i18n/en/index.ts +179 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/i18n/pl/index.ts +181 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/registry.ts +343 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/serve/definition.ts +147 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/serve/repository.ts +38 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/serve/route.ts +14 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/server/protocol-handler.ts +309 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/server/server.ts +154 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/server/stdio-transport.ts +193 -0
- package/src/app/api/[locale]/system/unified-interface/mcp/types.ts +246 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/create-form.ts +1510 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/create.ts +581 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/endpoint-to-metadata.ts +52 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definition/loader.ts +152 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/definitions/registry.ts +265 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/permissions/registry.ts +680 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/executor.ts +220 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/handler.ts +325 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/multi.ts +184 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/request-validator.ts +201 -0
- package/src/app/api/[locale]/system/unified-interface/shared/endpoints/route/single.ts +58 -0
- package/src/app/api/[locale]/system/unified-interface/shared/env/define-env-client.ts +49 -0
- package/src/app/api/[locale]/system/unified-interface/shared/env/define-env.ts +47 -0
- package/src/app/api/[locale]/system/unified-interface/shared/env/validation-logger.ts +58 -0
- package/src/app/api/[locale]/system/unified-interface/shared/field/enum.ts +110 -0
- package/src/app/api/[locale]/system/unified-interface/shared/field/specialized.ts +339 -0
- package/src/app/api/[locale]/system/unified-interface/shared/field/utils.test.ts +408 -0
- package/src/app/api/[locale]/system/unified-interface/shared/field/utils.ts +1349 -0
- package/src/app/api/[locale]/system/unified-interface/shared/field-config/endpoint-field-types.ts +107 -0
- package/src/app/api/[locale]/system/unified-interface/shared/field-config/field-config-types.ts +268 -0
- package/src/app/api/[locale]/system/unified-interface/shared/logger/colors.ts +114 -0
- package/src/app/api/[locale]/system/unified-interface/shared/logger/endpoint.ts +169 -0
- package/src/app/api/[locale]/system/unified-interface/shared/logger/file-logger.ts +88 -0
- package/src/app/api/[locale]/system/unified-interface/shared/logger/formatters.ts +177 -0
- package/src/app/api/[locale]/system/unified-interface/shared/server-only/auth/base-auth-handler.ts +82 -0
- package/src/app/api/[locale]/system/unified-interface/shared/server-only/auth/factory.ts +33 -0
- package/src/app/api/[locale]/system/unified-interface/shared/server-only/server-only.ts +4 -0
- package/src/app/api/[locale]/system/unified-interface/shared/types/actions.ts +289 -0
- package/src/app/api/[locale]/system/unified-interface/shared/types/endpoint.ts +1167 -0
- package/src/app/api/[locale]/system/unified-interface/shared/types/enums.ts +382 -0
- package/src/app/api/[locale]/system/unified-interface/shared/types/platform.ts +34 -0
- package/src/app/api/[locale]/system/unified-interface/shared/types/types.ts +80 -0
- package/src/app/api/[locale]/system/unified-interface/shared/types/ui-config.ts +76 -0
- package/src/app/api/[locale]/system/unified-interface/shared/utils/error-types.ts +27 -0
- package/src/app/api/[locale]/system/unified-interface/shared/utils/path.ts +63 -0
- package/src/app/api/[locale]/system/unified-interface/shared/utils/scanner.ts +241 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/actions.ts +256 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/configs.ts +1158 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/helpers.ts +80 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/accordion.ts +82 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/avatar.ts +75 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/badge.ts +89 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/code-output.ts +302 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/code-quality-list.ts +202 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/container.ts +129 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-card.ts +81 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-cards.ts +258 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-list.ts +123 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/data-table.ts +387 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/editable-text.ts +89 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/empty-state.ts +78 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/errors.ts +93 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/grouped-list.ts +448 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/index.ts +38 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/link-card.ts +130 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/link-list.ts +127 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/link.ts +68 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/loading.ts +81 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/markdown.ts +176 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/metric-card.ts +241 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/section.ts +90 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/stats-grid.ts +71 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/tabs.ts +80 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/text.ts +105 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/logic/title.ts +72 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/types.ts +240 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/field-helpers.ts +137 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/formatting.ts +437 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/url.ts +40 -0
- package/src/app/api/[locale]/system/unified-interface/shared/widgets/utils/widget-helpers.ts +465 -0
- package/src/app/api/[locale]/user/auth/enum.ts +16 -0
- package/src/app/api/[locale]/user/auth/i18n/de/index.ts +227 -0
- package/src/app/api/[locale]/user/auth/i18n/en/index.ts +205 -0
- package/src/app/api/[locale]/user/auth/i18n/pl/index.ts +219 -0
- package/src/app/api/[locale]/user/auth/types.ts +110 -0
- package/src/app/api/[locale]/user/enum.ts +64 -0
- package/src/app/api/[locale]/user/private/i18n/de/index.ts +3 -0
- package/src/app/api/[locale]/user/private/i18n/en/index.ts +1 -0
- package/src/app/api/[locale]/user/private/i18n/pl/index.ts +3 -0
- package/src/app/api/[locale]/user/types.ts +118 -0
- package/src/app/api/[locale]/user/user-roles/enum.ts +112 -0
- package/src/app/api/[locale]/user/user-roles/i18n/de/index.ts +85 -0
- package/src/app/api/[locale]/user/user-roles/i18n/en/index.ts +83 -0
- package/src/app/api/[locale]/user/user-roles/i18n/pl/index.ts +86 -0
- package/src/app/api/[locale]/user/user-roles/types.ts +34 -0
- package/src/app/api/i18n/de/index.ts +6 -0
- package/src/app/api/i18n/en/index.ts +5 -0
- package/src/app/api/i18n/pl/index.ts +5 -0
- package/src/app/i18n/de/index.ts +6 -0
- package/src/app/i18n/en/index.ts +5 -0
- package/src/app/i18n/pl/index.ts +5 -0
|
@@ -0,0 +1,1198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Executor Service
|
|
3
|
+
* Main orchestrator for the release process
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
|
|
8
|
+
import { confirm, select } from "@inquirer/prompts";
|
|
9
|
+
import type { ResponseType } from "next-vibe/shared/types/response.schema";
|
|
10
|
+
import {
|
|
11
|
+
ErrorResponseTypes,
|
|
12
|
+
fail,
|
|
13
|
+
success,
|
|
14
|
+
} from "next-vibe/shared/types/response.schema";
|
|
15
|
+
|
|
16
|
+
import type { CountryLanguage } from "@/i18n/core/config";
|
|
17
|
+
|
|
18
|
+
import type { EndpointLogger } from "../../unified-interface/shared/logger/endpoint";
|
|
19
|
+
import {
|
|
20
|
+
formatConfig,
|
|
21
|
+
formatDuration,
|
|
22
|
+
formatError,
|
|
23
|
+
formatHint,
|
|
24
|
+
formatProgress,
|
|
25
|
+
formatSection,
|
|
26
|
+
formatSkip,
|
|
27
|
+
formatStartup,
|
|
28
|
+
formatSuccess,
|
|
29
|
+
formatWarning,
|
|
30
|
+
} from "../../unified-interface/shared/logger/formatters";
|
|
31
|
+
import type {
|
|
32
|
+
GitInfo,
|
|
33
|
+
GitOpsConfig,
|
|
34
|
+
HookContext,
|
|
35
|
+
NotificationResult,
|
|
36
|
+
PackageResult,
|
|
37
|
+
PublishedPackage,
|
|
38
|
+
ReleaseConfig,
|
|
39
|
+
ReleaseResponseType,
|
|
40
|
+
RequestType,
|
|
41
|
+
Timings,
|
|
42
|
+
} from "../definition";
|
|
43
|
+
import { assetZipper } from "./asset-zipper";
|
|
44
|
+
import { changelogGenerator } from "./changelog-generator";
|
|
45
|
+
import { ciDetector } from "./ci-detector";
|
|
46
|
+
import type { IConfigLoader } from "./config";
|
|
47
|
+
import { MESSAGES } from "./constants";
|
|
48
|
+
import { dependencyManager } from "./dependency-manager";
|
|
49
|
+
import { gitService } from "./git-service";
|
|
50
|
+
import { hookRunner } from "./hook-runner";
|
|
51
|
+
import { notificationService } from "./notification-service";
|
|
52
|
+
import { packageService } from "./package-service";
|
|
53
|
+
import { publisher } from "./publisher";
|
|
54
|
+
import { qualityRunner } from "./quality-runner";
|
|
55
|
+
import { releaseCreator } from "./release-creator";
|
|
56
|
+
import { snykService } from "./snyk-service";
|
|
57
|
+
import { validationService } from "./validation";
|
|
58
|
+
import { versionService } from "./version-service";
|
|
59
|
+
|
|
60
|
+
// ============================================================================
|
|
61
|
+
// Interface
|
|
62
|
+
// ============================================================================
|
|
63
|
+
|
|
64
|
+
export interface IReleaseExecutor {
|
|
65
|
+
/**
|
|
66
|
+
* Execute the release process
|
|
67
|
+
*/
|
|
68
|
+
execute(
|
|
69
|
+
data: RequestType,
|
|
70
|
+
locale: CountryLanguage,
|
|
71
|
+
logger: EndpointLogger,
|
|
72
|
+
): Promise<ResponseType<ReleaseResponseType>>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ============================================================================
|
|
76
|
+
// Implementation
|
|
77
|
+
// ============================================================================
|
|
78
|
+
|
|
79
|
+
export class ReleaseExecutor implements IReleaseExecutor {
|
|
80
|
+
async execute(
|
|
81
|
+
data: RequestType,
|
|
82
|
+
locale: CountryLanguage,
|
|
83
|
+
logger: EndpointLogger,
|
|
84
|
+
): Promise<ResponseType<ReleaseResponseType>> {
|
|
85
|
+
void locale;
|
|
86
|
+
const startTime = Date.now();
|
|
87
|
+
const output: string[] = [];
|
|
88
|
+
const errors: string[] = [];
|
|
89
|
+
const warnings: string[] = [];
|
|
90
|
+
const packagesProcessed: PackageResult[] = [];
|
|
91
|
+
const publishedPackages: PublishedPackage[] = [];
|
|
92
|
+
const notificationsSent: NotificationResult[] = [];
|
|
93
|
+
let globalGitInfo: GitInfo | undefined;
|
|
94
|
+
|
|
95
|
+
// Timings tracking
|
|
96
|
+
const timings: Timings = { total: 0 };
|
|
97
|
+
const trackTime = (
|
|
98
|
+
phase: keyof Omit<Timings, "total">,
|
|
99
|
+
start: number,
|
|
100
|
+
): void => {
|
|
101
|
+
timings[phase] = Date.now() - start;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Detect CI environment
|
|
105
|
+
const ciEnv = ciDetector.detect();
|
|
106
|
+
|
|
107
|
+
// Declare config outside try block so it's available in catch
|
|
108
|
+
let config: ReleaseConfig | undefined;
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
output.push(MESSAGES.RELEASE_START);
|
|
112
|
+
|
|
113
|
+
// Load config from file or use configObject
|
|
114
|
+
if (data.configObject) {
|
|
115
|
+
config = data.configObject;
|
|
116
|
+
logger.debug("Using inline configuration");
|
|
117
|
+
} else {
|
|
118
|
+
// Lazy-load configLoader to avoid Turbopack warning about dynamic imports
|
|
119
|
+
// The config module uses dynamic imports that can't be statically analyzed
|
|
120
|
+
const { configLoader } = (await import("./config")) as {
|
|
121
|
+
configLoader: IConfigLoader;
|
|
122
|
+
};
|
|
123
|
+
const configResult = await configLoader.load(logger, data.configPath);
|
|
124
|
+
if (!configResult.success) {
|
|
125
|
+
return fail({
|
|
126
|
+
message: configResult.message,
|
|
127
|
+
errorType: configResult.errorType,
|
|
128
|
+
messageParams: configResult.messageParams,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
config = configResult.data;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Extract runtime options - request (data) params override config file
|
|
135
|
+
const isCI = data.ci ?? ciEnv.isCI;
|
|
136
|
+
const isVerbose = data.verbose ?? false;
|
|
137
|
+
const dryRun = data.dryRun ?? false;
|
|
138
|
+
// Track if forceUpdate was explicitly set (to know if we should prompt)
|
|
139
|
+
const forceUpdateExplicitlySet = data.forceUpdate !== undefined || false;
|
|
140
|
+
const forceUpdate = data.forceUpdate ?? false;
|
|
141
|
+
const skipLint = data.skipLint ?? false;
|
|
142
|
+
const skipTypecheck = data.skipTypecheck ?? false;
|
|
143
|
+
const skipBuild = data.skipBuild ?? false;
|
|
144
|
+
const skipTests = data.skipTests ?? false;
|
|
145
|
+
const skipSnyk = data.skipSnyk ?? false;
|
|
146
|
+
const skipPublish = data.skipPublish ?? false;
|
|
147
|
+
const skipChangelog = data.skipChangelog ?? false;
|
|
148
|
+
const skipGitTag = data.skipGitTag ?? false;
|
|
149
|
+
const skipGitPush = data.skipGitPush ?? false;
|
|
150
|
+
const targetPackage = data.targetPackage;
|
|
151
|
+
let versionIncrement = data.versionIncrement;
|
|
152
|
+
const prereleaseId = data.prereleaseId;
|
|
153
|
+
const notifyWebhook = data.notifyWebhook;
|
|
154
|
+
const packageManager = config.packageManager ?? "bun";
|
|
155
|
+
|
|
156
|
+
// Show startup banner
|
|
157
|
+
logger.vibe(formatStartup("Release Tool", "📦"));
|
|
158
|
+
logger.vibe("");
|
|
159
|
+
logger.vibe(` ${formatConfig("Package Manager", packageManager)}`);
|
|
160
|
+
logger.vibe(
|
|
161
|
+
` ${formatConfig("Dry Run", dryRun ? "YES" : "NO")} ${formatHint(dryRun ? "(changes won't be applied)" : "")}`,
|
|
162
|
+
);
|
|
163
|
+
if (ciEnv.isCI) {
|
|
164
|
+
logger.vibe(
|
|
165
|
+
` ${formatConfig("CI Environment", ciEnv.provider ?? "detected")}`,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
logger.vibe("");
|
|
169
|
+
|
|
170
|
+
// Show what will be checked/skipped
|
|
171
|
+
logger.vibe(` ${formatConfig("Lint", skipLint ? "SKIP" : "ON")}`);
|
|
172
|
+
logger.vibe(
|
|
173
|
+
` ${formatConfig("Typecheck", skipTypecheck ? "SKIP" : "ON")}`,
|
|
174
|
+
);
|
|
175
|
+
logger.vibe(` ${formatConfig("Build", skipBuild ? "SKIP" : "ON")}`);
|
|
176
|
+
logger.vibe(` ${formatConfig("Tests", skipTests ? "SKIP" : "ON")}`);
|
|
177
|
+
logger.vibe(` ${formatConfig("Publish", skipPublish ? "SKIP" : "ON")}`);
|
|
178
|
+
logger.vibe("");
|
|
179
|
+
|
|
180
|
+
if (isVerbose) {
|
|
181
|
+
logger.debug("Verbose mode enabled");
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const originalCwd = process.cwd();
|
|
185
|
+
const mainBranch = config.branch?.main ?? "main";
|
|
186
|
+
|
|
187
|
+
// Gather git info (always needed)
|
|
188
|
+
logger.vibe(formatProgress("Fetching git information..."));
|
|
189
|
+
globalGitInfo = gitService.getInfo(originalCwd, logger);
|
|
190
|
+
if (globalGitInfo) {
|
|
191
|
+
logger.debug("Git info", {
|
|
192
|
+
branch: globalGitInfo.currentBranch,
|
|
193
|
+
lastTag: globalGitInfo.lastTag,
|
|
194
|
+
uncommittedChanges: globalGitInfo.hasUncommittedChanges,
|
|
195
|
+
commitsSinceTag: globalGitInfo.commitsSinceLastTag,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Run basic validations (NOT branch check - that comes later before git ops)
|
|
200
|
+
logger.vibe(formatProgress("Running validations..."));
|
|
201
|
+
const validationResult = validationService.runBasicValidations(
|
|
202
|
+
config,
|
|
203
|
+
originalCwd,
|
|
204
|
+
packageManager,
|
|
205
|
+
logger,
|
|
206
|
+
);
|
|
207
|
+
if (!validationResult.success) {
|
|
208
|
+
return fail({
|
|
209
|
+
message: validationResult.message,
|
|
210
|
+
errorType: validationResult.errorType,
|
|
211
|
+
messageParams: validationResult.messageParams,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
trackTime("validation", startTime);
|
|
215
|
+
|
|
216
|
+
// Ask user if they want to update dependencies (unless forceUpdate explicitly set or CI)
|
|
217
|
+
if (!forceUpdateExplicitlySet && !isCI) {
|
|
218
|
+
const shouldUpdate = await confirm({
|
|
219
|
+
message: "Update dependencies before release?",
|
|
220
|
+
default: false,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
if (shouldUpdate) {
|
|
224
|
+
logger.vibe(formatProgress("Updating dependencies..."));
|
|
225
|
+
const pkgJsonResult = packageService.getPackageJson(
|
|
226
|
+
originalCwd,
|
|
227
|
+
logger,
|
|
228
|
+
);
|
|
229
|
+
if (pkgJsonResult.success) {
|
|
230
|
+
const updateResult = dependencyManager.updateDependencies(
|
|
231
|
+
originalCwd,
|
|
232
|
+
packageManager,
|
|
233
|
+
pkgJsonResult.data,
|
|
234
|
+
logger,
|
|
235
|
+
dryRun,
|
|
236
|
+
);
|
|
237
|
+
if (updateResult.success) {
|
|
238
|
+
logger.vibe(formatSuccess("Dependencies updated"));
|
|
239
|
+
} else {
|
|
240
|
+
logger.vibe(
|
|
241
|
+
formatWarning("Failed to update dependencies, continuing..."),
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
logger.vibe(formatSkip("Skipping dependency update"));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Handle force update mode - just update deps and return
|
|
251
|
+
if (forceUpdate) {
|
|
252
|
+
logger.vibe(
|
|
253
|
+
formatProgress("Force update mode: updating dependencies..."),
|
|
254
|
+
);
|
|
255
|
+
const packages = config.packages ?? [];
|
|
256
|
+
for (const pkg of packages) {
|
|
257
|
+
if (pkg.updateDeps === true || pkg.updateDeps === "force") {
|
|
258
|
+
const cwd = join(originalCwd, pkg.directory);
|
|
259
|
+
const pkgJsonResult = packageService.getPackageJson(cwd, logger);
|
|
260
|
+
if (pkgJsonResult.success) {
|
|
261
|
+
const updateResult = dependencyManager.updateDependencies(
|
|
262
|
+
cwd,
|
|
263
|
+
packageManager,
|
|
264
|
+
pkgJsonResult.data,
|
|
265
|
+
logger,
|
|
266
|
+
dryRun,
|
|
267
|
+
);
|
|
268
|
+
if (!updateResult.success) {
|
|
269
|
+
errors.push(
|
|
270
|
+
`Failed to update ${pkgJsonResult.data.name}: ${updateResult.message}`,
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return success({
|
|
277
|
+
success: errors.length === 0,
|
|
278
|
+
output: output.join("\n"),
|
|
279
|
+
duration: Date.now() - startTime,
|
|
280
|
+
packagesProcessed: [],
|
|
281
|
+
errors: errors.length > 0 ? errors : null,
|
|
282
|
+
warnings: warnings.length > 0 ? warnings : null,
|
|
283
|
+
publishedPackages: null,
|
|
284
|
+
notificationsSent: null,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Run global pre-release hook
|
|
289
|
+
if (config.hooks?.preRelease) {
|
|
290
|
+
const hookResult = hookRunner.runHook(
|
|
291
|
+
config.hooks.preRelease,
|
|
292
|
+
originalCwd,
|
|
293
|
+
logger,
|
|
294
|
+
dryRun,
|
|
295
|
+
{ packageManager },
|
|
296
|
+
);
|
|
297
|
+
if (!hookResult.success) {
|
|
298
|
+
const errorMsg = `Pre-release hook failed: ${hookResult.message}`;
|
|
299
|
+
errors.push(errorMsg);
|
|
300
|
+
// If continueOnError is false, fail the entire release
|
|
301
|
+
if (!config.continueOnError) {
|
|
302
|
+
return success(
|
|
303
|
+
{
|
|
304
|
+
success: false,
|
|
305
|
+
output: output.join("\n"),
|
|
306
|
+
duration: Date.now() - startTime,
|
|
307
|
+
packagesProcessed: [],
|
|
308
|
+
ciEnvironment: undefined,
|
|
309
|
+
errors,
|
|
310
|
+
warnings: warnings.length > 0 ? warnings : null,
|
|
311
|
+
gitInfo: globalGitInfo,
|
|
312
|
+
publishedPackages: null,
|
|
313
|
+
timings: { total: Date.now() - startTime },
|
|
314
|
+
notificationsSent: null,
|
|
315
|
+
} satisfies ReleaseResponseType,
|
|
316
|
+
{ isErrorResponse: true },
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Filter packages if targetPackage is specified
|
|
323
|
+
let packages = config.packages ?? [];
|
|
324
|
+
if (targetPackage) {
|
|
325
|
+
packages = packages.filter(
|
|
326
|
+
(pkg) =>
|
|
327
|
+
pkg.directory === targetPackage ||
|
|
328
|
+
pkg.directory.includes(targetPackage),
|
|
329
|
+
);
|
|
330
|
+
if (packages.length === 0) {
|
|
331
|
+
return fail({
|
|
332
|
+
message: "app.api.system.releaseTool.errors.packageNotFound",
|
|
333
|
+
errorType: ErrorResponseTypes.NOT_FOUND,
|
|
334
|
+
messageParams: { targetPackage },
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Process each package
|
|
340
|
+
for (const pkg of packages) {
|
|
341
|
+
const cwd = join(originalCwd, pkg.directory);
|
|
342
|
+
const packageJsonResult = packageService.getPackageJson(cwd, logger);
|
|
343
|
+
|
|
344
|
+
if (!packageJsonResult.success) {
|
|
345
|
+
packagesProcessed.push({
|
|
346
|
+
name: pkg.directory,
|
|
347
|
+
directory: pkg.directory,
|
|
348
|
+
status: "failed",
|
|
349
|
+
message: "Failed to read package.json",
|
|
350
|
+
});
|
|
351
|
+
if (!config.continueOnError) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const packageJson = packageJsonResult.data;
|
|
358
|
+
logger.vibe(formatSection(`Package: ${packageJson.name}`));
|
|
359
|
+
|
|
360
|
+
// Create hook context for this package
|
|
361
|
+
const hookContext: HookContext = {
|
|
362
|
+
packageManager,
|
|
363
|
+
packageName: packageJson.name,
|
|
364
|
+
version: packageJson.version,
|
|
365
|
+
directory: pkg.directory,
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
// Helper to handle quality check failures
|
|
369
|
+
let packageFailed = false;
|
|
370
|
+
const handleFailure = (
|
|
371
|
+
result: { success: boolean; message?: string },
|
|
372
|
+
step: string,
|
|
373
|
+
): boolean => {
|
|
374
|
+
if (!result.success) {
|
|
375
|
+
const errorMsg = result.message ?? `${step} failed`;
|
|
376
|
+
errors.push(`[${packageJson.name}] ${errorMsg}`);
|
|
377
|
+
if (!config?.continueOnError) {
|
|
378
|
+
packageFailed = true;
|
|
379
|
+
packagesProcessed.push({
|
|
380
|
+
name: packageJson.name,
|
|
381
|
+
directory: pkg.directory,
|
|
382
|
+
status: "failed",
|
|
383
|
+
message: errorMsg,
|
|
384
|
+
});
|
|
385
|
+
return true; // Should stop processing
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return false; // Continue processing
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
// Helper to handle hook failures (same behavior as quality failures)
|
|
392
|
+
const handleHookFailure = (hookName: string): boolean => {
|
|
393
|
+
return handleFailure(
|
|
394
|
+
{ success: false, message: `Hook ${hookName} failed` },
|
|
395
|
+
"Hook",
|
|
396
|
+
);
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
// Install dependencies if configured
|
|
400
|
+
if (pkg.install && !packageFailed) {
|
|
401
|
+
if (pkg.hooks?.preInstall) {
|
|
402
|
+
const hookResult = hookRunner.runHook(
|
|
403
|
+
pkg.hooks.preInstall,
|
|
404
|
+
cwd,
|
|
405
|
+
logger,
|
|
406
|
+
dryRun,
|
|
407
|
+
hookContext,
|
|
408
|
+
);
|
|
409
|
+
if (!hookResult.success && handleHookFailure("preInstall")) {
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
const installCommand =
|
|
414
|
+
typeof pkg.install === "string" ? pkg.install : undefined;
|
|
415
|
+
const installResult = qualityRunner.runInstall(
|
|
416
|
+
cwd,
|
|
417
|
+
packageManager,
|
|
418
|
+
logger,
|
|
419
|
+
dryRun,
|
|
420
|
+
installCommand,
|
|
421
|
+
);
|
|
422
|
+
if (handleFailure(installResult, "Install")) {
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
if (pkg.hooks?.postInstall) {
|
|
426
|
+
const hookResult = hookRunner.runHook(
|
|
427
|
+
pkg.hooks.postInstall,
|
|
428
|
+
cwd,
|
|
429
|
+
logger,
|
|
430
|
+
dryRun,
|
|
431
|
+
hookContext,
|
|
432
|
+
);
|
|
433
|
+
if (!hookResult.success && handleHookFailure("postInstall")) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// Clean if configured
|
|
440
|
+
if (pkg.clean && !packageFailed) {
|
|
441
|
+
if (pkg.hooks?.preClean) {
|
|
442
|
+
const hookResult = hookRunner.runHook(
|
|
443
|
+
pkg.hooks.preClean,
|
|
444
|
+
cwd,
|
|
445
|
+
logger,
|
|
446
|
+
dryRun,
|
|
447
|
+
hookContext,
|
|
448
|
+
);
|
|
449
|
+
if (!hookResult.success && handleHookFailure("preClean")) {
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const cleanCommand =
|
|
454
|
+
typeof pkg.clean === "string" ? pkg.clean : undefined;
|
|
455
|
+
const cleanResult = qualityRunner.runClean(
|
|
456
|
+
cwd,
|
|
457
|
+
packageManager,
|
|
458
|
+
logger,
|
|
459
|
+
dryRun,
|
|
460
|
+
cleanCommand,
|
|
461
|
+
);
|
|
462
|
+
if (handleFailure(cleanResult, "Clean")) {
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
if (pkg.hooks?.postClean) {
|
|
466
|
+
const hookResult = hookRunner.runHook(
|
|
467
|
+
pkg.hooks.postClean,
|
|
468
|
+
cwd,
|
|
469
|
+
logger,
|
|
470
|
+
dryRun,
|
|
471
|
+
hookContext,
|
|
472
|
+
);
|
|
473
|
+
if (!hookResult.success && handleHookFailure("postClean")) {
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// Note: Dependencies are only updated with --force-update flag
|
|
480
|
+
// The check for outdated deps happens earlier and warns the user
|
|
481
|
+
|
|
482
|
+
// Lint
|
|
483
|
+
if (pkg.lint && !skipLint && !packageFailed) {
|
|
484
|
+
if (pkg.hooks?.preLint) {
|
|
485
|
+
const hookResult = hookRunner.runHook(
|
|
486
|
+
pkg.hooks.preLint,
|
|
487
|
+
cwd,
|
|
488
|
+
logger,
|
|
489
|
+
dryRun,
|
|
490
|
+
hookContext,
|
|
491
|
+
);
|
|
492
|
+
if (!hookResult.success && handleHookFailure("preLint")) {
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
const lintCommand =
|
|
497
|
+
typeof pkg.lint === "string" ? pkg.lint : undefined;
|
|
498
|
+
const lintResult = qualityRunner.runLint(
|
|
499
|
+
cwd,
|
|
500
|
+
packageManager,
|
|
501
|
+
logger,
|
|
502
|
+
dryRun,
|
|
503
|
+
lintCommand,
|
|
504
|
+
);
|
|
505
|
+
if (handleFailure(lintResult, "Lint")) {
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
if (pkg.hooks?.postLint) {
|
|
509
|
+
const hookResult = hookRunner.runHook(
|
|
510
|
+
pkg.hooks.postLint,
|
|
511
|
+
cwd,
|
|
512
|
+
logger,
|
|
513
|
+
dryRun,
|
|
514
|
+
hookContext,
|
|
515
|
+
);
|
|
516
|
+
if (!hookResult.success && handleHookFailure("postLint")) {
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// Typecheck
|
|
523
|
+
if (pkg.typecheck && !skipTypecheck && !packageFailed) {
|
|
524
|
+
const typecheckCommand =
|
|
525
|
+
typeof pkg.typecheck === "string" ? pkg.typecheck : undefined;
|
|
526
|
+
const typecheckResult = qualityRunner.runTypecheck(
|
|
527
|
+
cwd,
|
|
528
|
+
packageManager,
|
|
529
|
+
logger,
|
|
530
|
+
dryRun,
|
|
531
|
+
typecheckCommand,
|
|
532
|
+
);
|
|
533
|
+
if (handleFailure(typecheckResult, "Typecheck")) {
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// Build
|
|
539
|
+
if (pkg.build && !skipBuild && !packageFailed) {
|
|
540
|
+
if (pkg.hooks?.preBuild) {
|
|
541
|
+
const hookResult = hookRunner.runHook(
|
|
542
|
+
pkg.hooks.preBuild,
|
|
543
|
+
cwd,
|
|
544
|
+
logger,
|
|
545
|
+
dryRun,
|
|
546
|
+
hookContext,
|
|
547
|
+
);
|
|
548
|
+
if (!hookResult.success && handleHookFailure("preBuild")) {
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
const buildCommand =
|
|
553
|
+
typeof pkg.build === "string" ? pkg.build : undefined;
|
|
554
|
+
const buildResult = qualityRunner.runBuild(
|
|
555
|
+
cwd,
|
|
556
|
+
packageManager,
|
|
557
|
+
logger,
|
|
558
|
+
dryRun,
|
|
559
|
+
buildCommand,
|
|
560
|
+
);
|
|
561
|
+
if (handleFailure(buildResult, "Build")) {
|
|
562
|
+
continue;
|
|
563
|
+
}
|
|
564
|
+
if (pkg.hooks?.postBuild) {
|
|
565
|
+
const hookResult = hookRunner.runHook(
|
|
566
|
+
pkg.hooks.postBuild,
|
|
567
|
+
cwd,
|
|
568
|
+
logger,
|
|
569
|
+
dryRun,
|
|
570
|
+
hookContext,
|
|
571
|
+
);
|
|
572
|
+
if (!hookResult.success && handleHookFailure("postBuild")) {
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Tests
|
|
579
|
+
if (pkg.test && !skipTests && !packageFailed) {
|
|
580
|
+
if (pkg.hooks?.preTest) {
|
|
581
|
+
const hookResult = hookRunner.runHook(
|
|
582
|
+
pkg.hooks.preTest,
|
|
583
|
+
cwd,
|
|
584
|
+
logger,
|
|
585
|
+
dryRun,
|
|
586
|
+
hookContext,
|
|
587
|
+
);
|
|
588
|
+
if (!hookResult.success && handleHookFailure("preTest")) {
|
|
589
|
+
continue;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
const testCommand =
|
|
593
|
+
typeof pkg.test === "string" ? pkg.test : undefined;
|
|
594
|
+
const testResult = qualityRunner.runTests(
|
|
595
|
+
cwd,
|
|
596
|
+
packageManager,
|
|
597
|
+
logger,
|
|
598
|
+
dryRun,
|
|
599
|
+
testCommand,
|
|
600
|
+
);
|
|
601
|
+
if (handleFailure(testResult, "Tests")) {
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
if (pkg.hooks?.postTest) {
|
|
605
|
+
const hookResult = hookRunner.runHook(
|
|
606
|
+
pkg.hooks.postTest,
|
|
607
|
+
cwd,
|
|
608
|
+
logger,
|
|
609
|
+
dryRun,
|
|
610
|
+
hookContext,
|
|
611
|
+
);
|
|
612
|
+
if (!hookResult.success && handleHookFailure("postTest")) {
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// Snyk
|
|
619
|
+
if (pkg.snyk && !skipSnyk && !packageFailed) {
|
|
620
|
+
const snykResult = isCI
|
|
621
|
+
? snykService.runSnykMonitor(cwd, packageJson.name, logger, dryRun)
|
|
622
|
+
: snykService.runSnykTest(cwd, packageJson.name, logger, dryRun);
|
|
623
|
+
if (handleFailure(snykResult, "Security scan")) {
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// Skip release steps if package failed quality checks
|
|
629
|
+
if (packageFailed) {
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// Handle release
|
|
634
|
+
const releaseConfig = pkg.release;
|
|
635
|
+
if (releaseConfig) {
|
|
636
|
+
// Ask for version increment if not provided and not in CI
|
|
637
|
+
if (!versionIncrement && !isCI) {
|
|
638
|
+
versionIncrement = await select({
|
|
639
|
+
message: "Select version increment:",
|
|
640
|
+
choices: [
|
|
641
|
+
{ name: "Patch (0.0.X)", value: "patch" },
|
|
642
|
+
{ name: "Minor (0.X.0)", value: "minor" },
|
|
643
|
+
{ name: "Major (X.0.0)", value: "major" },
|
|
644
|
+
],
|
|
645
|
+
default: "patch",
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
const versionInfo = versionService.getVersionInfo(
|
|
650
|
+
logger,
|
|
651
|
+
pkg,
|
|
652
|
+
packageJson,
|
|
653
|
+
config,
|
|
654
|
+
releaseConfig,
|
|
655
|
+
versionIncrement,
|
|
656
|
+
prereleaseId,
|
|
657
|
+
);
|
|
658
|
+
|
|
659
|
+
logger.debug(
|
|
660
|
+
`Processing tag release (${versionInfo.newTag}) for ${packageJson.name}...`,
|
|
661
|
+
);
|
|
662
|
+
|
|
663
|
+
// Check if tag exists
|
|
664
|
+
const tagExists = await gitService.checkTagExists(
|
|
665
|
+
versionInfo.newTag,
|
|
666
|
+
logger,
|
|
667
|
+
);
|
|
668
|
+
if (tagExists) {
|
|
669
|
+
packagesProcessed.push({
|
|
670
|
+
name: packageJson.name,
|
|
671
|
+
directory: pkg.directory,
|
|
672
|
+
version: versionInfo.newVersion,
|
|
673
|
+
tag: versionInfo.newTag,
|
|
674
|
+
status: "skipped",
|
|
675
|
+
message: "Tag already exists",
|
|
676
|
+
});
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// Check for new commits (only skip if we're also doing git operations)
|
|
681
|
+
// If skipGitTag is true, allow publishing even without new commits
|
|
682
|
+
if (
|
|
683
|
+
!gitService.hasNewCommitsSinceTag(versionInfo.lastTag, cwd, logger) &&
|
|
684
|
+
!skipGitTag
|
|
685
|
+
) {
|
|
686
|
+
packagesProcessed.push({
|
|
687
|
+
name: packageJson.name,
|
|
688
|
+
directory: pkg.directory,
|
|
689
|
+
version: versionInfo.newVersion,
|
|
690
|
+
tag: versionInfo.newTag,
|
|
691
|
+
status: "skipped",
|
|
692
|
+
message: "No new commits since last tag",
|
|
693
|
+
});
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Run pre-release hook
|
|
698
|
+
if (pkg.hooks?.preRelease) {
|
|
699
|
+
const hookResult = hookRunner.runHook(
|
|
700
|
+
pkg.hooks.preRelease,
|
|
701
|
+
cwd,
|
|
702
|
+
logger,
|
|
703
|
+
dryRun,
|
|
704
|
+
hookContext,
|
|
705
|
+
);
|
|
706
|
+
if (!hookResult.success && handleHookFailure("preRelease")) {
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// Update version
|
|
712
|
+
const updateResult = packageService.updatePackageVersion(
|
|
713
|
+
pkg,
|
|
714
|
+
versionInfo.newVersion,
|
|
715
|
+
cwd,
|
|
716
|
+
originalCwd,
|
|
717
|
+
logger,
|
|
718
|
+
);
|
|
719
|
+
if (handleFailure(updateResult, "Version update")) {
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Update version in other files
|
|
724
|
+
versionService.updateVariableStringValue(
|
|
725
|
+
logger,
|
|
726
|
+
versionInfo.newVersion,
|
|
727
|
+
releaseConfig,
|
|
728
|
+
);
|
|
729
|
+
|
|
730
|
+
// Zip folders
|
|
731
|
+
if (releaseConfig.foldersToZip) {
|
|
732
|
+
await assetZipper.zipFolders(
|
|
733
|
+
versionInfo.newTag,
|
|
734
|
+
packageJson,
|
|
735
|
+
releaseConfig.foldersToZip,
|
|
736
|
+
logger,
|
|
737
|
+
dryRun,
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// Run pre-publish hook
|
|
742
|
+
if (pkg.hooks?.prePublish) {
|
|
743
|
+
const hookResult = hookRunner.runHook(
|
|
744
|
+
pkg.hooks.prePublish,
|
|
745
|
+
cwd,
|
|
746
|
+
logger,
|
|
747
|
+
dryRun,
|
|
748
|
+
hookContext,
|
|
749
|
+
);
|
|
750
|
+
if (!hookResult.success && handleHookFailure("prePublish")) {
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// Generate changelog if configured
|
|
756
|
+
if (!skipChangelog) {
|
|
757
|
+
const changelogResult = changelogGenerator.generateChangelog(
|
|
758
|
+
cwd,
|
|
759
|
+
releaseConfig,
|
|
760
|
+
versionInfo,
|
|
761
|
+
logger,
|
|
762
|
+
dryRun,
|
|
763
|
+
);
|
|
764
|
+
if (handleFailure(changelogResult, "Changelog generation")) {
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Create git tag and publish
|
|
770
|
+
if (!skipPublish && !packageFailed) {
|
|
771
|
+
// Branch check RIGHT BEFORE git operations (last chance to warn)
|
|
772
|
+
const currentBranch =
|
|
773
|
+
globalGitInfo?.currentBranch ?? gitService.getCurrentBranch();
|
|
774
|
+
if (
|
|
775
|
+
currentBranch &&
|
|
776
|
+
currentBranch !== mainBranch &&
|
|
777
|
+
!config.branch?.allowNonMain
|
|
778
|
+
) {
|
|
779
|
+
logger.vibe(
|
|
780
|
+
formatWarning(
|
|
781
|
+
`Releasing from '${currentBranch}' branch (not '${mainBranch}')`,
|
|
782
|
+
),
|
|
783
|
+
);
|
|
784
|
+
logger.vibe(
|
|
785
|
+
formatHint(
|
|
786
|
+
"Set branch.allowNonMain: true in config to suppress this warning",
|
|
787
|
+
),
|
|
788
|
+
);
|
|
789
|
+
warnings.push(
|
|
790
|
+
`Released from ${currentBranch} instead of ${mainBranch}`,
|
|
791
|
+
);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
logger.vibe(formatProgress(`Releasing ${packageJson.name}...`));
|
|
795
|
+
|
|
796
|
+
// Build effective git config with request overrides
|
|
797
|
+
let effectiveGitConfig: GitOpsConfig = {
|
|
798
|
+
...releaseConfig.git,
|
|
799
|
+
skipTag: skipGitTag || releaseConfig.git?.skipTag,
|
|
800
|
+
skipPush: skipGitPush || releaseConfig.git?.skipPush,
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
// Interactive git prompts (only if not CI and not explicitly skipped)
|
|
804
|
+
if (!isCI && !dryRun) {
|
|
805
|
+
// Check if there are uncommitted changes
|
|
806
|
+
const hasChanges = globalGitInfo?.hasUncommittedChanges ?? false;
|
|
807
|
+
|
|
808
|
+
// Ask about git commit only if there are changes
|
|
809
|
+
if (!effectiveGitConfig.skipTag && hasChanges) {
|
|
810
|
+
const shouldCommit = await confirm({
|
|
811
|
+
message: `Version updated to ${versionInfo.newVersion} in package.json and release.config.ts. Commit these changes?`,
|
|
812
|
+
default: true,
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
if (!shouldCommit) {
|
|
816
|
+
logger.vibe(
|
|
817
|
+
formatWarning(
|
|
818
|
+
"Continuing without committing version changes",
|
|
819
|
+
),
|
|
820
|
+
);
|
|
821
|
+
// User chose not to commit, but we continue
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
// Ask about creating git tag
|
|
826
|
+
if (!effectiveGitConfig.skipTag) {
|
|
827
|
+
const shouldTag = await confirm({
|
|
828
|
+
message: `Create git tag ${versionInfo.newTag}?`,
|
|
829
|
+
default: true,
|
|
830
|
+
});
|
|
831
|
+
|
|
832
|
+
if (!shouldTag) {
|
|
833
|
+
logger.vibe(formatSkip("Skipping git tag creation"));
|
|
834
|
+
effectiveGitConfig.skipTag = true;
|
|
835
|
+
effectiveGitConfig.skipPush = true;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// Ask about pushing to remote
|
|
840
|
+
if (!effectiveGitConfig.skipPush && !effectiveGitConfig.skipTag) {
|
|
841
|
+
const shouldPush = await confirm({
|
|
842
|
+
message: `Push tag ${versionInfo.newTag} to ${effectiveGitConfig.remote || "origin"}?`,
|
|
843
|
+
default: true,
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
if (!shouldPush) {
|
|
847
|
+
logger.vibe(formatSkip("Skipping git push"));
|
|
848
|
+
effectiveGitConfig.skipPush = true;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
// Use git service for tag creation (if not skipped)
|
|
854
|
+
if (!effectiveGitConfig.skipTag) {
|
|
855
|
+
const tagResult = gitService.createTag(
|
|
856
|
+
versionInfo.newTag,
|
|
857
|
+
cwd,
|
|
858
|
+
logger,
|
|
859
|
+
dryRun,
|
|
860
|
+
effectiveGitConfig,
|
|
861
|
+
);
|
|
862
|
+
if (handleFailure(tagResult, "Git tag creation")) {
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// Update global git info with new tag
|
|
868
|
+
if (globalGitInfo) {
|
|
869
|
+
globalGitInfo.newTag = versionInfo.newTag;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// Ask about npm publish in interactive mode
|
|
873
|
+
let shouldPublish = true;
|
|
874
|
+
if (
|
|
875
|
+
!isCI &&
|
|
876
|
+
!skipPublish &&
|
|
877
|
+
!dryRun &&
|
|
878
|
+
releaseConfig.npm?.enabled !== false
|
|
879
|
+
) {
|
|
880
|
+
shouldPublish = await confirm({
|
|
881
|
+
message: `Publish ${packageJson.name}@${versionInfo.newVersion} to npm?`,
|
|
882
|
+
default: true,
|
|
883
|
+
});
|
|
884
|
+
|
|
885
|
+
if (!shouldPublish) {
|
|
886
|
+
logger.vibe(formatSkip("Skipping npm publish"));
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// Run CI release command or npm publish
|
|
891
|
+
if (isCI && releaseConfig.ciReleaseCommand && shouldPublish) {
|
|
892
|
+
const ciResult = publisher.runCiReleaseCommand(
|
|
893
|
+
releaseConfig,
|
|
894
|
+
packageJson.name,
|
|
895
|
+
logger,
|
|
896
|
+
dryRun,
|
|
897
|
+
);
|
|
898
|
+
if (handleFailure(ciResult, "CI release command")) {
|
|
899
|
+
continue;
|
|
900
|
+
}
|
|
901
|
+
} else if (releaseConfig.npm?.enabled !== false && shouldPublish) {
|
|
902
|
+
const npmResult = publisher.publishToNpm(
|
|
903
|
+
cwd,
|
|
904
|
+
packageJson,
|
|
905
|
+
releaseConfig,
|
|
906
|
+
logger,
|
|
907
|
+
dryRun,
|
|
908
|
+
ciEnv,
|
|
909
|
+
);
|
|
910
|
+
if (handleFailure(npmResult, "NPM publish")) {
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// Track NPM publish
|
|
915
|
+
if (npmResult.success && !dryRun) {
|
|
916
|
+
publishedPackages.push({
|
|
917
|
+
name: packageJson.name,
|
|
918
|
+
version: versionInfo.newVersion,
|
|
919
|
+
registry: "npm",
|
|
920
|
+
url: `${MESSAGES.NPM_REGISTRY_URL}/${packageJson.name}`,
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// Also publish to JSR if configured
|
|
925
|
+
const jsrResult = publisher.publishToJsr(
|
|
926
|
+
cwd,
|
|
927
|
+
packageJson,
|
|
928
|
+
releaseConfig,
|
|
929
|
+
logger,
|
|
930
|
+
dryRun,
|
|
931
|
+
);
|
|
932
|
+
if (handleFailure(jsrResult, "JSR publish")) {
|
|
933
|
+
continue;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// Track JSR publish
|
|
937
|
+
if (jsrResult.success && releaseConfig.jsr?.enabled && !dryRun) {
|
|
938
|
+
publishedPackages.push({
|
|
939
|
+
name: packageJson.name,
|
|
940
|
+
version: versionInfo.newVersion,
|
|
941
|
+
registry: "jsr",
|
|
942
|
+
url: `${MESSAGES.JSR_REGISTRY_URL}/@${packageJson.name}`,
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// Create GitHub/GitLab release if configured
|
|
948
|
+
const gitReleaseResult = releaseCreator.createGitRelease(
|
|
949
|
+
cwd,
|
|
950
|
+
releaseConfig,
|
|
951
|
+
packageJson,
|
|
952
|
+
versionInfo,
|
|
953
|
+
logger,
|
|
954
|
+
dryRun,
|
|
955
|
+
);
|
|
956
|
+
if (handleFailure(gitReleaseResult, "Git release creation")) {
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// Run post-publish hook (errors logged but don't fail release since package already published)
|
|
962
|
+
if (pkg.hooks?.postPublish && !packageFailed) {
|
|
963
|
+
const hookResult = hookRunner.runHook(
|
|
964
|
+
pkg.hooks.postPublish,
|
|
965
|
+
cwd,
|
|
966
|
+
logger,
|
|
967
|
+
dryRun,
|
|
968
|
+
hookContext,
|
|
969
|
+
);
|
|
970
|
+
if (!hookResult.success) {
|
|
971
|
+
warnings.push(
|
|
972
|
+
`[${packageJson.name}] postPublish hook failed: ${hookResult.message}`,
|
|
973
|
+
);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
// Run post-release hook (errors logged but don't fail release since package already published)
|
|
978
|
+
if (pkg.hooks?.postRelease && !packageFailed) {
|
|
979
|
+
const hookResult = hookRunner.runHook(
|
|
980
|
+
pkg.hooks.postRelease,
|
|
981
|
+
cwd,
|
|
982
|
+
logger,
|
|
983
|
+
dryRun,
|
|
984
|
+
hookContext,
|
|
985
|
+
);
|
|
986
|
+
if (!hookResult.success) {
|
|
987
|
+
warnings.push(
|
|
988
|
+
`[${packageJson.name}] postRelease hook failed: ${hookResult.message}`,
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if (!packageFailed) {
|
|
994
|
+
packagesProcessed.push({
|
|
995
|
+
name: packageJson.name,
|
|
996
|
+
directory: pkg.directory,
|
|
997
|
+
version: versionInfo.newVersion,
|
|
998
|
+
tag: versionInfo.newTag,
|
|
999
|
+
status: "success",
|
|
1000
|
+
message: dryRun
|
|
1001
|
+
? "Would have been released"
|
|
1002
|
+
: "Released successfully",
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
} else {
|
|
1006
|
+
packagesProcessed.push({
|
|
1007
|
+
name: packageJson.name,
|
|
1008
|
+
directory: pkg.directory,
|
|
1009
|
+
status: "skipped",
|
|
1010
|
+
message: "Release disabled",
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// Run global post-release hook only if no errors occurred
|
|
1016
|
+
// (errors logged but don't fail release since it's post-processing)
|
|
1017
|
+
const hasFailedPackages = packagesProcessed.some(
|
|
1018
|
+
(p) => p.status === "failed",
|
|
1019
|
+
);
|
|
1020
|
+
if (
|
|
1021
|
+
config.hooks?.postRelease &&
|
|
1022
|
+
!hasFailedPackages &&
|
|
1023
|
+
errors.length === 0
|
|
1024
|
+
) {
|
|
1025
|
+
const hookResult = hookRunner.runHook(
|
|
1026
|
+
config.hooks.postRelease,
|
|
1027
|
+
originalCwd,
|
|
1028
|
+
logger,
|
|
1029
|
+
dryRun,
|
|
1030
|
+
{ packageManager },
|
|
1031
|
+
);
|
|
1032
|
+
if (!hookResult.success) {
|
|
1033
|
+
warnings.push(
|
|
1034
|
+
`Global postRelease hook failed: ${hookResult.message}`,
|
|
1035
|
+
);
|
|
1036
|
+
}
|
|
1037
|
+
} else if (
|
|
1038
|
+
config.hooks?.postRelease &&
|
|
1039
|
+
(hasFailedPackages || errors.length > 0)
|
|
1040
|
+
) {
|
|
1041
|
+
logger.vibe(formatSkip("Skipping postRelease hook due to errors"));
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
output.push(MESSAGES.RELEASE_COMPLETE);
|
|
1045
|
+
|
|
1046
|
+
// Calculate total time
|
|
1047
|
+
timings.total = Date.now() - startTime;
|
|
1048
|
+
|
|
1049
|
+
// Add summary
|
|
1050
|
+
const successCount = packagesProcessed.filter(
|
|
1051
|
+
(p) => p.status === "success",
|
|
1052
|
+
).length;
|
|
1053
|
+
const skipCount = packagesProcessed.filter(
|
|
1054
|
+
(p) => p.status === "skipped",
|
|
1055
|
+
).length;
|
|
1056
|
+
const failCount = packagesProcessed.filter(
|
|
1057
|
+
(p) => p.status === "failed",
|
|
1058
|
+
).length;
|
|
1059
|
+
|
|
1060
|
+
// Show summary
|
|
1061
|
+
logger.vibe("");
|
|
1062
|
+
logger.vibe(formatSection("Summary"));
|
|
1063
|
+
if (failCount > 0) {
|
|
1064
|
+
logger.vibe(formatError(`${failCount} package(s) failed`));
|
|
1065
|
+
}
|
|
1066
|
+
if (successCount > 0) {
|
|
1067
|
+
logger.vibe(formatSuccess(`${successCount} package(s) released`));
|
|
1068
|
+
}
|
|
1069
|
+
if (skipCount > 0) {
|
|
1070
|
+
logger.vibe(formatSkip(`${skipCount} package(s) skipped`));
|
|
1071
|
+
}
|
|
1072
|
+
logger.vibe(` Total time: ${formatDuration(timings.total)}`);
|
|
1073
|
+
logger.vibe("");
|
|
1074
|
+
|
|
1075
|
+
logger.debug(MESSAGES.SUMMARY_HEADER, {
|
|
1076
|
+
success: successCount,
|
|
1077
|
+
skipped: skipCount,
|
|
1078
|
+
failed: failCount,
|
|
1079
|
+
});
|
|
1080
|
+
logger.debug(MESSAGES.TIMING_REPORT, { ...timings });
|
|
1081
|
+
|
|
1082
|
+
// Send notifications if configured
|
|
1083
|
+
const notifyConfig =
|
|
1084
|
+
config.notifications ||
|
|
1085
|
+
(notifyWebhook
|
|
1086
|
+
? {
|
|
1087
|
+
enabled: true,
|
|
1088
|
+
webhookUrl: notifyWebhook,
|
|
1089
|
+
onSuccess: true,
|
|
1090
|
+
onFailure: true,
|
|
1091
|
+
}
|
|
1092
|
+
: undefined);
|
|
1093
|
+
|
|
1094
|
+
if (notifyConfig?.enabled) {
|
|
1095
|
+
const notifyResult = await notificationService.sendNotification(
|
|
1096
|
+
notifyConfig,
|
|
1097
|
+
{
|
|
1098
|
+
success: errors.length === 0,
|
|
1099
|
+
packageName: packagesProcessed[0]?.name,
|
|
1100
|
+
version: packagesProcessed[0]?.version,
|
|
1101
|
+
duration: timings.total,
|
|
1102
|
+
timings,
|
|
1103
|
+
},
|
|
1104
|
+
logger,
|
|
1105
|
+
);
|
|
1106
|
+
notificationsSent.push(notifyResult);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// Extract only the fields expected by the response schema
|
|
1110
|
+
const ciEnvironment = ciEnv.isCI
|
|
1111
|
+
? {
|
|
1112
|
+
isCI: ciEnv.isCI as boolean,
|
|
1113
|
+
provider: ciEnv.provider,
|
|
1114
|
+
branch: ciEnv.branch,
|
|
1115
|
+
commit: ciEnv.commit,
|
|
1116
|
+
pr: ciEnv.pr,
|
|
1117
|
+
tag: ciEnv.tag,
|
|
1118
|
+
}
|
|
1119
|
+
: undefined;
|
|
1120
|
+
|
|
1121
|
+
const hasErrors = errors.length > 0;
|
|
1122
|
+
return success(
|
|
1123
|
+
{
|
|
1124
|
+
success: !hasErrors,
|
|
1125
|
+
output: output.join("\n"),
|
|
1126
|
+
duration: timings.total,
|
|
1127
|
+
packagesProcessed,
|
|
1128
|
+
ciEnvironment,
|
|
1129
|
+
errors: hasErrors ? errors : null,
|
|
1130
|
+
warnings: warnings.length > 0 ? warnings : null,
|
|
1131
|
+
gitInfo: globalGitInfo,
|
|
1132
|
+
publishedPackages:
|
|
1133
|
+
publishedPackages.length > 0 ? publishedPackages : null,
|
|
1134
|
+
timings,
|
|
1135
|
+
notificationsSent:
|
|
1136
|
+
notificationsSent.length > 0 ? notificationsSent : null,
|
|
1137
|
+
} satisfies ReleaseResponseType,
|
|
1138
|
+
hasErrors ? { isErrorResponse: true } : undefined,
|
|
1139
|
+
);
|
|
1140
|
+
} catch (error) {
|
|
1141
|
+
const errorMessage =
|
|
1142
|
+
error instanceof Error ? error.message : String(error);
|
|
1143
|
+
errors.push(errorMessage);
|
|
1144
|
+
output.push(MESSAGES.RELEASE_FAILED);
|
|
1145
|
+
|
|
1146
|
+
// Calculate total time even on failure
|
|
1147
|
+
timings.total = Date.now() - startTime;
|
|
1148
|
+
|
|
1149
|
+
// Send failure notification if configured
|
|
1150
|
+
const notifyConfig =
|
|
1151
|
+
config?.notifications ||
|
|
1152
|
+
(data.notifyWebhook
|
|
1153
|
+
? {
|
|
1154
|
+
enabled: true,
|
|
1155
|
+
webhookUrl: data.notifyWebhook,
|
|
1156
|
+
onSuccess: true,
|
|
1157
|
+
onFailure: true,
|
|
1158
|
+
}
|
|
1159
|
+
: undefined);
|
|
1160
|
+
|
|
1161
|
+
if (notifyConfig?.enabled) {
|
|
1162
|
+
const notifyResult = await notificationService.sendNotification(
|
|
1163
|
+
notifyConfig,
|
|
1164
|
+
{
|
|
1165
|
+
success: false,
|
|
1166
|
+
error: errorMessage,
|
|
1167
|
+
duration: timings.total,
|
|
1168
|
+
timings,
|
|
1169
|
+
},
|
|
1170
|
+
logger,
|
|
1171
|
+
);
|
|
1172
|
+
notificationsSent.push(notifyResult);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
return success(
|
|
1176
|
+
{
|
|
1177
|
+
success: false,
|
|
1178
|
+
output: output.join("\n"),
|
|
1179
|
+
duration: timings.total,
|
|
1180
|
+
packagesProcessed,
|
|
1181
|
+
ciEnvironment: undefined,
|
|
1182
|
+
errors,
|
|
1183
|
+
warnings: warnings.length > 0 ? warnings : null,
|
|
1184
|
+
gitInfo: globalGitInfo,
|
|
1185
|
+
publishedPackages:
|
|
1186
|
+
publishedPackages.length > 0 ? publishedPackages : null,
|
|
1187
|
+
timings,
|
|
1188
|
+
notificationsSent:
|
|
1189
|
+
notificationsSent.length > 0 ? notificationsSent : null,
|
|
1190
|
+
} satisfies ReleaseResponseType,
|
|
1191
|
+
{ isErrorResponse: true },
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
// Singleton instance
|
|
1198
|
+
export const releaseExecutor = new ReleaseExecutor();
|