@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/commands/config/set.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CmsPublishMode } from '@hubspot/local-dev-lib/types/Files';
|
|
2
|
-
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs
|
|
2
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
3
3
|
type ConfigSetArgs = CommonArgs & ConfigArgs & {
|
|
4
4
|
defaultCmsPublishMode: CmsPublishMode;
|
|
5
5
|
allowUsageTracking?: boolean;
|
package/commands/config/set.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lang_1 = require("../../lib/lang");
|
|
4
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
5
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
6
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
7
|
+
const configOptions_1 = require("../../lib/configOptions");
|
|
8
|
+
const en_1 = require("../../lang/en");
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
8
10
|
const command = 'set';
|
|
9
|
-
const describe = commands.config.subcommands.set.describe;
|
|
11
|
+
const describe = en_1.commands.config.subcommands.set.describe;
|
|
10
12
|
async function selectOptions() {
|
|
11
|
-
const { configOption } = await promptUser([
|
|
13
|
+
const { configOption } = await (0, promptUtils_1.promptUser)([
|
|
12
14
|
{
|
|
13
15
|
type: 'list',
|
|
14
16
|
name: 'configOption',
|
|
15
17
|
pageSize: 20,
|
|
16
|
-
message: commands.config.subcommands.set.promptMessage,
|
|
18
|
+
message: en_1.commands.config.subcommands.set.promptMessage,
|
|
17
19
|
choices: [
|
|
18
20
|
{
|
|
19
21
|
name: 'Default CMS publish mode',
|
|
@@ -30,50 +32,50 @@ async function selectOptions() {
|
|
|
30
32
|
async function handleConfigUpdate(accountId, args) {
|
|
31
33
|
const { allowAutoUpdates, allowUsageTracking, defaultCmsPublishMode, httpTimeout, } = args;
|
|
32
34
|
if (typeof defaultCmsPublishMode !== 'undefined') {
|
|
33
|
-
await setDefaultCmsPublishMode({ defaultCmsPublishMode, accountId });
|
|
35
|
+
await (0, configOptions_1.setDefaultCmsPublishMode)({ defaultCmsPublishMode, accountId });
|
|
34
36
|
return true;
|
|
35
37
|
}
|
|
36
38
|
else if (typeof httpTimeout !== 'undefined') {
|
|
37
|
-
await setHttpTimeout({ httpTimeout, accountId });
|
|
39
|
+
await (0, configOptions_1.setHttpTimeout)({ httpTimeout, accountId });
|
|
38
40
|
return true;
|
|
39
41
|
}
|
|
40
42
|
else if (typeof allowUsageTracking !== 'undefined') {
|
|
41
|
-
await setAllowUsageTracking({ allowUsageTracking, accountId });
|
|
43
|
+
await (0, configOptions_1.setAllowUsageTracking)({ allowUsageTracking, accountId });
|
|
42
44
|
return true;
|
|
43
45
|
}
|
|
44
46
|
else if (typeof allowAutoUpdates !== 'undefined') {
|
|
45
|
-
await setAllowAutoUpdates({ allowAutoUpdates, accountId });
|
|
47
|
+
await (0, configOptions_1.setAllowAutoUpdates)({ allowAutoUpdates, accountId });
|
|
46
48
|
return true;
|
|
47
49
|
}
|
|
48
50
|
return false;
|
|
49
51
|
}
|
|
50
52
|
async function handler(args) {
|
|
51
53
|
const { derivedAccountId } = args;
|
|
52
|
-
trackCommandUsage('config-set', {}, derivedAccountId);
|
|
54
|
+
(0, usageTracking_1.trackCommandUsage)('config-set', {}, derivedAccountId);
|
|
53
55
|
const configUpdated = await handleConfigUpdate(derivedAccountId, args);
|
|
54
56
|
if (!configUpdated) {
|
|
55
57
|
const selectedOptions = await selectOptions();
|
|
56
58
|
await handleConfigUpdate(derivedAccountId, selectedOptions);
|
|
57
59
|
}
|
|
58
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
60
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
59
61
|
}
|
|
60
62
|
function configSetBuilder(yargs) {
|
|
61
63
|
yargs
|
|
62
64
|
.options({
|
|
63
65
|
'default-cms-publish-mode': {
|
|
64
|
-
describe: commands.config.subcommands.set.options.defaultMode.describe,
|
|
66
|
+
describe: en_1.commands.config.subcommands.set.options.defaultMode.describe,
|
|
65
67
|
type: 'string',
|
|
66
68
|
},
|
|
67
69
|
'allow-usage-tracking': {
|
|
68
|
-
describe: commands.config.subcommands.set.options.allowUsageTracking.describe,
|
|
70
|
+
describe: en_1.commands.config.subcommands.set.options.allowUsageTracking.describe,
|
|
69
71
|
type: 'boolean',
|
|
70
72
|
},
|
|
71
73
|
'http-timeout': {
|
|
72
|
-
describe: commands.config.subcommands.set.options.httpTimeout.describe,
|
|
74
|
+
describe: en_1.commands.config.subcommands.set.options.httpTimeout.describe,
|
|
73
75
|
type: 'string',
|
|
74
76
|
},
|
|
75
77
|
'allow-auto-updates': {
|
|
76
|
-
describe: commands.config.subcommands.set.options.allowAutoUpdates.describe,
|
|
78
|
+
describe: en_1.commands.config.subcommands.set.options.allowAutoUpdates.describe,
|
|
77
79
|
type: 'boolean',
|
|
78
80
|
hidden: true,
|
|
79
81
|
},
|
|
@@ -87,12 +89,12 @@ function configSetBuilder(yargs) {
|
|
|
87
89
|
.example([
|
|
88
90
|
[
|
|
89
91
|
'$0 config set',
|
|
90
|
-
i18n(`commands.config.subcommands.set.examples.default`),
|
|
92
|
+
(0, lang_1.i18n)(`commands.config.subcommands.set.examples.default`),
|
|
91
93
|
],
|
|
92
94
|
]);
|
|
93
95
|
return yargs;
|
|
94
96
|
}
|
|
95
|
-
const builder = makeYargsBuilder(configSetBuilder, command, describe, {
|
|
97
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(configSetBuilder, command, describe, {
|
|
96
98
|
useGlobalOptions: true,
|
|
97
99
|
useConfigOptions: true,
|
|
98
100
|
});
|
|
@@ -102,4 +104,4 @@ const configSetCommand = {
|
|
|
102
104
|
handler,
|
|
103
105
|
builder,
|
|
104
106
|
};
|
|
105
|
-
|
|
107
|
+
exports.default = configSetCommand;
|
package/commands/config.d.ts
CHANGED
package/commands/config.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
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
|
+
const lang_1 = require("../lib/lang");
|
|
7
|
+
const set_1 = __importDefault(require("./config/set"));
|
|
8
|
+
const migrate_1 = __importDefault(require("./config/migrate"));
|
|
9
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
5
10
|
const command = 'config';
|
|
6
|
-
const describe = i18n('commands.config.describe');
|
|
11
|
+
const describe = (0, lang_1.i18n)('commands.config.describe');
|
|
7
12
|
function configBuilder(yargs) {
|
|
8
|
-
yargs.command(
|
|
13
|
+
yargs.command(set_1.default).command(migrate_1.default).demandCommand(1, '');
|
|
9
14
|
return yargs;
|
|
10
15
|
}
|
|
11
|
-
const builder = makeYargsBuilder(configBuilder, command, describe);
|
|
16
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(configBuilder, command, describe);
|
|
12
17
|
const configCommand = {
|
|
13
18
|
command,
|
|
14
19
|
describe,
|
|
15
20
|
builder,
|
|
16
21
|
handler: () => { },
|
|
17
22
|
};
|
|
18
|
-
|
|
23
|
+
exports.default = configCommand;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const github_1 = require("@hubspot/local-dev-lib/api/github");
|
|
9
|
+
const github_2 = require("@hubspot/local-dev-lib/github");
|
|
10
|
+
const createApiSamplePrompt_1 = require("../../lib/prompts/createApiSamplePrompt");
|
|
11
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
12
|
+
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
13
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
14
|
+
const en_1 = require("../../lang/en");
|
|
15
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
11
16
|
const apiSampleAssetType = {
|
|
12
17
|
hidden: true,
|
|
13
18
|
dest: ({ dest }) => dest,
|
|
14
19
|
validate: ({ name }) => {
|
|
15
20
|
if (!name) {
|
|
16
|
-
uiLogger.error(commands.create.subcommands.apiSample.errors.nameRequired);
|
|
21
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.apiSample.errors.nameRequired);
|
|
17
22
|
return false;
|
|
18
23
|
}
|
|
19
24
|
return true;
|
|
20
25
|
},
|
|
21
26
|
execute: async ({ dest, name, assetType, commandArgs }) => {
|
|
22
|
-
const filePath =
|
|
23
|
-
if (
|
|
24
|
-
const overwrite = await confirmPrompt(commands.create.subcommands.apiSample.folderOverwritePrompt(filePath), { defaultAnswer: false });
|
|
27
|
+
const filePath = path_1.default.join(dest, name);
|
|
28
|
+
if (fs_extra_1.default.existsSync(filePath)) {
|
|
29
|
+
const overwrite = await (0, promptUtils_1.confirmPrompt)(en_1.commands.create.subcommands.apiSample.folderOverwritePrompt(filePath), { defaultAnswer: false });
|
|
25
30
|
if (overwrite) {
|
|
26
|
-
|
|
31
|
+
fs_extra_1.default.rmdirSync(filePath, { recursive: true });
|
|
27
32
|
}
|
|
28
33
|
else {
|
|
29
34
|
return;
|
|
@@ -31,33 +36,33 @@ const apiSampleAssetType = {
|
|
|
31
36
|
}
|
|
32
37
|
let samplesConfig;
|
|
33
38
|
try {
|
|
34
|
-
const { data } = await fetchRepoFile('HubSpot/sample-apps-list', 'samples.json', 'main');
|
|
39
|
+
const { data } = await (0, github_1.fetchRepoFile)('HubSpot/sample-apps-list', 'samples.json', 'main');
|
|
35
40
|
samplesConfig = data;
|
|
36
41
|
}
|
|
37
42
|
catch (err) {
|
|
38
|
-
debugError(err);
|
|
43
|
+
(0, errorHandlers_1.debugError)(err);
|
|
39
44
|
}
|
|
40
45
|
if (!samplesConfig) {
|
|
41
|
-
uiLogger.error(commands.create.subcommands.apiSample.errors.noSamples);
|
|
42
|
-
process.exit(EXIT_CODES.ERROR);
|
|
46
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.apiSample.errors.noSamples);
|
|
47
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
43
48
|
}
|
|
44
|
-
const { sampleType, sampleLanguage } = await createApiSamplePrompt(samplesConfig);
|
|
49
|
+
const { sampleType, sampleLanguage } = await (0, createApiSamplePrompt_1.createApiSamplePrompt)(samplesConfig);
|
|
45
50
|
if (!sampleType || !sampleLanguage) {
|
|
46
|
-
uiLogger.error(commands.create.subcommands.apiSample.errors.noSamples);
|
|
47
|
-
process.exit(EXIT_CODES.ERROR);
|
|
51
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.apiSample.errors.noSamples);
|
|
52
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
48
53
|
}
|
|
49
|
-
uiLogger.info(commands.create.subcommands.apiSample.info.sampleChosen(sampleType, sampleLanguage));
|
|
50
|
-
const created = await cloneGithubRepo(`HubSpot/${sampleType}`, filePath, {
|
|
54
|
+
logger_1.uiLogger.info(en_1.commands.create.subcommands.apiSample.info.sampleChosen(sampleType, sampleLanguage));
|
|
55
|
+
const created = await (0, github_2.cloneGithubRepo)(`HubSpot/${sampleType}`, filePath, {
|
|
51
56
|
...commandArgs,
|
|
52
57
|
type: assetType,
|
|
53
58
|
sourceDir: sampleLanguage,
|
|
54
59
|
});
|
|
55
60
|
if (created) {
|
|
56
|
-
if (
|
|
57
|
-
|
|
61
|
+
if (fs_extra_1.default.existsSync(`${filePath}/.env.template`)) {
|
|
62
|
+
fs_extra_1.default.copySync(`${filePath}/.env.template`, `${filePath}/.env`);
|
|
58
63
|
}
|
|
59
|
-
uiLogger.success(commands.create.subcommands.apiSample.success.sampleCreated(filePath));
|
|
64
|
+
logger_1.uiLogger.success(en_1.commands.create.subcommands.apiSample.success.sampleCreated(filePath));
|
|
60
65
|
}
|
|
61
66
|
},
|
|
62
67
|
};
|
|
63
|
-
|
|
68
|
+
exports.default = apiSampleAssetType;
|
package/commands/create/app.d.ts
CHANGED
package/commands/create/app.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
2
4
|
const appAssetType = {
|
|
3
5
|
hidden: true,
|
|
4
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
5
7
|
execute: async ({ commandArgs, dest, assetType }) => {
|
|
6
|
-
await cloneGithubRepo('HubSpot/crm-card-weather-app', dest, {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/crm-card-weather-app', dest, {
|
|
7
9
|
...commandArgs,
|
|
8
10
|
type: assetType,
|
|
9
11
|
});
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
exports.default = appAssetType;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const functions_1 = require("@hubspot/local-dev-lib/cms/functions");
|
|
4
|
+
const createFunctionPrompt_1 = require("../../lib/prompts/createFunctionPrompt");
|
|
5
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
6
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
5
7
|
const functionAssetType = {
|
|
6
8
|
hidden: false,
|
|
7
9
|
dest: ({ name }) => name,
|
|
8
10
|
execute: async ({ dest }) => {
|
|
9
|
-
const functionDefinition = await createFunctionPrompt();
|
|
11
|
+
const functionDefinition = await (0, createFunctionPrompt_1.createFunctionPrompt)();
|
|
10
12
|
try {
|
|
11
|
-
await createFunction(functionDefinition, dest);
|
|
13
|
+
await (0, functions_1.createFunction)(functionDefinition, dest);
|
|
12
14
|
}
|
|
13
15
|
catch (e) {
|
|
14
|
-
logError(e);
|
|
15
|
-
process.exit(EXIT_CODES.ERROR);
|
|
16
|
+
(0, index_1.logError)(e);
|
|
17
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
16
18
|
}
|
|
17
19
|
},
|
|
18
20
|
};
|
|
19
|
-
|
|
21
|
+
exports.default = functionAssetType;
|
package/commands/create/index.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
const api_sample_1 = __importDefault(require("./api-sample"));
|
|
7
|
+
const app_1 = __importDefault(require("./app"));
|
|
8
|
+
const function_1 = __importDefault(require("./function"));
|
|
9
|
+
const module_1 = __importDefault(require("./module"));
|
|
10
|
+
const react_app_1 = __importDefault(require("./react-app"));
|
|
11
|
+
const template_1 = __importDefault(require("./template"));
|
|
12
|
+
const vue_app_1 = __importDefault(require("./vue-app"));
|
|
13
|
+
const webpack_serverless_1 = __importDefault(require("./webpack-serverless"));
|
|
14
|
+
const website_theme_1 = __importDefault(require("./website-theme"));
|
|
10
15
|
const assets = {
|
|
11
|
-
'api-sample':
|
|
12
|
-
app:
|
|
13
|
-
function:
|
|
14
|
-
module:
|
|
15
|
-
'react-app':
|
|
16
|
-
template:
|
|
17
|
-
'vue-app':
|
|
18
|
-
'webpack-serverless':
|
|
19
|
-
'website-theme':
|
|
16
|
+
'api-sample': api_sample_1.default,
|
|
17
|
+
app: app_1.default,
|
|
18
|
+
function: function_1.default,
|
|
19
|
+
module: module_1.default,
|
|
20
|
+
'react-app': react_app_1.default,
|
|
21
|
+
template: template_1.default,
|
|
22
|
+
'vue-app': vue_app_1.default,
|
|
23
|
+
'webpack-serverless': webpack_serverless_1.default,
|
|
24
|
+
'website-theme': website_theme_1.default,
|
|
20
25
|
};
|
|
21
|
-
|
|
26
|
+
exports.default = assets;
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const modules_1 = require("@hubspot/local-dev-lib/cms/modules");
|
|
4
|
+
const createModulePrompt_1 = require("../../lib/prompts/createModulePrompt");
|
|
5
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
6
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
7
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
8
|
+
const en_1 = require("../../lang/en");
|
|
7
9
|
const moduleAssetType = {
|
|
8
10
|
hidden: false,
|
|
9
11
|
dest: ({ dest }) => dest,
|
|
10
12
|
validate: ({ name }) => {
|
|
11
13
|
if (!name) {
|
|
12
|
-
uiLogger.error(commands.create.subcommands.module.errors.nameRequired);
|
|
14
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.module.errors.nameRequired);
|
|
13
15
|
return false;
|
|
14
16
|
}
|
|
15
17
|
return true;
|
|
16
18
|
},
|
|
17
19
|
execute: async ({ name, dest, getInternalVersion }) => {
|
|
18
|
-
const moduleDefinition = await createModulePrompt();
|
|
20
|
+
const moduleDefinition = await (0, createModulePrompt_1.createModulePrompt)();
|
|
19
21
|
try {
|
|
20
|
-
await createModule(moduleDefinition, name, dest, getInternalVersion);
|
|
22
|
+
await (0, modules_1.createModule)(moduleDefinition, name, dest, getInternalVersion);
|
|
21
23
|
}
|
|
22
24
|
catch (e) {
|
|
23
|
-
logError(e);
|
|
24
|
-
process.exit(EXIT_CODES.ERROR);
|
|
25
|
+
(0, index_1.logError)(e);
|
|
26
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
|
-
|
|
30
|
+
exports.default = moduleAssetType;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
2
4
|
const reactAppAssetType = {
|
|
3
5
|
hidden: false,
|
|
4
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
5
7
|
execute: async ({ commandArgs, dest, assetType }) => {
|
|
6
|
-
await cloneGithubRepo('HubSpot/cms-react-boilerplate', dest, {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-react-boilerplate', dest, {
|
|
7
9
|
...commandArgs,
|
|
8
10
|
type: assetType,
|
|
9
11
|
});
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
exports.default = reactAppAssetType;
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const templates_1 = require("@hubspot/local-dev-lib/cms/templates");
|
|
4
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
5
|
+
const createTemplatePrompt_1 = require("../../lib/prompts/createTemplatePrompt");
|
|
6
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
7
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
8
|
+
const en_1 = require("../../lang/en");
|
|
7
9
|
const templateAssetType = {
|
|
8
10
|
dest: ({ dest }) => dest,
|
|
9
11
|
hidden: false,
|
|
10
12
|
validate: ({ name }) => {
|
|
11
13
|
if (!name) {
|
|
12
|
-
uiLogger.error(commands.create.subcommands.template.errors.nameRequired);
|
|
14
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.template.errors.nameRequired);
|
|
13
15
|
return false;
|
|
14
16
|
}
|
|
15
17
|
return true;
|
|
16
18
|
},
|
|
17
19
|
execute: async ({ name, dest }) => {
|
|
18
|
-
const { templateType } = await createTemplatePrompt();
|
|
20
|
+
const { templateType } = await (0, createTemplatePrompt_1.createTemplatePrompt)();
|
|
19
21
|
try {
|
|
20
|
-
await createTemplate(name, dest, templateType);
|
|
22
|
+
await (0, templates_1.createTemplate)(name, dest, templateType);
|
|
21
23
|
}
|
|
22
24
|
catch (e) {
|
|
23
|
-
logError(e);
|
|
24
|
-
process.exit(EXIT_CODES.ERROR);
|
|
25
|
+
(0, index_1.logError)(e);
|
|
26
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
|
-
|
|
30
|
+
exports.default = templateAssetType;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
2
4
|
const vueAppAssetType = {
|
|
3
5
|
hidden: false,
|
|
4
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
5
7
|
execute: async ({ commandArgs, dest, assetType }) => {
|
|
6
|
-
await cloneGithubRepo('HubSpot/cms-vue-boilerplate', dest, {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-vue-boilerplate', dest, {
|
|
7
9
|
...commandArgs,
|
|
8
10
|
type: assetType,
|
|
9
11
|
});
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
exports.default = vueAppAssetType;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
2
4
|
const webpackServerlessAssetType = {
|
|
3
5
|
hidden: false,
|
|
4
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
5
7
|
execute: async ({ commandArgs, dest, assetType }) => {
|
|
6
|
-
await cloneGithubRepo('HubSpot/cms-webpack-serverless-boilerplate', dest, {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-webpack-serverless-boilerplate', dest, {
|
|
7
9
|
...commandArgs,
|
|
8
10
|
type: assetType,
|
|
9
11
|
});
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
exports.default = webpackServerlessAssetType;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
4
|
+
const config_1 = require("../../lib/projects/config");
|
|
3
5
|
const PROJECT_BOILERPLATE_BRANCH = 'cms-boilerplate-developer-projects';
|
|
4
6
|
const websiteThemeAssetType = {
|
|
5
7
|
hidden: false,
|
|
6
8
|
dest: ({ name, assetType }) => name || assetType,
|
|
7
9
|
execute: async ({ dest, assetType, commandArgs }) => {
|
|
8
|
-
const isInProject = await getIsInProject(dest);
|
|
10
|
+
const isInProject = await (0, config_1.getIsInProject)(dest);
|
|
9
11
|
if (isInProject) {
|
|
10
12
|
commandArgs.branch = PROJECT_BOILERPLATE_BRANCH;
|
|
11
13
|
}
|
|
12
|
-
await cloneGithubRepo('HubSpot/cms-theme-boilerplate', dest, {
|
|
14
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-theme-boilerplate', dest, {
|
|
13
15
|
...commandArgs,
|
|
14
16
|
type: assetType,
|
|
15
17
|
sourceDir: 'src',
|
|
16
18
|
});
|
|
17
19
|
},
|
|
18
20
|
};
|
|
19
|
-
|
|
21
|
+
exports.default = websiteThemeAssetType;
|
package/commands/create.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateArgs } from '../types/
|
|
2
|
-
import { YargsCommandModule } from '../types/Yargs
|
|
1
|
+
import { CreateArgs } from '../types/Cms';
|
|
2
|
+
import { YargsCommandModule } from '../types/Yargs';
|
|
3
3
|
declare const createCommand: YargsCommandModule<unknown, CreateArgs>;
|
|
4
4
|
export default createCommand;
|