@hubspot/cli 7.5.11-experimental.0 → 7.6.0-beta.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/bin/cli.js +102 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +74 -87
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +33 -58
- package/commands/app/migrate.d.ts +1 -2
- package/commands/app/migrate.js +7 -8
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +10 -8
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +29 -28
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +22 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +37 -46
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +18 -44
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +62 -74
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +18 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +18 -41
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +22 -10
- package/commands/getStarted.d.ts +9 -0
- package/commands/getStarted.js +227 -0
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- package/commands/hubdb/list.d.ts +4 -0
- package/commands/hubdb/list.js +83 -0
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +17 -8
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +17 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +52 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +77 -0
- package/commands/mcp.d.ts +3 -0
- package/commands/mcp.js +26 -0
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -29
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +17 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +17 -11
- package/commands/project/add.d.ts +5 -2
- package/commands/project/add.js +43 -80
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.d.ts +2 -8
- package/commands/project/create.js +84 -55
- package/commands/project/deploy.d.ts +2 -0
- package/commands/project/deploy.js +67 -13
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +88 -31
- package/commands/project/dev/unifiedFlow.d.ts +11 -2
- package/commands/project/dev/unifiedFlow.js +81 -41
- package/commands/project/listBuilds.js +2 -5
- package/commands/project/migrate.d.ts +1 -0
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +209 -0
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/delete.js +123 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +1 -0
- package/commands/project/upload.js +22 -8
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project.js +4 -2
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -22
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -48
- package/commands/testAccount/create.d.ts +6 -0
- package/commands/testAccount/create.js +100 -0
- package/commands/testAccount/createConfig.d.ts +10 -0
- package/commands/testAccount/createConfig.js +98 -0
- package/commands/testAccount/delete.d.ts +6 -0
- package/commands/testAccount/delete.js +48 -0
- package/commands/testAccount.d.ts +3 -0
- package/commands/testAccount.js +28 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -15
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -17
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +32 -26
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -47
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -134
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -75
- package/lang/en.d.ts +1135 -660
- package/lang/en.js +935 -471
- package/lang/en.lyaml +30 -213
- package/lib/accountTypes.js +1 -2
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +29 -6
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +34 -55
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +29 -0
- package/lib/constants.js +30 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +3 -2
- package/lib/errorHandlers/index.js +7 -0
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -5
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/marketplaceValidate.d.ts +12 -2
- package/lib/marketplaceValidate.js +22 -29
- package/lib/mcp/setup.d.ts +21 -0
- package/lib/mcp/setup.js +218 -0
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +23 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +5 -3
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- package/lib/projects/add/legacyAddComponent.d.ts +5 -0
- package/lib/projects/add/legacyAddComponent.js +48 -0
- package/lib/projects/add/v3AddComponent.d.ts +8 -0
- package/lib/projects/add/v3AddComponent.js +85 -0
- package/lib/projects/buildAndDeploy.js +18 -3
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -0
- package/lib/projects/create/index.d.ts +23 -0
- package/lib/projects/create/index.js +33 -0
- package/lib/projects/create/legacy.d.ts +6 -0
- package/lib/projects/{create.js → create/legacy.js} +20 -11
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +159 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
- package/lib/projects/localDev/LocalDevProcess.js +201 -0
- package/lib/projects/localDev/LocalDevState.d.ts +50 -0
- package/lib/projects/localDev/LocalDevState.js +119 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +53 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +5 -1
- package/lib/projects/upload.js +60 -20
- package/lib/projects/urls.d.ts +3 -0
- package/lib/projects/urls.js +17 -1
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
- package/lib/prompts/createProjectPrompt.d.ts +14 -5
- package/lib/prompts/createProjectPrompt.js +38 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -24
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -7
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +4 -1
- package/lib/prompts/promptUtils.js +5 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/server.d.ts +1 -0
- package/mcp-server/server.js +18 -0
- package/mcp-server/tools/index.d.ts +2 -0
- package/mcp-server/tools/index.js +19 -0
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
- package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
- package/mcp-server/tools/project/CreateProjectTool.js +104 -0
- package/mcp-server/tools/project/DeployProject.d.ts +20 -0
- package/mcp-server/tools/project/DeployProject.js +50 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
- package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
- package/mcp-server/tools/project/UploadProjectTools.js +35 -0
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
- package/mcp-server/tools/project/constants.d.ts +3 -0
- package/mcp-server/tools/project/constants.js +13 -0
- package/mcp-server/types.d.ts +14 -0
- package/mcp-server/types.js +17 -0
- package/mcp-server/utils/command.d.ts +3 -0
- package/mcp-server/utils/command.js +16 -0
- package/mcp-server/utils/content.d.ts +3 -0
- package/mcp-server/utils/content.js +21 -0
- package/mcp-server/utils/project.d.ts +5 -0
- package/mcp-server/utils/project.js +17 -0
- package/package.json +24 -16
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +35 -0
- package/types/LocalDev.js +2 -0
- package/types/Projects.d.ts +19 -2
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +10 -1
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -41
|
@@ -3,42 +3,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
10
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
11
7
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
12
8
|
const marketplaceValidate_1 = require("../../lib/marketplaceValidate");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const command = 'marketplace-validate <path>';
|
|
12
|
+
const describe = en_1.commands.theme.subcommands.marketplaceValidate.describe;
|
|
16
13
|
async function handler(args) {
|
|
17
14
|
const { path, derivedAccountId } = args;
|
|
18
15
|
(0, usageTracking_1.trackCommandUsage)('validate', {}, derivedAccountId);
|
|
19
16
|
SpinniesManager_1.default.init();
|
|
20
17
|
SpinniesManager_1.default.add('marketplaceValidation', {
|
|
21
|
-
text:
|
|
22
|
-
path,
|
|
23
|
-
}),
|
|
18
|
+
text: en_1.commands.theme.subcommands.marketplaceValidate.logs.validatingTheme(path),
|
|
24
19
|
});
|
|
25
20
|
const assetType = 'THEME';
|
|
26
21
|
const validationId = await (0, marketplaceValidate_1.kickOffValidation)(derivedAccountId, assetType, path);
|
|
27
22
|
await (0, marketplaceValidate_1.pollForValidationFinish)(derivedAccountId, validationId);
|
|
28
23
|
SpinniesManager_1.default.remove('marketplaceValidation');
|
|
29
24
|
const validationResults = await (0, marketplaceValidate_1.fetchValidationResults)(derivedAccountId, validationId);
|
|
30
|
-
(0, marketplaceValidate_1.processValidationErrors)(
|
|
31
|
-
(0, marketplaceValidate_1.displayValidationResults)(
|
|
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);
|
|
32
27
|
process.exit();
|
|
33
28
|
}
|
|
34
|
-
function
|
|
35
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
36
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
29
|
+
function themeValidateBuilder(yargs) {
|
|
38
30
|
yargs.positional('path', {
|
|
39
|
-
describe:
|
|
31
|
+
describe: en_1.commands.theme.subcommands.marketplaceValidate.positionals.path.describe,
|
|
40
32
|
type: 'string',
|
|
41
33
|
required: true,
|
|
42
34
|
});
|
|
43
35
|
return yargs;
|
|
44
36
|
}
|
|
37
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeValidateBuilder, command, describe, {
|
|
38
|
+
useGlobalOptions: true,
|
|
39
|
+
useConfigOptions: true,
|
|
40
|
+
useAccountOptions: true,
|
|
41
|
+
useEnvironmentOptions: true,
|
|
42
|
+
});
|
|
43
|
+
const themeValidateCommand = {
|
|
44
|
+
command,
|
|
45
|
+
describe,
|
|
46
|
+
handler,
|
|
47
|
+
builder,
|
|
48
|
+
};
|
|
49
|
+
exports.default = themeValidateCommand;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "preview [--src] [--dest]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs;
|
|
6
|
-
type ThemePreviewArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ThemePreviewArgs = CommonArgs & ConfigArgs & AccountArgs & {
|
|
7
3
|
src: string;
|
|
8
4
|
dest: string;
|
|
9
5
|
notify: string;
|
|
@@ -12,6 +8,5 @@ type ThemePreviewArgs = CombinedArgs & {
|
|
|
12
8
|
resetSession?: boolean;
|
|
13
9
|
generateFieldsTypes?: boolean;
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export {};
|
|
11
|
+
declare const themePreviewCommand: YargsCommandModule<unknown, ThemePreviewArgs>;
|
|
12
|
+
export default themePreviewCommand;
|
|
@@ -3,19 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
7
|
const path_1 = __importDefault(require("path"));
|
|
11
8
|
const cli_progress_1 = __importDefault(require("cli-progress"));
|
|
12
|
-
const
|
|
13
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
14
10
|
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
15
11
|
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
16
12
|
const themes_1 = require("@hubspot/local-dev-lib/cms/themes");
|
|
17
13
|
const theme_preview_dev_server_1 = require("@hubspot/theme-preview-dev-server");
|
|
18
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
19
14
|
const upload_1 = require("../../lib/upload");
|
|
20
15
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
21
16
|
const previewPrompt_1 = require("../../lib/prompts/previewPrompt");
|
|
@@ -27,13 +22,13 @@ const structure_1 = require("../../lib/projects/structure");
|
|
|
27
22
|
const Projects_1 = require("../../types/Projects");
|
|
28
23
|
const hasFeature_1 = require("../../lib/hasFeature");
|
|
29
24
|
const constants_1 = require("../../lib/constants");
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
26
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
27
|
+
const command = 'preview [--src] [--dest]';
|
|
28
|
+
const describe = en_1.commands.theme.subcommands.preview.describe;
|
|
32
29
|
function validateSrcPath(src) {
|
|
33
30
|
const logInvalidPath = () => {
|
|
34
|
-
logger_1.
|
|
35
|
-
path: src,
|
|
36
|
-
}));
|
|
31
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.preview.errors.invalidPath(src));
|
|
37
32
|
};
|
|
38
33
|
try {
|
|
39
34
|
const stats = fs_1.default.statSync(src);
|
|
@@ -50,7 +45,7 @@ function validateSrcPath(src) {
|
|
|
50
45
|
}
|
|
51
46
|
function handleUserInput() {
|
|
52
47
|
const onTerminate = () => {
|
|
53
|
-
logger_1.
|
|
48
|
+
logger_1.uiLogger.log(en_1.commands.theme.subcommands.preview.logs.processExited);
|
|
54
49
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
55
50
|
};
|
|
56
51
|
(0, process_1.handleExit)(onTerminate);
|
|
@@ -81,7 +76,7 @@ async function determineSrcAndDest(args) {
|
|
|
81
76
|
const projectComponents = await (0, structure_1.findProjectComponents)(projectDir);
|
|
82
77
|
const themeComponents = projectComponents.filter(c => c.type === Projects_1.ComponentTypes.HublTheme);
|
|
83
78
|
if (themeComponents.length === 0) {
|
|
84
|
-
logger_1.
|
|
79
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.preview.errors.noThemeComponents);
|
|
85
80
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
86
81
|
}
|
|
87
82
|
const answer = await (0, previewPrompt_1.previewProjectPrompt)(themeComponents);
|
|
@@ -105,7 +100,7 @@ async function handler(args) {
|
|
|
105
100
|
hideCursor: true,
|
|
106
101
|
}, cli_progress_1.default.Presets.rect);
|
|
107
102
|
initialUploadProgressBar.start(numFiles, 0, {
|
|
108
|
-
label:
|
|
103
|
+
label: en_1.commands.theme.subcommands.preview.initialUploadProgressBar.start,
|
|
109
104
|
});
|
|
110
105
|
let uploadsHaveStarted = false;
|
|
111
106
|
const uploadOptions = {
|
|
@@ -117,7 +112,8 @@ async function handler(args) {
|
|
|
117
112
|
if (!uploadsHaveStarted) {
|
|
118
113
|
uploadsHaveStarted = true;
|
|
119
114
|
initialUploadProgressBar.update(0, {
|
|
120
|
-
label:
|
|
115
|
+
label: en_1.commands.theme.subcommands.preview.initialUploadProgressBar
|
|
116
|
+
.uploading,
|
|
121
117
|
});
|
|
122
118
|
}
|
|
123
119
|
},
|
|
@@ -130,12 +126,12 @@ async function handler(args) {
|
|
|
130
126
|
onFinalErrorCallback: () => initialUploadProgressBar.increment(),
|
|
131
127
|
onFinishCallback: (results) => {
|
|
132
128
|
initialUploadProgressBar.update(numFiles, {
|
|
133
|
-
label:
|
|
129
|
+
label: en_1.commands.theme.subcommands.preview.initialUploadProgressBar.finish,
|
|
134
130
|
});
|
|
135
131
|
initialUploadProgressBar.stop();
|
|
136
132
|
results.forEach(result => {
|
|
137
133
|
if (result.resultType == files_1.FILE_UPLOAD_RESULT_TYPES.FAILURE) {
|
|
138
|
-
logger_1.
|
|
134
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.preview.errors.uploadFailed(result.file, dest));
|
|
139
135
|
(0, index_1.logError)(result.error, new index_1.ApiErrorContext({
|
|
140
136
|
accountId: derivedAccountId,
|
|
141
137
|
request: dest,
|
|
@@ -157,7 +153,7 @@ async function handler(args) {
|
|
|
157
153
|
createUnifiedDevServer = createDevServer;
|
|
158
154
|
}
|
|
159
155
|
catch (e) {
|
|
160
|
-
logger_1.
|
|
156
|
+
logger_1.uiLogger.warn('Unified dev server requires node 20 to run. Defaulting to legacy preview.');
|
|
161
157
|
}
|
|
162
158
|
const isUngatedForUnified = await (0, hasFeature_1.hasFeature)(derivedAccountId, constants_1.FEATURES.UNIFIED_THEME_PREVIEW);
|
|
163
159
|
if (isUngatedForUnified && createUnifiedDevServer) {
|
|
@@ -183,32 +179,30 @@ async function handler(args) {
|
|
|
183
179
|
});
|
|
184
180
|
}
|
|
185
181
|
}
|
|
186
|
-
function
|
|
187
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
188
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
182
|
+
function themePreviewBuilder(yargs) {
|
|
189
183
|
yargs
|
|
190
184
|
.option('src', {
|
|
191
|
-
describe:
|
|
185
|
+
describe: en_1.commands.theme.subcommands.preview.positionals.src,
|
|
192
186
|
type: 'string',
|
|
193
187
|
requiresArg: true,
|
|
194
188
|
})
|
|
195
189
|
.option('dest', {
|
|
196
|
-
describe:
|
|
190
|
+
describe: en_1.commands.theme.subcommands.preview.positionals.dest,
|
|
197
191
|
type: 'string',
|
|
198
192
|
requiresArg: true,
|
|
199
193
|
})
|
|
200
194
|
.option('notify', {
|
|
201
195
|
alias: 'n',
|
|
202
|
-
describe:
|
|
196
|
+
describe: en_1.commands.theme.subcommands.preview.options.notify,
|
|
203
197
|
type: 'string',
|
|
204
198
|
requiresArg: true,
|
|
205
199
|
})
|
|
206
200
|
.option('no-ssl', {
|
|
207
|
-
describe:
|
|
201
|
+
describe: en_1.commands.theme.subcommands.preview.options.noSsl,
|
|
208
202
|
type: 'boolean',
|
|
209
203
|
})
|
|
210
204
|
.option('port', {
|
|
211
|
-
describe:
|
|
205
|
+
describe: en_1.commands.theme.subcommands.preview.options.port,
|
|
212
206
|
type: 'number',
|
|
213
207
|
})
|
|
214
208
|
.option('resetSession', {
|
|
@@ -221,3 +215,15 @@ function builder(yargs) {
|
|
|
221
215
|
});
|
|
222
216
|
return yargs;
|
|
223
217
|
}
|
|
218
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themePreviewBuilder, command, describe, {
|
|
219
|
+
useGlobalOptions: true,
|
|
220
|
+
useConfigOptions: true,
|
|
221
|
+
useAccountOptions: true,
|
|
222
|
+
});
|
|
223
|
+
const themePreviewCommand = {
|
|
224
|
+
command,
|
|
225
|
+
describe,
|
|
226
|
+
handler,
|
|
227
|
+
builder,
|
|
228
|
+
};
|
|
229
|
+
exports.default = themePreviewCommand;
|
package/commands/theme.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function builder(yargs: Argv): Argv;
|
|
1
|
+
import { YargsCommandModuleBucket } from '../types/Yargs';
|
|
2
|
+
declare const themeCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default themeCommand;
|
package/commands/theme.js
CHANGED
|
@@ -1,53 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
exports.describe = (0, lang_1.i18n)('commands.theme.describe');
|
|
45
|
-
function builder(yargs) {
|
|
46
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
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");
|
|
11
|
+
const command = ['theme', 'themes'];
|
|
12
|
+
const describe = en_1.commands.theme.describe;
|
|
13
|
+
function themeBuilder(yargs) {
|
|
47
14
|
yargs
|
|
48
|
-
.command(
|
|
49
|
-
.command(
|
|
50
|
-
.command(
|
|
15
|
+
.command(preview_1.default)
|
|
16
|
+
.command(marketplace_validate_1.default)
|
|
17
|
+
.command(generate_selectors_1.default)
|
|
51
18
|
.demandCommand(1, '');
|
|
52
19
|
return yargs;
|
|
53
20
|
}
|
|
21
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeBuilder, command, describe);
|
|
22
|
+
const themeCommand = {
|
|
23
|
+
command,
|
|
24
|
+
describe,
|
|
25
|
+
builder,
|
|
26
|
+
handler: () => { },
|
|
27
|
+
};
|
|
28
|
+
exports.default = themeCommand;
|
package/commands/upload.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, CmsPublishModeArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
|
+
type UploadArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & CmsPublishModeArgs & {
|
|
3
|
+
src?: string;
|
|
4
|
+
dest?: string;
|
|
5
|
+
fieldOptions?: string | string[];
|
|
6
|
+
saveOutput?: boolean;
|
|
7
|
+
convertFields?: boolean;
|
|
8
|
+
clean?: boolean;
|
|
9
|
+
force?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const uploadCommand: YargsCommandModule<unknown, UploadArgs>;
|
|
12
|
+
export default uploadCommand;
|