@hubspot/cli 7.7.21-experimental.0 → 7.7.21-experimental.1
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/api/__tests__/migrate.test.js +29 -27
- package/api/migrate.js +22 -14
- package/bin/cli.js +101 -92
- package/bin/hs +2 -2
- package/bin/hscms +2 -2
- package/bin/silenceErrors.js +2 -1
- package/commands/__tests__/account.test.js +34 -29
- package/commands/__tests__/auth.test.js +16 -11
- package/commands/__tests__/cms.test.js +20 -15
- package/commands/__tests__/config.test.js +19 -14
- package/commands/__tests__/create.test.js +15 -10
- package/commands/__tests__/customObject.test.js +19 -14
- package/commands/__tests__/doctor.test.js +48 -43
- package/commands/__tests__/feedback.test.js +45 -7
- package/commands/__tests__/fetch.test.js +28 -29
- package/commands/__tests__/filemanager.test.js +19 -14
- package/commands/__tests__/function.test.js +21 -16
- package/commands/__tests__/getStarted.test.js +50 -55
- package/commands/__tests__/hubdb.test.js +22 -17
- package/commands/__tests__/init.test.js +17 -12
- package/commands/__tests__/lint.test.js +18 -13
- package/commands/__tests__/list.test.js +23 -18
- package/commands/__tests__/logs.test.js +27 -28
- package/commands/__tests__/mcp.test.js +19 -14
- package/commands/__tests__/mv.test.js +52 -14
- package/commands/__tests__/open.test.js +51 -13
- package/commands/__tests__/project.test.js +49 -44
- package/commands/__tests__/remove.test.js +51 -13
- package/commands/__tests__/sandbox.test.js +19 -14
- package/commands/__tests__/secret.test.js +21 -16
- package/commands/__tests__/testAccount.test.js +21 -16
- package/commands/__tests__/theme.test.js +20 -15
- package/commands/account/__tests__/auth.test.js +16 -11
- package/commands/account/__tests__/clean.test.js +17 -12
- package/commands/account/__tests__/createOverride.test.js +15 -10
- package/commands/account/__tests__/info.test.js +16 -11
- package/commands/account/__tests__/list.test.js +16 -11
- package/commands/account/__tests__/remove.test.js +18 -13
- package/commands/account/__tests__/removeOverride.js +13 -8
- package/commands/account/__tests__/rename.test.js +20 -15
- package/commands/account/__tests__/use.test.js +15 -10
- package/commands/account/auth.d.ts +1 -1
- package/commands/account/auth.js +67 -65
- package/commands/account/clean.d.ts +1 -1
- package/commands/account/clean.js +60 -55
- package/commands/account/createOverride.d.ts +1 -1
- package/commands/account/createOverride.js +57 -52
- package/commands/account/info.d.ts +1 -1
- package/commands/account/info.js +35 -33
- package/commands/account/list.d.ts +1 -1
- package/commands/account/list.js +45 -43
- package/commands/account/remove.d.ts +1 -1
- package/commands/account/remove.js +42 -37
- package/commands/account/removeOverride.d.ts +1 -1
- package/commands/account/removeOverride.js +43 -38
- package/commands/account/rename.d.ts +1 -1
- package/commands/account/rename.js +20 -18
- package/commands/account/use.d.ts +1 -1
- package/commands/account/use.js +31 -29
- package/commands/account.d.ts +1 -1
- package/commands/account.js +28 -23
- package/commands/app/__tests__/install.test.js +52 -0
- package/commands/app/__tests__/migrate.test.js +34 -29
- package/commands/app/install.d.ts +8 -0
- package/commands/app/install.js +127 -0
- package/commands/app/migrate.d.ts +2 -2
- package/commands/app/migrate.js +43 -40
- package/commands/app/secret/__tests__/add.test.js +11 -6
- package/commands/app/secret/__tests__/delete.test.js +11 -6
- package/commands/app/secret/__tests__/list.test.js +11 -6
- package/commands/app/secret/__tests__/update.test.js +11 -6
- package/commands/app/secret/add.d.ts +1 -1
- package/commands/app/secret/add.js +30 -28
- package/commands/app/secret/delete.d.ts +1 -1
- package/commands/app/secret/delete.js +36 -34
- package/commands/app/secret/list.d.ts +1 -1
- package/commands/app/secret/list.js +27 -25
- package/commands/app/secret/update.d.ts +1 -1
- package/commands/app/secret/update.js +34 -32
- package/commands/app/secret.d.ts +1 -1
- package/commands/app/secret.js +17 -12
- package/commands/app.d.ts +1 -1
- package/commands/app.js +16 -6
- package/commands/auth.d.ts +1 -1
- package/commands/auth.js +72 -70
- package/commands/cms/convertFields.d.ts +1 -1
- package/commands/cms/convertFields.js +39 -34
- package/commands/cms/getReactModule.d.ts +1 -1
- package/commands/cms/getReactModule.js +37 -32
- package/commands/cms/lighthouseScore.d.ts +1 -1
- package/commands/cms/lighthouseScore.js +72 -67
- package/commands/cms.d.ts +1 -1
- package/commands/cms.js +16 -11
- package/commands/completion.d.ts +1 -1
- package/commands/completion.js +15 -10
- package/commands/config/migrate.d.ts +1 -1
- package/commands/config/migrate.js +32 -27
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +25 -23
- package/commands/config.d.ts +1 -1
- package/commands/config.js +13 -8
- package/commands/create/api-sample.d.ts +1 -1
- package/commands/create/api-sample.js +33 -28
- package/commands/create/app.d.ts +1 -1
- package/commands/create/app.js +5 -3
- package/commands/create/function.d.ts +1 -1
- package/commands/create/function.js +11 -9
- package/commands/create/index.d.ts +1 -1
- package/commands/create/index.js +24 -19
- package/commands/create/module.d.ts +1 -1
- package/commands/create/module.js +14 -12
- package/commands/create/react-app.d.ts +1 -1
- package/commands/create/react-app.js +5 -3
- package/commands/create/template.d.ts +1 -1
- package/commands/create/template.js +14 -12
- package/commands/create/vue-app.d.ts +1 -1
- package/commands/create/vue-app.js +5 -3
- package/commands/create/webpack-serverless.d.ts +1 -1
- package/commands/create/webpack-serverless.js +5 -3
- package/commands/create/website-theme.d.ts +1 -1
- package/commands/create/website-theme.js +7 -5
- package/commands/create.d.ts +2 -2
- package/commands/create.js +35 -30
- package/commands/customObject/__tests__/create.test.js +18 -13
- package/commands/customObject/__tests__/schema.test.js +23 -18
- package/commands/customObject/create.d.ts +1 -1
- package/commands/customObject/create.js +30 -28
- package/commands/customObject/schema/__tests__/create.test.js +18 -13
- package/commands/customObject/schema/__tests__/delete.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch-all.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch.test.js +18 -13
- package/commands/customObject/schema/__tests__/list.test.js +18 -13
- package/commands/customObject/schema/__tests__/update.test.js +18 -13
- package/commands/customObject/schema/create.d.ts +1 -1
- package/commands/customObject/schema/create.js +30 -28
- package/commands/customObject/schema/delete.d.ts +1 -1
- package/commands/customObject/schema/delete.js +26 -24
- package/commands/customObject/schema/fetch-all.d.ts +1 -1
- package/commands/customObject/schema/fetch-all.js +24 -22
- package/commands/customObject/schema/fetch.d.ts +1 -1
- package/commands/customObject/schema/fetch.js +26 -24
- package/commands/customObject/schema/list.d.ts +1 -1
- package/commands/customObject/schema/list.js +15 -13
- package/commands/customObject/schema/update.d.ts +1 -1
- package/commands/customObject/schema/update.js +34 -32
- package/commands/customObject/schema.d.ts +1 -1
- package/commands/customObject/schema.js +22 -17
- package/commands/customObject.d.ts +1 -1
- package/commands/customObject.js +18 -13
- package/commands/doctor.d.ts +1 -1
- package/commands/doctor.js +33 -28
- package/commands/feedback.d.ts +1 -1
- package/commands/feedback.js +24 -19
- package/commands/fetch.d.ts +1 -1
- package/commands/fetch.js +30 -28
- package/commands/filemanager/__tests__/fetch.test.js +22 -17
- package/commands/filemanager/__tests__/upload.test.js +20 -15
- package/commands/filemanager/fetch.d.ts +1 -1
- package/commands/filemanager/fetch.js +25 -23
- package/commands/filemanager/upload.d.ts +1 -1
- package/commands/filemanager/upload.js +44 -39
- package/commands/filemanager.d.ts +1 -1
- package/commands/filemanager.js +13 -8
- package/commands/function/deploy.d.ts +1 -1
- package/commands/function/deploy.js +40 -35
- package/commands/function/list.d.ts +1 -1
- package/commands/function/list.js +29 -24
- package/commands/function/server.d.ts +1 -1
- package/commands/function/server.js +17 -15
- package/commands/function.d.ts +1 -1
- package/commands/function.js +18 -12
- package/commands/getStarted.d.ts +1 -1
- package/commands/getStarted.js +131 -140
- package/commands/hubdb/__tests__/clear.test.js +18 -13
- package/commands/hubdb/__tests__/create.test.js +18 -13
- package/commands/hubdb/__tests__/delete.test.js +18 -13
- package/commands/hubdb/__tests__/fetch.test.js +18 -13
- package/commands/hubdb/__tests__/list.test.js +28 -23
- package/commands/hubdb/clear.d.ts +1 -1
- package/commands/hubdb/clear.js +22 -20
- package/commands/hubdb/create.d.ts +1 -1
- package/commands/hubdb/create.js +35 -30
- package/commands/hubdb/delete.d.ts +1 -1
- package/commands/hubdb/delete.js +26 -24
- package/commands/hubdb/fetch.d.ts +1 -1
- package/commands/hubdb/fetch.js +19 -17
- package/commands/hubdb/list.d.ts +1 -1
- package/commands/hubdb/list.js +35 -33
- package/commands/hubdb.d.ts +1 -1
- package/commands/hubdb.js +24 -18
- package/commands/init.d.ts +1 -1
- package/commands/init.js +88 -83
- package/commands/lint.d.ts +1 -1
- package/commands/lint.js +26 -24
- package/commands/list.d.ts +1 -1
- package/commands/list.js +37 -32
- package/commands/logs.d.ts +1 -1
- package/commands/logs.js +37 -35
- package/commands/mcp/__tests__/setup.test.js +12 -7
- package/commands/mcp/__tests__/start.test.js +12 -7
- package/commands/mcp/setup.d.ts +1 -1
- package/commands/mcp/setup.js +20 -17
- package/commands/mcp/start.d.ts +5 -2
- package/commands/mcp/start.js +41 -31
- package/commands/mcp.d.ts +1 -1
- package/commands/mcp.js +12 -7
- package/commands/module/marketplace-validate.d.ts +1 -1
- package/commands/module/marketplace-validate.js +26 -21
- package/commands/module.d.ts +1 -1
- package/commands/module.js +13 -7
- package/commands/mv.d.ts +1 -1
- package/commands/mv.js +22 -20
- package/commands/open.d.ts +1 -1
- package/commands/open.js +21 -19
- package/commands/project/__tests__/add.test.js +15 -10
- package/commands/project/__tests__/create.test.js +19 -14
- package/commands/project/__tests__/deploy.test.js +143 -103
- package/commands/project/__tests__/devUnifiedFlow.test.js +157 -148
- package/commands/project/__tests__/download.test.js +19 -14
- package/commands/project/__tests__/installDeps.test.js +70 -32
- package/commands/project/__tests__/listBuilds.test.js +19 -14
- package/commands/project/__tests__/logs.test.js +94 -56
- package/commands/project/__tests__/migrate.test.js +30 -25
- package/commands/project/__tests__/migrateApp.test.js +22 -17
- package/commands/project/__tests__/open.test.js +21 -16
- package/commands/project/__tests__/profile.test.js +19 -14
- package/commands/project/__tests__/upload.test.js +23 -18
- package/commands/project/__tests__/watch.test.js +19 -14
- package/commands/project/add.d.ts +1 -1
- package/commands/project/add.js +36 -34
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +72 -67
- package/commands/project/create.d.ts +2 -2
- package/commands/project/create.js +68 -63
- package/commands/project/deploy.d.ts +3 -2
- package/commands/project/deploy.js +102 -91
- package/commands/project/dev/deprecatedFlow.d.ts +2 -2
- package/commands/project/dev/deprecatedFlow.js +58 -52
- package/commands/project/dev/index.d.ts +1 -1
- package/commands/project/dev/index.js +47 -44
- package/commands/project/dev/unifiedFlow.d.ts +3 -3
- package/commands/project/dev/unifiedFlow.js +74 -67
- package/commands/project/download.d.ts +1 -1
- package/commands/project/download.js +40 -35
- package/commands/project/installDeps.d.ts +1 -1
- package/commands/project/installDeps.js +34 -29
- package/commands/project/listBuilds.d.ts +1 -1
- package/commands/project/listBuilds.js +45 -40
- package/commands/project/logs.d.ts +1 -1
- package/commands/project/logs.js +54 -52
- package/commands/project/migrate.d.ts +1 -1
- package/commands/project/migrate.js +26 -24
- package/commands/project/migrateApp.d.ts +2 -2
- package/commands/project/migrateApp.js +20 -18
- package/commands/project/open.d.ts +1 -1
- package/commands/project/open.js +30 -25
- package/commands/project/profile/add.d.ts +1 -1
- package/commands/project/profile/add.js +73 -68
- package/commands/project/profile/delete.d.ts +1 -1
- package/commands/project/profile/delete.js +56 -51
- package/commands/project/profile.d.ts +1 -1
- package/commands/project/profile.js +14 -9
- package/commands/project/upload.d.ts +1 -1
- package/commands/project/upload.js +55 -50
- package/commands/project/validate.d.ts +1 -1
- package/commands/project/validate.js +40 -35
- package/commands/project/watch.d.ts +1 -1
- package/commands/project/watch.js +61 -59
- package/commands/project.d.ts +1 -1
- package/commands/project.js +43 -38
- package/commands/remove.d.ts +1 -1
- package/commands/remove.js +17 -15
- package/commands/sandbox/__tests__/create.test.js +20 -15
- package/commands/sandbox/__tests__/delete.test.js +20 -15
- package/commands/sandbox/create.d.ts +1 -1
- package/commands/sandbox/create.js +69 -67
- package/commands/sandbox/delete.d.ts +1 -1
- package/commands/sandbox/delete.js +96 -94
- package/commands/sandbox.d.ts +1 -1
- package/commands/sandbox.js +14 -9
- package/commands/secret/__tests__/addSecret.test.js +18 -13
- package/commands/secret/__tests__/deleteSecret.test.js +18 -13
- package/commands/secret/__tests__/listSecret.test.js +18 -13
- package/commands/secret/__tests__/updateSecret.test.js +18 -13
- package/commands/secret/addSecret.d.ts +1 -1
- package/commands/secret/addSecret.js +28 -26
- package/commands/secret/deleteSecret.d.ts +1 -1
- package/commands/secret/deleteSecret.js +29 -27
- package/commands/secret/listSecret.d.ts +1 -1
- package/commands/secret/listSecret.js +21 -19
- package/commands/secret/updateSecret.d.ts +1 -1
- package/commands/secret/updateSecret.js +27 -25
- package/commands/secret.d.ts +1 -1
- package/commands/secret.js +18 -13
- package/commands/testAccount/__tests__/create.test.js +22 -17
- package/commands/testAccount/__tests__/createConfig.test.js +11 -9
- package/commands/testAccount/__tests__/delete.test.js +20 -15
- package/commands/testAccount/create.d.ts +1 -1
- package/commands/testAccount/create.js +57 -62
- package/commands/testAccount/createConfig.d.ts +1 -3
- package/commands/testAccount/createConfig.js +47 -43
- package/commands/testAccount/delete.d.ts +1 -1
- package/commands/testAccount/delete.js +19 -17
- package/commands/testAccount.d.ts +1 -1
- package/commands/testAccount.js +15 -10
- package/commands/theme/__tests__/generate-selectors.test.js +12 -7
- package/commands/theme/__tests__/marketplace-validate.test.js +19 -14
- package/commands/theme/__tests__/preview.test.js +17 -12
- package/commands/theme/generate-selectors.d.ts +1 -1
- package/commands/theme/generate-selectors.js +28 -23
- package/commands/theme/marketplace-validate.d.ts +1 -1
- package/commands/theme/marketplace-validate.js +24 -19
- package/commands/theme/preview.d.ts +1 -1
- package/commands/theme/preview.js +65 -60
- package/commands/theme.d.ts +1 -1
- package/commands/theme.js +16 -11
- package/commands/upload.d.ts +1 -1
- package/commands/upload.js +82 -77
- package/commands/watch.d.ts +1 -1
- package/commands/watch.js +51 -45
- package/lang/en.d.ts +62 -23
- package/lang/en.js +434 -389
- package/lang/en.lyaml +0 -26
- package/lib/__tests__/accountTypes.test.js +22 -20
- package/lib/__tests__/buildAccount.test.js +90 -27
- package/lib/__tests__/commonOpts.test.js +22 -20
- package/lib/__tests__/dependencyManagement.test.js +51 -46
- package/lib/__tests__/developerTestAccounts.test.js +62 -27
- package/lib/__tests__/hasFeature.test.js +8 -6
- package/lib/__tests__/npm.test.js +20 -15
- package/lib/__tests__/oauth.test.js +28 -23
- package/lib/__tests__/parsing.test.js +20 -18
- package/lib/__tests__/polling.test.js +26 -24
- package/lib/__tests__/process.test.js +19 -14
- package/lib/__tests__/projectProfiles.test.js +39 -34
- package/lib/__tests__/sandboxSync.test.js +35 -30
- package/lib/__tests__/sandboxes.test.js +31 -29
- package/lib/__tests__/serverlessLogs.test.js +13 -8
- package/lib/__tests__/usageTracking.test.js +42 -47
- package/lib/__tests__/validation.test.js +20 -18
- package/lib/__tests__/yargsUtils.test.js +41 -6
- package/lib/accountTypes.js +34 -24
- package/lib/app/__tests__/migrate.test.js +99 -94
- package/lib/app/__tests__/migrate_legacy.test.js +31 -29
- package/lib/app/migrate.d.ts +3 -3
- package/lib/app/migrate.js +145 -127
- package/lib/app/migrate_legacy.d.ts +1 -1
- package/lib/app/migrate_legacy.js +78 -72
- package/lib/app/urls.js +9 -5
- package/lib/buildAccount.d.ts +8 -2
- package/lib/buildAccount.js +119 -61
- package/lib/commonOpts.d.ts +1 -1
- package/lib/commonOpts.js +59 -42
- package/lib/configMigrate.js +38 -34
- package/lib/configOptions.js +40 -34
- package/lib/constants.js +34 -31
- package/lib/customObject.js +6 -2
- package/lib/dependencyManagement.js +45 -37
- package/lib/developerTestAccounts.d.ts +1 -1
- package/lib/developerTestAccounts.js +39 -34
- package/lib/doctor/Diagnosis.d.ts +1 -1
- package/lib/doctor/Diagnosis.js +29 -25
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +37 -30
- package/lib/doctor/Doctor.d.ts +1 -1
- package/lib/doctor/Doctor.js +101 -94
- package/lib/doctor/__tests__/Diagnosis.test.js +14 -9
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +34 -29
- package/lib/doctor/__tests__/Doctor.test.js +26 -24
- package/lib/enums/exitCodes.js +4 -1
- package/lib/errorHandlers/index.js +41 -32
- package/lib/errorHandlers/suppressError.d.ts +1 -1
- package/lib/errorHandlers/suppressError.js +31 -28
- package/lib/filesystem.js +15 -8
- package/lib/generateSelectors.js +29 -18
- package/lib/hasFeature.d.ts +1 -1
- package/lib/hasFeature.js +6 -3
- package/lib/interpolation.js +18 -11
- package/lib/lang.d.ts +1 -1
- package/lib/lang.js +27 -22
- package/lib/links.js +24 -16
- package/lib/marketplaceValidate.js +39 -29
- package/lib/mcp/setup.js +105 -72
- package/lib/middleware/__test__/configMiddleware.test.js +55 -20
- package/lib/middleware/__test__/gitMiddleware.test.js +42 -7
- package/lib/middleware/__test__/notificationsMiddleware.test.js +4 -2
- package/lib/middleware/__test__/requestMiddleware.test.js +11 -6
- package/lib/middleware/__test__/utils.test.js +11 -9
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +44 -9
- package/lib/middleware/autoUpdateMiddleware.js +40 -33
- package/lib/middleware/configMiddleware.js +42 -36
- package/lib/middleware/fireAlarmMiddleware.js +18 -12
- package/lib/middleware/gitMiddleware.js +8 -5
- package/lib/middleware/notificationsMiddleware.js +23 -16
- package/lib/middleware/requestMiddleware.js +10 -4
- package/lib/middleware/utils.js +4 -1
- package/lib/middleware/yargsChecksMiddleware.js +13 -10
- package/lib/npm.js +23 -14
- package/lib/oauth.js +35 -29
- package/lib/parsing.js +6 -3
- package/lib/polling.js +15 -11
- package/lib/process.js +19 -11
- package/lib/projectProfiles.d.ts +2 -2
- package/lib/projectProfiles.js +42 -32
- package/lib/projects/ProjectLogsManager.js +21 -18
- package/lib/projects/__tests__/AppDevModeInterface.test.js +145 -140
- package/lib/projects/__tests__/LocalDevProcess.test.js +73 -68
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +37 -32
- package/lib/projects/__tests__/ProjectLogsManager.test.js +58 -56
- package/lib/projects/__tests__/buildAndDeploy.test.js +9 -7
- package/lib/projects/__tests__/components.test.js +14 -9
- package/lib/projects/__tests__/projects.test.js +40 -35
- package/lib/projects/__tests__/structure.test.js +81 -43
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +28 -26
- package/lib/projects/add/__tests__/v3AddComponent.test.js +30 -25
- package/lib/projects/add/legacyAddComponent.d.ts +1 -1
- package/lib/projects/add/legacyAddComponent.js +30 -24
- package/lib/projects/add/v3AddComponent.d.ts +1 -1
- package/lib/projects/add/v3AddComponent.js +42 -36
- package/lib/projects/buildAndDeploy.d.ts +1 -1
- package/lib/projects/buildAndDeploy.js +97 -88
- package/lib/projects/components.js +25 -19
- package/lib/projects/config.d.ts +1 -1
- package/lib/projects/config.js +41 -32
- package/lib/projects/create/__tests__/legacy.test.js +57 -22
- package/lib/projects/create/__tests__/v3.test.js +7 -5
- package/lib/projects/create/index.d.ts +3 -3
- package/lib/projects/create/index.js +22 -19
- package/lib/projects/create/legacy.d.ts +1 -1
- package/lib/projects/create/legacy.js +31 -25
- package/lib/projects/create/v3.d.ts +3 -3
- package/lib/projects/create/v3.js +59 -49
- package/lib/projects/ensureProjectExists.js +37 -31
- package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -3
- package/lib/projects/localDev/AppDevModeInterface.js +60 -58
- package/lib/projects/localDev/DevServerManager.d.ts +1 -1
- package/lib/projects/localDev/DevServerManager.js +24 -24
- package/lib/projects/localDev/DevServerManagerV2.d.ts +2 -2
- package/lib/projects/localDev/DevServerManagerV2.js +20 -17
- package/lib/projects/localDev/LocalDevLogger.d.ts +1 -1
- package/lib/projects/localDev/LocalDevLogger.js +64 -59
- package/lib/projects/localDev/LocalDevManager.d.ts +1 -1
- package/lib/projects/localDev/LocalDevManager.js +111 -106
- package/lib/projects/localDev/LocalDevProcess.d.ts +4 -4
- package/lib/projects/localDev/LocalDevProcess.js +30 -25
- package/lib/projects/localDev/LocalDevState.d.ts +3 -3
- package/lib/projects/localDev/LocalDevState.js +5 -3
- package/lib/projects/localDev/LocalDevWatcher.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWatcher.js +11 -6
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWebsocketServer.js +27 -25
- package/lib/projects/localDev/helpers.d.ts +4 -4
- package/lib/projects/localDev/helpers.js +174 -156
- package/lib/projects/structure.d.ts +4 -4
- package/lib/projects/structure.js +78 -32
- package/lib/projects/ui.js +13 -10
- package/lib/projects/upload.d.ts +3 -2
- package/lib/projects/upload.js +65 -55
- package/lib/projects/urls.js +24 -14
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +54 -48
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +11 -9
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +16 -11
- package/lib/prompts/accountNamePrompt.d.ts +1 -1
- package/lib/prompts/accountNamePrompt.js +31 -26
- package/lib/prompts/accountsPrompt.js +15 -12
- package/lib/prompts/cmsFieldPrompt.js +19 -13
- package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
- package/lib/prompts/createApiSamplePrompt.js +12 -9
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +11 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +88 -43
- package/lib/prompts/createFunctionPrompt.js +20 -17
- package/lib/prompts/createModulePrompt.js +15 -12
- package/lib/prompts/createTemplatePrompt.js +8 -5
- package/lib/prompts/downloadProjectPrompt.js +20 -17
- package/lib/prompts/installAppPrompt.js +26 -19
- package/lib/prompts/personalAccessKeyPrompt.d.ts +2 -2
- package/lib/prompts/personalAccessKeyPrompt.js +47 -40
- package/lib/prompts/previewPrompt.js +22 -15
- package/lib/prompts/projectAddPrompt.d.ts +1 -1
- package/lib/prompts/projectAddPrompt.js +18 -14
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +54 -48
- package/lib/prompts/projectNameAndDestPrompt.d.ts +1 -1
- package/lib/prompts/projectNameAndDestPrompt.js +29 -22
- package/lib/prompts/projectNamePrompt.js +14 -11
- package/lib/prompts/projectsLogsPrompt.js +8 -5
- package/lib/prompts/promptUtils.d.ts +1 -1
- package/lib/prompts/promptUtils.js +87 -70
- package/lib/prompts/sandboxesPrompt.d.ts +1 -1
- package/lib/prompts/sandboxesPrompt.js +30 -26
- package/lib/prompts/secretPrompt.js +15 -10
- package/lib/prompts/selectAppPrompt.js +14 -11
- package/lib/prompts/selectHubDBTablePrompt.js +30 -24
- package/lib/prompts/selectProjectTemplatePrompt.d.ts +1 -1
- package/lib/prompts/selectProjectTemplatePrompt.js +13 -10
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +25 -22
- package/lib/prompts/setAsDefaultAccountPrompt.js +16 -13
- package/lib/prompts/uploadPrompt.js +17 -11
- package/lib/sandboxSync.d.ts +1 -1
- package/lib/sandboxSync.js +65 -58
- package/lib/sandboxes.d.ts +1 -1
- package/lib/sandboxes.js +76 -68
- package/lib/schema.js +23 -12
- package/lib/serverlessLogs.js +52 -45
- package/lib/testUtils.js +8 -4
- package/lib/ui/SpinniesManager.d.ts +1 -1
- package/lib/ui/SpinniesManager.js +34 -29
- package/lib/ui/boxen.js +14 -11
- package/lib/ui/git.js +20 -14
- package/lib/ui/index.js +74 -56
- package/lib/ui/logger.js +13 -10
- package/lib/ui/serverlessFunctionLogs.js +20 -14
- package/lib/ui/spinniesUtils.js +39 -24
- package/lib/ui/supportHyperlinks.js +6 -3
- package/lib/ui/supportsColor.js +17 -11
- package/lib/ui/table.js +13 -6
- package/lib/upload.js +21 -15
- package/lib/usageTracking.d.ts +11 -0
- package/lib/usageTracking.js +95 -95
- package/lib/utils/hasFlag.js +8 -2
- package/lib/validation.js +87 -48
- package/lib/yargsUtils.d.ts +1 -1
- package/lib/yargsUtils.js +16 -13
- package/mcp-server/server.js +8 -6
- package/mcp-server/tools/index.js +16 -13
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +1 -1
- package/mcp-server/tools/project/AddFeatureToProject.js +41 -34
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
- package/mcp-server/tools/project/CreateProjectTool.js +52 -45
- package/mcp-server/tools/project/DeployProject.d.ts +1 -1
- package/mcp-server/tools/project/DeployProject.js +24 -17
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +27 -20
- package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +21 -11
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.js +19 -12
- package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +15 -12
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +16 -13
- package/mcp-server/tools/project/__tests__/DeployProject.test.js +9 -6
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +7 -4
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +7 -4
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +7 -4
- package/mcp-server/tools/project/constants.js +9 -3
- package/mcp-server/types.js +5 -1
- package/mcp-server/utils/__tests__/command.test.js +11 -9
- package/mcp-server/utils/__tests__/project.test.js +26 -18
- package/mcp-server/utils/command.d.ts +1 -1
- package/mcp-server/utils/command.js +11 -4
- package/mcp-server/utils/content.d.ts +1 -1
- package/mcp-server/utils/content.js +6 -2
- package/mcp-server/utils/project.js +17 -8
- package/mcp-server/utils/toolUsageTracking.d.ts +1 -0
- package/mcp-server/utils/toolUsageTracking.js +25 -0
- package/package.json +13 -17
- package/types/{cms.d.ts → Cms.d.ts} +1 -1
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +4 -4
- package/types/LocalDev.js +2 -1
- package/types/ProjectComponents.d.ts +2 -2
- package/types/ProjectComponents.js +2 -1
- package/types/Projects.d.ts +1 -1
- package/types/Projects.js +5 -2
- package/types/Prompts.js +2 -1
- package/types/Sandboxes.js +2 -0
- package/types/Yargs.js +2 -1
- package/types/sandboxes.js +0 -1
- /package/{types/cms.js → commands/app/__tests__/install.test.d.ts} +0 -0
- /package/types/{sandboxes.d.ts → Sandboxes.d.ts} +0 -0
package/lib/lang.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
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.MISSING_LANGUAGE_DATA_PREFIX = void 0;
|
|
7
|
+
exports.i18n = i18n;
|
|
8
|
+
exports.setLangData = setLangData;
|
|
9
|
+
const util_1 = __importDefault(require("util"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
12
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
13
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
14
|
+
const interpolation_1 = require("./interpolation");
|
|
15
|
+
exports.MISSING_LANGUAGE_DATA_PREFIX = '[Missing language data]';
|
|
11
16
|
let locale;
|
|
12
17
|
let languageObj;
|
|
13
18
|
function loadLanguageFromYaml() {
|
|
@@ -17,20 +22,20 @@ function loadLanguageFromYaml() {
|
|
|
17
22
|
const nodeLocale = Intl.DateTimeFormat()
|
|
18
23
|
.resolvedOptions()
|
|
19
24
|
.locale.split('-')[0];
|
|
20
|
-
const languageFilePath =
|
|
21
|
-
const languageFileExists =
|
|
25
|
+
const languageFilePath = path_1.default.join(__dirname, `../lang/${nodeLocale}.lyaml`);
|
|
26
|
+
const languageFileExists = fs_extra_1.default.existsSync(languageFilePath);
|
|
22
27
|
// Fall back to using the default language file
|
|
23
28
|
locale = languageFileExists ? nodeLocale : 'en';
|
|
24
|
-
languageObj =
|
|
25
|
-
logger.debug('Loaded language data: ',
|
|
29
|
+
languageObj = js_yaml_1.default.load(fs_extra_1.default.readFileSync(path_1.default.join(__dirname, `../lang/${locale}.lyaml`), 'utf8'));
|
|
30
|
+
logger_1.logger.debug('Loaded language data: ', util_1.default.inspect(languageObj, true, 999, true));
|
|
26
31
|
}
|
|
27
32
|
catch (e) {
|
|
28
|
-
logger.error('Error loading language data: ', e);
|
|
33
|
+
logger_1.logger.error('Error loading language data: ', e);
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
function getTextValue(lookupDotNotation) {
|
|
32
37
|
const lookupProps = [locale, ...lookupDotNotation.split('.')];
|
|
33
|
-
const missingTextData = `${MISSING_LANGUAGE_DATA_PREFIX}: ${lookupProps.join('.')}`;
|
|
38
|
+
const missingTextData = `${exports.MISSING_LANGUAGE_DATA_PREFIX}: ${lookupProps.join('.')}`;
|
|
34
39
|
let textValue = languageObj;
|
|
35
40
|
let previouslyCheckedProp = lookupProps[0];
|
|
36
41
|
try {
|
|
@@ -42,8 +47,8 @@ function getTextValue(lookupDotNotation) {
|
|
|
42
47
|
});
|
|
43
48
|
}
|
|
44
49
|
catch (e) {
|
|
45
|
-
logger.debug(`Unable to access language property: ${lookupProps.join('.')}. Failed to access prop "${previouslyCheckedProp}".`);
|
|
46
|
-
logger.error('Unable to access language property.');
|
|
50
|
+
logger_1.logger.debug(`Unable to access language property: ${lookupProps.join('.')}. Failed to access prop "${previouslyCheckedProp}".`);
|
|
51
|
+
logger_1.logger.error('Unable to access language property.');
|
|
47
52
|
return missingTextData;
|
|
48
53
|
}
|
|
49
54
|
if (!textValue) {
|
|
@@ -54,7 +59,7 @@ function getTextValue(lookupDotNotation) {
|
|
|
54
59
|
}
|
|
55
60
|
return textValue;
|
|
56
61
|
}
|
|
57
|
-
|
|
62
|
+
function i18n(lookupDotNotation, options = {}) {
|
|
58
63
|
if (!languageObj) {
|
|
59
64
|
loadLanguageFromYaml();
|
|
60
65
|
}
|
|
@@ -62,10 +67,10 @@ export function i18n(lookupDotNotation, options = {}) {
|
|
|
62
67
|
throw new Error(`i18n must be passed a string value for lookupDotNotation, received ${typeof lookupDotNotation}`);
|
|
63
68
|
}
|
|
64
69
|
const textValue = getTextValue(lookupDotNotation);
|
|
65
|
-
const shouldInterpolate = !textValue.startsWith(MISSING_LANGUAGE_DATA_PREFIX);
|
|
66
|
-
return shouldInterpolate ? interpolate(textValue, options) : textValue;
|
|
70
|
+
const shouldInterpolate = !textValue.startsWith(exports.MISSING_LANGUAGE_DATA_PREFIX);
|
|
71
|
+
return shouldInterpolate ? (0, interpolation_1.interpolate)(textValue, options) : textValue;
|
|
67
72
|
}
|
|
68
|
-
|
|
73
|
+
function setLangData(newLocale, newLangObj) {
|
|
69
74
|
locale = newLocale;
|
|
70
75
|
languageObj = newLangObj;
|
|
71
76
|
}
|
package/lib/links.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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.getSiteLinksAsArray = getSiteLinksAsArray;
|
|
7
|
+
exports.logSiteLinks = logSiteLinks;
|
|
8
|
+
exports.openLink = openLink;
|
|
9
|
+
const open_1 = __importDefault(require("open"));
|
|
10
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
11
|
+
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
12
|
+
const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
13
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
14
|
+
const table_1 = require("./ui/table");
|
|
7
15
|
const SITE_LINKS = {
|
|
8
16
|
APPS_MARKETPLACE: {
|
|
9
17
|
shortcut: 'apps-marketplace',
|
|
@@ -74,28 +82,28 @@ const SITE_LINKS = {
|
|
|
74
82
|
getUrl: (accountId, baseUrl) => `${baseUrl}/website/${accountId}/pages/site`,
|
|
75
83
|
},
|
|
76
84
|
};
|
|
77
|
-
|
|
78
|
-
const baseUrl = getHubSpotWebsiteOrigin(getEnv() === 'qa' ? ENVIRONMENTS.QA : ENVIRONMENTS.PROD);
|
|
85
|
+
function getSiteLinksAsArray(accountId) {
|
|
86
|
+
const baseUrl = (0, urls_1.getHubSpotWebsiteOrigin)((0, config_1.getEnv)() === 'qa' ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD);
|
|
79
87
|
return Object.values(SITE_LINKS)
|
|
80
88
|
.sort((a, b) => (a.shortcut < b.shortcut ? -1 : 1))
|
|
81
89
|
.map(l => ({ ...l, url: l.getUrl(accountId, baseUrl) }));
|
|
82
90
|
}
|
|
83
|
-
|
|
91
|
+
function logSiteLinks(accountId) {
|
|
84
92
|
const linksAsArray = getSiteLinksAsArray(accountId).map(l => [
|
|
85
93
|
`${l.shortcut}${l.alias ? ` [alias: ${l.alias}]` : ''}`,
|
|
86
94
|
'=>',
|
|
87
95
|
l.url,
|
|
88
96
|
]);
|
|
89
|
-
linksAsArray.unshift(getTableHeader(['Shortcut', '', 'Url']));
|
|
90
|
-
logger.log(getTableContents(linksAsArray));
|
|
97
|
+
linksAsArray.unshift((0, table_1.getTableHeader)(['Shortcut', '', 'Url']));
|
|
98
|
+
logger_1.logger.log((0, table_1.getTableContents)(linksAsArray));
|
|
91
99
|
}
|
|
92
|
-
|
|
100
|
+
function openLink(accountId, shortcut) {
|
|
93
101
|
const match = Object.values(SITE_LINKS).find(l => l.shortcut === shortcut || (l.alias && l.alias === shortcut));
|
|
94
102
|
if (!match) {
|
|
95
|
-
logger.error(`We couldn't find a shortcut matching ${shortcut}. Type 'hs open list' to see a list of available shortcuts`);
|
|
103
|
+
logger_1.logger.error(`We couldn't find a shortcut matching ${shortcut}. Type 'hs open list' to see a list of available shortcuts`);
|
|
96
104
|
return;
|
|
97
105
|
}
|
|
98
|
-
const baseUrl = getHubSpotWebsiteOrigin(getEnv() === 'qa' ? ENVIRONMENTS.QA : ENVIRONMENTS.PROD);
|
|
99
|
-
|
|
100
|
-
logger.success(`We opened ${match.getUrl(accountId, baseUrl)} in your browser`);
|
|
106
|
+
const baseUrl = (0, urls_1.getHubSpotWebsiteOrigin)((0, config_1.getEnv)() === 'qa' ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD);
|
|
107
|
+
(0, open_1.default)(match.getUrl(accountId, baseUrl), { url: true });
|
|
108
|
+
logger_1.logger.success(`We opened ${match.getUrl(accountId, baseUrl)} in your browser`);
|
|
101
109
|
}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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.kickOffValidation = kickOffValidation;
|
|
7
|
+
exports.pollForValidationFinish = pollForValidationFinish;
|
|
8
|
+
exports.fetchValidationResults = fetchValidationResults;
|
|
9
|
+
exports.processValidationErrors = processValidationErrors;
|
|
10
|
+
exports.displayValidationResults = displayValidationResults;
|
|
11
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
12
|
+
const marketplaceValidation_1 = require("@hubspot/local-dev-lib/api/marketplaceValidation");
|
|
13
|
+
const logger_1 = require("./ui/logger");
|
|
14
|
+
const exitCodes_1 = require("./enums/exitCodes");
|
|
5
15
|
const SLEEP_TIME = 2000;
|
|
6
|
-
|
|
16
|
+
async function kickOffValidation(accountId, assetType, src) {
|
|
7
17
|
const requestGroup = 'EXTERNAL_DEVELOPER';
|
|
8
18
|
try {
|
|
9
|
-
const { data: requestResult } = await requestValidation(accountId, {
|
|
19
|
+
const { data: requestResult } = await (0, marketplaceValidation_1.requestValidation)(accountId, {
|
|
10
20
|
path: src,
|
|
11
21
|
assetType,
|
|
12
22
|
requestGroup,
|
|
@@ -14,14 +24,14 @@ export async function kickOffValidation(accountId, assetType, src) {
|
|
|
14
24
|
return requestResult;
|
|
15
25
|
}
|
|
16
26
|
catch (err) {
|
|
17
|
-
uiLogger.debug(err);
|
|
18
|
-
process.exit(EXIT_CODES.ERROR);
|
|
27
|
+
logger_1.uiLogger.debug(err);
|
|
28
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
19
29
|
}
|
|
20
30
|
}
|
|
21
|
-
|
|
31
|
+
async function pollForValidationFinish(accountId, validationId) {
|
|
22
32
|
try {
|
|
23
33
|
const checkValidationStatus = async () => {
|
|
24
|
-
const { data: validationStatus } = await getValidationStatus(accountId, {
|
|
34
|
+
const { data: validationStatus } = await (0, marketplaceValidation_1.getValidationStatus)(accountId, {
|
|
25
35
|
validationId,
|
|
26
36
|
});
|
|
27
37
|
if (validationStatus === 'REQUESTED') {
|
|
@@ -32,42 +42,42 @@ export async function pollForValidationFinish(accountId, validationId) {
|
|
|
32
42
|
await checkValidationStatus();
|
|
33
43
|
}
|
|
34
44
|
catch (err) {
|
|
35
|
-
uiLogger.debug(err);
|
|
36
|
-
process.exit(EXIT_CODES.ERROR);
|
|
45
|
+
logger_1.uiLogger.debug(err);
|
|
46
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
|
-
|
|
49
|
+
async function fetchValidationResults(accountId, validationId) {
|
|
40
50
|
try {
|
|
41
|
-
const { data: validationResults } = await getValidationResults(accountId, {
|
|
51
|
+
const { data: validationResults } = await (0, marketplaceValidation_1.getValidationResults)(accountId, {
|
|
42
52
|
validationId,
|
|
43
53
|
});
|
|
44
54
|
return validationResults;
|
|
45
55
|
}
|
|
46
56
|
catch (err) {
|
|
47
|
-
uiLogger.debug(err);
|
|
48
|
-
process.exit(EXIT_CODES.ERROR);
|
|
57
|
+
logger_1.uiLogger.debug(err);
|
|
58
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
49
59
|
}
|
|
50
60
|
}
|
|
51
|
-
|
|
61
|
+
function processValidationErrors(invalidPathError, validationResults) {
|
|
52
62
|
if (validationResults.errors.length) {
|
|
53
63
|
const { assetPath, errors } = validationResults;
|
|
54
64
|
errors.forEach(err => {
|
|
55
65
|
if (err.failureReasonType === 'DOWNLOAD_EMPTY') {
|
|
56
|
-
uiLogger.error(invalidPathError(assetPath));
|
|
66
|
+
logger_1.uiLogger.error(invalidPathError(assetPath));
|
|
57
67
|
}
|
|
58
68
|
else {
|
|
59
|
-
uiLogger.error(`${err.context}`);
|
|
69
|
+
logger_1.uiLogger.error(`${err.context}`);
|
|
60
70
|
}
|
|
61
71
|
});
|
|
62
|
-
process.exit(EXIT_CODES.ERROR);
|
|
72
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
63
73
|
}
|
|
64
74
|
}
|
|
65
75
|
function displayFileInfo(file, line, resultsCopy) {
|
|
66
76
|
if (file) {
|
|
67
|
-
uiLogger.log(resultsCopy.warnings.file(file));
|
|
77
|
+
logger_1.uiLogger.log(resultsCopy.warnings.file(file));
|
|
68
78
|
}
|
|
69
79
|
if (line) {
|
|
70
|
-
uiLogger.log(resultsCopy.warnings.lineNumber(line.toString()));
|
|
80
|
+
logger_1.uiLogger.log(resultsCopy.warnings.lineNumber(line.toString()));
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
83
|
function displayResults(checks, resultsCopy) {
|
|
@@ -77,19 +87,19 @@ function displayResults(checks, resultsCopy) {
|
|
|
77
87
|
const failedValidations = results.filter(test => test.status === 'FAIL');
|
|
78
88
|
const warningValidations = results.filter(test => test.status === 'WARN');
|
|
79
89
|
failedValidations.forEach(val => {
|
|
80
|
-
uiLogger.error(`${val.message}`);
|
|
90
|
+
logger_1.uiLogger.error(`${val.message}`);
|
|
81
91
|
displayFileInfo(val.file, val.line, resultsCopy);
|
|
82
92
|
});
|
|
83
93
|
warningValidations.forEach(val => {
|
|
84
|
-
uiLogger.warn(`${val.message}`);
|
|
94
|
+
logger_1.uiLogger.warn(`${val.message}`);
|
|
85
95
|
displayFileInfo(val.file, val.line, resultsCopy);
|
|
86
96
|
});
|
|
87
97
|
}
|
|
88
98
|
if (status === 'PASS') {
|
|
89
|
-
uiLogger.success(resultsCopy.noErrors);
|
|
99
|
+
logger_1.uiLogger.success(resultsCopy.noErrors);
|
|
90
100
|
results.forEach(test => {
|
|
91
101
|
if (test.status === 'WARN') {
|
|
92
|
-
uiLogger.warn(`${test.message}`);
|
|
102
|
+
logger_1.uiLogger.warn(`${test.message}`);
|
|
93
103
|
displayFileInfo(test.file, test.line, resultsCopy);
|
|
94
104
|
}
|
|
95
105
|
});
|
|
@@ -97,10 +107,10 @@ function displayResults(checks, resultsCopy) {
|
|
|
97
107
|
}
|
|
98
108
|
return;
|
|
99
109
|
}
|
|
100
|
-
|
|
110
|
+
function displayValidationResults(resultsCopy, validationResults) {
|
|
101
111
|
Object.keys(validationResults.results).forEach(type => {
|
|
102
|
-
uiLogger.log(
|
|
112
|
+
logger_1.uiLogger.log(chalk_1.default.bold(resultsCopy[type.toLowerCase()]));
|
|
103
113
|
displayResults(validationResults.results[type], resultsCopy);
|
|
104
|
-
uiLogger.log('');
|
|
114
|
+
logger_1.uiLogger.log('');
|
|
105
115
|
});
|
|
106
116
|
}
|
package/lib/mcp/setup.js
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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.supportedTools = void 0;
|
|
7
|
+
exports.addMintlifyMcpServer = addMintlifyMcpServer;
|
|
8
|
+
exports.setupMintlify = setupMintlify;
|
|
9
|
+
exports.addMcpServerToConfig = addMcpServerToConfig;
|
|
10
|
+
exports.setupClaudeCode = setupClaudeCode;
|
|
11
|
+
exports.setupCursor = setupCursor;
|
|
12
|
+
exports.setupWindsurf = setupWindsurf;
|
|
13
|
+
const logger_1 = require("../ui/logger");
|
|
14
|
+
const en_1 = require("../../lang/en");
|
|
15
|
+
const promptUtils_1 = require("../prompts/promptUtils");
|
|
16
|
+
const SpinniesManager_1 = __importDefault(require("../ui/SpinniesManager"));
|
|
17
|
+
const errorHandlers_1 = require("../errorHandlers");
|
|
18
|
+
const command_1 = require("../../mcp-server/utils/command");
|
|
19
|
+
const child_process_1 = require("child_process");
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
21
|
+
const os_1 = __importDefault(require("os"));
|
|
22
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
23
|
+
const fs_1 = require("fs");
|
|
12
24
|
const mcpServerName = 'hubspot-cli-mcp';
|
|
13
25
|
const claudeCode = 'claude';
|
|
14
26
|
const windsurf = 'windsurf';
|
|
15
27
|
const cursor = 'cursor';
|
|
16
28
|
const supportedMintlifyClients = [windsurf, cursor];
|
|
17
|
-
|
|
18
|
-
{ name: commands.mcp.setup.claudeCode, value: claudeCode },
|
|
19
|
-
{ name: commands.mcp.setup.cursor, value: cursor },
|
|
20
|
-
{ name: commands.mcp.setup.windsurf, value: windsurf },
|
|
29
|
+
exports.supportedTools = [
|
|
30
|
+
{ name: en_1.commands.mcp.setup.claudeCode, value: claudeCode },
|
|
31
|
+
{ name: en_1.commands.mcp.setup.cursor, value: cursor },
|
|
32
|
+
{ name: en_1.commands.mcp.setup.windsurf, value: windsurf },
|
|
21
33
|
];
|
|
22
34
|
const defaultMcpCommand = {
|
|
23
35
|
command: 'hs',
|
|
24
36
|
args: ['mcp', 'start'],
|
|
25
37
|
};
|
|
26
|
-
|
|
38
|
+
async function addMintlifyMcpServer(installTargets) {
|
|
27
39
|
await runSetupFunction(() => setupMintlify(installTargets));
|
|
28
40
|
}
|
|
29
|
-
|
|
30
|
-
uiLogger.info(commands.mcp.setup.installingDocSearch);
|
|
31
|
-
uiLogger.log('');
|
|
41
|
+
async function setupMintlify(derivedTargets = supportedMintlifyClients) {
|
|
42
|
+
logger_1.uiLogger.info(en_1.commands.mcp.setup.installingDocSearch);
|
|
43
|
+
logger_1.uiLogger.log('');
|
|
32
44
|
return new Promise(resolve => {
|
|
33
45
|
const subcommands = ['mint-mcp', 'add', 'hubspot-migration'];
|
|
34
46
|
const docsSearchClients = derivedTargets.filter(target => supportedMintlifyClients.includes(target));
|
|
35
|
-
const childProcess = spawn(`npx`, docsSearchClients && docsSearchClients.length
|
|
47
|
+
const childProcess = (0, child_process_1.spawn)(`npx`, docsSearchClients && docsSearchClients.length
|
|
36
48
|
? [...subcommands, '--client', ...docsSearchClients]
|
|
37
49
|
: subcommands, {
|
|
38
50
|
stdio: 'inherit',
|
|
@@ -45,18 +57,18 @@ export async function setupMintlify(derivedTargets = supportedMintlifyClients) {
|
|
|
45
57
|
});
|
|
46
58
|
});
|
|
47
59
|
}
|
|
48
|
-
|
|
60
|
+
async function addMcpServerToConfig(targets) {
|
|
49
61
|
try {
|
|
50
62
|
let derivedTargets = [];
|
|
51
63
|
if (!targets || targets.length === 0) {
|
|
52
|
-
const { selectedTargets } = await promptUser({
|
|
64
|
+
const { selectedTargets } = await (0, promptUtils_1.promptUser)({
|
|
53
65
|
name: 'selectedTargets',
|
|
54
66
|
type: 'checkbox',
|
|
55
|
-
message: commands.mcp.setup.prompts.targets,
|
|
56
|
-
choices: supportedTools,
|
|
67
|
+
message: en_1.commands.mcp.setup.prompts.targets,
|
|
68
|
+
choices: exports.supportedTools,
|
|
57
69
|
validate: (choices) => {
|
|
58
70
|
return choices.length === 0
|
|
59
|
-
? commands.mcp.setup.prompts.targetsRequired
|
|
71
|
+
? en_1.commands.mcp.setup.prompts.targetsRequired
|
|
60
72
|
: true;
|
|
61
73
|
},
|
|
62
74
|
});
|
|
@@ -65,7 +77,7 @@ export async function addMcpServerToConfig(targets) {
|
|
|
65
77
|
else {
|
|
66
78
|
derivedTargets = targets;
|
|
67
79
|
}
|
|
68
|
-
|
|
80
|
+
SpinniesManager_1.default.init();
|
|
69
81
|
if (derivedTargets.includes(claudeCode)) {
|
|
70
82
|
await runSetupFunction(setupClaudeCode);
|
|
71
83
|
}
|
|
@@ -75,12 +87,12 @@ export async function addMcpServerToConfig(targets) {
|
|
|
75
87
|
if (derivedTargets.includes(windsurf)) {
|
|
76
88
|
await runSetupFunction(setupWindsurf);
|
|
77
89
|
}
|
|
78
|
-
uiLogger.info(commands.mcp.setup.success(derivedTargets));
|
|
90
|
+
logger_1.uiLogger.info(en_1.commands.mcp.setup.success(derivedTargets));
|
|
79
91
|
return derivedTargets;
|
|
80
92
|
}
|
|
81
93
|
catch (error) {
|
|
82
|
-
|
|
83
|
-
text: commands.mcp.setup.spinners.failedToConfigure,
|
|
94
|
+
SpinniesManager_1.default.fail('mcpSetup', {
|
|
95
|
+
text: en_1.commands.mcp.setup.spinners.failedToConfigure,
|
|
84
96
|
});
|
|
85
97
|
throw error;
|
|
86
98
|
}
|
|
@@ -93,22 +105,38 @@ async function runSetupFunction(func) {
|
|
|
93
105
|
}
|
|
94
106
|
function setupMcpConfigFile(config) {
|
|
95
107
|
try {
|
|
96
|
-
|
|
108
|
+
SpinniesManager_1.default.add('spinner', {
|
|
97
109
|
text: config.configuringMessage,
|
|
98
110
|
});
|
|
99
|
-
if (!existsSync(config.configPath)) {
|
|
100
|
-
|
|
111
|
+
if (!(0, fs_1.existsSync)(config.configPath)) {
|
|
112
|
+
fs_extra_1.default.writeFileSync(config.configPath, JSON.stringify({}, null, 2));
|
|
101
113
|
}
|
|
102
114
|
let mcpConfig = {};
|
|
115
|
+
let configContent;
|
|
116
|
+
try {
|
|
117
|
+
configContent = fs_extra_1.default.readFileSync(config.configPath, 'utf8');
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
SpinniesManager_1.default.fail('spinner', {
|
|
121
|
+
text: config.failedMessage,
|
|
122
|
+
});
|
|
123
|
+
(0, errorHandlers_1.logError)(error);
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
103
126
|
try {
|
|
104
|
-
|
|
105
|
-
|
|
127
|
+
// In the event the file exists, but is empty, initialize it to and empty object
|
|
128
|
+
if (configContent.trim() === '') {
|
|
129
|
+
mcpConfig = {};
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
mcpConfig = JSON.parse(configContent);
|
|
133
|
+
}
|
|
106
134
|
}
|
|
107
135
|
catch (error) {
|
|
108
|
-
|
|
136
|
+
SpinniesManager_1.default.fail('spinner', {
|
|
109
137
|
text: config.failedMessage,
|
|
110
138
|
});
|
|
111
|
-
|
|
139
|
+
logger_1.uiLogger.error(en_1.commands.mcp.setup.errors.errorParsingJsonFIle(config.configPath, error instanceof Error ? error.message : `${error}`));
|
|
112
140
|
return false;
|
|
113
141
|
}
|
|
114
142
|
// Initialize mcpServers if it doesn't exist
|
|
@@ -120,87 +148,92 @@ function setupMcpConfigFile(config) {
|
|
|
120
148
|
...config.mcpCommand,
|
|
121
149
|
};
|
|
122
150
|
// Write the updated config
|
|
123
|
-
|
|
124
|
-
|
|
151
|
+
fs_extra_1.default.writeFileSync(config.configPath, JSON.stringify(mcpConfig, null, 2));
|
|
152
|
+
SpinniesManager_1.default.succeed('spinner', {
|
|
125
153
|
text: config.configuredMessage,
|
|
126
154
|
});
|
|
127
155
|
return true;
|
|
128
156
|
}
|
|
129
157
|
catch (error) {
|
|
130
|
-
|
|
158
|
+
SpinniesManager_1.default.fail('spinner', {
|
|
131
159
|
text: config.failedMessage,
|
|
132
160
|
});
|
|
133
|
-
logError(error);
|
|
161
|
+
(0, errorHandlers_1.logError)(error);
|
|
134
162
|
return false;
|
|
135
163
|
}
|
|
136
164
|
}
|
|
137
|
-
|
|
165
|
+
async function setupClaudeCode(mcpCommand = defaultMcpCommand) {
|
|
138
166
|
try {
|
|
139
|
-
|
|
140
|
-
text: commands.mcp.setup.spinners.configuringClaudeCode,
|
|
167
|
+
SpinniesManager_1.default.add('claudeCode', {
|
|
168
|
+
text: en_1.commands.mcp.setup.spinners.configuringClaudeCode,
|
|
141
169
|
});
|
|
142
170
|
try {
|
|
143
171
|
// Check if claude command is available
|
|
144
|
-
await execAsync('claude --version');
|
|
172
|
+
await (0, command_1.execAsync)('claude --version');
|
|
145
173
|
// Run claude mcp add command
|
|
146
174
|
const mcpConfig = JSON.stringify({
|
|
147
175
|
type: 'stdio',
|
|
148
|
-
...mcpCommand,
|
|
176
|
+
...buildCommandWithAgentString(mcpCommand, claudeCode),
|
|
149
177
|
});
|
|
150
|
-
const { stdout } = await execAsync('claude mcp list');
|
|
178
|
+
const { stdout } = await (0, command_1.execAsync)('claude mcp list');
|
|
151
179
|
if (stdout.includes(mcpServerName)) {
|
|
152
|
-
|
|
153
|
-
text: commands.mcp.setup.spinners.alreadyInstalled,
|
|
180
|
+
SpinniesManager_1.default.update('claudeCode', {
|
|
181
|
+
text: en_1.commands.mcp.setup.spinners.alreadyInstalled,
|
|
154
182
|
});
|
|
155
|
-
await execAsync(`claude mcp remove "${mcpServerName}" --scope user`);
|
|
183
|
+
await (0, command_1.execAsync)(`claude mcp remove "${mcpServerName}" --scope user`);
|
|
156
184
|
}
|
|
157
|
-
await execAsync(`claude mcp add-json "${mcpServerName}" '${mcpConfig}' --scope user`);
|
|
158
|
-
|
|
159
|
-
text: commands.mcp.setup.spinners.configuredClaudeCode,
|
|
185
|
+
await (0, command_1.execAsync)(`claude mcp add-json "${mcpServerName}" '${mcpConfig}' --scope user`);
|
|
186
|
+
SpinniesManager_1.default.succeed('claudeCode', {
|
|
187
|
+
text: en_1.commands.mcp.setup.spinners.configuredClaudeCode,
|
|
160
188
|
});
|
|
161
189
|
return true;
|
|
162
190
|
}
|
|
163
191
|
catch (error) {
|
|
164
192
|
if (error instanceof Error &&
|
|
165
193
|
error.message.includes('claude: command not found')) {
|
|
166
|
-
|
|
167
|
-
text: commands.mcp.setup.spinners.claudeCodeNotFound,
|
|
194
|
+
SpinniesManager_1.default.fail('claudeCode', {
|
|
195
|
+
text: en_1.commands.mcp.setup.spinners.claudeCodeNotFound,
|
|
168
196
|
});
|
|
169
197
|
}
|
|
170
198
|
else {
|
|
171
|
-
|
|
172
|
-
text: commands.mcp.setup.spinners.claudeCodeInstallFailed,
|
|
199
|
+
SpinniesManager_1.default.fail('claudeCode', {
|
|
200
|
+
text: en_1.commands.mcp.setup.spinners.claudeCodeInstallFailed,
|
|
173
201
|
});
|
|
174
|
-
logError(error);
|
|
202
|
+
(0, errorHandlers_1.logError)(error);
|
|
175
203
|
}
|
|
176
204
|
return false;
|
|
177
205
|
}
|
|
178
206
|
}
|
|
179
207
|
catch (error) {
|
|
180
|
-
|
|
181
|
-
text: commands.mcp.setup.spinners.claudeCodeInstallFailed,
|
|
208
|
+
SpinniesManager_1.default.fail('claudeCode', {
|
|
209
|
+
text: en_1.commands.mcp.setup.spinners.claudeCodeInstallFailed,
|
|
182
210
|
});
|
|
183
|
-
logError(error);
|
|
211
|
+
(0, errorHandlers_1.logError)(error);
|
|
184
212
|
return false;
|
|
185
213
|
}
|
|
186
214
|
}
|
|
187
|
-
|
|
188
|
-
const cursorConfigPath =
|
|
215
|
+
function setupCursor(mcpCommand = defaultMcpCommand) {
|
|
216
|
+
const cursorConfigPath = path_1.default.join(os_1.default.homedir(), '.cursor', 'mcp.json');
|
|
189
217
|
return setupMcpConfigFile({
|
|
190
218
|
configPath: cursorConfigPath,
|
|
191
|
-
configuringMessage: commands.mcp.setup.spinners.configuringCursor,
|
|
192
|
-
configuredMessage: commands.mcp.setup.spinners.configuredCursor,
|
|
193
|
-
failedMessage: commands.mcp.setup.spinners.failedToConfigureCursor,
|
|
194
|
-
mcpCommand,
|
|
219
|
+
configuringMessage: en_1.commands.mcp.setup.spinners.configuringCursor,
|
|
220
|
+
configuredMessage: en_1.commands.mcp.setup.spinners.configuredCursor,
|
|
221
|
+
failedMessage: en_1.commands.mcp.setup.spinners.failedToConfigureCursor,
|
|
222
|
+
mcpCommand: buildCommandWithAgentString(mcpCommand, cursor),
|
|
195
223
|
});
|
|
196
224
|
}
|
|
197
|
-
|
|
198
|
-
const windsurfConfigPath =
|
|
225
|
+
function setupWindsurf(mcpCommand = defaultMcpCommand) {
|
|
226
|
+
const windsurfConfigPath = path_1.default.join(os_1.default.homedir(), '.codeium', 'windsurf', 'mcp_config.json');
|
|
199
227
|
return setupMcpConfigFile({
|
|
200
228
|
configPath: windsurfConfigPath,
|
|
201
|
-
configuringMessage: commands.mcp.setup.spinners.configuringWindsurf,
|
|
202
|
-
configuredMessage: commands.mcp.setup.spinners.configuredWindsurf,
|
|
203
|
-
failedMessage: commands.mcp.setup.spinners.failedToConfigureWindsurf,
|
|
204
|
-
mcpCommand,
|
|
229
|
+
configuringMessage: en_1.commands.mcp.setup.spinners.configuringWindsurf,
|
|
230
|
+
configuredMessage: en_1.commands.mcp.setup.spinners.configuredWindsurf,
|
|
231
|
+
failedMessage: en_1.commands.mcp.setup.spinners.failedToConfigureWindsurf,
|
|
232
|
+
mcpCommand: buildCommandWithAgentString(mcpCommand, windsurf),
|
|
205
233
|
});
|
|
206
234
|
}
|
|
235
|
+
function buildCommandWithAgentString(mcpCommand, agent) {
|
|
236
|
+
const mcpCommandCopy = structuredClone(mcpCommand);
|
|
237
|
+
mcpCommandCopy.args.push('--ai-agent', agent);
|
|
238
|
+
return mcpCommandCopy;
|
|
239
|
+
}
|