@hubspot/cli 7.5.11-experimental.0 → 7.7.0-experimental.0
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 +5 -6
- package/bin/hsmcp.d.ts +2 -0
- package/bin/hsmcp.js +13 -0
- package/commands/account/auth.d.ts +3 -7
- package/commands/account/auth.js +19 -9
- 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 +35 -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 +12 -8
- package/commands/auth.d.ts +3 -7
- package/commands/auth.js +12 -5
- 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 +24 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +25 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +25 -15
- 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 +20 -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 +64 -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 +20 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +32 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +40 -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 +20 -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 +24 -10
- 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.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +12 -5
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +44 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +19 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -27
- package/commands/module.d.ts +3 -1
- package/commands/module.js +22 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +19 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +19 -11
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.js +3 -3
- package/commands/project/deploy.d.ts +1 -0
- package/commands/project/deploy.js +40 -12
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +48 -16
- package/commands/project/dev/unifiedFlow.d.ts +2 -1
- package/commands/project/dev/unifiedFlow.js +85 -30
- 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 +38 -8
- package/commands/project/validate.d.ts +4 -0
- package/commands/project/validate.js +53 -0
- package/commands/project.js +4 -0
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +19 -11
- 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 +20 -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 +25 -48
- package/commands/setupMcp.d.ts +8 -0
- package/commands/setupMcp.js +229 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +14 -6
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +17 -10
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +16 -9
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +23 -46
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +118 -97
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +76 -65
- package/lang/en.d.ts +838 -574
- package/lang/en.js +630 -373
- package/lang/en.lyaml +30 -23
- package/lib/accountTypes.js +2 -1
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +14 -3
- 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/configMigrate.js +24 -10
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +2 -1
- package/lib/filesystem.d.ts +1 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +8 -0
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +6 -0
- package/lib/projectProfiles.js +65 -0
- package/lib/projects/buildAndDeploy.js +17 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +26 -0
- package/lib/projects/localDev/AppDevModeInterface.js +156 -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 +158 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +27 -0
- package/lib/projects/localDev/LocalDevProcess.js +171 -0
- package/lib/projects/localDev/LocalDevState.d.ts +37 -0
- package/lib/projects/localDev/LocalDevState.js +78 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +56 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +17 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +92 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +2 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +1 -0
- package/lib/prompts/installAppPrompt.js +35 -0
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +2 -1
- package/lib/prompts/promptUtils.js +2 -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/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/index.d.ts +1 -0
- package/mcp-server/index.js +17 -0
- package/mcp-server/mcpLoader.d.ts +5 -0
- package/mcp-server/mcpLoader.js +24 -0
- package/mcp-server/tools/ExplainProjectStructureTool.d.ts +33 -0
- package/mcp-server/tools/ExplainProjectStructureTool.js +266 -0
- package/mcp-server/tools/GenerateAppComponentTool.d.ts +99 -0
- package/mcp-server/tools/GenerateAppComponentTool.js +193 -0
- package/mcp-server/tools/GenerateCardComponentTool.d.ts +74 -0
- package/mcp-server/tools/GenerateCardComponentTool.js +146 -0
- package/mcp-server/tools/GenerateProjectConfigTool.d.ts +32 -0
- package/mcp-server/tools/GenerateProjectConfigTool.js +40 -0
- package/mcp-server/tools/HubSpotCLIHelper.d.ts +16 -0
- package/mcp-server/tools/HubSpotCLIHelper.js +74 -0
- package/mcp-server/tools/UploadProjectTool.d.ts +44 -0
- package/mcp-server/tools/UploadProjectTool.js +149 -0
- package/mcp-server/tools/ValidateProjectTool.d.ts +62 -0
- package/mcp-server/tools/ValidateProjectTool.js +315 -0
- package/package.json +13 -6
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +24 -0
- package/types/LocalDev.js +2 -0
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +8 -1
- 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
package/commands/config/set.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handler = handler;
|
|
4
|
-
exports.builder = builder;
|
|
5
3
|
const lang_1 = require("../../lib/lang");
|
|
6
4
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
7
5
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
8
6
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
9
7
|
const configOptions_1 = require("../../lib/configOptions");
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const en_1 = require("../../lang/en");
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'set';
|
|
11
|
+
const describe = en_1.commands.config.subcommands.set.describe;
|
|
12
12
|
async function selectOptions() {
|
|
13
|
-
const {
|
|
13
|
+
const { configOption } = await (0, promptUtils_1.promptUser)([
|
|
14
14
|
{
|
|
15
15
|
type: 'list',
|
|
16
|
-
name: '
|
|
16
|
+
name: 'configOption',
|
|
17
17
|
pageSize: 20,
|
|
18
|
-
message:
|
|
18
|
+
message: en_1.commands.config.subcommands.set.promptMessage,
|
|
19
19
|
choices: [
|
|
20
20
|
{
|
|
21
21
|
name: 'Default CMS publish mode',
|
|
@@ -23,13 +23,14 @@ async function selectOptions() {
|
|
|
23
23
|
},
|
|
24
24
|
{ name: 'Allow usage tracking', value: { allowUsageTracking: '' } },
|
|
25
25
|
{ name: 'HTTP timeout', value: { httpTimeout: '' } },
|
|
26
|
+
// TODO enable when we unhide this option { name: 'Allow auto updates', value: { allowAutoUpdates: '' } },
|
|
26
27
|
],
|
|
27
28
|
},
|
|
28
29
|
]);
|
|
29
|
-
return
|
|
30
|
+
return configOption;
|
|
30
31
|
}
|
|
31
|
-
async function handleConfigUpdate(accountId,
|
|
32
|
-
const { allowUsageTracking, defaultCmsPublishMode, httpTimeout } =
|
|
32
|
+
async function handleConfigUpdate(accountId, args) {
|
|
33
|
+
const { allowAutoUpdates, allowUsageTracking, defaultCmsPublishMode, httpTimeout, } = args;
|
|
33
34
|
if (typeof defaultCmsPublishMode !== 'undefined') {
|
|
34
35
|
await (0, configOptions_1.setDefaultCmsPublishMode)({ defaultCmsPublishMode, accountId });
|
|
35
36
|
return true;
|
|
@@ -42,6 +43,10 @@ async function handleConfigUpdate(accountId, options) {
|
|
|
42
43
|
await (0, configOptions_1.setAllowUsageTracking)({ allowUsageTracking, accountId });
|
|
43
44
|
return true;
|
|
44
45
|
}
|
|
46
|
+
else if (typeof allowAutoUpdates !== 'undefined') {
|
|
47
|
+
await (0, configOptions_1.setAllowAutoUpdates)({ allowAutoUpdates, accountId });
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
45
50
|
return false;
|
|
46
51
|
}
|
|
47
52
|
async function handler(args) {
|
|
@@ -54,25 +59,33 @@ async function handler(args) {
|
|
|
54
59
|
}
|
|
55
60
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
56
61
|
}
|
|
57
|
-
function
|
|
62
|
+
function configSetBuilder(yargs) {
|
|
58
63
|
yargs
|
|
59
64
|
.options({
|
|
60
65
|
'default-cms-publish-mode': {
|
|
61
|
-
describe:
|
|
66
|
+
describe: en_1.commands.config.subcommands.set.options.defaultMode.describe,
|
|
62
67
|
type: 'string',
|
|
63
68
|
},
|
|
64
69
|
'allow-usage-tracking': {
|
|
65
|
-
describe:
|
|
70
|
+
describe: en_1.commands.config.subcommands.set.options.allowUsageTracking.describe,
|
|
66
71
|
type: 'boolean',
|
|
67
72
|
},
|
|
68
73
|
'http-timeout': {
|
|
69
|
-
describe:
|
|
74
|
+
describe: en_1.commands.config.subcommands.set.options.httpTimeout.describe,
|
|
70
75
|
type: 'string',
|
|
71
76
|
},
|
|
77
|
+
'allow-auto-updates': {
|
|
78
|
+
describe: en_1.commands.config.subcommands.set.options.allowAutoUpdates.describe,
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
hidden: true,
|
|
81
|
+
},
|
|
72
82
|
})
|
|
73
83
|
.conflicts('defaultCmsPublishMode', 'allowUsageTracking')
|
|
74
84
|
.conflicts('defaultCmsPublishMode', 'httpTimeout')
|
|
75
85
|
.conflicts('allowUsageTracking', 'httpTimeout')
|
|
86
|
+
.conflicts('allowAutoUpdates', 'defaultCmsPublishMode')
|
|
87
|
+
.conflicts('allowAutoUpdates', 'allowUsageTracking')
|
|
88
|
+
.conflicts('allowAutoUpdates', 'httpTimeout')
|
|
76
89
|
.example([
|
|
77
90
|
[
|
|
78
91
|
'$0 config set',
|
|
@@ -81,3 +94,14 @@ function builder(yargs) {
|
|
|
81
94
|
]);
|
|
82
95
|
return yargs;
|
|
83
96
|
}
|
|
97
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(configSetBuilder, command, describe, {
|
|
98
|
+
useGlobalOptions: true,
|
|
99
|
+
useConfigOptions: true,
|
|
100
|
+
});
|
|
101
|
+
const configSetCommand = {
|
|
102
|
+
command,
|
|
103
|
+
describe,
|
|
104
|
+
handler,
|
|
105
|
+
builder,
|
|
106
|
+
};
|
|
107
|
+
exports.default = configSetCommand;
|
package/commands/config.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 configCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default configCommand;
|
package/commands/config.js
CHANGED
|
@@ -1,49 +1,25 @@
|
|
|
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
|
-
exports.describe = exports.command = void 0;
|
|
37
|
-
exports.builder = builder;
|
|
38
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
39
6
|
const lang_1 = require("../lib/lang");
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(
|
|
47
|
-
yargs.command(set).command(migrate).demandCommand(1, '');
|
|
7
|
+
const set_1 = __importDefault(require("./config/set"));
|
|
8
|
+
const migrate_1 = __importDefault(require("./config/migrate"));
|
|
9
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
10
|
+
const command = 'config';
|
|
11
|
+
const describe = (0, lang_1.i18n)('commands.config.describe');
|
|
12
|
+
function configBuilder(yargs) {
|
|
13
|
+
yargs.command(set_1.default).command(migrate_1.default).demandCommand(1, '');
|
|
48
14
|
return yargs;
|
|
49
15
|
}
|
|
16
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(configBuilder, command, describe);
|
|
17
|
+
const configCommand = {
|
|
18
|
+
command,
|
|
19
|
+
describe,
|
|
20
|
+
builder,
|
|
21
|
+
handler: () => { },
|
|
22
|
+
};
|
|
23
|
+
exports.default = configCommand;
|
|
24
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
25
|
+
module.exports = configCommand;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
module.exports = {
|
|
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");
|
|
16
|
+
const apiSampleAssetType = {
|
|
15
17
|
hidden: true,
|
|
16
18
|
dest: ({ dest }) => dest,
|
|
17
19
|
validate: ({ name }) => {
|
|
18
20
|
if (!name) {
|
|
19
|
-
|
|
21
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.apiSample.errors.nameRequired);
|
|
20
22
|
return false;
|
|
21
23
|
}
|
|
22
24
|
return true;
|
|
23
25
|
},
|
|
24
|
-
execute: async ({ dest, name, assetType,
|
|
25
|
-
const filePath =
|
|
26
|
-
if (
|
|
27
|
-
const overwrite = await confirmPrompt(
|
|
28
|
-
folderName: filePath,
|
|
29
|
-
}), { defaultAnswer: false });
|
|
26
|
+
execute: async ({ dest, name, assetType, commandArgs }) => {
|
|
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 });
|
|
30
30
|
if (overwrite) {
|
|
31
|
-
|
|
31
|
+
fs_extra_1.default.rmdirSync(filePath, { recursive: true });
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
return;
|
|
@@ -36,37 +36,33 @@ module.exports = {
|
|
|
36
36
|
}
|
|
37
37
|
let samplesConfig;
|
|
38
38
|
try {
|
|
39
|
-
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');
|
|
40
40
|
samplesConfig = data;
|
|
41
41
|
}
|
|
42
42
|
catch (err) {
|
|
43
|
-
debugError(err);
|
|
43
|
+
(0, errorHandlers_1.debugError)(err);
|
|
44
44
|
}
|
|
45
45
|
if (!samplesConfig) {
|
|
46
|
-
|
|
47
|
-
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);
|
|
48
48
|
}
|
|
49
|
-
const { sampleType, sampleLanguage } = await createApiSamplePrompt(samplesConfig);
|
|
49
|
+
const { sampleType, sampleLanguage } = await (0, createApiSamplePrompt_1.createApiSamplePrompt)(samplesConfig);
|
|
50
50
|
if (!sampleType || !sampleLanguage) {
|
|
51
|
-
|
|
52
|
-
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);
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}));
|
|
58
|
-
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, {
|
|
56
|
+
...commandArgs,
|
|
59
57
|
type: assetType,
|
|
60
58
|
sourceDir: sampleLanguage,
|
|
61
|
-
...options,
|
|
62
59
|
});
|
|
63
60
|
if (created) {
|
|
64
|
-
if (
|
|
65
|
-
|
|
61
|
+
if (fs_extra_1.default.existsSync(`${filePath}/.env.template`)) {
|
|
62
|
+
fs_extra_1.default.copySync(`${filePath}/.env.template`, `${filePath}/.env`);
|
|
66
63
|
}
|
|
67
|
-
|
|
68
|
-
filePath,
|
|
69
|
-
}));
|
|
64
|
+
logger_1.uiLogger.success(en_1.commands.create.subcommands.apiSample.success.sampleCreated(filePath));
|
|
70
65
|
}
|
|
71
66
|
},
|
|
72
67
|
};
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
module.exports = {
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
4
|
+
const appAssetType = {
|
|
6
5
|
hidden: true,
|
|
7
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
8
|
-
execute: async ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
execute: async ({ commandArgs, dest, assetType }) => {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/crm-card-weather-app', dest, {
|
|
9
|
+
...commandArgs,
|
|
10
|
+
type: assetType,
|
|
11
|
+
});
|
|
12
|
+
},
|
|
12
13
|
};
|
|
14
|
+
exports.default = appAssetType;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
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");
|
|
7
|
+
const functionAssetType = {
|
|
8
|
+
hidden: false,
|
|
9
9
|
dest: ({ name }) => name,
|
|
10
10
|
execute: async ({ dest }) => {
|
|
11
|
-
const functionDefinition = await createFunctionPrompt();
|
|
11
|
+
const functionDefinition = await (0, createFunctionPrompt_1.createFunctionPrompt)();
|
|
12
12
|
try {
|
|
13
|
-
await createFunction(functionDefinition, dest);
|
|
13
|
+
await (0, functions_1.createFunction)(functionDefinition, dest);
|
|
14
14
|
}
|
|
15
15
|
catch (e) {
|
|
16
|
-
logError(e);
|
|
17
|
-
process.exit(EXIT_CODES.ERROR);
|
|
16
|
+
(0, index_1.logError)(e);
|
|
17
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
|
+
exports.default = functionAssetType;
|
package/commands/create/index.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
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"));
|
|
15
|
+
const assets = {
|
|
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,
|
|
14
25
|
};
|
|
26
|
+
exports.default = assets;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
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");
|
|
9
|
+
const moduleAssetType = {
|
|
10
|
+
hidden: false,
|
|
11
11
|
dest: ({ dest }) => dest,
|
|
12
12
|
validate: ({ name }) => {
|
|
13
13
|
if (!name) {
|
|
14
|
-
|
|
14
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.module.errors.nameRequired);
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
18
18
|
},
|
|
19
19
|
execute: async ({ name, dest, getInternalVersion }) => {
|
|
20
|
-
const moduleDefinition = await createModulePrompt();
|
|
20
|
+
const moduleDefinition = await (0, createModulePrompt_1.createModulePrompt)();
|
|
21
21
|
try {
|
|
22
|
-
await createModule(moduleDefinition, name, dest, getInternalVersion);
|
|
22
|
+
await (0, modules_1.createModule)(moduleDefinition, name, dest, getInternalVersion);
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
25
|
-
logError(e);
|
|
26
|
-
process.exit(EXIT_CODES.ERROR);
|
|
25
|
+
(0, index_1.logError)(e);
|
|
26
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
|
+
exports.default = moduleAssetType;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
4
|
+
const reactAppAssetType = {
|
|
5
|
+
hidden: false,
|
|
6
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
7
|
-
execute: async ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
execute: async ({ commandArgs, dest, assetType }) => {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-react-boilerplate', dest, {
|
|
9
|
+
...commandArgs,
|
|
10
|
+
type: assetType,
|
|
11
|
+
});
|
|
12
|
+
},
|
|
11
13
|
};
|
|
14
|
+
exports.default = reactAppAssetType;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
module.exports = {
|
|
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");
|
|
9
|
+
const templateAssetType = {
|
|
11
10
|
dest: ({ dest }) => dest,
|
|
11
|
+
hidden: false,
|
|
12
12
|
validate: ({ name }) => {
|
|
13
13
|
if (!name) {
|
|
14
|
-
|
|
14
|
+
logger_1.uiLogger.error(en_1.commands.create.subcommands.template.errors.nameRequired);
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
return true;
|
|
18
18
|
},
|
|
19
19
|
execute: async ({ name, dest }) => {
|
|
20
|
-
const { templateType } = await createTemplatePrompt();
|
|
20
|
+
const { templateType } = await (0, createTemplatePrompt_1.createTemplatePrompt)();
|
|
21
21
|
try {
|
|
22
|
-
await createTemplate(name, dest, templateType);
|
|
22
|
+
await (0, templates_1.createTemplate)(name, dest, templateType);
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
25
|
-
logError(e);
|
|
26
|
-
process.exit(EXIT_CODES.ERROR);
|
|
25
|
+
(0, index_1.logError)(e);
|
|
26
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
27
27
|
}
|
|
28
|
-
return { templateType };
|
|
29
28
|
},
|
|
30
29
|
};
|
|
30
|
+
exports.default = templateAssetType;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
4
|
+
const vueAppAssetType = {
|
|
5
|
+
hidden: false,
|
|
6
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
7
|
-
execute: async ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
execute: async ({ commandArgs, dest, assetType }) => {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-vue-boilerplate', dest, {
|
|
9
|
+
...commandArgs,
|
|
10
|
+
type: assetType,
|
|
11
|
+
});
|
|
12
|
+
},
|
|
11
13
|
};
|
|
14
|
+
exports.default = vueAppAssetType;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
4
|
+
const webpackServerlessAssetType = {
|
|
5
|
+
hidden: false,
|
|
6
6
|
dest: ({ name, assetType }) => name || assetType,
|
|
7
|
-
execute: async ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
execute: async ({ commandArgs, dest, assetType }) => {
|
|
8
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-webpack-serverless-boilerplate', dest, {
|
|
9
|
+
...commandArgs,
|
|
10
|
+
type: assetType,
|
|
11
|
+
});
|
|
12
|
+
},
|
|
11
13
|
};
|
|
14
|
+
exports.default = webpackServerlessAssetType;
|