infra-kit 0.1.82 → 0.1.85
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/.eslintcache +1 -0
- package/.turbo/turbo-build.log +11 -0
- package/.turbo/turbo-eslint-check.log +5 -0
- package/.turbo/turbo-prettier-check.log +5 -0
- package/.turbo/turbo-test.log +17 -0
- package/.turbo/turbo-ts-check.log +5 -0
- package/dist/cli.js +5 -3
- package/dist/cli.js.map +3 -3
- package/dist/mcp.js +6 -4
- package/dist/mcp.js.map +3 -3
- package/package.json +10 -11
- package/src/commands/gh-merge-dev/gh-merge-dev.ts +2 -2
- package/src/lib/command-echo/command-echo.ts +1 -1
- package/src/lib/release-utils/release-utils.ts +2 -1
- package/src/mcp/server.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -0
- package/.env.example +0 -17
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/doctor.ts":"1","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/index.ts":"2","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/env-clear.ts":"3","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/index.ts":"4","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/env-list.ts":"5","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/index.ts":"6","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/env-load.ts":"7","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/index.ts":"8","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/env-status.ts":"9","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/index.ts":"10","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/gh-merge-dev.ts":"11","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/index.ts":"12","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/gh-release-deliver.ts":"13","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/index.ts":"14","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts":"15","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/index.ts":"16","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts":"17","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/index.ts":"18","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/gh-release-deploy-service.ts":"19","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/index.ts":"20","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/gh-release-list.ts":"21","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/index.ts":"22","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/index.ts":"23","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/init.ts":"24","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/index.ts":"25","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/release-create.ts":"26","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/index.ts":"27","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/release-create-batch.ts":"28","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/index.ts":"29","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/worktrees-add.ts":"30","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/index.ts":"31","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/worktrees-list.ts":"32","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/index.ts":"33","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/worktrees-remove.ts":"34","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/index.ts":"35","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/worktrees-sync.ts":"36","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/cli.ts":"37","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/mcp.ts":"38","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-cli-auth.ts":"39","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-project.ts":"40","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/index.ts":"41","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts":"42","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/index.ts":"43","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts":"44","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/index.ts":"45","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/index.ts":"46","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/api.ts":"47","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/index.ts":"48","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/types.ts":"49","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/command-echo.ts":"50","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/index.ts":"51","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/constants.ts":"52","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/error-handlers/index.ts":"53","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/git-utils.ts":"54","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/index.ts":"55","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/logger/index.ts":"56","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/index.ts":"57","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/release-utils.ts":"58","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/index.ts":"59","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/tool-handler.ts":"60","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/index.ts":"61","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/version-utils.ts":"62","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/prompts/index.ts":"63","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/resources/index.ts":"64","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/server.ts":"65","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/tools/index.ts":"66","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/sanity.test.tsx":"67","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/types.ts":"68"},{"size":2678,"mtime":1775813835763,"results":"69","hashOfConfig":"70"},{"size":49,"mtime":1775813835764,"results":"71","hashOfConfig":"70"},{"size":2486,"mtime":1775813835764,"results":"72","hashOfConfig":"70"},{"size":56,"mtime":1775813835764,"results":"73","hashOfConfig":"70"},{"size":1256,"mtime":1775813835765,"results":"74","hashOfConfig":"70"},{"size":53,"mtime":1775813835765,"results":"75","hashOfConfig":"70"},{"size":3419,"mtime":1775813835766,"results":"76","hashOfConfig":"70"},{"size":53,"mtime":1775813835766,"results":"77","hashOfConfig":"70"},{"size":2934,"mtime":1775813835767,"results":"78","hashOfConfig":"70"},{"size":59,"mtime":1775813835767,"results":"79","hashOfConfig":"70"},{"size":5617,"mtime":1775813835768,"results":"80","hashOfConfig":"70"},{"size":63,"mtime":1775813835771,"results":"81","hashOfConfig":"70"},{"size":5391,"mtime":1775813835772,"results":"82","hashOfConfig":"70"},{"size":81,"mtime":1775813835772,"results":"83","hashOfConfig":"70"},{"size":4316,"mtime":1775813835773,"results":"84","hashOfConfig":"70"},{"size":88,"mtime":1775813835773,"results":"85","hashOfConfig":"70"},{"size":7131,"mtime":1775813835774,"results":"86","hashOfConfig":"70"},{"size":103,"mtime":1775813835774,"results":"87","hashOfConfig":"70"},{"size":5951,"mtime":1775813835775,"results":"88","hashOfConfig":"70"},{"size":100,"mtime":1775813835775,"results":"89","hashOfConfig":"70"},{"size":2189,"mtime":1775813835775,"results":"90","hashOfConfig":"70"},{"size":72,"mtime":1775813835776,"results":"91","hashOfConfig":"70"},{"size":30,"mtime":1775813835776,"results":"92","hashOfConfig":"70"},{"size":3283,"mtime":1775813835777,"results":"93","hashOfConfig":"70"},{"size":71,"mtime":1775813835778,"results":"94","hashOfConfig":"70"},{"size":5247,"mtime":1775813835778,"results":"95","hashOfConfig":"70"},{"size":87,"mtime":1775813835779,"results":"96","hashOfConfig":"70"},{"size":6101,"mtime":1775813835779,"results":"97","hashOfConfig":"70"},{"size":68,"mtime":1775813835780,"results":"98","hashOfConfig":"70"},{"size":8142,"mtime":1775813835780,"results":"99","hashOfConfig":"70"},{"size":71,"mtime":1775813835780,"results":"100","hashOfConfig":"70"},{"size":2870,"mtime":1775813835781,"results":"101","hashOfConfig":"70"},{"size":77,"mtime":1775813835781,"results":"102","hashOfConfig":"70"},{"size":5740,"mtime":1775813835781,"results":"103","hashOfConfig":"70"},{"size":71,"mtime":1775813835782,"results":"104","hashOfConfig":"70"},{"size":4117,"mtime":1775813835782,"results":"105","hashOfConfig":"70"},{"size":9452,"mtime":1775813835783,"results":"106","hashOfConfig":"107"},{"size":1044,"mtime":1775813835783,"results":"108","hashOfConfig":"70"},{"size":730,"mtime":1775813835783,"results":"109","hashOfConfig":"70"},{"size":656,"mtime":1775813835784,"results":"110","hashOfConfig":"70"},{"size":117,"mtime":1775813835784,"results":"111","hashOfConfig":"70"},{"size":768,"mtime":1775813835787,"results":"112","hashOfConfig":"70"},{"size":57,"mtime":1775813835788,"results":"113","hashOfConfig":"70"},{"size":4149,"mtime":1775813835788,"results":"114","hashOfConfig":"70"},{"size":147,"mtime":1775813835788,"results":"115","hashOfConfig":"70"},{"size":204,"mtime":1775813835788,"results":"116","hashOfConfig":"70"},{"size":9253,"mtime":1775813835789,"results":"117","hashOfConfig":"70"},{"size":363,"mtime":1775813835789,"results":"118","hashOfConfig":"70"},{"size":2111,"mtime":1775813835789,"results":"119","hashOfConfig":"70"},{"size":1811,"mtime":1775813835790,"results":"120","hashOfConfig":"70"},{"size":45,"mtime":1775813835790,"results":"121","hashOfConfig":"70"},{"size":1568,"mtime":1775813835790,"results":"122","hashOfConfig":"70"},{"size":1015,"mtime":1775813835791,"results":"123","hashOfConfig":"70"},{"size":1344,"mtime":1775813835791,"results":"124","hashOfConfig":"70"},{"size":66,"mtime":1775813835791,"results":"125","hashOfConfig":"70"},{"size":1003,"mtime":1775813835791,"results":"126","hashOfConfig":"70"},{"size":237,"mtime":1775813835792,"results":"127","hashOfConfig":"70"},{"size":4683,"mtime":1775813835792,"results":"128","hashOfConfig":"70"},{"size":51,"mtime":1775813835792,"results":"129","hashOfConfig":"70"},{"size":774,"mtime":1775813835793,"results":"130","hashOfConfig":"70"},{"size":61,"mtime":1775813835793,"results":"131","hashOfConfig":"70"},{"size":733,"mtime":1775813835793,"results":"132","hashOfConfig":"70"},{"size":140,"mtime":1775813835794,"results":"133","hashOfConfig":"70"},{"size":142,"mtime":1775813835794,"results":"134","hashOfConfig":"70"},{"size":577,"mtime":1775813835794,"results":"135","hashOfConfig":"70"},{"size":1999,"mtime":1775813835795,"results":"136","hashOfConfig":"70"},{"size":149,"mtime":1775813835795,"results":"137","hashOfConfig":"138"},{"size":242,"mtime":1775813835795,"results":"139","hashOfConfig":"70"},{"filePath":"140","messages":"141","suppressedMessages":"142","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"jgfgyi",{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","suppressedMessages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","suppressedMessages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","suppressedMessages":"157","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","suppressedMessages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","suppressedMessages":"163","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","suppressedMessages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","suppressedMessages":"169","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","suppressedMessages":"172","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"173","messages":"174","suppressedMessages":"175","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","suppressedMessages":"178","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"179","messages":"180","suppressedMessages":"181","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"182","messages":"183","suppressedMessages":"184","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"185","messages":"186","suppressedMessages":"187","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"188","messages":"189","suppressedMessages":"190","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"191","messages":"192","suppressedMessages":"193","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"194","messages":"195","suppressedMessages":"196","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"197","messages":"198","suppressedMessages":"199","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"200","messages":"201","suppressedMessages":"202","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"203","messages":"204","suppressedMessages":"205","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"206","messages":"207","suppressedMessages":"208","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"209","messages":"210","suppressedMessages":"211","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"212","messages":"213","suppressedMessages":"214","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"215","messages":"216","suppressedMessages":"217","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"218","messages":"219","suppressedMessages":"220","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"221","messages":"222","suppressedMessages":"223","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"224","messages":"225","suppressedMessages":"226","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"227","messages":"228","suppressedMessages":"229","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"230","messages":"231","suppressedMessages":"232","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"233","messages":"234","suppressedMessages":"235","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"236","messages":"237","suppressedMessages":"238","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"239","messages":"240","suppressedMessages":"241","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"242","messages":"243","suppressedMessages":"244","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"245","messages":"246","suppressedMessages":"247","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"248","messages":"249","suppressedMessages":"250","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1pn6f",{"filePath":"251","messages":"252","suppressedMessages":"253","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"254","messages":"255","suppressedMessages":"256","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"257","messages":"258","suppressedMessages":"259","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"260","messages":"261","suppressedMessages":"262","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"263","messages":"264","suppressedMessages":"265","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"266","messages":"267","suppressedMessages":"268","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"269","messages":"270","suppressedMessages":"271","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"272","messages":"273","suppressedMessages":"274","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"275","messages":"276","suppressedMessages":"277","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"278","messages":"279","suppressedMessages":"280","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"281","messages":"282","suppressedMessages":"283","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"284","messages":"285","suppressedMessages":"286","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"287","messages":"288","suppressedMessages":"289","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"290","messages":"291","suppressedMessages":"292","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"293","messages":"294","suppressedMessages":"295","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"296","messages":"297","suppressedMessages":"298","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"299","messages":"300","suppressedMessages":"301","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"302","messages":"303","suppressedMessages":"304","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"305","messages":"306","suppressedMessages":"307","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"308","messages":"309","suppressedMessages":"310","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"311","messages":"312","suppressedMessages":"313","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"314","messages":"315","suppressedMessages":"316","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"317","messages":"318","suppressedMessages":"319","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"320","messages":"321","suppressedMessages":"322","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"323","messages":"324","suppressedMessages":"325","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"326","messages":"327","suppressedMessages":"328","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"329","messages":"330","suppressedMessages":"331","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"332","messages":"333","suppressedMessages":"334","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"335","messages":"336","suppressedMessages":"337","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"338","messages":"339","suppressedMessages":"340","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"193rhvy",{"filePath":"341","messages":"342","suppressedMessages":"343","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/doctor.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/env-clear.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/env-list.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/env-load.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/env-status.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/gh-merge-dev.ts",[],["344"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/gh-release-deliver.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts",[],["345"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/gh-release-deploy-service.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/gh-release-list.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/init.ts",[],["346","347","348"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/release-create.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/release-create-batch.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/worktrees-add.ts",[],["349"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/worktrees-list.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/worktrees-remove.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/worktrees-sync.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/cli.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/mcp.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-cli-auth.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-project.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/api.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/types.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/command-echo.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/constants.ts",[],["350"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/error-handlers/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/git-utils.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/logger/index.ts",[],["351"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/release-utils.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/tool-handler.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/version-utils.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/prompts/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/resources/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/server.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/tools/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/sanity.test.tsx",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/types.ts",[],[],{"ruleId":"352","severity":2,"message":"353","line":21,"column":87,"messageId":"354","endLine":21,"endColumn":89,"suppressions":"355"},{"ruleId":"352","severity":2,"message":"356","line":30,"column":113,"messageId":"354","endLine":30,"endColumn":115,"suppressions":"357"},{"ruleId":"358","severity":2,"message":"359","line":52,"column":53,"endLine":52,"endColumn":59,"suppressions":"360"},{"ruleId":"358","severity":2,"message":"359","line":77,"column":54,"endLine":77,"endColumn":60,"suppressions":"361"},{"ruleId":"362","severity":2,"message":"363","line":97,"column":5,"messageId":"364","endLine":97,"endColumn":47,"suppressions":"365"},{"ruleId":"352","severity":2,"message":"366","line":33,"column":100,"messageId":"354","endLine":33,"endColumn":102,"suppressions":"367"},{"ruleId":"368","severity":2,"message":"369","line":51,"column":30,"messageId":"370","endLine":51,"endColumn":54,"suppressions":"371"},{"ruleId":"368","severity":2,"message":"369","line":6,"column":30,"messageId":"370","endLine":6,"endColumn":54,"suppressions":"372"},"sonarjs/cognitive-complexity","Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.","refactorFunction",["373"],"Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.",["374"],"sonarjs/slow-regex","Make sure the regex used here, which is vulnerable to super-linear runtime due to backtracking, cannot lead to denial of service.",["375"],["376"],"no-template-curly-in-string","Unexpected template string expression.","unexpectedTemplateExpression",["377"],"Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.",["378"],"sonarjs/publicly-writable-directories","Make sure publicly writable directories are used safely here.","safeDirectory",["379"],["380"],{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},"directive",""]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> infra-kit@0.1.85 build /Users/arthur/projects/infra-kit/apps/infra-kit/cli
|
|
4
|
+
> pnpm run clean-artifacts && node ./scripts/build.js
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
> infra-kit@0.1.85 clean-artifacts /Users/arthur/projects/infra-kit/apps/infra-kit/cli
|
|
8
|
+
> rm -rf dist
|
|
9
|
+
|
|
10
|
+
✅ Build was completed successfully: cli.js - [33m0.0494[39m MB
|
|
11
|
+
✅ Build was completed successfully: mcp.js - [33m0.0424[39m MB
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> infra-kit@0.1.85 test /Users/arthur/projects/infra-kit/apps/infra-kit/cli
|
|
4
|
+
> pnpm exec vitest run --reporter=dot
|
|
5
|
+
|
|
6
|
+
[?25l
|
|
7
|
+
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.4 [39m[90m/Users/arthur/projects/infra-kit/apps/infra-kit/cli[39m
|
|
8
|
+
|
|
9
|
+
[?2026h[33m*[39m
|
|
10
|
+
[?2026l[K[1A[K[33m[39m[32m·[39m
|
|
11
|
+
|
|
12
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
13
|
+
[2m Tests [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
14
|
+
[2m Start at [22m 12:59:00
|
|
15
|
+
[2m Duration [22m 102ms[2m (transform 16ms, setup 14ms, import 9ms, tests 1ms, environment 0ms)[22m
|
|
16
|
+
|
|
17
|
+
[?25h
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import to,{Separator as Y}from"@inquirer/select";import{Command as oo,Option as
|
|
|
5
5
|
`),Jr.stdout.write(`${o}
|
|
6
6
|
`),de.unlinkSync(r);let i={variableCount:t.length,unsetStatements:n};return{content:[{type:"text",text:JSON.stringify(i,null,2)}],structuredContent:i}},Lr={name:"env-clear",description:"Clear loaded env vars. Returns a file path that must be sourced (source <path>) to apply. The env-clear shell alias does this automatically.",inputSchema:{},outputSchema:{filePath:ue.string().describe("Path to the file that must be sourced to apply"),variableCount:ue.number().describe("Number of variables cleared"),unsetStatements:ue.array(ue.string()).describe("Unset statements generated")},handler:fe};import{z as Fe}from"zod";import ar from"node:process";import{$ as cr}from"zx";var _=async()=>{try{await cr`doppler --version`}catch(e){s.error({error:e},"Error: Doppler CLI is not installed."),s.error("Please install it from: https://docs.doppler.com/docs/install-cli"),ar.exit(1)}try{await cr`doppler me`}catch(e){s.error({error:e},"Error: Doppler CLI is not authenticated."),s.error("Please authenticate by running: doppler login"),ar.exit(1)}};import Br from"node:path";import{$ as lr}from"zx";var D=async e=>{let t=(await lr`git worktree list`).stdout.split(`
|
|
7
7
|
`).filter(Boolean),n={release:jr,feature:Vr};return t.map(n[e]).filter(o=>o!==null)},jr=e=>{let r=e.split(" ").filter(Boolean);return r.length<3||!r[0]?.includes("release/v")?null:`release/${r[0]?.split("/").pop()||""}`},Vr=e=>{let r=e.split(" ").filter(Boolean);return r.length<3||!r[0]?.includes("feature/")?null:`feature/${r[0]?.split("/").pop()||""}`},$=async()=>(await lr`git rev-parse --show-toplevel`).stdout.trim();var Z=async()=>{let e=await $(),r=Br.basename(e),t=Ve[r];if(!t)throw new Error(`Could not determine Doppler project for directory "${r}". Expected one of: ${Object.keys(Ve).join(", ")}`);return t};var ge=async()=>{await _();let e=await Z();s.info(`Doppler project: ${e}
|
|
8
|
-
`),s.info("Available configs:");for(let t of C)s.info(` - ${t}`);let r={project:e,configs:C};return{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}},Fr={name:"env-list",description:"List available Doppler configs for the detected project",inputSchema:{},outputSchema:{project:Fe.string().describe("Detected Doppler project name"),configs:Fe.array(Fe.string()).describe("Available environment configs")},handler:ge};import Wr from"@inquirer/select";import pr from"node:fs";import qr from"node:path";import mr from"node:process";import{z as Q}from"zod";import{$ as Me}from"zx";var Mr=()=>{let e="",r=[],t=!1;return{start(n){e=n,r=[],t=!1},setInteractive(){t=!0},addOption(n,o){r.push({flag:n,value:o})},print(){if(!t||r.length===0)return;let n=r.map(o=>typeof o.value=="boolean"?o.value?o.flag:"":Array.isArray(o.value)?`${o.flag} "${o.value.join(", ")}"`:`${o.flag} ${o.value}`).filter(Boolean).join(" ");s.info(`\u{1F4DF} Equivalent command:
|
|
8
|
+
`),s.info("Available configs:");for(let t of C)s.info(` - ${t}`);let r={project:e,configs:C};return{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}},Fr={name:"env-list",description:"List available Doppler configs for the detected project",inputSchema:{},outputSchema:{project:Fe.string().describe("Detected Doppler project name"),configs:Fe.array(Fe.string()).describe("Available environment configs")},handler:ge};import Wr from"@inquirer/select";import pr from"node:fs";import qr from"node:path";import mr from"node:process";import{z as Q}from"zod";import{$ as Me}from"zx";var Mr=()=>{let e="",r=[],t=!1;return{start(n){e=n,r=[],t=!1},setInteractive(){t=!0},addOption(n,o){r.push({flag:n,value:o})},print(){if(!t||r.length===0)return;let n=r.map(o=>typeof o.value=="boolean"?o.value?o.flag:"":Array.isArray(o.value)?`${o.flag} "${o.value.join(", ")}"`:`${o.flag} "${o.value}"`).filter(Boolean).join(" ");s.info(`\u{1F4DF} Equivalent command:
|
|
9
9
|
pnpm exec infra-kit ${e} ${n}
|
|
10
10
|
`)},reset(){e="",r=[],t=!1}}},l=Mr();var he=async e=>{await _();let{config:r}=e;l.start("env-load");let t="";r?t=r:(l.setInteractive(),t=await Wr({message:"Select environment config",choices:C.map(f=>({name:f,value:f}))},{output:mr.stderr})),l.addOption("--config",t);let n=await Z();Me.quiet=!0;let o=await Me`doppler secrets download --no-file --format env --project ${n} --config ${t}`;Me.quiet=!1;let i=o.stdout.trim(),a=new Date().toISOString(),p=["set -a",i,`${V}=${t}`,`${B}=${n}`,`${F}=${a}`,"set +a"],c=M(),m=qr.resolve(c,j);pr.mkdirSync(c,{recursive:!0}),pr.writeFileSync(m,`${p.join(`
|
|
11
11
|
`)}
|
|
@@ -14,12 +14,14 @@ pnpm exec infra-kit ${e} ${n}
|
|
|
14
14
|
`).filter(f=>f.includes("=")).length,project:n,config:t};return{content:[{type:"text",text:JSON.stringify(d,null,2)}],structuredContent:d}},Ur={name:"env-load",description:"Load Doppler env vars for a config. Returns a file path that must be sourced (source <path>) to apply variables. The env-load shell alias does this automatically.",inputSchema:{config:Q.string().describe("Environment config name to load (e.g. dev, arthur, renana)")},outputSchema:{filePath:Q.string().describe("Path to the file that must be sourced to apply variables"),variableCount:Q.number().describe("Number of variables loaded"),project:Q.string().describe("Doppler project name"),config:Q.string().describe("Doppler config name")},handler:he};import Gr from"node:path";import ee from"node:process";import{z as q}from"zod";var ve=async()=>{await _(),s.info("Environment session status:");let e=M(),r=ee.env[Be],t=Gr.join(e,j),n=0,o=0,i=ee.env[V]??null,a=ee.env[B]??null,p=ee.env[F]??null;if(i){let m=me(t);m.length>0&&(o=m.length,n=m.filter(d=>d in ee.env).length);let u=p?.replace(/\.\d{3}Z$/,"")??null;s.info(` ${i}: ${n} of ${o} vars loaded (project: ${a}, loadedAt: ${u}, session: ${r})
|
|
15
15
|
`)}else s.info(` Session ${r}: no env loaded
|
|
16
16
|
`);let c={sessionId:r,sessionLoadedCount:n,sessionTotalCount:o,sessionConfig:i,sessionProject:a,sessionLoadedAt:p};return{content:[{type:"text",text:JSON.stringify(c,null,2)}],structuredContent:c}},zr={name:"env-status",description:"Show Doppler authentication status and detected project info",inputSchema:{},outputSchema:{sessionId:q.string().describe("Current terminal session ID"),sessionLoadedCount:q.number().describe("Number of cached vars active in the current session"),sessionTotalCount:q.number().describe("Total number of cached var names"),sessionConfig:q.string().nullable().describe("Doppler config name of the loaded session (environment name)"),sessionProject:q.string().nullable().describe("Doppler project name of the loaded session"),sessionLoadedAt:q.string().nullable().describe("ISO 8601 timestamp of when the env was loaded")},handler:ve};import Yr from"@inquirer/checkbox";import Zr from"@inquirer/confirm";import Qr from"node:process";import{z}from"zod";import{$ as A}from"zx";import{$ as Ts}from"zx";import ke from"node:process";import{$ as E}from"zx";import{$ as oe}from"zx";import re from"node:process";var We=async(e,r)=>{try{let{baseUrl:t,token:n,email:o,projectId:i}=r,a={name:e.name,projectId:e.projectId||i,description:e.description||"",released:e.released||!1,archived:e.archived||!1},p=`${t}/rest/api/3/version`,c=btoa(`${o}:${n}`),m=await fetch(p,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(a)});if(!m.ok){let d=await m.text();throw s.error({status:m.status,statusText:m.statusText,error:d},"Failed to create Jira version"),new Error(`HTTP ${m.status}: ${m.statusText}`)}return{success:!0,version:await m.json()}}catch(t){throw s.error({error:t},"Error creating Jira version"),t}},ye=async e=>{try{let{baseUrl:r,token:t,email:n,projectId:o}=e,i=`${r}/rest/api/3/project/${o}/versions`,a=btoa(`${n}:${t}`),p=await fetch(i,{method:"GET",headers:{Accept:"application/json",Authorization:`Basic ${a}`}});if(!p.ok){let m=await p.text();throw s.error({status:p.status,statusText:p.statusText,error:m},"Failed to get Jira project versions"),new Error(`HTTP ${p.status}: ${p.statusText}`)}return await p.json()}catch(r){throw s.error({error:r},"Error getting Jira project versions"),r}},Hr=async(e,r)=>{try{return(await ye(r)).find(o=>o.name===e)||null}catch(t){throw s.error({error:t,versionName:e},"Error finding Jira version by name"),t}},Xr=async(e,r)=>{try{let{baseUrl:t,token:n,email:o}=r,i={released:e.released??!0,archived:e.archived??!1};e.releaseDate?i.releaseDate=e.releaseDate:e.released!==!1&&(i.releaseDate=new Date().toISOString().split("T")[0]),e.description!==void 0&&(i.description=e.description);let a=`${t}/rest/api/3/version/${e.versionId}`,p=btoa(`${o}:${n}`),c=await fetch(a,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Basic ${p}`},body:JSON.stringify(i)});if(!c.ok){let u=await c.text();throw s.error({status:c.status,statusText:c.statusText,error:u},"Failed to update Jira version"),new Error(`HTTP ${c.status}: ${c.statusText}`)}return{success:!0,version:await c.json()}}catch(t){throw s.error({error:t},"Error updating Jira version"),t}},qe=async(e,r)=>{try{let{versionName:t}=e,n=await Hr(t,r);if(!n)throw s.error({versionName:t},"Jira version not found"),new Error(`Version "${t}" not found in Jira project`);return await Xr({versionId:n.id,released:!0,releaseDate:new Date().toISOString().split("T")[0]},r)}catch(t){throw s.error({error:t},"Error delivering Jira release"),t}},U=async()=>{let e=re.env.JIRA_BASE_URL,r=re.env.JIRA_TOKEN||re.env.JIRA_API_TOKEN,t=re.env.JIRA_PROJECT_ID,n=re.env.JIRA_EMAIL,o=[];if(e||o.push("JIRA_BASE_URL (e.g., https://your-domain.atlassian.net)"),r||o.push("JIRA_TOKEN or JIRA_API_TOKEN (your Jira API token)"),t||o.push("JIRA_PROJECT_ID (numeric project ID)"),n||o.push("JIRA_EMAIL (your Jira email address)"),o.length>0){let a=["Jira configuration is required but incomplete.","Please configure the following environment variables:",...o.map(p=>` - ${p}`),"","You can set these in your .env file or as environment variables."].join(`
|
|
17
|
-
`);throw new Error(a)}let i=Number.parseInt(t,10);if(Number.isNaN(i))throw new TypeError(`Invalid JIRA_PROJECT_ID: "${t}" must be a numeric value (e.g., 10001)`);return{baseUrl:e.replace(/\/$/,""),token:r,projectId:i,email:n}},te=async()=>{try{return await U()}catch(e){return s.warn({error:e},"Jira configuration not available, skipping Jira integration"),null}};var we=e=>e==="hotfix"?"main":"dev",se=async(e="regular")=>{let r=we(e);oe.quiet=!0,await oe`git fetch origin`,await oe`git switch ${r}`,await oe`git pull origin ${r}`,oe.quiet=!1},ne=async e=>{let{version:r,jiraConfig:t,description:n,type:o="regular"}=e,i=`v${r}`,a=await We({name:i,projectId:t.projectId,description:n||"",released:!1,archived:!1},t),p=`${t.baseUrl}/projects/${a.version.projectId}/versions/${a.version.id}/tab/release-report-all-issues`,c=await Re({version:r,jiraVersionUrl:p,type:o});return{version:r,type:o,branchName:c.branchName,prUrl:c.prUrl,jiraVersionUrl:p}},w=async()=>{let e=new Map,r=await te();if(!r)return e;try{let t=await ye(r);for(let n of t)n.description&&e.set(n.name,n.description)}catch{}return e},G=(e,r,t)=>{let n=t?" ".repeat(t-e.length+3):" ";return`${e}${n}
|
|
17
|
+
`);throw new Error(a)}let i=Number.parseInt(t,10);if(Number.isNaN(i))throw new TypeError(`Invalid JIRA_PROJECT_ID: "${t}" must be a numeric value (e.g., 10001)`);return{baseUrl:e.replace(/\/$/,""),token:r,projectId:i,email:n}},te=async()=>{try{return await U()}catch(e){return s.warn({error:e},"Jira configuration not available, skipping Jira integration"),null}};var we=e=>e==="hotfix"?"main":"dev",se=async(e="regular")=>{let r=we(e);oe.quiet=!0,await oe`git fetch origin`,await oe`git switch ${r}`,await oe`git pull origin ${r}`,oe.quiet=!1},ne=async e=>{let{version:r,jiraConfig:t,description:n,type:o="regular"}=e,i=`v${r}`,a=await We({name:i,projectId:t.projectId,description:n||"",released:!1,archived:!1},t),p=`${t.baseUrl}/projects/${a.version.projectId}/versions/${a.version.id}/tab/release-report-all-issues`,c=await Re({version:r,jiraVersionUrl:p,type:o});return{version:r,type:o,branchName:c.branchName,prUrl:c.prUrl,jiraVersionUrl:p}},w=async()=>{let e=new Map,r=await te();if(!r)return e;try{let t=await ye(r);for(let n of t)n.description&&e.set(n.name,n.description)}catch{}return e},G=(e,r,t)=>{let n=t?" ".repeat(t-e.length+3):" ",o=`[${r}]`.padEnd(11);return`${e}${n}${o}`},v=e=>e.toLowerCase().startsWith("hotfix")?"hotfix":"regular",x=e=>{let{branches:r,descriptions:t,types:n}=e,o=r.map(a=>a.replace("release/v","")),i=Math.max(...o.map(a=>a.length));return r.map((a,p)=>{let c=o[p],m=n?n.get(a)||"regular":void 0,u=t.get(`v${c}`),d=" ".repeat(i-c.length+3),f=m?G(c,m,i):c;return u&&(f=m?`${f} ${u}`:`${c}${d}${u}`),{name:f,value:a}})};var Ue=e=>e.replace("release/","").slice(1).split(".").map(Number),be=e=>[...e].sort((r,t)=>{let[n,o,i]=Ue(r),[a,p,c]=Ue(t);return n!==a?(n??0)-(a??0):o!==p?(o??0)-(p??0):(i??0)-(c??0)});var dr=async()=>{let e=await E`gh pr list --search "Release in:title" --base dev --json number,title,headRefName,state,baseRefName`,r=await E`gh pr list --search "Hotfix in:title" --base main --json number,title,headRefName,state,baseRefName`,t=[...JSON.parse(e.stdout),...JSON.parse(r.stdout)],n=new Set;return t.filter(o=>n.has(o.headRefName)?!1:(n.add(o.headRefName),!0))},xe=async()=>{try{let e=await dr();return e.length===0&&(s.error("\u274C No release PRs found. Check the project folder for the script. Exiting..."),ke.exit(1)),be(e.map(r=>r.headRefName))}catch(e){s.error({error:e},"\u274C Error fetching release PRs"),ke.exit(1)}},y=async()=>{try{let e=await dr();e.length===0&&(s.error("\u274C No release PRs found. Check the project folder for the script. Exiting..."),ke.exit(1));let r=be(e.map(n=>n.headRefName)),t=new Map(e.map(n=>[n.headRefName,n]));return r.map(n=>({branch:n,title:t.get(n).title}))}catch(e){s.error({error:e},"\u274C Error fetching release PRs"),ke.exit(1)}},Re=async e=>{let{version:r,jiraVersionUrl:t,type:n}=e,o=n==="hotfix"?"Hotfix":"Release",i=we(n),a=`release/v${r}`;try{E.quiet=!0,await E`git switch ${i}`,await E`git pull origin ${i}`,await E`git checkout -b ${a}`,await E`git push -u origin ${a}`,await E`git commit --allow-empty-message --allow-empty --message ''`,await E`git push origin ${a}`;let c=(await E`gh pr create --title "${o} v${r}" --body "${t} \n" --base ${i} --head ${a}`).stdout.trim();return await E`git switch ${i}`,E.quiet=!1,{branchName:a,prUrl:c}}catch(p){throw s.error({error:p,branchName:a},`Error creating release branch ${a}`),p}};var Te=async e=>{let{all:r,confirmedCommand:t}=e;l.start("merge-dev");let o=(await y()).filter(u=>v(u.title)==="regular").map(u=>u.branch);if(o.length===0)return s.info("\u2139\uFE0F No open release branches found"),l.print(),{content:[{type:"text",text:JSON.stringify({successfulMerges:0,failedMerges:0,failedBranches:[],totalBranches:0},null,2)}],structuredContent:{successfulMerges:0,failedMerges:0,failedBranches:[],totalBranches:0}};let i=[];if(r)i=o;else{l.setInteractive();let u=await w();i=await Yr({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:o,descriptions:u})})}i.length===o.length?l.addOption("--all",!0):l.addOption("--versions",i.map(u=>u.replace("release/v","")));let p=t?!0:await Zr({message:`Are you sure you want to merge dev into these branches: ${i.join(", ")}?`});t||l.setInteractive(),p||(s.info("Operation cancelled. Exiting..."),Qr.exit(0)),t||l.addOption("--yes",!0),A.quiet=!0,await A`git fetch origin`,await A`git switch dev`,await A`git pull origin dev`;let c=[];for(let u of i)await et(u)||c.push(u);if(A.quiet=!1,c.length>0){s.info(`
|
|
18
18
|
\u26A0\uFE0F ${c.length} branch(es) failed to merge automatically.
|
|
19
19
|
`),s.info("\u{1F4CB} Manual merge script for failed branches:");for(let u of c)s.info(`# Merge dev into ${u} and resolve conflicts if any
|
|
20
|
+
|
|
20
21
|
git switch ${u} && git pull origin ${u} && git merge origin/dev
|
|
21
22
|
git push origin ${u} && git switch dev
|
|
22
|
-
`);s.info(`\u2705 ${i.length-c.length}/${i.length} merges completed successfully.`)}else s.info("\u2705 All merges completed successfully!");l.print();let m={successfulMerges:i.length-c.length,failedMerges:c.length,failedBranches:c,totalBranches:i.length};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}},et=async e=>{try{return await A`git switch ${e}`,await A`git pull origin ${e}`,await A`git merge origin/dev --no-edit`,await A`git push origin ${e}`,await A`git switch dev`,s.info(`Successfully merged dev into ${e}`),!0}catch(r){return s.error({error:r,branch:e},`Error merging dev into ${e}`),await A`git reset --merge HEAD~1`,!1}},rt={name:"gh-merge-dev",description:"Merge dev branch into selected release branches",inputSchema:{all:z.boolean().describe("Merge dev into all release branches without prompting")},outputSchema:{successfulMerges:z.number().describe("Number of successful merges"),failedMerges:z.number().describe("Number of failed merges"),failedBranches:z.array(z.string()).describe("List of branches that failed to merge"),totalBranches:z.number().describe("Total number of branches processed")},handler:Te};import tt from"@inquirer/confirm";import ot from"@inquirer/select";import Ge from"node:process";import{z as ie}from"zod";import{$ as S}from"zx";var Ce=async e=>{let{version:r,confirmedCommand:t}=e;l.start("release-deliver");let n=await y(),o=n.map(d=>d.branch),i=new Map(n.map(d=>[d.branch,v(d.title)])),a="";if(r)a=`release/v${r}`;else{l.setInteractive();let d=await w();a=await ot({message:"\u{1F33F} Select release branch",choices:x({branches:o,descriptions:d,types:i})})}let p=a.replace("release/v","");l.addOption("--version",p);let c=n.find(d=>d.branch===a);c||(s.error(`\u274C Release branch ${a} not found in open PRs. Exiting...`),Ge.exit(1));let m=v(c.title),u=t?!0:await tt({message:`Are you sure you want to deliver version ${a} to production?`});t||l.setInteractive(),u||(s.info("Operation cancelled. Exiting..."),Ge.exit(0)),l.addOption("--yes",!0);try{S.quiet=!0,m==="hotfix"?(await S`gh pr merge ${a} --squash --admin --delete-branch`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`):(await S`gh pr merge ${a} --squash --admin --delete-branch`,await S`gh pr create --base main --head dev --title "Release v${p} (RC)" --body ""`,await S`gh pr merge dev --squash --admin`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`),S.quiet=!1;let d=await te();if(d)try{let g=a.replace("release/","");await qe({versionName:g},d)}catch(g){s.error({error:g},"Failed to deliver Jira release (non-blocking)")}else s.info("\u{1F514} Jira is not configured, skipping Jira release delivery");s.info(`Successfully delivered ${a} to production!`),l.print();let f={releaseBranch:a,version:a.replace("release/v",""),type:m,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){s.error({error:d},"\u274C Error merging release branch into dev"),Ge.exit(1)}},st={name:"gh-release-deliver",description:"Deliver a release branch to production",inputSchema:{version:ie.string().describe('Version to deliver to production (e.g., "1.2.5")')},outputSchema:{releaseBranch:ie.string().describe("The release branch that was delivered"),version:ie.string().describe("The version that was delivered"),type:ie.enum(["regular","hotfix"]).describe("Release type"),success:ie.boolean().describe("Whether the delivery was successful")},handler:Ce};import ur from"@inquirer/select";import fr from"node:process";import{z as O}from"zod";import{$ as ze}from"zx";var Se=async e=>{let{version:r,env:t,skipTerraform:n}=e;l.start("release-deploy-all");let o="";if(r)o=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let c=await y(),m=c.map(f=>f.branch),u=new Map(c.map(f=>[f.branch,v(f.title)])),d=await w();o=await ur({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:m,descriptions:d,types:u})]})}let i=o==="dev"?"dev":o.replace("release/v","");l.addOption("--version",i);let a="";t?a=t:(l.setInteractive(),a=await ur({message:"\u{1F9EA} Select environment",choices:C.map(c=>({name:c,value:c}))})),l.addOption("--env",a),C.includes(a)||(s.error(`\u274C Invalid environment: ${a}. Exiting...`),fr.exit(1));let p=n??!1;p&&l.addOption("--skip-terraform",!0);try{ze.quiet=!0,await ze`gh workflow run deploy-all.yml --ref ${o} -f environment=${a} ${p?["-f","skip_terraform_deploy=true"]:[]}`,ze.quiet=!1,s.info(`Successfully launched deploy-all workflow_dispatch for release branch: ${o} and environment: ${a}`),l.print();let m={releaseBranch:o,version:o.replace("release/v",""),environment:a,skipTerraformDeploy:p,success:!0};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}}catch(c){s.error({error:c},"\u274C Error launching workflow"),fr.exit(1)}},nt={name:"gh-release-deploy-all",description:"Deploy a release branch to a specified environment",inputSchema:{version:O.string().describe('Version to deploy (e.g., "1.2.5")'),env:O.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),skipTerraform:O.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:O.string().describe("The release branch that was deployed"),version:O.string().describe("The version that was deployed"),environment:O.string().describe("The environment deployed to"),skipTerraformDeploy:O.boolean().describe("Whether terraform deployment was skipped"),success:O.boolean().describe("Whether the deployment was successful")},handler:Se};import it from"@inquirer/checkbox";import gr from"@inquirer/select";import at from"node:fs/promises";import{resolve as ct}from"node:path";import ae from"node:process";import lt from"yaml";import{z as I}from"zod";import{$ as Ke}from"zx";var $e=async e=>{let{version:r,env:t,services:n,skipTerraform:o}=e;l.start("release-deploy-selected");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let f=await y(),g=f.map(k=>k.branch),R=new Map(f.map(k=>[k.branch,v(k.title)])),T=await w();i=await gr({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:g,descriptions:T,types:R})]})}let a=i==="dev"?"dev":i.replace("release/v","");l.addOption("--version",a);let p="";t?p=t:(l.setInteractive(),p=await gr({message:"\u{1F9EA} Select environment",choices:C.map(f=>({name:f,value:f}))})),l.addOption("--env",p),C.includes(p)||(s.error(`\u274C Invalid environment: ${p}. Exiting...`),ae.exit(1));let c=await pt();c.length===0&&(s.error("\u274C No services found in workflow file. Exiting..."),ae.exit(1));let m=[];n&&n.length>0?m=n:(l.setInteractive(),m=await it({message:"\u{1F680} Select services to deploy (space to select, enter to confirm)",choices:c.map(f=>({name:f,value:f}))})),l.addOption("--services",m),m.length===0&&(s.error("\u274C No services selected. Exiting..."),ae.exit(1));let u=m.filter(f=>!c.includes(f));u.length>0&&(s.error(`\u274C Invalid services: ${u.join(", ")}. Available services: ${c.join(", ")}`),ae.exit(1));let d=o??!1;d&&l.addOption("--skip-terraform",!0);try{Ke.quiet=!0;let f=m.flatMap(T=>["-f",`${T}=true`]);await Ke`gh workflow run deploy-selected-services.yml --ref ${i} -f environment=${p} ${f} ${d?["-f","skip_terraform_deploy=true"]:[]}`,Ke.quiet=!1,s.info(`Successfully launched deploy-selected-services workflow_dispatch for release branch: ${i}, environment: ${p}, services: ${m.join(", ")}`),l.print();let R={releaseBranch:i,version:i.replace("release/v",""),environment:p,services:m,skipTerraformDeploy:d,success:!0};return{content:[{type:"text",text:JSON.stringify(R,null,2)}],structuredContent:R}}catch(f){s.error({error:f},"\u274C Error launching workflow"),ae.exit(1)}},pt=async()=>{let e=await $(),r=ct(e,".github/workflows/deploy-selected-services.yml"),t=await at.readFile(r,"utf-8"),o=lt.parse(t).on.workflow_dispatch.inputs,i=[];for(let[a,p]of Object.entries(o))p.type==="boolean"&&a!=="skip_terraform_deploy"&&i.push(a);return i},mt={name:"gh-release-deploy-selected",description:"Deploy selected services from a release branch to a specified environment",inputSchema:{version:I.string().describe('Version to deploy (e.g., "1.2.5")'),env:I.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),services:I.array(I.string()).describe('List of services to deploy (e.g., ["client-be", "client-fe"])'),skipTerraform:I.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:I.string().describe("The release branch that was deployed"),version:I.string().describe("The version that was deployed"),environment:I.string().describe("The environment deployed to"),services:I.array(I.string()).describe("The services that were deployed"),skipTerraformDeploy:I.boolean().describe("Whether terraform deployment was skipped"),success:I.boolean().describe("Whether the deployment was successful")},handler:$e};import He from"@inquirer/select";import dt from"node:fs/promises";import{resolve as ut}from"node:path";import Xe from"node:process";import ft from"yaml";import{z as P}from"zod";import{$ as Ye}from"zx";var Ee=async e=>{let{version:r,env:t,service:n,skipTerraform:o}=e;l.start("release-deploy-service");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let d=await y(),f=d.map(T=>T.branch),g=new Map(d.map(T=>[T.branch,v(T.title)])),R=await w();i=await He({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:f,descriptions:R,types:g})]})}let a=i==="dev"?"dev":i.replace("release/v","");l.addOption("--version",a);let p="";t?p=t:(l.setInteractive(),p=await He({message:"\u{1F9EA} Select environment",choices:C.map(d=>({name:d,value:d}))})),l.addOption("--env",p),C.includes(p)||(s.error(`\u274C Invalid environment: ${p}. Exiting...`),Xe.exit(1));let c=await gt(),m="";n?m=n:(l.setInteractive(),m=await He({message:"\u{1F680} Select service to deploy",choices:c.map(d=>({name:d,value:d}))})),l.addOption("--service",m),c.includes(m)||(s.error(`\u274C Invalid service: ${m}. Available services: ${c.join(", ")}`),Xe.exit(1));let u=o??!1;u&&l.addOption("--skip-terraform",!0);try{Ye.quiet=!0,await Ye`gh workflow run deploy-single-service.yml --ref ${i} -f environment=${p} -f service=${m} ${u?["-f","skip_terraform_deploy=true"]:[]}`,Ye.quiet=!1,s.info(`Successfully launched deploy-single-service workflow_dispatch for release branch: ${i}, environment: ${p}, service: ${m}`),l.print();let f={releaseBranch:i,version:i.replace("release/v",""),environment:p,service:m,skipTerraformDeploy:u,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){s.error({error:d},"\u274C Error launching workflow"),Xe.exit(1)}},gt=async()=>{let e=await $(),r=ut(e,".github/workflows/deploy-single-service.yml"),t=await dt.readFile(r,"utf-8");return ft.parse(t).on.workflow_dispatch.inputs.service.options},ht={name:"gh-release-deploy-service",description:"Deploy a specific service in a release branch to a specified environment",inputSchema:{version:P.string().describe('Version to deploy (e.g., "1.2.5")'),env:P.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),service:P.string().describe('Service to deploy (e.g., "client-be", "client-fe")'),skipTerraform:P.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:P.string().describe("The release branch that was deployed"),version:P.string().describe("The version that was deployed"),environment:P.string().describe("The environment deployed to"),service:P.string().describe("The service that was deployed"),skipTerraformDeploy:P.boolean().describe("Whether terraform deployment was skipped"),success:P.boolean().describe("Whether the deployment was successful")},handler:Ee};import{z as K}from"zod";var Ie=async()=>{let r=(await y()).map(a=>({version:a.branch.replace("release/",""),type:v(a.title)})),t=await w(),n=Math.max(...r.map(a=>a.version.length)),o=r.map(a=>{let p=G(a.version,a.type,n),c=t.get(a.version);return c?`${p} ${c}`:p});s.info(`All release branches:
|
|
23
|
+
`);s.info(`\u2705 ${i.length-c.length}/${i.length} merges completed successfully.`)}else s.info(`\u2705 All merges completed successfully!
|
|
24
|
+
`);l.print();let m={successfulMerges:i.length-c.length,failedMerges:c.length,failedBranches:c,totalBranches:i.length};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}},et=async e=>{try{return await A`git switch ${e}`,await A`git pull origin ${e}`,await A`git merge origin/dev --no-edit`,await A`git push origin ${e}`,await A`git switch dev`,s.info(`Successfully merged dev into ${e}`),!0}catch(r){return s.error({error:r,branch:e},`Error merging dev into ${e}`),await A`git reset --merge HEAD~1`,!1}},rt={name:"gh-merge-dev",description:"Merge dev branch into selected release branches",inputSchema:{all:z.boolean().describe("Merge dev into all release branches without prompting")},outputSchema:{successfulMerges:z.number().describe("Number of successful merges"),failedMerges:z.number().describe("Number of failed merges"),failedBranches:z.array(z.string()).describe("List of branches that failed to merge"),totalBranches:z.number().describe("Total number of branches processed")},handler:Te};import tt from"@inquirer/confirm";import ot from"@inquirer/select";import Ge from"node:process";import{z as ie}from"zod";import{$ as S}from"zx";var Ce=async e=>{let{version:r,confirmedCommand:t}=e;l.start("release-deliver");let n=await y(),o=n.map(d=>d.branch),i=new Map(n.map(d=>[d.branch,v(d.title)])),a="";if(r)a=`release/v${r}`;else{l.setInteractive();let d=await w();a=await ot({message:"\u{1F33F} Select release branch",choices:x({branches:o,descriptions:d,types:i})})}let p=a.replace("release/v","");l.addOption("--version",p);let c=n.find(d=>d.branch===a);c||(s.error(`\u274C Release branch ${a} not found in open PRs. Exiting...`),Ge.exit(1));let m=v(c.title),u=t?!0:await tt({message:`Are you sure you want to deliver version ${a} to production?`});t||l.setInteractive(),u||(s.info("Operation cancelled. Exiting..."),Ge.exit(0)),l.addOption("--yes",!0);try{S.quiet=!0,m==="hotfix"?(await S`gh pr merge ${a} --squash --admin --delete-branch`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`):(await S`gh pr merge ${a} --squash --admin --delete-branch`,await S`gh pr create --base main --head dev --title "Release v${p} (RC)" --body ""`,await S`gh pr merge dev --squash --admin`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`),S.quiet=!1;let d=await te();if(d)try{let g=a.replace("release/","");await qe({versionName:g},d)}catch(g){s.error({error:g},"Failed to deliver Jira release (non-blocking)")}else s.info("\u{1F514} Jira is not configured, skipping Jira release delivery");s.info(`Successfully delivered ${a} to production!`),l.print();let f={releaseBranch:a,version:a.replace("release/v",""),type:m,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){s.error({error:d},"\u274C Error merging release branch into dev"),Ge.exit(1)}},st={name:"gh-release-deliver",description:"Deliver a release branch to production",inputSchema:{version:ie.string().describe('Version to deliver to production (e.g., "1.2.5")')},outputSchema:{releaseBranch:ie.string().describe("The release branch that was delivered"),version:ie.string().describe("The version that was delivered"),type:ie.enum(["regular","hotfix"]).describe("Release type"),success:ie.boolean().describe("Whether the delivery was successful")},handler:Ce};import ur from"@inquirer/select";import fr from"node:process";import{z as O}from"zod";import{$ as ze}from"zx";var Se=async e=>{let{version:r,env:t,skipTerraform:n}=e;l.start("release-deploy-all");let o="";if(r)o=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let c=await y(),m=c.map(f=>f.branch),u=new Map(c.map(f=>[f.branch,v(f.title)])),d=await w();o=await ur({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:m,descriptions:d,types:u})]})}let i=o==="dev"?"dev":o.replace("release/v","");l.addOption("--version",i);let a="";t?a=t:(l.setInteractive(),a=await ur({message:"\u{1F9EA} Select environment",choices:C.map(c=>({name:c,value:c}))})),l.addOption("--env",a),C.includes(a)||(s.error(`\u274C Invalid environment: ${a}. Exiting...`),fr.exit(1));let p=n??!1;p&&l.addOption("--skip-terraform",!0);try{ze.quiet=!0,await ze`gh workflow run deploy-all.yml --ref ${o} -f environment=${a} ${p?["-f","skip_terraform_deploy=true"]:[]}`,ze.quiet=!1,s.info(`Successfully launched deploy-all workflow_dispatch for release branch: ${o} and environment: ${a}`),l.print();let m={releaseBranch:o,version:o.replace("release/v",""),environment:a,skipTerraformDeploy:p,success:!0};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}}catch(c){s.error({error:c},"\u274C Error launching workflow"),fr.exit(1)}},nt={name:"gh-release-deploy-all",description:"Deploy a release branch to a specified environment",inputSchema:{version:O.string().describe('Version to deploy (e.g., "1.2.5")'),env:O.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),skipTerraform:O.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:O.string().describe("The release branch that was deployed"),version:O.string().describe("The version that was deployed"),environment:O.string().describe("The environment deployed to"),skipTerraformDeploy:O.boolean().describe("Whether terraform deployment was skipped"),success:O.boolean().describe("Whether the deployment was successful")},handler:Se};import it from"@inquirer/checkbox";import gr from"@inquirer/select";import at from"node:fs/promises";import{resolve as ct}from"node:path";import ae from"node:process";import lt from"yaml";import{z as I}from"zod";import{$ as Ke}from"zx";var $e=async e=>{let{version:r,env:t,services:n,skipTerraform:o}=e;l.start("release-deploy-selected");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let f=await y(),g=f.map(k=>k.branch),R=new Map(f.map(k=>[k.branch,v(k.title)])),T=await w();i=await gr({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:g,descriptions:T,types:R})]})}let a=i==="dev"?"dev":i.replace("release/v","");l.addOption("--version",a);let p="";t?p=t:(l.setInteractive(),p=await gr({message:"\u{1F9EA} Select environment",choices:C.map(f=>({name:f,value:f}))})),l.addOption("--env",p),C.includes(p)||(s.error(`\u274C Invalid environment: ${p}. Exiting...`),ae.exit(1));let c=await pt();c.length===0&&(s.error("\u274C No services found in workflow file. Exiting..."),ae.exit(1));let m=[];n&&n.length>0?m=n:(l.setInteractive(),m=await it({message:"\u{1F680} Select services to deploy (space to select, enter to confirm)",choices:c.map(f=>({name:f,value:f}))})),l.addOption("--services",m),m.length===0&&(s.error("\u274C No services selected. Exiting..."),ae.exit(1));let u=m.filter(f=>!c.includes(f));u.length>0&&(s.error(`\u274C Invalid services: ${u.join(", ")}. Available services: ${c.join(", ")}`),ae.exit(1));let d=o??!1;d&&l.addOption("--skip-terraform",!0);try{Ke.quiet=!0;let f=m.flatMap(T=>["-f",`${T}=true`]);await Ke`gh workflow run deploy-selected-services.yml --ref ${i} -f environment=${p} ${f} ${d?["-f","skip_terraform_deploy=true"]:[]}`,Ke.quiet=!1,s.info(`Successfully launched deploy-selected-services workflow_dispatch for release branch: ${i}, environment: ${p}, services: ${m.join(", ")}`),l.print();let R={releaseBranch:i,version:i.replace("release/v",""),environment:p,services:m,skipTerraformDeploy:d,success:!0};return{content:[{type:"text",text:JSON.stringify(R,null,2)}],structuredContent:R}}catch(f){s.error({error:f},"\u274C Error launching workflow"),ae.exit(1)}},pt=async()=>{let e=await $(),r=ct(e,".github/workflows/deploy-selected-services.yml"),t=await at.readFile(r,"utf-8"),o=lt.parse(t).on.workflow_dispatch.inputs,i=[];for(let[a,p]of Object.entries(o))p.type==="boolean"&&a!=="skip_terraform_deploy"&&i.push(a);return i},mt={name:"gh-release-deploy-selected",description:"Deploy selected services from a release branch to a specified environment",inputSchema:{version:I.string().describe('Version to deploy (e.g., "1.2.5")'),env:I.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),services:I.array(I.string()).describe('List of services to deploy (e.g., ["client-be", "client-fe"])'),skipTerraform:I.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:I.string().describe("The release branch that was deployed"),version:I.string().describe("The version that was deployed"),environment:I.string().describe("The environment deployed to"),services:I.array(I.string()).describe("The services that were deployed"),skipTerraformDeploy:I.boolean().describe("Whether terraform deployment was skipped"),success:I.boolean().describe("Whether the deployment was successful")},handler:$e};import He from"@inquirer/select";import dt from"node:fs/promises";import{resolve as ut}from"node:path";import Xe from"node:process";import ft from"yaml";import{z as P}from"zod";import{$ as Ye}from"zx";var Ee=async e=>{let{version:r,env:t,service:n,skipTerraform:o}=e;l.start("release-deploy-service");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let d=await y(),f=d.map(T=>T.branch),g=new Map(d.map(T=>[T.branch,v(T.title)])),R=await w();i=await He({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:f,descriptions:R,types:g})]})}let a=i==="dev"?"dev":i.replace("release/v","");l.addOption("--version",a);let p="";t?p=t:(l.setInteractive(),p=await He({message:"\u{1F9EA} Select environment",choices:C.map(d=>({name:d,value:d}))})),l.addOption("--env",p),C.includes(p)||(s.error(`\u274C Invalid environment: ${p}. Exiting...`),Xe.exit(1));let c=await gt(),m="";n?m=n:(l.setInteractive(),m=await He({message:"\u{1F680} Select service to deploy",choices:c.map(d=>({name:d,value:d}))})),l.addOption("--service",m),c.includes(m)||(s.error(`\u274C Invalid service: ${m}. Available services: ${c.join(", ")}`),Xe.exit(1));let u=o??!1;u&&l.addOption("--skip-terraform",!0);try{Ye.quiet=!0,await Ye`gh workflow run deploy-single-service.yml --ref ${i} -f environment=${p} -f service=${m} ${u?["-f","skip_terraform_deploy=true"]:[]}`,Ye.quiet=!1,s.info(`Successfully launched deploy-single-service workflow_dispatch for release branch: ${i}, environment: ${p}, service: ${m}`),l.print();let f={releaseBranch:i,version:i.replace("release/v",""),environment:p,service:m,skipTerraformDeploy:u,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){s.error({error:d},"\u274C Error launching workflow"),Xe.exit(1)}},gt=async()=>{let e=await $(),r=ut(e,".github/workflows/deploy-single-service.yml"),t=await dt.readFile(r,"utf-8");return ft.parse(t).on.workflow_dispatch.inputs.service.options},ht={name:"gh-release-deploy-service",description:"Deploy a specific service in a release branch to a specified environment",inputSchema:{version:P.string().describe('Version to deploy (e.g., "1.2.5")'),env:P.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),service:P.string().describe('Service to deploy (e.g., "client-be", "client-fe")'),skipTerraform:P.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:P.string().describe("The release branch that was deployed"),version:P.string().describe("The version that was deployed"),environment:P.string().describe("The environment deployed to"),service:P.string().describe("The service that was deployed"),skipTerraformDeploy:P.boolean().describe("Whether terraform deployment was skipped"),success:P.boolean().describe("Whether the deployment was successful")},handler:Ee};import{z as K}from"zod";var Ie=async()=>{let r=(await y()).map(a=>({version:a.branch.replace("release/",""),type:v(a.title)})),t=await w(),n=Math.max(...r.map(a=>a.version.length)),o=r.map(a=>{let p=G(a.version,a.type,n),c=t.get(a.version);return c?`${p} ${c}`:p});s.info(`All release branches:
|
|
23
25
|
`),s.info(`
|
|
24
26
|
${o.join(`
|
|
25
27
|
`)}
|