@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
https://github.com/jbcarpanelli/spinnies
|
|
3
4
|
|
|
@@ -7,12 +8,16 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
7
8
|
|
|
8
9
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
10
|
**/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const readline_1 = __importDefault(require("readline"));
|
|
16
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
+
const cli_cursor_1 = __importDefault(require("cli-cursor"));
|
|
18
|
+
const spinniesUtils_1 = require("./spinniesUtils");
|
|
14
19
|
function safeColor(text, color) {
|
|
15
|
-
const chalkFn =
|
|
20
|
+
const chalkFn = chalk_1.default[color];
|
|
16
21
|
if (typeof chalkFn === 'function') {
|
|
17
22
|
return chalkFn(text);
|
|
18
23
|
}
|
|
@@ -35,9 +40,9 @@ class SpinniesManager {
|
|
|
35
40
|
spinnerColor: 'greenBright',
|
|
36
41
|
succeedColor: 'green',
|
|
37
42
|
failColor: 'red',
|
|
38
|
-
spinner: terminalSupportsUnicode() ? SPINNERS.dots : SPINNERS.dashes,
|
|
43
|
+
spinner: (0, spinniesUtils_1.terminalSupportsUnicode)() ? spinniesUtils_1.SPINNERS.dots : spinniesUtils_1.SPINNERS.dashes,
|
|
39
44
|
disableSpins: false,
|
|
40
|
-
...purgeSpinnersOptions(options),
|
|
45
|
+
...(0, spinniesUtils_1.purgeSpinnersOptions)(options),
|
|
41
46
|
};
|
|
42
47
|
this.spin =
|
|
43
48
|
!this.options.disableSpins &&
|
|
@@ -71,11 +76,11 @@ class SpinniesManager {
|
|
|
71
76
|
options.text = resolvedName;
|
|
72
77
|
}
|
|
73
78
|
const spinnerProperties = {
|
|
74
|
-
...colorOptions(this.options),
|
|
79
|
+
...(0, spinniesUtils_1.colorOptions)(this.options),
|
|
75
80
|
succeedPrefix: this.options.succeedPrefix,
|
|
76
81
|
failPrefix: this.options.failPrefix,
|
|
77
82
|
status: 'spinning',
|
|
78
|
-
...purgeSpinnerOptions(options),
|
|
83
|
+
...(0, spinniesUtils_1.purgeSpinnerOptions)(options),
|
|
79
84
|
};
|
|
80
85
|
this.spinners[resolvedName] = spinnerProperties;
|
|
81
86
|
this.updateSpinnerState();
|
|
@@ -137,7 +142,7 @@ class SpinniesManager {
|
|
|
137
142
|
if (!this.spinners[name]) {
|
|
138
143
|
throw Error(`No spinner initialized with name ${name}`);
|
|
139
144
|
}
|
|
140
|
-
options = purgeSpinnerOptions(options);
|
|
145
|
+
options = (0, spinniesUtils_1.purgeSpinnerOptions)(options);
|
|
141
146
|
status = status || 'spinning';
|
|
142
147
|
this.spinners[name] = { ...this.spinners[name], ...options, status };
|
|
143
148
|
}
|
|
@@ -148,7 +153,7 @@ class SpinniesManager {
|
|
|
148
153
|
}
|
|
149
154
|
this.currentInterval = this.loopStream();
|
|
150
155
|
if (!this.isCursorHidden) {
|
|
151
|
-
|
|
156
|
+
cli_cursor_1.default.hide();
|
|
152
157
|
}
|
|
153
158
|
this.isCursorHidden = true;
|
|
154
159
|
this.checkIfActiveSpinners();
|
|
@@ -158,8 +163,8 @@ class SpinniesManager {
|
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
165
|
loopStream() {
|
|
161
|
-
const frames = this.options.spinner?.frames || SPINNERS.dots.frames;
|
|
162
|
-
const interval = this.options.spinner?.interval || SPINNERS.dots.interval;
|
|
166
|
+
const frames = this.options.spinner?.frames || spinniesUtils_1.SPINNERS.dots.frames;
|
|
167
|
+
const interval = this.options.spinner?.interval || spinniesUtils_1.SPINNERS.dots.interval;
|
|
163
168
|
return setInterval(() => {
|
|
164
169
|
this.setStreamOutput(frames[this.currentFrameIndex]);
|
|
165
170
|
this.currentFrameIndex =
|
|
@@ -174,13 +179,13 @@ class SpinniesManager {
|
|
|
174
179
|
const hasActiveSpinners = this.hasActiveSpinners();
|
|
175
180
|
Object.values(this.spinners).forEach(spinner => {
|
|
176
181
|
let { text } = spinner;
|
|
177
|
-
const { status, color, spinnerColor, succeedColor, failColor, indent = 0, succeedPrefix = prefixOptions(this.options).succeedPrefix, failPrefix = prefixOptions(this.options).failPrefix, } = spinner;
|
|
182
|
+
const { status, color, spinnerColor, succeedColor, failColor, indent = 0, succeedPrefix = (0, spinniesUtils_1.prefixOptions)(this.options).succeedPrefix, failPrefix = (0, spinniesUtils_1.prefixOptions)(this.options).failPrefix, } = spinner;
|
|
178
183
|
let line;
|
|
179
184
|
let prefixLength = indent;
|
|
180
185
|
text = text ?? '';
|
|
181
186
|
if (status === 'spinning') {
|
|
182
187
|
prefixLength += frame.length + 1;
|
|
183
|
-
text = breakText(text, prefixLength);
|
|
188
|
+
text = (0, spinniesUtils_1.breakText)(text, prefixLength);
|
|
184
189
|
const colorizedFrame = safeColor(frame, spinnerColor);
|
|
185
190
|
const colorizedText = safeColor(text, color);
|
|
186
191
|
line = `${colorizedFrame} ${colorizedText}`;
|
|
@@ -189,35 +194,35 @@ class SpinniesManager {
|
|
|
189
194
|
if (status === 'succeed') {
|
|
190
195
|
prefixLength += succeedPrefix.length + 1;
|
|
191
196
|
if (hasActiveSpinners) {
|
|
192
|
-
text = breakText(text, prefixLength);
|
|
197
|
+
text = (0, spinniesUtils_1.breakText)(text, prefixLength);
|
|
193
198
|
}
|
|
194
199
|
const colorizedText = safeColor(text, succeedColor);
|
|
195
|
-
line = `${
|
|
200
|
+
line = `${chalk_1.default.green(succeedPrefix)} ${colorizedText}`;
|
|
196
201
|
}
|
|
197
202
|
else if (status === 'fail') {
|
|
198
203
|
prefixLength += failPrefix.length + 1;
|
|
199
204
|
if (hasActiveSpinners) {
|
|
200
|
-
text = breakText(text, prefixLength);
|
|
205
|
+
text = (0, spinniesUtils_1.breakText)(text, prefixLength);
|
|
201
206
|
}
|
|
202
207
|
const colorizedText = safeColor(text, failColor);
|
|
203
|
-
line = `${
|
|
208
|
+
line = `${chalk_1.default.red(failPrefix)} ${colorizedText}`;
|
|
204
209
|
}
|
|
205
210
|
else {
|
|
206
211
|
if (hasActiveSpinners) {
|
|
207
|
-
text = breakText(text, prefixLength);
|
|
212
|
+
text = (0, spinniesUtils_1.breakText)(text, prefixLength);
|
|
208
213
|
}
|
|
209
214
|
line = safeColor(text, color);
|
|
210
215
|
}
|
|
211
216
|
}
|
|
212
|
-
linesLength.push(...getLinesLength(text, prefixLength));
|
|
217
|
+
linesLength.push(...(0, spinniesUtils_1.getLinesLength)(text, prefixLength));
|
|
213
218
|
output += indent ? `${' '.repeat(indent)}${line}\n` : `${line}\n`;
|
|
214
219
|
});
|
|
215
220
|
if (!hasActiveSpinners) {
|
|
216
|
-
|
|
221
|
+
readline_1.default.clearScreenDown(this.stream);
|
|
217
222
|
}
|
|
218
|
-
writeStream(this.stream, output, linesLength);
|
|
223
|
+
(0, spinniesUtils_1.writeStream)(this.stream, output, linesLength);
|
|
219
224
|
if (hasActiveSpinners) {
|
|
220
|
-
cleanStream(this.stream, linesLength);
|
|
225
|
+
(0, spinniesUtils_1.cleanStream)(this.stream, linesLength);
|
|
221
226
|
}
|
|
222
227
|
this.lineCount = linesLength.length;
|
|
223
228
|
}
|
|
@@ -230,12 +235,12 @@ class SpinniesManager {
|
|
|
230
235
|
if (!this.hasActiveSpinners()) {
|
|
231
236
|
if (this.spin) {
|
|
232
237
|
this.setStreamOutput();
|
|
233
|
-
|
|
238
|
+
readline_1.default.moveCursor(this.stream, 0, this.lineCount);
|
|
234
239
|
if (this.currentInterval) {
|
|
235
240
|
clearInterval(this.currentInterval);
|
|
236
241
|
}
|
|
237
242
|
this.isCursorHidden = false;
|
|
238
|
-
|
|
243
|
+
cli_cursor_1.default.show();
|
|
239
244
|
}
|
|
240
245
|
this.spinners = {};
|
|
241
246
|
}
|
|
@@ -243,11 +248,11 @@ class SpinniesManager {
|
|
|
243
248
|
bindSigint() {
|
|
244
249
|
process.removeAllListeners('SIGINT');
|
|
245
250
|
process.on('SIGINT', () => {
|
|
246
|
-
|
|
247
|
-
|
|
251
|
+
cli_cursor_1.default.show();
|
|
252
|
+
readline_1.default.moveCursor(process.stderr, 0, this.lineCount);
|
|
248
253
|
process.exit(0);
|
|
249
254
|
});
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
const toExport = new SpinniesManager();
|
|
253
|
-
|
|
258
|
+
exports.default = toExport;
|
package/lib/ui/boxen.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logInBox = logInBox;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
5
|
+
const index_1 = require("./index");
|
|
6
|
+
const logger_2 = require("@hubspot/local-dev-lib/logger");
|
|
7
|
+
const en_1 = require("../../lang/en");
|
|
5
8
|
const defaultOptions = {
|
|
6
9
|
titleAlignment: 'left',
|
|
7
|
-
borderColor: UI_COLORS.MARIGOLD,
|
|
10
|
+
borderColor: index_1.UI_COLORS.MARIGOLD,
|
|
8
11
|
margin: 1,
|
|
9
12
|
padding: 1,
|
|
10
13
|
textAlignment: 'left',
|
|
11
14
|
borderStyle: 'round',
|
|
12
15
|
};
|
|
13
|
-
|
|
16
|
+
async function logInBox({ contents, options, }) {
|
|
14
17
|
try {
|
|
15
18
|
const boxen = (await import('boxen')).default;
|
|
16
|
-
uiLogger.log(boxen(contents, { ...defaultOptions, ...options }));
|
|
19
|
+
logger_1.uiLogger.log(boxen(contents, { ...defaultOptions, ...options }));
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
22
|
catch (error) {
|
|
20
|
-
logger.debug(lib.boxen.failedToLoad);
|
|
23
|
+
logger_2.logger.debug(en_1.lib.boxen.failedToLoad);
|
|
21
24
|
if (options?.title) {
|
|
22
|
-
uiLogger.log(options.title);
|
|
23
|
-
uiLogger.log('');
|
|
25
|
+
logger_1.uiLogger.log(options.title);
|
|
26
|
+
logger_1.uiLogger.log('');
|
|
24
27
|
}
|
|
25
|
-
uiLogger.log(contents);
|
|
28
|
+
logger_1.uiLogger.log(contents);
|
|
26
29
|
}
|
|
27
30
|
}
|
package/lib/ui/git.js
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.checkAndWarnGitInclusion = checkAndWarnGitInclusion;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const gitignore_1 = require("@hubspot/local-dev-lib/gitignore");
|
|
9
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
+
const lang_1 = require("../lang");
|
|
11
|
+
function checkAndWarnGitInclusion(configPath) {
|
|
6
12
|
try {
|
|
7
|
-
const { inGit, configIgnored } = checkGitInclusion(configPath);
|
|
13
|
+
const { inGit, configIgnored } = (0, gitignore_1.checkGitInclusion)(configPath);
|
|
8
14
|
if (!inGit || configIgnored)
|
|
9
15
|
return;
|
|
10
|
-
logger.warn(i18n(`lib.ui.git.securityIssue`));
|
|
11
|
-
logger.warn(i18n(`lib.ui.git.configFileTracked`));
|
|
12
|
-
logger.warn(i18n(`lib.ui.git.fileName`, { configPath }));
|
|
13
|
-
logger.warn(i18n(`lib.ui.git.remediate`));
|
|
14
|
-
logger.warn(i18n(`lib.ui.git.moveConfig`, { homeDir:
|
|
15
|
-
logger.warn(i18n(`lib.ui.git.addGitignore`, { configPath }));
|
|
16
|
-
logger.warn(i18n(`lib.ui.git.noRemote`));
|
|
16
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.securityIssue`));
|
|
17
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.configFileTracked`));
|
|
18
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.fileName`, { configPath }));
|
|
19
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.remediate`));
|
|
20
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.moveConfig`, { homeDir: os_1.default.homedir() }));
|
|
21
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.addGitignore`, { configPath }));
|
|
22
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.noRemote`));
|
|
17
23
|
}
|
|
18
24
|
catch (e) {
|
|
19
25
|
// fail silently
|
|
20
|
-
logger.debug(i18n(`lib.ui.git.checkFailed`));
|
|
26
|
+
logger_1.logger.debug((0, lang_1.i18n)(`lib.ui.git.checkFailed`));
|
|
21
27
|
}
|
|
22
28
|
}
|
package/lib/ui/index.js
CHANGED
|
@@ -1,25 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.UI_COLORS = void 0;
|
|
7
|
+
exports.uiLine = uiLine;
|
|
8
|
+
exports.uiLink = uiLink;
|
|
9
|
+
exports.uiAccountDescription = uiAccountDescription;
|
|
10
|
+
exports.uiInfoSection = uiInfoSection;
|
|
11
|
+
exports.uiCommandReference = uiCommandReference;
|
|
12
|
+
exports.uiFeatureHighlight = uiFeatureHighlight;
|
|
13
|
+
exports.uiBetaTag = uiBetaTag;
|
|
14
|
+
exports.uiDeprecatedTag = uiDeprecatedTag;
|
|
15
|
+
exports.uiCommandDisabledBanner = uiCommandDisabledBanner;
|
|
16
|
+
exports.uiDeprecatedDescription = uiDeprecatedDescription;
|
|
17
|
+
exports.uiDeprecatedMessage = uiDeprecatedMessage;
|
|
18
|
+
exports.indent = indent;
|
|
19
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
21
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
22
|
+
const supportHyperlinks_1 = require("./supportHyperlinks");
|
|
23
|
+
const supportsColor_1 = require("./supportsColor");
|
|
24
|
+
const lang_1 = require("../lang");
|
|
25
|
+
const { HUBSPOT_ACCOUNT_TYPE_STRINGS, } = require('@hubspot/local-dev-lib/constants/config');
|
|
26
|
+
exports.UI_COLORS = {
|
|
9
27
|
SORBET: '#FF8F59',
|
|
10
28
|
MARIGOLD: '#f5c26b',
|
|
11
29
|
MARIGOLD_DARK: '#dbae60',
|
|
12
30
|
};
|
|
13
|
-
|
|
14
|
-
logger.log('-'.repeat(50));
|
|
31
|
+
function uiLine() {
|
|
32
|
+
logger_1.logger.log('-'.repeat(50));
|
|
15
33
|
}
|
|
16
34
|
function getTerminalUISupport() {
|
|
17
35
|
return {
|
|
18
|
-
hyperlinks: supportsHyperlinkModule.stdout,
|
|
19
|
-
color: supportsColor.stdout.hasBasic,
|
|
36
|
+
hyperlinks: supportHyperlinks_1.supportsHyperlinkModule.stdout,
|
|
37
|
+
color: supportsColor_1.supportsColor.stdout.hasBasic,
|
|
20
38
|
};
|
|
21
39
|
}
|
|
22
|
-
|
|
40
|
+
function uiLink(linkText, url) {
|
|
23
41
|
const terminalUISupport = getTerminalUISupport();
|
|
24
42
|
const encodedUrl = encodeURI(url);
|
|
25
43
|
if (terminalUISupport.hyperlinks) {
|
|
@@ -31,105 +49,105 @@ export function uiLink(linkText, url) {
|
|
|
31
49
|
linkText,
|
|
32
50
|
CLOSE_SEQUENCE,
|
|
33
51
|
].join('');
|
|
34
|
-
return terminalUISupport.color ?
|
|
52
|
+
return terminalUISupport.color ? chalk_1.default.cyan(result) : result;
|
|
35
53
|
}
|
|
36
54
|
return terminalUISupport.color
|
|
37
|
-
? `${linkText}: ${
|
|
55
|
+
? `${linkText}: ${chalk_1.default.reset.cyan(encodedUrl)}`
|
|
38
56
|
: `${linkText}: ${encodedUrl}`;
|
|
39
57
|
}
|
|
40
|
-
|
|
41
|
-
const account = getAccountConfig(accountId || undefined);
|
|
58
|
+
function uiAccountDescription(accountId, bold = true) {
|
|
59
|
+
const account = (0, config_1.getAccountConfig)(accountId || undefined);
|
|
42
60
|
let message;
|
|
43
61
|
if (account && account.accountType) {
|
|
44
|
-
message = `${account.name} [${HUBSPOT_ACCOUNT_TYPE_STRINGS[account.accountType]}] (${accountId})`;
|
|
62
|
+
message = `${account.name ? `${account.name} ` : ''}[${HUBSPOT_ACCOUNT_TYPE_STRINGS[account.accountType]}] (${accountId})`;
|
|
45
63
|
}
|
|
46
64
|
else {
|
|
47
65
|
message = accountId ? accountId.toString() : '';
|
|
48
66
|
}
|
|
49
|
-
return bold ?
|
|
67
|
+
return bold ? chalk_1.default.bold(message) : message;
|
|
50
68
|
}
|
|
51
|
-
|
|
69
|
+
function uiInfoSection(title, logContent) {
|
|
52
70
|
uiLine();
|
|
53
|
-
logger.log(
|
|
54
|
-
logger.log('');
|
|
71
|
+
logger_1.logger.log(chalk_1.default.bold(title));
|
|
72
|
+
logger_1.logger.log('');
|
|
55
73
|
logContent();
|
|
56
|
-
logger.log('');
|
|
74
|
+
logger_1.logger.log('');
|
|
57
75
|
uiLine();
|
|
58
76
|
}
|
|
59
|
-
|
|
77
|
+
function uiCommandReference(command, withQuotes = true) {
|
|
60
78
|
const terminalUISupport = getTerminalUISupport();
|
|
61
79
|
const commandReference = withQuotes ? `\`${command}\`` : command;
|
|
62
|
-
return
|
|
63
|
-
?
|
|
80
|
+
return chalk_1.default.bold(terminalUISupport.color
|
|
81
|
+
? chalk_1.default.hex(exports.UI_COLORS.MARIGOLD_DARK)(commandReference)
|
|
64
82
|
: commandReference);
|
|
65
83
|
}
|
|
66
|
-
|
|
67
|
-
uiInfoSection(title ? title : i18n(`lib.ui.featureHighlight.defaultTitle`), () => {
|
|
84
|
+
function uiFeatureHighlight(features, title) {
|
|
85
|
+
uiInfoSection(title ? title : (0, lang_1.i18n)(`lib.ui.featureHighlight.defaultTitle`), () => {
|
|
68
86
|
features.forEach((c, i) => {
|
|
69
87
|
const featureKey = `lib.ui.featureHighlight.featureKeys.${c}`;
|
|
70
|
-
const message = i18n(`${featureKey}.message`, {
|
|
71
|
-
command: uiCommandReference(i18n(`${featureKey}.command`)),
|
|
72
|
-
link: uiLink(i18n(`${featureKey}.linkText`), i18n(`${featureKey}.url`)),
|
|
88
|
+
const message = (0, lang_1.i18n)(`${featureKey}.message`, {
|
|
89
|
+
command: uiCommandReference((0, lang_1.i18n)(`${featureKey}.command`)),
|
|
90
|
+
link: uiLink((0, lang_1.i18n)(`${featureKey}.linkText`), (0, lang_1.i18n)(`${featureKey}.url`)),
|
|
73
91
|
});
|
|
74
92
|
if (i !== 0) {
|
|
75
|
-
logger.log('');
|
|
93
|
+
logger_1.logger.log('');
|
|
76
94
|
}
|
|
77
|
-
logger.log(message);
|
|
95
|
+
logger_1.logger.log(message);
|
|
78
96
|
});
|
|
79
97
|
});
|
|
80
98
|
}
|
|
81
|
-
|
|
99
|
+
function uiBetaTag(message, log = true) {
|
|
82
100
|
const terminalUISupport = getTerminalUISupport();
|
|
83
|
-
const tag = i18n(`lib.ui.betaTag`);
|
|
84
|
-
const result = `${terminalUISupport.color ?
|
|
101
|
+
const tag = (0, lang_1.i18n)(`lib.ui.betaTag`);
|
|
102
|
+
const result = `${terminalUISupport.color ? chalk_1.default.hex(exports.UI_COLORS.SORBET)(tag) : tag} ${message}`;
|
|
85
103
|
if (log) {
|
|
86
|
-
logger.log(result);
|
|
104
|
+
logger_1.logger.log(result);
|
|
87
105
|
return;
|
|
88
106
|
}
|
|
89
107
|
return result;
|
|
90
108
|
}
|
|
91
|
-
|
|
109
|
+
function uiDeprecatedTag(message, log = true) {
|
|
92
110
|
const terminalUISupport = getTerminalUISupport();
|
|
93
|
-
const tag = i18n(`lib.ui.deprecatedTag`);
|
|
94
|
-
const result = `${terminalUISupport.color ?
|
|
111
|
+
const tag = (0, lang_1.i18n)(`lib.ui.deprecatedTag`);
|
|
112
|
+
const result = `${terminalUISupport.color ? chalk_1.default.yellow(tag) : tag} ${message}`;
|
|
95
113
|
if (log) {
|
|
96
|
-
logger.log(result);
|
|
114
|
+
logger_1.logger.log(result);
|
|
97
115
|
return;
|
|
98
116
|
}
|
|
99
117
|
return result;
|
|
100
118
|
}
|
|
101
|
-
|
|
119
|
+
function uiCommandDisabledBanner(command, url, message) {
|
|
102
120
|
const tag = message ||
|
|
103
|
-
i18n(`lib.ui.disabledMessage`, {
|
|
121
|
+
(0, lang_1.i18n)(`lib.ui.disabledMessage`, {
|
|
104
122
|
command: uiCommandReference(command),
|
|
105
|
-
url: url ? uiLink(i18n(`lib.ui.disabledUrlText`), url) : '',
|
|
123
|
+
url: url ? uiLink((0, lang_1.i18n)(`lib.ui.disabledUrlText`), url) : '',
|
|
106
124
|
npmCommand: uiCommandReference('npm i -g @hubspot/cli@latest'),
|
|
107
125
|
});
|
|
108
|
-
logger.log();
|
|
126
|
+
logger_1.logger.log();
|
|
109
127
|
uiLine();
|
|
110
|
-
logger.error(tag);
|
|
128
|
+
logger_1.logger.error(tag);
|
|
111
129
|
uiLine();
|
|
112
|
-
logger.log();
|
|
130
|
+
logger_1.logger.log();
|
|
113
131
|
}
|
|
114
|
-
|
|
115
|
-
const tag = i18n(`lib.ui.deprecatedDescription`, {
|
|
132
|
+
function uiDeprecatedDescription(message, command, url) {
|
|
133
|
+
const tag = (0, lang_1.i18n)(`lib.ui.deprecatedDescription`, {
|
|
116
134
|
message,
|
|
117
135
|
command: uiCommandReference(command),
|
|
118
|
-
url: url ? uiLink(i18n(`lib.ui.deprecatedUrlText`), url) : '',
|
|
136
|
+
url: url ? uiLink((0, lang_1.i18n)(`lib.ui.deprecatedUrlText`), url) : '',
|
|
119
137
|
});
|
|
120
138
|
return uiDeprecatedTag(tag);
|
|
121
139
|
}
|
|
122
|
-
|
|
140
|
+
function uiDeprecatedMessage(command, url, message) {
|
|
123
141
|
const tag = message ||
|
|
124
|
-
i18n(`lib.ui.deprecatedMessage`, {
|
|
142
|
+
(0, lang_1.i18n)(`lib.ui.deprecatedMessage`, {
|
|
125
143
|
command: uiCommandReference(command),
|
|
126
|
-
url: url ? uiLink(i18n(`lib.ui.deprecatedUrlText`), url) : '',
|
|
144
|
+
url: url ? uiLink((0, lang_1.i18n)(`lib.ui.deprecatedUrlText`), url) : '',
|
|
127
145
|
});
|
|
128
|
-
logger.log();
|
|
146
|
+
logger_1.logger.log();
|
|
129
147
|
uiDeprecatedTag(tag);
|
|
130
|
-
logger.log();
|
|
148
|
+
logger_1.logger.log();
|
|
131
149
|
}
|
|
132
|
-
|
|
150
|
+
function indent(level) {
|
|
133
151
|
const indentation = ' ';
|
|
134
152
|
return indentation.repeat(level);
|
|
135
153
|
}
|
package/lib/ui/logger.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiLogger = void 0;
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
2
5
|
// Wrapper around LDL logger to provide type checking
|
|
3
|
-
|
|
4
|
-
log: (message) =>
|
|
5
|
-
error: (message) =>
|
|
6
|
-
warn: (message) =>
|
|
7
|
-
success: (message) =>
|
|
8
|
-
info: (message) =>
|
|
9
|
-
debug:
|
|
10
|
-
group: (message) =>
|
|
11
|
-
groupEnd: () =>
|
|
6
|
+
exports.uiLogger = {
|
|
7
|
+
log: (message) => logger_1.logger.log(message),
|
|
8
|
+
error: (message) => logger_1.logger.error(message),
|
|
9
|
+
warn: (message) => logger_1.logger.warn(message),
|
|
10
|
+
success: (message) => logger_1.logger.success(message),
|
|
11
|
+
info: (message) => logger_1.logger.info(message),
|
|
12
|
+
debug: logger_1.logger.debug,
|
|
13
|
+
group: (message) => logger_1.logger.group(message),
|
|
14
|
+
groupEnd: () => logger_1.logger.groupEnd(),
|
|
12
15
|
json: (json) => console.log(JSON.stringify(json, null, 2)),
|
|
13
16
|
};
|
|
@@ -1,13 +1,19 @@
|
|
|
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.outputLogs = outputLogs;
|
|
7
|
+
const moment_1 = __importDefault(require("moment"));
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
+
const lang_1 = require("../lang");
|
|
5
11
|
const SEPARATOR = ' - ';
|
|
6
12
|
const LOG_STATUS_COLORS = {
|
|
7
|
-
SUCCESS: Styles.success,
|
|
8
|
-
ERROR: Styles.error,
|
|
9
|
-
UNHANDLED_ERROR: Styles.error,
|
|
10
|
-
HANDLED_ERROR: Styles.error,
|
|
13
|
+
SUCCESS: logger_1.Styles.success,
|
|
14
|
+
ERROR: logger_1.Styles.error,
|
|
15
|
+
UNHANDLED_ERROR: logger_1.Styles.error,
|
|
16
|
+
HANDLED_ERROR: logger_1.Styles.error,
|
|
11
17
|
};
|
|
12
18
|
function errorHandler(log, options) {
|
|
13
19
|
return `${formatLogHeader(log, options)}${formatError(log, options)}`;
|
|
@@ -46,17 +52,17 @@ function formatStackTrace(log) {
|
|
|
46
52
|
.join('');
|
|
47
53
|
}
|
|
48
54
|
function formatTimestamp(log) {
|
|
49
|
-
return `${
|
|
55
|
+
return `${chalk_1.default.whiteBright((0, moment_1.default)(log.createdAt).toISOString())}`;
|
|
50
56
|
}
|
|
51
57
|
function formatExecutionTime(log) {
|
|
52
|
-
return `${
|
|
58
|
+
return `${chalk_1.default.whiteBright('Execution Time:')} ${log.executionTime}ms`;
|
|
53
59
|
}
|
|
54
60
|
function processLog(log, options) {
|
|
55
61
|
try {
|
|
56
62
|
return logHandler[log.status](log, options);
|
|
57
63
|
}
|
|
58
64
|
catch (e) {
|
|
59
|
-
logger.error(i18n(`lib.ui.serverlessFunctionLogs.unableToProcessLog`, {
|
|
65
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.ui.serverlessFunctionLogs.unableToProcessLog`, {
|
|
60
66
|
log: JSON.stringify(log),
|
|
61
67
|
}));
|
|
62
68
|
}
|
|
@@ -70,7 +76,7 @@ function isLogsResponse(logsResp) {
|
|
|
70
76
|
function processLogs(logsResp, options) {
|
|
71
77
|
const isLogsResp = isLogsResponse(logsResp);
|
|
72
78
|
if (!logsResp || (isLogsResp && logsResp.results.length === 0)) {
|
|
73
|
-
return i18n(`lib.ui.serverlessFunctionLogs.noLogsFound`);
|
|
79
|
+
return (0, lang_1.i18n)(`lib.ui.serverlessFunctionLogs.noLogsFound`);
|
|
74
80
|
}
|
|
75
81
|
else if (isLogsResp) {
|
|
76
82
|
return logsResp
|
|
@@ -81,6 +87,6 @@ function processLogs(logsResp, options) {
|
|
|
81
87
|
}
|
|
82
88
|
return processLog(logsResp, options);
|
|
83
89
|
}
|
|
84
|
-
|
|
85
|
-
logger.log(processLogs(logsResp, options));
|
|
90
|
+
function outputLogs(logsResp, options) {
|
|
91
|
+
logger_1.logger.log(processLogs(logsResp, options));
|
|
86
92
|
}
|