@hubspot/cli 7.7.21-experimental.1 → 7.7.23-experimental.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (568) hide show
  1. package/api/__tests__/migrate.test.js +27 -29
  2. package/api/migrate.js +14 -22
  3. package/bin/cli.js +92 -97
  4. package/bin/hs +2 -2
  5. package/bin/hscms +2 -2
  6. package/bin/silenceErrors.js +1 -2
  7. package/commands/__tests__/account.test.js +29 -34
  8. package/commands/__tests__/auth.test.js +11 -16
  9. package/commands/__tests__/cms.test.js +15 -20
  10. package/commands/__tests__/config.test.js +14 -19
  11. package/commands/__tests__/create.test.js +10 -15
  12. package/commands/__tests__/customObject.test.js +14 -19
  13. package/commands/__tests__/doctor.test.js +43 -48
  14. package/commands/__tests__/feedback.test.js +7 -45
  15. package/commands/__tests__/fetch.test.js +29 -28
  16. package/commands/__tests__/filemanager.test.js +14 -19
  17. package/commands/__tests__/function.test.js +16 -21
  18. package/commands/__tests__/getStarted.test.js +45 -50
  19. package/commands/__tests__/hubdb.test.js +17 -22
  20. package/commands/__tests__/init.test.js +12 -17
  21. package/commands/__tests__/lint.test.js +13 -18
  22. package/commands/__tests__/list.test.js +18 -23
  23. package/commands/__tests__/logs.test.js +28 -27
  24. package/commands/__tests__/mcp.test.js +14 -19
  25. package/commands/__tests__/mv.test.js +14 -52
  26. package/commands/__tests__/open.test.js +13 -51
  27. package/commands/__tests__/project.test.js +44 -49
  28. package/commands/__tests__/remove.test.js +13 -51
  29. package/commands/__tests__/sandbox.test.js +14 -19
  30. package/commands/__tests__/secret.test.js +16 -21
  31. package/commands/__tests__/testAccount.test.js +16 -21
  32. package/commands/__tests__/theme.test.js +15 -20
  33. package/commands/account/__tests__/auth.test.js +11 -16
  34. package/commands/account/__tests__/clean.test.js +12 -17
  35. package/commands/account/__tests__/createOverride.test.js +10 -15
  36. package/commands/account/__tests__/info.test.js +11 -16
  37. package/commands/account/__tests__/list.test.js +11 -16
  38. package/commands/account/__tests__/remove.test.js +13 -18
  39. package/commands/account/__tests__/removeOverride.js +8 -13
  40. package/commands/account/__tests__/rename.test.js +15 -20
  41. package/commands/account/__tests__/use.test.js +10 -15
  42. package/commands/account/auth.d.ts +1 -1
  43. package/commands/account/auth.js +65 -67
  44. package/commands/account/clean.d.ts +1 -1
  45. package/commands/account/clean.js +55 -60
  46. package/commands/account/createOverride.d.ts +1 -1
  47. package/commands/account/createOverride.js +52 -57
  48. package/commands/account/info.d.ts +1 -1
  49. package/commands/account/info.js +33 -35
  50. package/commands/account/list.d.ts +1 -1
  51. package/commands/account/list.js +43 -45
  52. package/commands/account/remove.d.ts +1 -1
  53. package/commands/account/remove.js +37 -42
  54. package/commands/account/removeOverride.d.ts +1 -1
  55. package/commands/account/removeOverride.js +38 -43
  56. package/commands/account/rename.d.ts +1 -1
  57. package/commands/account/rename.js +18 -20
  58. package/commands/account/use.d.ts +1 -1
  59. package/commands/account/use.js +29 -31
  60. package/commands/account.d.ts +1 -1
  61. package/commands/account.js +23 -28
  62. package/commands/app/__tests__/migrate.test.js +29 -34
  63. package/commands/app/migrate.d.ts +2 -2
  64. package/commands/app/migrate.js +40 -43
  65. package/commands/app/secret/__tests__/add.test.js +6 -11
  66. package/commands/app/secret/__tests__/delete.test.js +6 -11
  67. package/commands/app/secret/__tests__/list.test.js +6 -11
  68. package/commands/app/secret/__tests__/update.test.js +6 -11
  69. package/commands/app/secret/add.d.ts +1 -1
  70. package/commands/app/secret/add.js +28 -30
  71. package/commands/app/secret/delete.d.ts +1 -1
  72. package/commands/app/secret/delete.js +34 -36
  73. package/commands/app/secret/list.d.ts +1 -1
  74. package/commands/app/secret/list.js +25 -27
  75. package/commands/app/secret/update.d.ts +1 -1
  76. package/commands/app/secret/update.js +32 -34
  77. package/commands/app/secret.d.ts +1 -1
  78. package/commands/app/secret.js +12 -17
  79. package/commands/app.d.ts +1 -1
  80. package/commands/app.js +6 -16
  81. package/commands/auth.d.ts +1 -1
  82. package/commands/auth.js +70 -72
  83. package/commands/cms/convertFields.d.ts +1 -1
  84. package/commands/cms/convertFields.js +34 -39
  85. package/commands/cms/getReactModule.d.ts +1 -1
  86. package/commands/cms/getReactModule.js +32 -37
  87. package/commands/cms/lighthouseScore.d.ts +1 -1
  88. package/commands/cms/lighthouseScore.js +67 -72
  89. package/commands/cms.d.ts +1 -1
  90. package/commands/cms.js +11 -16
  91. package/commands/completion.d.ts +1 -1
  92. package/commands/completion.js +10 -15
  93. package/commands/config/migrate.d.ts +1 -1
  94. package/commands/config/migrate.js +27 -32
  95. package/commands/config/set.d.ts +2 -1
  96. package/commands/config/set.js +40 -32
  97. package/commands/config.d.ts +1 -1
  98. package/commands/config.js +8 -13
  99. package/commands/create/api-sample.d.ts +1 -1
  100. package/commands/create/api-sample.js +28 -33
  101. package/commands/create/app.d.ts +1 -1
  102. package/commands/create/app.js +3 -5
  103. package/commands/create/function.d.ts +1 -1
  104. package/commands/create/function.js +9 -11
  105. package/commands/create/index.d.ts +1 -1
  106. package/commands/create/index.js +19 -24
  107. package/commands/create/module.d.ts +1 -1
  108. package/commands/create/module.js +12 -14
  109. package/commands/create/react-app.d.ts +1 -1
  110. package/commands/create/react-app.js +3 -5
  111. package/commands/create/template.d.ts +1 -1
  112. package/commands/create/template.js +12 -14
  113. package/commands/create/vue-app.d.ts +1 -1
  114. package/commands/create/vue-app.js +3 -5
  115. package/commands/create/webpack-serverless.d.ts +1 -1
  116. package/commands/create/webpack-serverless.js +3 -5
  117. package/commands/create/website-theme.d.ts +1 -1
  118. package/commands/create/website-theme.js +5 -7
  119. package/commands/create.d.ts +2 -2
  120. package/commands/create.js +30 -35
  121. package/commands/customObject/__tests__/create.test.js +13 -18
  122. package/commands/customObject/__tests__/schema.test.js +18 -23
  123. package/commands/customObject/create.d.ts +1 -1
  124. package/commands/customObject/create.js +28 -30
  125. package/commands/customObject/schema/__tests__/create.test.js +13 -18
  126. package/commands/customObject/schema/__tests__/delete.test.js +13 -18
  127. package/commands/customObject/schema/__tests__/fetch-all.test.js +13 -18
  128. package/commands/customObject/schema/__tests__/fetch.test.js +13 -18
  129. package/commands/customObject/schema/__tests__/list.test.js +13 -18
  130. package/commands/customObject/schema/__tests__/update.test.js +13 -18
  131. package/commands/customObject/schema/create.d.ts +1 -1
  132. package/commands/customObject/schema/create.js +28 -30
  133. package/commands/customObject/schema/delete.d.ts +1 -1
  134. package/commands/customObject/schema/delete.js +24 -26
  135. package/commands/customObject/schema/fetch-all.d.ts +1 -1
  136. package/commands/customObject/schema/fetch-all.js +22 -24
  137. package/commands/customObject/schema/fetch.d.ts +1 -1
  138. package/commands/customObject/schema/fetch.js +24 -26
  139. package/commands/customObject/schema/list.d.ts +1 -1
  140. package/commands/customObject/schema/list.js +13 -15
  141. package/commands/customObject/schema/update.d.ts +1 -1
  142. package/commands/customObject/schema/update.js +32 -34
  143. package/commands/customObject/schema.d.ts +1 -1
  144. package/commands/customObject/schema.js +17 -22
  145. package/commands/customObject.d.ts +1 -1
  146. package/commands/customObject.js +13 -18
  147. package/commands/doctor.d.ts +1 -1
  148. package/commands/doctor.js +28 -33
  149. package/commands/feedback.d.ts +1 -1
  150. package/commands/feedback.js +19 -24
  151. package/commands/fetch.d.ts +1 -1
  152. package/commands/fetch.js +28 -30
  153. package/commands/filemanager/__tests__/fetch.test.js +17 -22
  154. package/commands/filemanager/__tests__/upload.test.js +15 -20
  155. package/commands/filemanager/fetch.d.ts +1 -1
  156. package/commands/filemanager/fetch.js +23 -25
  157. package/commands/filemanager/upload.d.ts +1 -1
  158. package/commands/filemanager/upload.js +39 -44
  159. package/commands/filemanager.d.ts +1 -1
  160. package/commands/filemanager.js +8 -13
  161. package/commands/function/deploy.d.ts +1 -1
  162. package/commands/function/deploy.js +35 -40
  163. package/commands/function/list.d.ts +1 -1
  164. package/commands/function/list.js +24 -29
  165. package/commands/function/server.d.ts +1 -1
  166. package/commands/function/server.js +15 -17
  167. package/commands/function.d.ts +1 -1
  168. package/commands/function.js +12 -18
  169. package/commands/getStarted.d.ts +1 -1
  170. package/commands/getStarted.js +119 -125
  171. package/commands/hubdb/__tests__/clear.test.js +13 -18
  172. package/commands/hubdb/__tests__/create.test.js +13 -18
  173. package/commands/hubdb/__tests__/delete.test.js +13 -18
  174. package/commands/hubdb/__tests__/fetch.test.js +13 -18
  175. package/commands/hubdb/__tests__/list.test.js +23 -28
  176. package/commands/hubdb/clear.d.ts +1 -1
  177. package/commands/hubdb/clear.js +20 -22
  178. package/commands/hubdb/create.d.ts +1 -1
  179. package/commands/hubdb/create.js +30 -35
  180. package/commands/hubdb/delete.d.ts +1 -1
  181. package/commands/hubdb/delete.js +24 -26
  182. package/commands/hubdb/fetch.d.ts +1 -1
  183. package/commands/hubdb/fetch.js +17 -19
  184. package/commands/hubdb/list.d.ts +1 -1
  185. package/commands/hubdb/list.js +33 -35
  186. package/commands/hubdb.d.ts +1 -1
  187. package/commands/hubdb.js +18 -24
  188. package/commands/init.d.ts +1 -1
  189. package/commands/init.js +83 -88
  190. package/commands/lint.d.ts +1 -1
  191. package/commands/lint.js +24 -26
  192. package/commands/list.d.ts +1 -1
  193. package/commands/list.js +32 -37
  194. package/commands/logs.d.ts +1 -1
  195. package/commands/logs.js +35 -37
  196. package/commands/mcp/__tests__/setup.test.js +7 -12
  197. package/commands/mcp/__tests__/start.test.js +7 -12
  198. package/commands/mcp/setup.d.ts +1 -1
  199. package/commands/mcp/setup.js +17 -19
  200. package/commands/mcp/start.d.ts +1 -1
  201. package/commands/mcp/start.js +29 -34
  202. package/commands/mcp.d.ts +1 -1
  203. package/commands/mcp.js +7 -12
  204. package/commands/module/marketplace-validate.d.ts +1 -1
  205. package/commands/module/marketplace-validate.js +21 -26
  206. package/commands/module.d.ts +1 -1
  207. package/commands/module.js +7 -13
  208. package/commands/mv.d.ts +1 -1
  209. package/commands/mv.js +20 -22
  210. package/commands/open.d.ts +1 -1
  211. package/commands/open.js +19 -21
  212. package/commands/project/__tests__/add.test.js +10 -15
  213. package/commands/project/__tests__/create.test.js +14 -19
  214. package/commands/project/__tests__/deploy.test.js +96 -134
  215. package/commands/project/__tests__/devUnifiedFlow.test.js +133 -139
  216. package/commands/project/__tests__/download.test.js +14 -19
  217. package/commands/project/__tests__/installDeps.test.js +32 -70
  218. package/commands/project/__tests__/listBuilds.test.js +14 -19
  219. package/commands/project/__tests__/logs.test.js +56 -94
  220. package/commands/project/__tests__/migrate.test.js +25 -30
  221. package/commands/project/__tests__/migrateApp.test.js +17 -22
  222. package/commands/project/__tests__/open.test.js +16 -21
  223. package/commands/project/__tests__/profile.test.js +14 -19
  224. package/commands/project/__tests__/upload.test.js +18 -23
  225. package/commands/project/__tests__/watch.test.js +14 -19
  226. package/commands/project/add.d.ts +1 -1
  227. package/commands/project/add.js +34 -36
  228. package/commands/project/cloneApp.d.ts +1 -1
  229. package/commands/project/cloneApp.js +67 -72
  230. package/commands/project/create.d.ts +2 -2
  231. package/commands/project/create.js +63 -68
  232. package/commands/project/deploy.d.ts +1 -1
  233. package/commands/project/deploy.js +67 -69
  234. package/commands/project/dev/deprecatedFlow.d.ts +2 -2
  235. package/commands/project/dev/deprecatedFlow.js +52 -58
  236. package/commands/project/dev/index.d.ts +1 -1
  237. package/commands/project/dev/index.js +44 -47
  238. package/commands/project/dev/unifiedFlow.d.ts +3 -3
  239. package/commands/project/dev/unifiedFlow.js +62 -68
  240. package/commands/project/download.d.ts +1 -1
  241. package/commands/project/download.js +35 -40
  242. package/commands/project/installDeps.d.ts +1 -1
  243. package/commands/project/installDeps.js +29 -34
  244. package/commands/project/listBuilds.d.ts +1 -1
  245. package/commands/project/listBuilds.js +40 -45
  246. package/commands/project/logs.d.ts +1 -1
  247. package/commands/project/logs.js +52 -54
  248. package/commands/project/migrate.d.ts +1 -1
  249. package/commands/project/migrate.js +24 -26
  250. package/commands/project/migrateApp.d.ts +2 -2
  251. package/commands/project/migrateApp.js +18 -20
  252. package/commands/project/open.d.ts +1 -1
  253. package/commands/project/open.js +25 -30
  254. package/commands/project/profile/add.d.ts +1 -1
  255. package/commands/project/profile/add.js +68 -73
  256. package/commands/project/profile/delete.d.ts +1 -1
  257. package/commands/project/profile/delete.js +51 -56
  258. package/commands/project/profile.d.ts +1 -1
  259. package/commands/project/profile.js +9 -14
  260. package/commands/project/upload.d.ts +1 -1
  261. package/commands/project/upload.js +50 -55
  262. package/commands/project/validate.d.ts +1 -1
  263. package/commands/project/validate.js +35 -40
  264. package/commands/project/watch.d.ts +1 -1
  265. package/commands/project/watch.js +59 -61
  266. package/commands/project.d.ts +1 -1
  267. package/commands/project.js +38 -43
  268. package/commands/remove.d.ts +1 -1
  269. package/commands/remove.js +15 -17
  270. package/commands/sandbox/__tests__/create.test.js +15 -20
  271. package/commands/sandbox/__tests__/delete.test.js +15 -20
  272. package/commands/sandbox/create.d.ts +1 -1
  273. package/commands/sandbox/create.js +67 -69
  274. package/commands/sandbox/delete.d.ts +1 -1
  275. package/commands/sandbox/delete.js +94 -96
  276. package/commands/sandbox.d.ts +1 -1
  277. package/commands/sandbox.js +9 -14
  278. package/commands/secret/__tests__/addSecret.test.js +13 -18
  279. package/commands/secret/__tests__/deleteSecret.test.js +13 -18
  280. package/commands/secret/__tests__/listSecret.test.js +13 -18
  281. package/commands/secret/__tests__/updateSecret.test.js +13 -18
  282. package/commands/secret/addSecret.d.ts +1 -1
  283. package/commands/secret/addSecret.js +26 -28
  284. package/commands/secret/deleteSecret.d.ts +1 -1
  285. package/commands/secret/deleteSecret.js +27 -29
  286. package/commands/secret/listSecret.d.ts +1 -1
  287. package/commands/secret/listSecret.js +19 -21
  288. package/commands/secret/updateSecret.d.ts +1 -1
  289. package/commands/secret/updateSecret.js +25 -27
  290. package/commands/secret.d.ts +1 -1
  291. package/commands/secret.js +13 -18
  292. package/commands/testAccount/__tests__/create.test.js +17 -22
  293. package/commands/testAccount/__tests__/createConfig.test.js +6 -11
  294. package/commands/testAccount/__tests__/delete.test.js +15 -20
  295. package/commands/testAccount/create.d.ts +1 -1
  296. package/commands/testAccount/create.js +45 -53
  297. package/commands/testAccount/createConfig.d.ts +1 -1
  298. package/commands/testAccount/createConfig.js +36 -41
  299. package/commands/testAccount/delete.d.ts +1 -1
  300. package/commands/testAccount/delete.js +17 -19
  301. package/commands/testAccount.d.ts +1 -1
  302. package/commands/testAccount.js +10 -15
  303. package/commands/theme/__tests__/generate-selectors.test.js +7 -12
  304. package/commands/theme/__tests__/marketplace-validate.test.js +14 -19
  305. package/commands/theme/__tests__/preview.test.js +12 -17
  306. package/commands/theme/generate-selectors.d.ts +1 -1
  307. package/commands/theme/generate-selectors.js +23 -28
  308. package/commands/theme/marketplace-validate.d.ts +1 -1
  309. package/commands/theme/marketplace-validate.js +19 -24
  310. package/commands/theme/preview.d.ts +1 -1
  311. package/commands/theme/preview.js +60 -65
  312. package/commands/theme.d.ts +1 -1
  313. package/commands/theme.js +11 -16
  314. package/commands/upload.d.ts +1 -1
  315. package/commands/upload.js +77 -82
  316. package/commands/watch.d.ts +1 -1
  317. package/commands/watch.js +45 -51
  318. package/lang/en.d.ts +10 -23
  319. package/lang/en.js +380 -399
  320. package/lib/__tests__/accountTypes.test.js +20 -22
  321. package/lib/__tests__/buildAccount.test.js +28 -63
  322. package/lib/__tests__/commonOpts.test.js +20 -22
  323. package/lib/__tests__/dependencyManagement.test.js +46 -51
  324. package/lib/__tests__/developerTestAccounts.test.js +27 -62
  325. package/lib/__tests__/hasFeature.test.js +6 -8
  326. package/lib/__tests__/npm.test.js +15 -20
  327. package/lib/__tests__/oauth.test.js +23 -28
  328. package/lib/__tests__/parsing.test.js +18 -20
  329. package/lib/__tests__/polling.test.js +24 -26
  330. package/lib/__tests__/process.test.js +14 -19
  331. package/lib/__tests__/projectProfiles.test.js +34 -39
  332. package/lib/__tests__/sandboxSync.test.js +30 -35
  333. package/lib/__tests__/sandboxes.test.js +29 -31
  334. package/lib/__tests__/serverlessLogs.test.js +8 -13
  335. package/lib/__tests__/usageTracking.test.js +33 -34
  336. package/lib/__tests__/validation.test.js +18 -20
  337. package/lib/__tests__/yargsUtils.test.js +17 -41
  338. package/lib/accountTypes.js +24 -34
  339. package/lib/app/__tests__/migrate.test.js +94 -99
  340. package/lib/app/__tests__/migrate_legacy.test.js +29 -31
  341. package/lib/app/migrate.d.ts +3 -3
  342. package/lib/app/migrate.js +127 -145
  343. package/lib/app/migrate_legacy.d.ts +1 -1
  344. package/lib/app/migrate_legacy.js +72 -78
  345. package/lib/app/urls.js +5 -9
  346. package/lib/buildAccount.d.ts +1 -1
  347. package/lib/buildAccount.js +71 -80
  348. package/lib/commonOpts.d.ts +1 -1
  349. package/lib/commonOpts.js +42 -59
  350. package/lib/configMigrate.js +34 -38
  351. package/lib/configOptions.d.ts +5 -0
  352. package/lib/configOptions.js +44 -40
  353. package/lib/constants.d.ts +4 -0
  354. package/lib/constants.js +35 -34
  355. package/lib/customObject.js +2 -6
  356. package/lib/dependencyManagement.js +37 -45
  357. package/lib/developerTestAccounts.d.ts +1 -1
  358. package/lib/developerTestAccounts.js +34 -39
  359. package/lib/doctor/Diagnosis.d.ts +1 -1
  360. package/lib/doctor/Diagnosis.js +25 -29
  361. package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
  362. package/lib/doctor/DiagnosticInfoBuilder.js +30 -37
  363. package/lib/doctor/Doctor.d.ts +1 -1
  364. package/lib/doctor/Doctor.js +94 -101
  365. package/lib/doctor/__tests__/Diagnosis.test.js +9 -14
  366. package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +29 -34
  367. package/lib/doctor/__tests__/Doctor.test.js +24 -26
  368. package/lib/enums/exitCodes.js +1 -4
  369. package/lib/errorHandlers/index.js +32 -41
  370. package/lib/errorHandlers/suppressError.d.ts +1 -1
  371. package/lib/errorHandlers/suppressError.js +28 -31
  372. package/lib/filesystem.js +8 -15
  373. package/lib/generateSelectors.js +18 -29
  374. package/lib/hasFeature.d.ts +1 -1
  375. package/lib/hasFeature.js +3 -6
  376. package/lib/interpolation.js +11 -18
  377. package/lib/lang.d.ts +1 -1
  378. package/lib/lang.js +22 -27
  379. package/lib/links.js +16 -24
  380. package/lib/marketplaceValidate.js +29 -39
  381. package/lib/mcp/setup.js +70 -82
  382. package/lib/middleware/__test__/configMiddleware.test.js +20 -55
  383. package/lib/middleware/__test__/gitMiddleware.test.js +7 -42
  384. package/lib/middleware/__test__/notificationsMiddleware.test.js +2 -4
  385. package/lib/middleware/__test__/requestMiddleware.test.js +6 -11
  386. package/lib/middleware/__test__/utils.test.js +9 -11
  387. package/lib/middleware/__test__/yargsChecksMiddleware.test.js +9 -44
  388. package/lib/middleware/autoUpdateMiddleware.js +33 -40
  389. package/lib/middleware/configMiddleware.js +36 -42
  390. package/lib/middleware/fireAlarmMiddleware.js +12 -18
  391. package/lib/middleware/gitMiddleware.js +5 -8
  392. package/lib/middleware/notificationsMiddleware.js +16 -23
  393. package/lib/middleware/requestMiddleware.js +4 -10
  394. package/lib/middleware/utils.js +1 -4
  395. package/lib/middleware/yargsChecksMiddleware.js +10 -13
  396. package/lib/npm.js +14 -23
  397. package/lib/oauth.js +29 -35
  398. package/lib/parsing.js +3 -6
  399. package/lib/polling.js +11 -15
  400. package/lib/process.js +11 -19
  401. package/lib/projectProfiles.d.ts +2 -2
  402. package/lib/projectProfiles.js +32 -42
  403. package/lib/projects/ProjectLogsManager.js +18 -21
  404. package/lib/projects/__tests__/AppDevModeInterface.test.js +140 -145
  405. package/lib/projects/__tests__/LocalDevProcess.test.js +68 -73
  406. package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +32 -37
  407. package/lib/projects/__tests__/ProjectLogsManager.test.js +56 -58
  408. package/lib/projects/__tests__/buildAndDeploy.test.js +7 -9
  409. package/lib/projects/__tests__/components.test.js +9 -14
  410. package/lib/projects/__tests__/projects.test.js +35 -40
  411. package/lib/projects/__tests__/structure.test.js +43 -81
  412. package/lib/projects/add/__tests__/legacyAddComponent.test.js +26 -28
  413. package/lib/projects/add/__tests__/v3AddComponent.test.js +25 -30
  414. package/lib/projects/add/legacyAddComponent.d.ts +1 -1
  415. package/lib/projects/add/legacyAddComponent.js +24 -30
  416. package/lib/projects/add/v3AddComponent.d.ts +1 -1
  417. package/lib/projects/add/v3AddComponent.js +36 -42
  418. package/lib/projects/buildAndDeploy.d.ts +1 -1
  419. package/lib/projects/buildAndDeploy.js +88 -97
  420. package/lib/projects/components.js +19 -25
  421. package/lib/projects/config.d.ts +1 -1
  422. package/lib/projects/config.js +32 -41
  423. package/lib/projects/create/__tests__/legacy.test.js +22 -57
  424. package/lib/projects/create/__tests__/v3.test.js +5 -7
  425. package/lib/projects/create/index.d.ts +3 -3
  426. package/lib/projects/create/index.js +19 -22
  427. package/lib/projects/create/legacy.d.ts +1 -1
  428. package/lib/projects/create/legacy.js +25 -31
  429. package/lib/projects/create/v3.d.ts +3 -3
  430. package/lib/projects/create/v3.js +49 -59
  431. package/lib/projects/ensureProjectExists.js +31 -37
  432. package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -3
  433. package/lib/projects/localDev/AppDevModeInterface.js +58 -60
  434. package/lib/projects/localDev/DevServerManager.d.ts +1 -1
  435. package/lib/projects/localDev/DevServerManager.js +22 -24
  436. package/lib/projects/localDev/DevServerManagerV2.d.ts +2 -2
  437. package/lib/projects/localDev/DevServerManagerV2.js +15 -20
  438. package/lib/projects/localDev/LocalDevLogger.d.ts +1 -1
  439. package/lib/projects/localDev/LocalDevLogger.js +68 -64
  440. package/lib/projects/localDev/LocalDevManager.d.ts +1 -1
  441. package/lib/projects/localDev/LocalDevManager.js +106 -111
  442. package/lib/projects/localDev/LocalDevProcess.d.ts +5 -4
  443. package/lib/projects/localDev/LocalDevProcess.js +37 -30
  444. package/lib/projects/localDev/LocalDevState.d.ts +3 -3
  445. package/lib/projects/localDev/LocalDevState.js +3 -5
  446. package/lib/projects/localDev/LocalDevWatcher.d.ts +1 -1
  447. package/lib/projects/localDev/LocalDevWatcher.js +6 -11
  448. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -1
  449. package/lib/projects/localDev/LocalDevWebsocketServer.js +29 -27
  450. package/lib/projects/localDev/helpers.d.ts +3 -3
  451. package/lib/projects/localDev/helpers.js +156 -174
  452. package/lib/projects/structure.d.ts +4 -4
  453. package/lib/projects/structure.js +32 -78
  454. package/lib/projects/ui.js +10 -13
  455. package/lib/projects/upload.d.ts +2 -3
  456. package/lib/projects/upload.js +55 -65
  457. package/lib/projects/urls.d.ts +1 -1
  458. package/lib/projects/urls.js +15 -25
  459. package/lib/projects/watch.d.ts +1 -1
  460. package/lib/projects/watch.js +48 -54
  461. package/lib/prompts/__tests__/downloadProjectPrompt.test.js +9 -11
  462. package/lib/prompts/__tests__/projectsLogsPrompt.test.js +11 -16
  463. package/lib/prompts/accountNamePrompt.d.ts +1 -1
  464. package/lib/prompts/accountNamePrompt.js +26 -31
  465. package/lib/prompts/accountsPrompt.js +12 -15
  466. package/lib/prompts/cmsFieldPrompt.js +13 -19
  467. package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
  468. package/lib/prompts/createApiSamplePrompt.js +9 -12
  469. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +1 -1
  470. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +23 -26
  471. package/lib/prompts/createFunctionPrompt.js +17 -20
  472. package/lib/prompts/createModulePrompt.js +12 -15
  473. package/lib/prompts/createTemplatePrompt.js +5 -8
  474. package/lib/prompts/downloadProjectPrompt.js +17 -20
  475. package/lib/prompts/installAppPrompt.js +19 -26
  476. package/lib/prompts/personalAccessKeyPrompt.d.ts +2 -2
  477. package/lib/prompts/personalAccessKeyPrompt.js +40 -47
  478. package/lib/prompts/previewPrompt.js +15 -22
  479. package/lib/prompts/projectAddPrompt.d.ts +1 -1
  480. package/lib/prompts/projectAddPrompt.js +14 -18
  481. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -1
  482. package/lib/prompts/projectDevTargetAccountPrompt.js +48 -54
  483. package/lib/prompts/projectNameAndDestPrompt.d.ts +1 -1
  484. package/lib/prompts/projectNameAndDestPrompt.js +22 -29
  485. package/lib/prompts/projectNamePrompt.js +11 -14
  486. package/lib/prompts/projectsLogsPrompt.js +5 -8
  487. package/lib/prompts/promptUtils.d.ts +1 -1
  488. package/lib/prompts/promptUtils.js +17 -24
  489. package/lib/prompts/sandboxesPrompt.d.ts +1 -1
  490. package/lib/prompts/sandboxesPrompt.js +26 -30
  491. package/lib/prompts/secretPrompt.js +10 -15
  492. package/lib/prompts/selectAppPrompt.js +11 -14
  493. package/lib/prompts/selectHubDBTablePrompt.js +24 -30
  494. package/lib/prompts/selectProjectTemplatePrompt.d.ts +1 -1
  495. package/lib/prompts/selectProjectTemplatePrompt.js +10 -13
  496. package/lib/prompts/selectPublicAppForMigrationPrompt.js +22 -25
  497. package/lib/prompts/setAsDefaultAccountPrompt.js +13 -16
  498. package/lib/prompts/uploadPrompt.js +11 -17
  499. package/lib/sandboxSync.d.ts +1 -1
  500. package/lib/sandboxSync.js +58 -65
  501. package/lib/sandboxes.d.ts +1 -1
  502. package/lib/sandboxes.js +68 -76
  503. package/lib/schema.js +13 -20
  504. package/lib/serverlessLogs.js +45 -52
  505. package/lib/testUtils.js +4 -8
  506. package/lib/ui/SpinniesManager.d.ts +1 -1
  507. package/lib/ui/SpinniesManager.js +29 -34
  508. package/lib/ui/boxen.js +11 -14
  509. package/lib/ui/git.js +14 -20
  510. package/lib/ui/index.js +55 -73
  511. package/lib/ui/logger.js +10 -13
  512. package/lib/ui/serverlessFunctionLogs.js +14 -20
  513. package/lib/ui/spinniesUtils.js +24 -39
  514. package/lib/ui/supportHyperlinks.js +3 -6
  515. package/lib/ui/supportsColor.js +11 -17
  516. package/lib/ui/table.js +6 -13
  517. package/lib/upload.js +15 -21
  518. package/lib/usageTracking.js +35 -44
  519. package/lib/utils/hasFlag.js +2 -8
  520. package/lib/validation.js +48 -87
  521. package/lib/yargsUtils.d.ts +2 -1
  522. package/lib/yargsUtils.js +19 -16
  523. package/mcp-server/server.js +6 -8
  524. package/mcp-server/tools/index.js +13 -16
  525. package/mcp-server/tools/project/AddFeatureToProject.d.ts +1 -1
  526. package/mcp-server/tools/project/AddFeatureToProject.js +35 -39
  527. package/mcp-server/tools/project/CreateProjectTool.d.ts +1 -1
  528. package/mcp-server/tools/project/CreateProjectTool.js +46 -50
  529. package/mcp-server/tools/project/DeployProject.d.ts +1 -1
  530. package/mcp-server/tools/project/DeployProject.js +18 -22
  531. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
  532. package/mcp-server/tools/project/GuidedWalkthroughTool.js +21 -25
  533. package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -1
  534. package/mcp-server/tools/project/UploadProjectTools.js +12 -19
  535. package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
  536. package/mcp-server/tools/project/ValidateProjectTool.js +13 -17
  537. package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +12 -14
  538. package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +13 -15
  539. package/mcp-server/tools/project/__tests__/DeployProject.test.js +6 -8
  540. package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +4 -6
  541. package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +4 -6
  542. package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +4 -6
  543. package/mcp-server/tools/project/constants.js +3 -9
  544. package/mcp-server/types.js +1 -5
  545. package/mcp-server/utils/__tests__/command.test.js +9 -11
  546. package/mcp-server/utils/__tests__/project.test.js +12 -17
  547. package/mcp-server/utils/command.d.ts +1 -1
  548. package/mcp-server/utils/command.js +4 -11
  549. package/mcp-server/utils/content.d.ts +1 -1
  550. package/mcp-server/utils/content.js +2 -6
  551. package/mcp-server/utils/project.js +8 -14
  552. package/mcp-server/utils/toolUsageTracking.js +11 -14
  553. package/package.json +15 -11
  554. package/types/Cms.d.ts +1 -1
  555. package/types/Cms.js +1 -2
  556. package/types/LocalDev.d.ts +4 -4
  557. package/types/LocalDev.js +1 -2
  558. package/types/ProjectComponents.d.ts +2 -2
  559. package/types/ProjectComponents.js +1 -2
  560. package/types/Projects.d.ts +1 -1
  561. package/types/Projects.js +2 -5
  562. package/types/Prompts.js +1 -2
  563. package/types/Sandboxes.js +1 -2
  564. package/types/Yargs.js +1 -2
  565. package/commands/app/__tests__/install.test.d.ts +0 -1
  566. package/commands/app/__tests__/install.test.js +0 -52
  567. package/commands/app/install.d.ts +0 -8
  568. package/commands/app/install.js +0 -127
@@ -1,92 +1,90 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const projects_1 = require("@hubspot/local-dev-lib/api/projects");
4
- const config_1 = require("@hubspot/local-dev-lib/config");
5
- const index_1 = require("@hubspot/local-dev-lib/errors/index");
6
- const buildAndDeploy_1 = require("../../lib/projects/buildAndDeploy");
7
- const usageTracking_1 = require("../../lib/usageTracking");
8
- const index_2 = require("../../lib/errorHandlers/index");
9
- const config_2 = require("../../lib/projects/config");
10
- const buildAndDeploy_2 = require("../../lib/projects/buildAndDeploy");
11
- const projectNamePrompt_1 = require("../../lib/prompts/projectNamePrompt");
12
- const promptUtils_1 = require("../../lib/prompts/promptUtils");
13
- const ui_1 = require("../../lib/ui");
14
- const exitCodes_1 = require("../../lib/enums/exitCodes");
15
- const logger_1 = require("../../lib/ui/logger");
16
- const yargsUtils_1 = require("../../lib/yargsUtils");
17
- const projectProfiles_1 = require("../../lib/projectProfiles");
18
- const constants_1 = require("../../lib/constants");
19
- const en_1 = require("../../lang/en");
1
+ import { deployProject, fetchProject, } from '@hubspot/local-dev-lib/api/projects';
2
+ import { getAccountConfig } from '@hubspot/local-dev-lib/config';
3
+ import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
4
+ import { useV3Api } from '../../lib/projects/buildAndDeploy.js';
5
+ import { trackCommandUsage } from '../../lib/usageTracking.js';
6
+ import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
7
+ import { getProjectConfig } from '../../lib/projects/config.js';
8
+ import { pollDeployStatus } from '../../lib/projects/buildAndDeploy.js';
9
+ import { projectNamePrompt } from '../../lib/prompts/projectNamePrompt.js';
10
+ import { promptUser } from '../../lib/prompts/promptUtils.js';
11
+ import { uiBetaTag, uiLine } from '../../lib/ui/index.js';
12
+ import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
13
+ import { uiLogger } from '../../lib/ui/logger.js';
14
+ import { makeYargsBuilder } from '../../lib/yargsUtils.js';
15
+ import { loadProfile, logProfileFooter, logProfileHeader, exitIfUsingProfiles, } from '../../lib/projectProfiles.js';
16
+ import { PROJECT_ERROR_TYPES, PROJECT_DEPLOY_TEXT, } from '../../lib/constants.js';
17
+ import { commands } from '../../lang/en.js';
20
18
  const command = 'deploy';
21
- const describe = (0, ui_1.uiBetaTag)(en_1.commands.project.deploy.describe, false);
19
+ const describe = uiBetaTag(commands.project.deploy.describe, false);
22
20
  function validateBuildId(buildId, deployedBuildId, latestBuildId, projectName, accountId) {
23
21
  if (Number(buildId) > latestBuildId) {
24
- return en_1.commands.project.deploy.errors.buildIdDoesNotExist(accountId, buildId, projectName);
22
+ return commands.project.deploy.errors.buildIdDoesNotExist(accountId, buildId, projectName);
25
23
  }
26
24
  if (Number(buildId) === deployedBuildId) {
27
- return en_1.commands.project.deploy.errors.buildAlreadyDeployed(accountId, buildId, projectName);
25
+ return commands.project.deploy.errors.buildAlreadyDeployed(accountId, buildId, projectName);
28
26
  }
29
27
  return true;
30
28
  }
31
29
  function logDeployErrors(errorData) {
32
- logger_1.uiLogger.error(errorData.message);
30
+ uiLogger.error(errorData.message);
33
31
  errorData.errors.forEach(err => {
34
- if (err.subCategory === constants_1.PROJECT_ERROR_TYPES.DEPLOY_CONTAINS_REMOVALS) {
35
- logger_1.uiLogger.log(en_1.commands.project.deploy.errors.deployContainsRemovals(err.context.COMPONENT_NAME));
32
+ if (err.subCategory === PROJECT_ERROR_TYPES.DEPLOY_CONTAINS_REMOVALS) {
33
+ uiLogger.log(commands.project.deploy.errors.deployContainsRemovals(err.context.COMPONENT_NAME));
36
34
  }
37
35
  else {
38
- logger_1.uiLogger.log(err.message);
36
+ uiLogger.log(err.message);
39
37
  }
40
38
  });
41
39
  }
42
40
  async function handler(args) {
43
41
  const { derivedAccountId, project: projectOption, buildId: buildIdOption, force: forceOption, deployLatestBuild: deployLatestBuildOption, json: formatOutputAsJson, } = args;
44
- const accountConfig = (0, config_1.getAccountConfig)(derivedAccountId);
42
+ const accountConfig = getAccountConfig(derivedAccountId);
45
43
  const accountType = accountConfig && accountConfig.accountType;
46
44
  let targetAccountId;
47
45
  const jsonOutput = {};
48
- const { projectConfig, projectDir } = await (0, config_2.getProjectConfig)();
49
- if ((0, buildAndDeploy_1.useV3Api)(projectConfig?.platformVersion)) {
46
+ const { projectConfig, projectDir } = await getProjectConfig();
47
+ if (useV3Api(projectConfig?.platformVersion)) {
50
48
  if (args.profile) {
51
- (0, projectProfiles_1.logProfileHeader)(args.profile);
52
- const profile = (0, projectProfiles_1.loadProfile)(projectConfig, projectDir, args.profile);
49
+ logProfileHeader(args.profile);
50
+ const profile = loadProfile(projectConfig, projectDir, args.profile);
53
51
  if (!profile) {
54
- (0, ui_1.uiLine)();
55
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
52
+ uiLine();
53
+ process.exit(EXIT_CODES.ERROR);
56
54
  }
57
55
  targetAccountId = profile.accountId;
58
- (0, projectProfiles_1.logProfileFooter)(profile);
56
+ logProfileFooter(profile);
59
57
  }
60
58
  else {
61
59
  // A profile must be specified if this project has profiles configured
62
- await (0, projectProfiles_1.exitIfUsingProfiles)(projectConfig, projectDir);
60
+ await exitIfUsingProfiles(projectConfig, projectDir);
63
61
  }
64
62
  }
65
63
  if (!targetAccountId) {
66
64
  targetAccountId = derivedAccountId;
67
65
  }
68
- (0, usageTracking_1.trackCommandUsage)('project-deploy', accountType ? { type: accountType } : undefined, targetAccountId);
66
+ trackCommandUsage('project-deploy', accountType ? { type: accountType } : undefined, targetAccountId);
69
67
  let projectName = projectOption;
70
68
  if (!projectOption && projectConfig) {
71
69
  projectName = projectConfig.name;
72
70
  }
73
- const namePromptResponse = await (0, projectNamePrompt_1.projectNamePrompt)(targetAccountId, {
71
+ const namePromptResponse = await projectNamePrompt(targetAccountId, {
74
72
  project: projectName,
75
73
  });
76
74
  projectName = namePromptResponse.projectName;
77
75
  let buildIdToDeploy = buildIdOption;
78
76
  let deploySuccess = false;
79
77
  try {
80
- const { data: { latestBuild, deployedBuildId }, } = await (0, projects_1.fetchProject)(targetAccountId, projectName);
78
+ const { data: { latestBuild, deployedBuildId }, } = await fetchProject(targetAccountId, projectName);
81
79
  if (!latestBuild || !latestBuild.buildId) {
82
- logger_1.uiLogger.error(en_1.commands.project.deploy.errors.noBuilds);
83
- return process.exit(exitCodes_1.EXIT_CODES.ERROR);
80
+ uiLogger.error(commands.project.deploy.errors.noBuilds);
81
+ return process.exit(EXIT_CODES.ERROR);
84
82
  }
85
83
  if (buildIdToDeploy) {
86
84
  const validationResult = validateBuildId(buildIdToDeploy, deployedBuildId, latestBuild.buildId, projectName, targetAccountId);
87
85
  if (validationResult !== true) {
88
- logger_1.uiLogger.error(validationResult.toString());
89
- return process.exit(exitCodes_1.EXIT_CODES.ERROR);
86
+ uiLogger.error(validationResult.toString());
87
+ return process.exit(EXIT_CODES.ERROR);
90
88
  }
91
89
  }
92
90
  else {
@@ -94,9 +92,9 @@ async function handler(args) {
94
92
  buildIdToDeploy = latestBuild.buildId;
95
93
  }
96
94
  else {
97
- const deployBuildIdPromptResponse = await (0, promptUtils_1.promptUser)({
95
+ const deployBuildIdPromptResponse = await promptUser({
98
96
  name: 'buildId',
99
- message: en_1.commands.project.deploy.deployBuildIdPrompt,
97
+ message: commands.project.deploy.deployBuildIdPrompt,
100
98
  default: latestBuild.buildId === deployedBuildId
101
99
  ? undefined
102
100
  : latestBuild.buildId,
@@ -106,78 +104,78 @@ async function handler(args) {
106
104
  }
107
105
  }
108
106
  if (!buildIdToDeploy) {
109
- logger_1.uiLogger.error(en_1.commands.project.deploy.errors.noBuildId);
110
- return process.exit(exitCodes_1.EXIT_CODES.ERROR);
107
+ uiLogger.error(commands.project.deploy.errors.noBuildId);
108
+ return process.exit(EXIT_CODES.ERROR);
111
109
  }
112
- const { data: deployResp } = await (0, projects_1.deployProject)(targetAccountId, projectName, buildIdToDeploy, (0, buildAndDeploy_1.useV3Api)(projectConfig?.platformVersion), forceOption);
110
+ const { data: deployResp } = await deployProject(targetAccountId, projectName, buildIdToDeploy, useV3Api(projectConfig?.platformVersion), forceOption);
113
111
  if (!deployResp || deployResp.buildResultType !== 'DEPLOY_QUEUED') {
114
- logger_1.uiLogger.error(en_1.commands.project.deploy.errors.deploy);
115
- return process.exit(exitCodes_1.EXIT_CODES.ERROR);
112
+ uiLogger.error(commands.project.deploy.errors.deploy);
113
+ return process.exit(EXIT_CODES.ERROR);
116
114
  }
117
115
  else if (formatOutputAsJson) {
118
116
  jsonOutput.deployId = Number(deployResp.id);
119
117
  }
120
- const deployResult = await (0, buildAndDeploy_2.pollDeployStatus)(targetAccountId, projectName, Number(deployResp.id), buildIdToDeploy);
121
- if (deployResult.status === constants_1.PROJECT_DEPLOY_TEXT.STATES.SUCCESS) {
118
+ const deployResult = await pollDeployStatus(targetAccountId, projectName, Number(deployResp.id), buildIdToDeploy);
119
+ if (deployResult.status === PROJECT_DEPLOY_TEXT.STATES.SUCCESS) {
122
120
  deploySuccess = true;
123
121
  }
124
122
  }
125
123
  catch (e) {
126
- if ((0, index_1.isHubSpotHttpError)(e) && e.status === 404) {
127
- logger_1.uiLogger.error(en_1.commands.project.deploy.errors.projectNotFound(targetAccountId, projectName));
124
+ if (isHubSpotHttpError(e) && e.status === 404) {
125
+ uiLogger.error(commands.project.deploy.errors.projectNotFound(targetAccountId, projectName));
128
126
  }
129
- else if ((0, index_1.isHubSpotHttpError)(e) && e.status === 400) {
127
+ else if (isHubSpotHttpError(e) && e.status === 400) {
130
128
  if (e.data?.message && e.data?.errors) {
131
129
  logDeployErrors(e.data);
132
130
  }
133
131
  else {
134
- logger_1.uiLogger.error(e.message);
132
+ uiLogger.error(e.message);
135
133
  }
136
134
  }
137
135
  else {
138
- (0, index_2.logError)(e, new index_2.ApiErrorContext({
136
+ logError(e, new ApiErrorContext({
139
137
  accountId: targetAccountId,
140
138
  request: 'project deploy',
141
139
  }));
142
140
  }
143
- return process.exit(exitCodes_1.EXIT_CODES.ERROR);
141
+ return process.exit(EXIT_CODES.ERROR);
144
142
  }
145
143
  if (formatOutputAsJson) {
146
- logger_1.uiLogger.json(jsonOutput);
144
+ uiLogger.json(jsonOutput);
147
145
  }
148
146
  if (deploySuccess) {
149
- process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
147
+ process.exit(EXIT_CODES.SUCCESS);
150
148
  }
151
149
  else {
152
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
150
+ process.exit(EXIT_CODES.ERROR);
153
151
  }
154
152
  }
155
153
  function projectDeployBuilder(yargs) {
156
154
  yargs.options({
157
155
  project: {
158
- describe: en_1.commands.project.deploy.options.project,
156
+ describe: commands.project.deploy.options.project,
159
157
  type: 'string',
160
158
  },
161
159
  build: {
162
160
  alias: ['build-id'],
163
- describe: en_1.commands.project.deploy.options.build,
161
+ describe: commands.project.deploy.options.build,
164
162
  type: 'number',
165
163
  },
166
164
  deployLatestBuild: {
167
165
  alias: ['deploy-latest-build'],
168
- describe: en_1.commands.project.deploy.options.deployLatestBuild,
166
+ describe: commands.project.deploy.options.deployLatestBuild,
169
167
  default: false,
170
168
  type: 'boolean',
171
169
  },
172
170
  profile: {
173
171
  alias: ['p'],
174
- describe: en_1.commands.project.deploy.options.profile,
172
+ describe: commands.project.deploy.options.profile,
175
173
  type: 'string',
176
174
  hidden: true,
177
175
  },
178
176
  force: {
179
177
  alias: ['f'],
180
- describe: en_1.commands.project.deploy.options.force,
178
+ describe: commands.project.deploy.options.force,
181
179
  default: false,
182
180
  type: 'boolean',
183
181
  },
@@ -185,15 +183,15 @@ function projectDeployBuilder(yargs) {
185
183
  yargs.conflicts('profile', 'project');
186
184
  yargs.conflicts('profile', 'account');
187
185
  yargs.example([
188
- ['$0 project deploy', en_1.commands.project.deploy.examples.default],
186
+ ['$0 project deploy', commands.project.deploy.examples.default],
189
187
  [
190
188
  '$0 project deploy --project="my-project" --build=5',
191
- en_1.commands.project.deploy.examples.withOptions,
189
+ commands.project.deploy.examples.withOptions,
192
190
  ],
193
191
  ]);
194
192
  return yargs;
195
193
  }
196
- const builder = (0, yargsUtils_1.makeYargsBuilder)(projectDeployBuilder, command, describe, {
194
+ const builder = makeYargsBuilder(projectDeployBuilder, command, describe, {
197
195
  useGlobalOptions: true,
198
196
  useConfigOptions: true,
199
197
  useAccountOptions: true,
@@ -206,4 +204,4 @@ const projectDeployCommand = {
206
204
  builder,
207
205
  handler,
208
206
  };
209
- exports.default = projectDeployCommand;
207
+ export default projectDeployCommand;
@@ -1,6 +1,6 @@
1
1
  import { ArgumentsCamelCase } from 'yargs';
2
- import { ProjectConfig } from '../../../types/Projects';
3
- import { ProjectDevArgs } from '../../../types/Yargs';
2
+ import { ProjectConfig } from '../../../types/Projects.js';
3
+ import { ProjectDevArgs } from '../../../types/Yargs.js';
4
4
  type DeprecatedProjectDevFlowArgs = {
5
5
  args: ArgumentsCamelCase<ProjectDevArgs>;
6
6
  accountId: number;
@@ -1,66 +1,60 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deprecatedProjectDevFlow = deprecatedProjectDevFlow;
7
- const logger_1 = require("@hubspot/local-dev-lib/logger");
8
- const config_1 = require("@hubspot/local-dev-lib/config");
9
- const environment_1 = require("@hubspot/local-dev-lib/environment");
10
- const structure_1 = require("../../../lib/projects/structure");
11
- const Projects_1 = require("../../../types/Projects");
12
- const lang_1 = require("../../../lib/lang");
13
- const exitCodes_1 = require("../../../lib/enums/exitCodes");
14
- const ui_1 = require("../../../lib/ui");
15
- const SpinniesManager_1 = __importDefault(require("../../../lib/ui/SpinniesManager"));
16
- const LocalDevManager_1 = __importDefault(require("../../../lib/projects/localDev/LocalDevManager"));
17
- const helpers_1 = require("../../../lib/projects/localDev/helpers");
18
- const process_1 = require("../../../lib/process");
19
- const accountTypes_1 = require("../../../lib/accountTypes");
20
- const ensureProjectExists_1 = require("../../../lib/projects/ensureProjectExists");
21
- async function deprecatedProjectDevFlow({ args, accountId, projectConfig, projectDir, }) {
1
+ import { logger } from '@hubspot/local-dev-lib/logger';
2
+ import { getAccountConfig, getConfigAccounts, getEnv, } from '@hubspot/local-dev-lib/config';
3
+ import { getValidEnv } from '@hubspot/local-dev-lib/environment';
4
+ import { findProjectComponents, getProjectComponentTypes, } from '../../../lib/projects/structure.js';
5
+ import { ComponentTypes } from '../../../types/Projects.js';
6
+ import { i18n } from '../../../lib/lang.js';
7
+ import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
8
+ import { uiCommandReference } from '../../../lib/ui/index.js';
9
+ import SpinniesManager from '../../../lib/ui/SpinniesManager.js';
10
+ import LocalDevManager from '../../../lib/projects/localDev/LocalDevManager.js';
11
+ import { confirmDefaultAccountIsTarget, suggestRecommendedNestedAccount, checkIfAccountFlagIsSupported, checkIfDefaultAccountIsSupported, createSandboxForLocalDev, createDeveloperTestAccountForLocalDev, createNewProjectForLocalDev, createInitialBuildForNewProject, useExistingDevTestAccount, checkIfParentAccountIsAuthed, hasSandboxes, } from '../../../lib/projects/localDev/helpers.js';
12
+ import { handleExit } from '../../../lib/process.js';
13
+ import { isSandbox, isDeveloperTestAccount, } from '../../../lib/accountTypes.js';
14
+ import { ensureProjectExists } from '../../../lib/projects/ensureProjectExists.js';
15
+ export async function deprecatedProjectDevFlow({ args, accountId, projectConfig, projectDir, }) {
22
16
  const { userProvidedAccount, derivedAccountId } = args;
23
- const env = (0, environment_1.getValidEnv)((0, config_1.getEnv)(derivedAccountId));
24
- const components = await (0, structure_1.findProjectComponents)(projectDir);
17
+ const env = getValidEnv(getEnv(derivedAccountId));
18
+ const components = await findProjectComponents(projectDir);
25
19
  const runnableComponents = components.filter(component => component.runnable);
26
- const componentTypes = (0, structure_1.getProjectComponentTypes)(runnableComponents);
27
- const hasPrivateApps = !!componentTypes[Projects_1.ComponentTypes.PrivateApp];
28
- const hasPublicApps = !!componentTypes[Projects_1.ComponentTypes.PublicApp];
29
- const accountConfig = (0, config_1.getAccountConfig)(accountId);
20
+ const componentTypes = getProjectComponentTypes(runnableComponents);
21
+ const hasPrivateApps = !!componentTypes[ComponentTypes.PrivateApp];
22
+ const hasPublicApps = !!componentTypes[ComponentTypes.PublicApp];
23
+ const accountConfig = getAccountConfig(accountId);
30
24
  if (!accountConfig) {
31
- logger_1.logger.error((0, lang_1.i18n)('commands.project.subcommands.dev.errors.noAccount', {
25
+ logger.error(i18n('commands.project.subcommands.dev.errors.noAccount', {
32
26
  accountId: accountId,
33
- authCommand: (0, ui_1.uiCommandReference)('hs auth'),
27
+ authCommand: uiCommandReference('hs auth'),
34
28
  }));
35
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
29
+ process.exit(EXIT_CODES.ERROR);
36
30
  }
37
31
  if (runnableComponents.length === 0) {
38
- logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.dev.errors.noRunnableComponents`, {
32
+ logger.error(i18n(`commands.project.subcommands.dev.errors.noRunnableComponents`, {
39
33
  projectDir,
40
- command: (0, ui_1.uiCommandReference)('hs project add'),
34
+ command: uiCommandReference('hs project add'),
41
35
  }));
42
- process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
36
+ process.exit(EXIT_CODES.SUCCESS);
43
37
  }
44
38
  else if (hasPrivateApps && hasPublicApps) {
45
- logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.dev.errors.invalidProjectComponents`));
46
- process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
39
+ logger.error(i18n(`commands.project.subcommands.dev.errors.invalidProjectComponents`));
40
+ process.exit(EXIT_CODES.SUCCESS);
47
41
  }
48
- const accounts = (0, config_1.getConfigAccounts)();
42
+ const accounts = getConfigAccounts();
49
43
  if (!accounts) {
50
- logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.dev.errors.noAccountsInConfig`, {
51
- authCommand: (0, ui_1.uiCommandReference)('hs auth'),
44
+ logger.error(i18n(`commands.project.subcommands.dev.errors.noAccountsInConfig`, {
45
+ authCommand: uiCommandReference('hs auth'),
52
46
  }));
53
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
47
+ process.exit(EXIT_CODES.ERROR);
54
48
  }
55
49
  let bypassRecommendedAccountPrompt = false;
56
- if ((0, accountTypes_1.isDeveloperTestAccount)(accountConfig)) {
50
+ if (isDeveloperTestAccount(accountConfig)) {
57
51
  bypassRecommendedAccountPrompt = true;
58
52
  }
59
- else if (!hasPublicApps && (0, accountTypes_1.isSandbox)(accountConfig)) {
53
+ else if (!hasPublicApps && isSandbox(accountConfig)) {
60
54
  bypassRecommendedAccountPrompt = true;
61
55
  }
62
56
  else if (!hasPublicApps) {
63
- const defaultAccountHasSandboxes = await (0, helpers_1.hasSandboxes)(accountConfig);
57
+ const defaultAccountHasSandboxes = await hasSandboxes(accountConfig);
64
58
  bypassRecommendedAccountPrompt = !defaultAccountHasSandboxes;
65
59
  }
66
60
  // targetProjectAccountId and targetTestingAccountId are set to null if --account flag is not provided.
@@ -70,20 +64,20 @@ async function deprecatedProjectDevFlow({ args, accountId, projectConfig, projec
70
64
  let targetTestingAccountId = userProvidedAccount ? derivedAccountId : null;
71
65
  // Check that the default account or flag option is valid for the type of app in this project
72
66
  if (userProvidedAccount) {
73
- (0, helpers_1.checkIfAccountFlagIsSupported)(accountConfig, hasPublicApps);
67
+ checkIfAccountFlagIsSupported(accountConfig, hasPublicApps);
74
68
  if (hasPublicApps) {
75
69
  targetProjectAccountId = accountConfig.parentAccountId || null;
76
70
  }
77
71
  }
78
72
  else {
79
- await (0, helpers_1.checkIfDefaultAccountIsSupported)(accountConfig, hasPublicApps);
73
+ await checkIfDefaultAccountIsSupported(accountConfig, hasPublicApps);
80
74
  }
81
75
  // The user is targeting an account type that we recommend developing on
82
76
  if (!targetProjectAccountId && bypassRecommendedAccountPrompt) {
83
77
  targetTestingAccountId = derivedAccountId;
84
- await (0, helpers_1.confirmDefaultAccountIsTarget)(accountConfig);
78
+ await confirmDefaultAccountIsTarget(accountConfig);
85
79
  if (hasPublicApps) {
86
- (0, helpers_1.checkIfParentAccountIsAuthed)(accountConfig);
80
+ checkIfParentAccountIsAuthed(accountConfig);
87
81
  targetProjectAccountId = accountConfig.parentAccountId || null;
88
82
  }
89
83
  else {
@@ -93,49 +87,49 @@ async function deprecatedProjectDevFlow({ args, accountId, projectConfig, projec
93
87
  let createNewSandbox = false;
94
88
  let createNewDeveloperTestAccount = false;
95
89
  if (!targetProjectAccountId) {
96
- const { targetAccountId, parentAccountId, createNestedAccount, notInConfigAccount, } = await (0, helpers_1.suggestRecommendedNestedAccount)(accounts, accountConfig, hasPublicApps);
90
+ const { targetAccountId, parentAccountId, createNestedAccount, notInConfigAccount, } = await suggestRecommendedNestedAccount(accounts, accountConfig, hasPublicApps);
97
91
  targetProjectAccountId = hasPublicApps
98
92
  ? parentAccountId || null
99
93
  : targetAccountId;
100
94
  targetTestingAccountId = targetAccountId;
101
95
  // Only used for developer test accounts that are not yet in the config
102
96
  if (notInConfigAccount) {
103
- await (0, helpers_1.useExistingDevTestAccount)(env, notInConfigAccount);
97
+ await useExistingDevTestAccount(env, notInConfigAccount);
104
98
  }
105
99
  createNewSandbox = hasPrivateApps && createNestedAccount;
106
100
  createNewDeveloperTestAccount = hasPublicApps && createNestedAccount;
107
101
  }
108
102
  if (createNewSandbox) {
109
- targetProjectAccountId = await (0, helpers_1.createSandboxForLocalDev)(derivedAccountId, accountConfig, env);
103
+ targetProjectAccountId = await createSandboxForLocalDev(derivedAccountId, accountConfig, env);
110
104
  // We will be running our tests against this new sandbox account
111
105
  targetTestingAccountId = targetProjectAccountId;
112
106
  }
113
107
  if (createNewDeveloperTestAccount) {
114
- targetTestingAccountId = await (0, helpers_1.createDeveloperTestAccountForLocalDev)(derivedAccountId, accountConfig, env);
108
+ targetTestingAccountId = await createDeveloperTestAccountForLocalDev(derivedAccountId, accountConfig, env);
115
109
  targetProjectAccountId = derivedAccountId;
116
110
  }
117
111
  if (!targetProjectAccountId || !targetTestingAccountId) {
118
- logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.dev.errors.noAccount`));
119
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
112
+ logger.error(i18n(`commands.project.subcommands.dev.errors.noAccount`));
113
+ process.exit(EXIT_CODES.ERROR);
120
114
  }
121
115
  // eslint-disable-next-line prefer-const
122
- let { projectExists, project } = await (0, ensureProjectExists_1.ensureProjectExists)(targetProjectAccountId, projectConfig.name, {
116
+ let { projectExists, project } = await ensureProjectExists(targetProjectAccountId, projectConfig.name, {
123
117
  allowCreate: false,
124
118
  noLogs: true,
125
119
  withPolling: createNewSandbox,
126
120
  });
127
121
  let deployedBuild;
128
122
  let isGithubLinked = false;
129
- SpinniesManager_1.default.init();
123
+ SpinniesManager.init();
130
124
  if (projectExists && project) {
131
125
  deployedBuild = project.deployedBuild;
132
126
  isGithubLinked = Boolean(project.sourceIntegration && project.sourceIntegration.source === 'GITHUB');
133
127
  }
134
128
  else {
135
- project = await (0, helpers_1.createNewProjectForLocalDev)(projectConfig, targetProjectAccountId, createNewSandbox, hasPublicApps);
136
- deployedBuild = await (0, helpers_1.createInitialBuildForNewProject)(projectConfig, projectDir, targetProjectAccountId);
129
+ project = await createNewProjectForLocalDev(projectConfig, targetProjectAccountId, createNewSandbox, hasPublicApps);
130
+ deployedBuild = await createInitialBuildForNewProject(projectConfig, projectDir, targetProjectAccountId);
137
131
  }
138
- const LocalDev = new LocalDevManager_1.default({
132
+ const LocalDev = new LocalDevManager({
139
133
  runnableComponents,
140
134
  debug: args.debug,
141
135
  deployedBuild,
@@ -148,5 +142,5 @@ async function deprecatedProjectDevFlow({ args, accountId, projectConfig, projec
148
142
  env,
149
143
  });
150
144
  await LocalDev.start();
151
- (0, process_1.handleExit)(({ isSIGHUP }) => LocalDev.stop(!isSIGHUP));
145
+ handleExit(({ isSIGHUP }) => LocalDev.stop(!isSIGHUP));
152
146
  }
@@ -1,5 +1,5 @@
1
1
  import { Argv, CommandModule } from 'yargs';
2
- import { ProjectDevArgs } from '../../../types/Yargs';
2
+ import { ProjectDevArgs } from '../../../types/Yargs.js';
3
3
  export declare const builder: (yargs: Argv) => Promise<Argv<ProjectDevArgs>>;
4
4
  declare const projectDevCommand: CommandModule<unknown, ProjectDevArgs>;
5
5
  export default projectDevCommand;