@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,9 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const en_1 = require("../../lang/en");
|
|
8
|
+
const generateSelectors_1 = require("../../lib/generateSelectors");
|
|
9
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
7
12
|
const HUBL_EXPRESSION_REGEX = new RegExp(/{%\s*(.*)\s*%}/, 'g');
|
|
8
13
|
const HUBL_VARIABLE_NAME_REGEX = new RegExp(/{%\s*set\s*(\w*)/, 'i');
|
|
9
14
|
const HUBL_STATEMENT_REGEX = new RegExp(/{{\s*[\w.(,\d\-\s)|/~]*.*}}/, 'g');
|
|
@@ -14,16 +19,16 @@ const CSS_SELECTORS_REGEX = new RegExp(/([\s\w:.,\0-[\]]*){/, 'i');
|
|
|
14
19
|
const CSS_EXPRESSION_REGEX = new RegExp(/(?!\s)([^}])*(?![.#\s,>])[^}]*}/, 'g');
|
|
15
20
|
const THEME_PATH_REGEX = new RegExp(/=\s*.*(theme\.(\w|\.)*)/, 'i');
|
|
16
21
|
const command = 'generate-selectors <path>';
|
|
17
|
-
const describe = commands.theme.subcommands.generateSelectors.describe;
|
|
22
|
+
const describe = en_1.commands.theme.subcommands.generateSelectors.describe;
|
|
18
23
|
async function handler(args) {
|
|
19
24
|
const { path } = args;
|
|
20
|
-
const fieldsJsonPath = findFieldsJsonPath(path);
|
|
25
|
+
const fieldsJsonPath = (0, generateSelectors_1.findFieldsJsonPath)(path);
|
|
21
26
|
if (!fieldsJsonPath) {
|
|
22
|
-
uiLogger.error(commands.theme.subcommands.generateSelectors.errors.fieldsNotFound);
|
|
23
|
-
process.exit(EXIT_CODES.ERROR);
|
|
27
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.generateSelectors.errors.fieldsNotFound);
|
|
28
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
24
29
|
}
|
|
25
|
-
let fieldsJson = JSON.parse(
|
|
26
|
-
let cssString = combineThemeCss(path) ?? '';
|
|
30
|
+
let fieldsJson = JSON.parse(fs_1.default.readFileSync(fieldsJsonPath, 'utf-8'));
|
|
31
|
+
let cssString = (0, generateSelectors_1.combineThemeCss)(path) ?? '';
|
|
27
32
|
/**
|
|
28
33
|
* Creates map of HubL variable names to theme field paths
|
|
29
34
|
*/
|
|
@@ -129,34 +134,34 @@ async function handler(args) {
|
|
|
129
134
|
return themeFieldsSelectorMap;
|
|
130
135
|
}, {});
|
|
131
136
|
if (!Object.keys(finalMap).length) {
|
|
132
|
-
uiLogger.error(commands.theme.subcommands.generateSelectors.errors.noSelectorsFound);
|
|
133
|
-
process.exit(EXIT_CODES.ERROR);
|
|
137
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.generateSelectors.errors.noSelectorsFound);
|
|
138
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
134
139
|
}
|
|
135
140
|
Object.keys(finalMap).forEach(themeFieldKey => {
|
|
136
141
|
const fieldKey = themeFieldKey.split('.');
|
|
137
142
|
const selectors = finalMap[themeFieldKey];
|
|
138
|
-
fieldsJson = setPreviewSelectors(fieldsJson, fieldKey.splice(1), selectors);
|
|
143
|
+
fieldsJson = (0, generateSelectors_1.setPreviewSelectors)(fieldsJson, fieldKey.splice(1), selectors);
|
|
139
144
|
});
|
|
140
145
|
// Because fields can have nested inheritance we generated inherited selectors
|
|
141
146
|
// multiple times to make sure all inherted selectors are bubbled up.
|
|
142
|
-
const maxFieldsDepth = getMaxFieldsDepth();
|
|
147
|
+
const maxFieldsDepth = (0, generateSelectors_1.getMaxFieldsDepth)();
|
|
143
148
|
for (let i = 0; i < maxFieldsDepth; i += 1) {
|
|
144
|
-
fieldsJson = generateInheritedSelectors(fieldsJson);
|
|
149
|
+
fieldsJson = (0, generateSelectors_1.generateInheritedSelectors)(fieldsJson);
|
|
145
150
|
}
|
|
146
|
-
const selectorsMap = generateSelectorsMap(fieldsJson);
|
|
151
|
+
const selectorsMap = (0, generateSelectors_1.generateSelectorsMap)(fieldsJson);
|
|
147
152
|
const selectorsPath = `${path}/editor-preview.json`;
|
|
148
|
-
|
|
149
|
-
uiLogger.success(commands.theme.subcommands.generateSelectors.success(path, selectorsPath));
|
|
153
|
+
fs_1.default.writeFileSync(selectorsPath, `${JSON.stringify({ selectors: selectorsMap }, null, 2)}\n`);
|
|
154
|
+
logger_1.uiLogger.success(en_1.commands.theme.subcommands.generateSelectors.success(path, selectorsPath));
|
|
150
155
|
}
|
|
151
156
|
function themeSelectorBuilder(yargs) {
|
|
152
157
|
yargs.positional('path', {
|
|
153
|
-
describe: commands.theme.subcommands.generateSelectors.positionals.path,
|
|
158
|
+
describe: en_1.commands.theme.subcommands.generateSelectors.positionals.path,
|
|
154
159
|
type: 'string',
|
|
155
160
|
required: true,
|
|
156
161
|
});
|
|
157
162
|
return yargs;
|
|
158
163
|
}
|
|
159
|
-
const builder = makeYargsBuilder(themeSelectorBuilder, command, describe, {
|
|
164
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeSelectorBuilder, command, describe, {
|
|
160
165
|
useGlobalOptions: true,
|
|
161
166
|
});
|
|
162
167
|
const themeSelectorsCommand = {
|
|
@@ -165,4 +170,4 @@ const themeSelectorsCommand = {
|
|
|
165
170
|
handler,
|
|
166
171
|
builder,
|
|
167
172
|
};
|
|
168
|
-
|
|
173
|
+
exports.default = themeSelectorsCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
2
|
type ThemeValidateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
3
|
path: string;
|
|
4
4
|
};
|
|
@@ -1,35 +1,40 @@
|
|
|
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
|
+
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
7
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
8
|
+
const marketplaceValidate_1 = require("../../lib/marketplaceValidate");
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
6
11
|
const command = 'marketplace-validate <path>';
|
|
7
|
-
const describe = commands.theme.subcommands.marketplaceValidate.describe;
|
|
12
|
+
const describe = en_1.commands.theme.subcommands.marketplaceValidate.describe;
|
|
8
13
|
async function handler(args) {
|
|
9
14
|
const { path, derivedAccountId } = args;
|
|
10
|
-
trackCommandUsage('validate', {}, derivedAccountId);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
text: commands.theme.subcommands.marketplaceValidate.logs.validatingTheme(path),
|
|
15
|
+
(0, usageTracking_1.trackCommandUsage)('validate', {}, derivedAccountId);
|
|
16
|
+
SpinniesManager_1.default.init();
|
|
17
|
+
SpinniesManager_1.default.add('marketplaceValidation', {
|
|
18
|
+
text: en_1.commands.theme.subcommands.marketplaceValidate.logs.validatingTheme(path),
|
|
14
19
|
});
|
|
15
20
|
const assetType = 'THEME';
|
|
16
|
-
const validationId = await kickOffValidation(derivedAccountId, assetType, path);
|
|
17
|
-
await pollForValidationFinish(derivedAccountId, validationId);
|
|
18
|
-
|
|
19
|
-
const validationResults = await fetchValidationResults(derivedAccountId, validationId);
|
|
20
|
-
processValidationErrors(commands.theme.subcommands.marketplaceValidate.errors.invalidPath, validationResults);
|
|
21
|
-
displayValidationResults(commands.theme.subcommands.marketplaceValidate.results, validationResults);
|
|
21
|
+
const validationId = await (0, marketplaceValidate_1.kickOffValidation)(derivedAccountId, assetType, path);
|
|
22
|
+
await (0, marketplaceValidate_1.pollForValidationFinish)(derivedAccountId, validationId);
|
|
23
|
+
SpinniesManager_1.default.remove('marketplaceValidation');
|
|
24
|
+
const validationResults = await (0, marketplaceValidate_1.fetchValidationResults)(derivedAccountId, validationId);
|
|
25
|
+
(0, marketplaceValidate_1.processValidationErrors)(en_1.commands.theme.subcommands.marketplaceValidate.errors.invalidPath, validationResults);
|
|
26
|
+
(0, marketplaceValidate_1.displayValidationResults)(en_1.commands.theme.subcommands.marketplaceValidate.results, validationResults);
|
|
22
27
|
process.exit();
|
|
23
28
|
}
|
|
24
29
|
function themeValidateBuilder(yargs) {
|
|
25
30
|
yargs.positional('path', {
|
|
26
|
-
describe: commands.theme.subcommands.marketplaceValidate.positionals.path.describe,
|
|
31
|
+
describe: en_1.commands.theme.subcommands.marketplaceValidate.positionals.path.describe,
|
|
27
32
|
type: 'string',
|
|
28
33
|
required: true,
|
|
29
34
|
});
|
|
30
35
|
return yargs;
|
|
31
36
|
}
|
|
32
|
-
const builder = makeYargsBuilder(themeValidateBuilder, command, describe, {
|
|
37
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeValidateBuilder, command, describe, {
|
|
33
38
|
useGlobalOptions: true,
|
|
34
39
|
useConfigOptions: true,
|
|
35
40
|
useAccountOptions: true,
|
|
@@ -41,4 +46,4 @@ const themeValidateCommand = {
|
|
|
41
46
|
handler,
|
|
42
47
|
builder,
|
|
43
48
|
};
|
|
44
|
-
|
|
49
|
+
exports.default = themeValidateCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule } from '../../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
2
|
type ThemePreviewArgs = CommonArgs & ConfigArgs & AccountArgs & {
|
|
3
3
|
src: string;
|
|
4
4
|
dest: string;
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const cli_progress_1 = __importDefault(require("cli-progress"));
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
10
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
11
|
+
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
12
|
+
const themes_1 = require("@hubspot/local-dev-lib/cms/themes");
|
|
13
|
+
const theme_preview_dev_server_1 = require("@hubspot/theme-preview-dev-server");
|
|
14
|
+
const upload_1 = require("../../lib/upload");
|
|
15
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
16
|
+
const previewPrompt_1 = require("../../lib/prompts/previewPrompt");
|
|
17
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
18
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
19
|
+
const process_1 = require("../../lib/process");
|
|
20
|
+
const config_1 = require("../../lib/projects/config");
|
|
21
|
+
const structure_1 = require("../../lib/projects/structure");
|
|
22
|
+
const Projects_1 = require("../../types/Projects");
|
|
23
|
+
const hasFeature_1 = require("../../lib/hasFeature");
|
|
24
|
+
const constants_1 = require("../../lib/constants");
|
|
25
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
26
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
22
27
|
const command = 'preview [--src] [--dest]';
|
|
23
|
-
const describe = commands.theme.subcommands.preview.describe;
|
|
28
|
+
const describe = en_1.commands.theme.subcommands.preview.describe;
|
|
24
29
|
function validateSrcPath(src) {
|
|
25
30
|
const logInvalidPath = () => {
|
|
26
|
-
uiLogger.error(commands.theme.subcommands.preview.errors.invalidPath(src));
|
|
31
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.preview.errors.invalidPath(src));
|
|
27
32
|
};
|
|
28
33
|
try {
|
|
29
|
-
const stats =
|
|
34
|
+
const stats = fs_1.default.statSync(src);
|
|
30
35
|
if (!stats.isDirectory()) {
|
|
31
36
|
logInvalidPath();
|
|
32
37
|
return false;
|
|
@@ -40,11 +45,11 @@ function validateSrcPath(src) {
|
|
|
40
45
|
}
|
|
41
46
|
function handleUserInput() {
|
|
42
47
|
const onTerminate = () => {
|
|
43
|
-
uiLogger.log(commands.theme.subcommands.preview.logs.processExited);
|
|
44
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
48
|
+
logger_1.uiLogger.log(en_1.commands.theme.subcommands.preview.logs.processExited);
|
|
49
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
45
50
|
};
|
|
46
|
-
handleExit(onTerminate);
|
|
47
|
-
handleKeypress(key => {
|
|
51
|
+
(0, process_1.handleExit)(onTerminate);
|
|
52
|
+
(0, process_1.handleKeypress)(key => {
|
|
48
53
|
if ((key.ctrl && key.name === 'c') || key.name === 'q') {
|
|
49
54
|
onTerminate();
|
|
50
55
|
}
|
|
@@ -53,33 +58,33 @@ function handleUserInput() {
|
|
|
53
58
|
async function determineSrcAndDest(args) {
|
|
54
59
|
let absoluteSrc;
|
|
55
60
|
let dest;
|
|
56
|
-
const { projectDir, projectConfig } = await getProjectConfig();
|
|
61
|
+
const { projectDir, projectConfig } = await (0, config_1.getProjectConfig)();
|
|
57
62
|
if (!(projectDir && projectConfig)) {
|
|
58
63
|
// Not in a project, prompt for src and dest of traditional theme
|
|
59
|
-
const previewPromptAnswers = await previewPrompt(args);
|
|
64
|
+
const previewPromptAnswers = await (0, previewPrompt_1.previewPrompt)(args);
|
|
60
65
|
const src = args.src || previewPromptAnswers.src;
|
|
61
66
|
dest = args.dest || previewPromptAnswers.dest;
|
|
62
|
-
absoluteSrc =
|
|
67
|
+
absoluteSrc = path_1.default.resolve((0, path_2.getCwd)(), src);
|
|
63
68
|
if (!dest || !validateSrcPath(absoluteSrc)) {
|
|
64
|
-
process.exit(EXIT_CODES.ERROR);
|
|
69
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
else {
|
|
68
73
|
// In a project
|
|
69
|
-
let themeJsonPath = getThemeJSONPath(getCwd());
|
|
74
|
+
let themeJsonPath = (0, themes_1.getThemeJSONPath)((0, path_2.getCwd)());
|
|
70
75
|
if (!themeJsonPath) {
|
|
71
|
-
const projectComponents = await findProjectComponents(projectDir);
|
|
72
|
-
const themeComponents = projectComponents.filter(c => c.type === ComponentTypes.HublTheme);
|
|
76
|
+
const projectComponents = await (0, structure_1.findProjectComponents)(projectDir);
|
|
77
|
+
const themeComponents = projectComponents.filter(c => c.type === Projects_1.ComponentTypes.HublTheme);
|
|
73
78
|
if (themeComponents.length === 0) {
|
|
74
|
-
uiLogger.error(commands.theme.subcommands.preview.errors.noThemeComponents);
|
|
75
|
-
process.exit(EXIT_CODES.ERROR);
|
|
79
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.preview.errors.noThemeComponents);
|
|
80
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
76
81
|
}
|
|
77
|
-
const answer = await previewProjectPrompt(themeComponents);
|
|
82
|
+
const answer = await (0, previewPrompt_1.previewProjectPrompt)(themeComponents);
|
|
78
83
|
themeJsonPath = `${answer.themeComponentPath}/theme.json`;
|
|
79
84
|
}
|
|
80
|
-
const { dir: themeDir } =
|
|
85
|
+
const { dir: themeDir } = path_1.default.parse(themeJsonPath);
|
|
81
86
|
absoluteSrc = themeDir;
|
|
82
|
-
const { base: themeName } =
|
|
87
|
+
const { base: themeName } = path_1.default.parse(themeDir);
|
|
83
88
|
dest = `@projects/${projectConfig.name}/${themeName}`;
|
|
84
89
|
}
|
|
85
90
|
return { absoluteSrc, dest };
|
|
@@ -87,15 +92,15 @@ async function determineSrcAndDest(args) {
|
|
|
87
92
|
async function handler(args) {
|
|
88
93
|
const { derivedAccountId, notify, noSsl, resetSession, port, generateFieldsTypes, } = args;
|
|
89
94
|
const { absoluteSrc, dest } = await determineSrcAndDest(args);
|
|
90
|
-
const filePaths = await getUploadableFileList(absoluteSrc, false);
|
|
95
|
+
const filePaths = await (0, upload_1.getUploadableFileList)(absoluteSrc, false);
|
|
91
96
|
function startProgressBar(numFiles) {
|
|
92
|
-
const initialUploadProgressBar = new
|
|
97
|
+
const initialUploadProgressBar = new cli_progress_1.default.SingleBar({
|
|
93
98
|
gracefulExit: true,
|
|
94
99
|
format: '[{bar}] {percentage}% | {value}/{total} | {label}',
|
|
95
100
|
hideCursor: true,
|
|
96
|
-
},
|
|
101
|
+
}, cli_progress_1.default.Presets.rect);
|
|
97
102
|
initialUploadProgressBar.start(numFiles, 0, {
|
|
98
|
-
label: commands.theme.subcommands.preview.initialUploadProgressBar.start,
|
|
103
|
+
label: en_1.commands.theme.subcommands.preview.initialUploadProgressBar.start,
|
|
99
104
|
});
|
|
100
105
|
let uploadsHaveStarted = false;
|
|
101
106
|
const uploadOptions = {
|
|
@@ -107,7 +112,7 @@ async function handler(args) {
|
|
|
107
112
|
if (!uploadsHaveStarted) {
|
|
108
113
|
uploadsHaveStarted = true;
|
|
109
114
|
initialUploadProgressBar.update(0, {
|
|
110
|
-
label: commands.theme.subcommands.preview.initialUploadProgressBar
|
|
115
|
+
label: en_1.commands.theme.subcommands.preview.initialUploadProgressBar
|
|
111
116
|
.uploading,
|
|
112
117
|
});
|
|
113
118
|
}
|
|
@@ -121,13 +126,13 @@ async function handler(args) {
|
|
|
121
126
|
onFinalErrorCallback: () => initialUploadProgressBar.increment(),
|
|
122
127
|
onFinishCallback: (results) => {
|
|
123
128
|
initialUploadProgressBar.update(numFiles, {
|
|
124
|
-
label: commands.theme.subcommands.preview.initialUploadProgressBar.finish,
|
|
129
|
+
label: en_1.commands.theme.subcommands.preview.initialUploadProgressBar.finish,
|
|
125
130
|
});
|
|
126
131
|
initialUploadProgressBar.stop();
|
|
127
132
|
results.forEach(result => {
|
|
128
|
-
if (result.resultType == FILE_UPLOAD_RESULT_TYPES.FAILURE) {
|
|
129
|
-
uiLogger.error(commands.theme.subcommands.preview.errors.uploadFailed(result.file, dest));
|
|
130
|
-
logError(result.error, new ApiErrorContext({
|
|
133
|
+
if (result.resultType == files_1.FILE_UPLOAD_RESULT_TYPES.FAILURE) {
|
|
134
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.preview.errors.uploadFailed(result.file, dest));
|
|
135
|
+
(0, index_1.logError)(result.error, new index_1.ApiErrorContext({
|
|
131
136
|
accountId: derivedAccountId,
|
|
132
137
|
request: dest,
|
|
133
138
|
payload: result.file,
|
|
@@ -138,7 +143,7 @@ async function handler(args) {
|
|
|
138
143
|
};
|
|
139
144
|
return uploadOptions;
|
|
140
145
|
}
|
|
141
|
-
trackCommandUsage('preview', {}, derivedAccountId);
|
|
146
|
+
(0, usageTracking_1.trackCommandUsage)('preview', {}, derivedAccountId);
|
|
142
147
|
let createUnifiedDevServer;
|
|
143
148
|
try {
|
|
144
149
|
// @ts-ignore TODO: Remove when we deprecate Node 18
|
|
@@ -148,9 +153,9 @@ async function handler(args) {
|
|
|
148
153
|
createUnifiedDevServer = createDevServer;
|
|
149
154
|
}
|
|
150
155
|
catch (e) {
|
|
151
|
-
uiLogger.warn('Unified dev server requires node 20 to run. Defaulting to legacy preview.');
|
|
156
|
+
logger_1.uiLogger.warn('Unified dev server requires node 20 to run. Defaulting to legacy preview.');
|
|
152
157
|
}
|
|
153
|
-
const isUngatedForUnified = await hasFeature(derivedAccountId, FEATURES.UNIFIED_THEME_PREVIEW);
|
|
158
|
+
const isUngatedForUnified = await (0, hasFeature_1.hasFeature)(derivedAccountId, constants_1.FEATURES.UNIFIED_THEME_PREVIEW);
|
|
154
159
|
if (isUngatedForUnified && createUnifiedDevServer) {
|
|
155
160
|
if (port) {
|
|
156
161
|
process.env['PORT'] = port.toString();
|
|
@@ -163,7 +168,7 @@ async function handler(args) {
|
|
|
163
168
|
});
|
|
164
169
|
}
|
|
165
170
|
else {
|
|
166
|
-
preview(derivedAccountId, absoluteSrc, dest, {
|
|
171
|
+
(0, theme_preview_dev_server_1.preview)(derivedAccountId, absoluteSrc, dest, {
|
|
167
172
|
notify,
|
|
168
173
|
filePaths,
|
|
169
174
|
noSsl,
|
|
@@ -177,27 +182,27 @@ async function handler(args) {
|
|
|
177
182
|
function themePreviewBuilder(yargs) {
|
|
178
183
|
yargs
|
|
179
184
|
.option('src', {
|
|
180
|
-
describe: commands.theme.subcommands.preview.positionals.src,
|
|
185
|
+
describe: en_1.commands.theme.subcommands.preview.positionals.src,
|
|
181
186
|
type: 'string',
|
|
182
187
|
requiresArg: true,
|
|
183
188
|
})
|
|
184
189
|
.option('dest', {
|
|
185
|
-
describe: commands.theme.subcommands.preview.positionals.dest,
|
|
190
|
+
describe: en_1.commands.theme.subcommands.preview.positionals.dest,
|
|
186
191
|
type: 'string',
|
|
187
192
|
requiresArg: true,
|
|
188
193
|
})
|
|
189
194
|
.option('notify', {
|
|
190
195
|
alias: 'n',
|
|
191
|
-
describe: commands.theme.subcommands.preview.options.notify,
|
|
196
|
+
describe: en_1.commands.theme.subcommands.preview.options.notify,
|
|
192
197
|
type: 'string',
|
|
193
198
|
requiresArg: true,
|
|
194
199
|
})
|
|
195
200
|
.option('no-ssl', {
|
|
196
|
-
describe: commands.theme.subcommands.preview.options.noSsl,
|
|
201
|
+
describe: en_1.commands.theme.subcommands.preview.options.noSsl,
|
|
197
202
|
type: 'boolean',
|
|
198
203
|
})
|
|
199
204
|
.option('port', {
|
|
200
|
-
describe: commands.theme.subcommands.preview.options.port,
|
|
205
|
+
describe: en_1.commands.theme.subcommands.preview.options.port,
|
|
201
206
|
type: 'number',
|
|
202
207
|
})
|
|
203
208
|
.option('resetSession', {
|
|
@@ -210,7 +215,7 @@ function themePreviewBuilder(yargs) {
|
|
|
210
215
|
});
|
|
211
216
|
return yargs;
|
|
212
217
|
}
|
|
213
|
-
const builder = makeYargsBuilder(themePreviewBuilder, command, describe, {
|
|
218
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themePreviewBuilder, command, describe, {
|
|
214
219
|
useGlobalOptions: true,
|
|
215
220
|
useConfigOptions: true,
|
|
216
221
|
useAccountOptions: true,
|
|
@@ -221,4 +226,4 @@ const themePreviewCommand = {
|
|
|
221
226
|
handler,
|
|
222
227
|
builder,
|
|
223
228
|
};
|
|
224
|
-
|
|
229
|
+
exports.default = themePreviewCommand;
|
package/commands/theme.d.ts
CHANGED
package/commands/theme.js
CHANGED
|
@@ -1,23 +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
|
+
const marketplace_validate_1 = __importDefault(require("./theme/marketplace-validate"));
|
|
7
|
+
const generate_selectors_1 = __importDefault(require("./theme/generate-selectors"));
|
|
8
|
+
const preview_1 = __importDefault(require("./theme/preview"));
|
|
9
|
+
const en_1 = require("../lang/en");
|
|
10
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
6
11
|
const command = ['theme', 'themes'];
|
|
7
|
-
const describe = commands.theme.describe;
|
|
12
|
+
const describe = en_1.commands.theme.describe;
|
|
8
13
|
function themeBuilder(yargs) {
|
|
9
14
|
yargs
|
|
10
|
-
.command(
|
|
11
|
-
.command(
|
|
12
|
-
.command(
|
|
15
|
+
.command(preview_1.default)
|
|
16
|
+
.command(marketplace_validate_1.default)
|
|
17
|
+
.command(generate_selectors_1.default)
|
|
13
18
|
.demandCommand(1, '');
|
|
14
19
|
return yargs;
|
|
15
20
|
}
|
|
16
|
-
const builder = makeYargsBuilder(themeBuilder, command, describe);
|
|
21
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeBuilder, command, describe);
|
|
17
22
|
const themeCommand = {
|
|
18
23
|
command,
|
|
19
24
|
describe,
|
|
20
25
|
builder,
|
|
21
26
|
handler: () => { },
|
|
22
27
|
};
|
|
23
|
-
|
|
28
|
+
exports.default = themeCommand;
|
package/commands/upload.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, CmsPublishModeArgs, YargsCommandModule } from '../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, CmsPublishModeArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
2
|
type UploadArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & CmsPublishModeArgs & {
|
|
3
3
|
src?: string;
|
|
4
4
|
dest?: string;
|