@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
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
8
5
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
9
6
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
10
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
11
7
|
const ui_1 = require("../../lib/ui");
|
|
12
8
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
13
9
|
const lang_1 = require("../../lib/lang");
|
|
14
10
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
15
11
|
const ui_2 = require("../../lib/ui");
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
13
|
+
const command = 'add [name]';
|
|
14
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.add.describe`);
|
|
18
15
|
async function handler(args) {
|
|
19
16
|
const { name, derivedAccountId } = args;
|
|
20
17
|
let secretName = name;
|
|
@@ -49,13 +46,23 @@ async function handler(args) {
|
|
|
49
46
|
}));
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
function
|
|
53
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
54
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
55
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
49
|
+
function addSecretBuilder(yargs) {
|
|
56
50
|
yargs.positional('name', {
|
|
57
51
|
describe: (0, lang_1.i18n)(`commands.secret.subcommands.add.positionals.name.describe`),
|
|
58
52
|
type: 'string',
|
|
59
53
|
});
|
|
60
54
|
return yargs;
|
|
61
55
|
}
|
|
56
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(addSecretBuilder, command, describe, {
|
|
57
|
+
useGlobalOptions: true,
|
|
58
|
+
useConfigOptions: true,
|
|
59
|
+
useAccountOptions: true,
|
|
60
|
+
useEnvironmentOptions: true,
|
|
61
|
+
});
|
|
62
|
+
const addSecretCommand = {
|
|
63
|
+
command,
|
|
64
|
+
describe,
|
|
65
|
+
handler,
|
|
66
|
+
builder,
|
|
67
|
+
};
|
|
68
|
+
exports.default = addSecretCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "delete [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type DeleteSecretArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type DeleteSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
force?: boolean;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const deleteSecretCommand: YargsCommandModule<unknown, DeleteSecretArgs>;
|
|
7
|
+
export default deleteSecretCommand;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
8
5
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
@@ -11,10 +8,10 @@ const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
|
11
8
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
12
9
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
13
10
|
const ui_1 = require("../../lib/ui");
|
|
14
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
15
11
|
const lang_1 = require("../../lib/lang");
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
13
|
+
const command = 'delete [name]';
|
|
14
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.delete.describe`);
|
|
18
15
|
async function handler(args) {
|
|
19
16
|
const { name, derivedAccountId, force } = args;
|
|
20
17
|
let secretName = name;
|
|
@@ -59,10 +56,7 @@ async function handler(args) {
|
|
|
59
56
|
}));
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
|
-
function
|
|
63
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
64
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
65
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
59
|
+
function deleteSecretBuilder(yargs) {
|
|
66
60
|
yargs
|
|
67
61
|
.positional('name', {
|
|
68
62
|
describe: (0, lang_1.i18n)(`commands.secret.subcommands.delete.positionals.name.describe`),
|
|
@@ -74,3 +68,16 @@ function builder(yargs) {
|
|
|
74
68
|
});
|
|
75
69
|
return yargs;
|
|
76
70
|
}
|
|
71
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(deleteSecretBuilder, command, describe, {
|
|
72
|
+
useGlobalOptions: true,
|
|
73
|
+
useConfigOptions: true,
|
|
74
|
+
useAccountOptions: true,
|
|
75
|
+
useEnvironmentOptions: true,
|
|
76
|
+
});
|
|
77
|
+
const deleteSecretCommand = {
|
|
78
|
+
command,
|
|
79
|
+
describe,
|
|
80
|
+
handler,
|
|
81
|
+
builder,
|
|
82
|
+
};
|
|
83
|
+
exports.default = deleteSecretCommand;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type ListSecretArgs = CommonArgs & CombinedArgs;
|
|
7
|
-
export declare function handler(args: ArgumentsCamelCase<ListSecretArgs>): Promise<void>;
|
|
8
|
-
export declare function builder(yargs: Argv): Argv<ListSecretArgs>;
|
|
9
|
-
export {};
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ListSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
3
|
+
declare const listSecretCommand: YargsCommandModule<unknown, ListSecretArgs>;
|
|
4
|
+
export default listSecretCommand;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
8
5
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
9
6
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
10
7
|
const ui_1 = require("../../lib/ui");
|
|
11
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
12
8
|
const lang_1 = require("../../lib/lang");
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'list';
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.list.describe`);
|
|
15
12
|
async function handler(args) {
|
|
16
13
|
const { derivedAccountId } = args;
|
|
17
14
|
(0, usageTracking_1.trackCommandUsage)('secrets-list', {}, derivedAccountId);
|
|
@@ -32,9 +29,19 @@ async function handler(args) {
|
|
|
32
29
|
}));
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
function
|
|
36
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
38
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
32
|
+
function listSecretBuilder(yargs) {
|
|
39
33
|
return yargs;
|
|
40
34
|
}
|
|
35
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(listSecretBuilder, command, describe, {
|
|
36
|
+
useGlobalOptions: true,
|
|
37
|
+
useConfigOptions: true,
|
|
38
|
+
useAccountOptions: true,
|
|
39
|
+
useEnvironmentOptions: true,
|
|
40
|
+
});
|
|
41
|
+
const listSecretCommand = {
|
|
42
|
+
command,
|
|
43
|
+
describe,
|
|
44
|
+
handler,
|
|
45
|
+
builder,
|
|
46
|
+
};
|
|
47
|
+
exports.default = listSecretCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "update [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type UpdateSecretArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type UpdateSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const updateSecretCommand: YargsCommandModule<unknown, UpdateSecretArgs>;
|
|
6
|
+
export default updateSecretCommand;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
7
4
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
8
5
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
6
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
10
7
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
8
|
const ui_1 = require("../../lib/ui");
|
|
12
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
13
9
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
14
10
|
const lang_1 = require("../../lib/lang");
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
|
+
const command = 'update [name]';
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.update.describe`);
|
|
17
14
|
async function handler(args) {
|
|
18
15
|
const { name, derivedAccountId } = args;
|
|
19
16
|
let secretName = name;
|
|
@@ -48,13 +45,23 @@ async function handler(args) {
|
|
|
48
45
|
}));
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
function
|
|
52
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
53
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
54
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
48
|
+
function updateSecretBuilder(yargs) {
|
|
55
49
|
yargs.positional('name', {
|
|
56
50
|
describe: (0, lang_1.i18n)(`commands.secret.subcommands.update.positionals.name.describe`),
|
|
57
51
|
type: 'string',
|
|
58
52
|
});
|
|
59
53
|
return yargs;
|
|
60
54
|
}
|
|
55
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(updateSecretBuilder, command, describe, {
|
|
56
|
+
useGlobalOptions: true,
|
|
57
|
+
useConfigOptions: true,
|
|
58
|
+
useAccountOptions: true,
|
|
59
|
+
useEnvironmentOptions: true,
|
|
60
|
+
});
|
|
61
|
+
const updateSecretCommand = {
|
|
62
|
+
command,
|
|
63
|
+
describe,
|
|
64
|
+
handler,
|
|
65
|
+
builder,
|
|
66
|
+
};
|
|
67
|
+
exports.default = updateSecretCommand;
|
package/commands/secret.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 secretCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default secretCommand;
|
package/commands/secret.js
CHANGED
|
@@ -1,55 +1,32 @@
|
|
|
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 listSecretCommand = __importStar(require("./secret/listSecret"));
|
|
41
|
-
const deleteSecretCommand = __importStar(require("./secret/deleteSecret"));
|
|
42
|
-
const updateSecretCommand = __importStar(require("./secret/updateSecret"));
|
|
6
|
+
const addSecret_1 = __importDefault(require("./secret/addSecret"));
|
|
7
|
+
const listSecret_1 = __importDefault(require("./secret/listSecret"));
|
|
8
|
+
const deleteSecret_1 = __importDefault(require("./secret/deleteSecret"));
|
|
9
|
+
const updateSecret_1 = __importDefault(require("./secret/updateSecret"));
|
|
43
10
|
const lang_1 = require("../lib/lang");
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
11
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
12
|
+
const command = ['secret', 'secrets'];
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.describe`);
|
|
14
|
+
function secretBuilder(yargs) {
|
|
48
15
|
yargs
|
|
49
|
-
.command(
|
|
50
|
-
.command(
|
|
51
|
-
.command(
|
|
52
|
-
.command(
|
|
16
|
+
.command(listSecret_1.default)
|
|
17
|
+
.command(addSecret_1.default)
|
|
18
|
+
.command(updateSecret_1.default)
|
|
19
|
+
.command(deleteSecret_1.default)
|
|
53
20
|
.demandCommand(1, '');
|
|
54
21
|
return yargs;
|
|
55
22
|
}
|
|
23
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(secretBuilder, command, describe);
|
|
24
|
+
const secretCommand = {
|
|
25
|
+
command,
|
|
26
|
+
describe,
|
|
27
|
+
builder,
|
|
28
|
+
handler: () => { },
|
|
29
|
+
};
|
|
30
|
+
exports.default = secretCommand;
|
|
31
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
32
|
+
module.exports = secretCommand;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
|
+
type SetupMcpArgs = CommonArgs & {
|
|
3
|
+
autoSetup?: boolean;
|
|
4
|
+
showInstructions?: boolean;
|
|
5
|
+
global?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const setupMcpCommand: YargsCommandModule<unknown, SetupMcpArgs>;
|
|
8
|
+
export default setupMcpCommand;
|
|
@@ -0,0 +1,229 @@
|
|
|
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 exitCodes_1 = require("../lib/enums/exitCodes");
|
|
7
|
+
const en_1 = require("../lang/en");
|
|
8
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
9
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
+
const promptUtils_1 = require("../lib/prompts/promptUtils");
|
|
11
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const os_1 = __importDefault(require("os"));
|
|
14
|
+
const command = 'setup-mcp';
|
|
15
|
+
const describe = en_1.commands.setupMcp.describe;
|
|
16
|
+
function getCursorMcpConfigPath(global = true) {
|
|
17
|
+
if (global) {
|
|
18
|
+
// Global configuration: ~/.cursor/mcp.json
|
|
19
|
+
const homeDir = os_1.default.homedir();
|
|
20
|
+
return path_1.default.join(homeDir, '.cursor', 'mcp.json');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// Project-specific configuration: .cursor/mcp.json in current directory
|
|
24
|
+
return path_1.default.join(process.cwd(), '.cursor', 'mcp.json');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const MCP_SERVER_COMMAND = 'hsmcp';
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
async function readCursorConfig(global = true) {
|
|
30
|
+
const configPath = getCursorMcpConfigPath(global);
|
|
31
|
+
try {
|
|
32
|
+
if (await fs_extra_1.default.pathExists(configPath)) {
|
|
33
|
+
const content = await fs_extra_1.default.readFile(configPath, 'utf8');
|
|
34
|
+
return JSON.parse(content);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
logger_1.logger.debug(`Error reading Cursor config: ${error}`);
|
|
39
|
+
}
|
|
40
|
+
return { mcpServers: {} };
|
|
41
|
+
}
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
async function writeCursorConfig(config, global = true) {
|
|
44
|
+
const configPath = getCursorMcpConfigPath(global);
|
|
45
|
+
const configDir = path_1.default.dirname(configPath);
|
|
46
|
+
// Ensure the directory exists
|
|
47
|
+
await fs_extra_1.default.ensureDir(configDir);
|
|
48
|
+
// Write the config with proper formatting
|
|
49
|
+
await fs_extra_1.default.writeFile(configPath, JSON.stringify(config, null, 2));
|
|
50
|
+
}
|
|
51
|
+
async function setupMcpServer(global = true) {
|
|
52
|
+
try {
|
|
53
|
+
const config = await readCursorConfig(global);
|
|
54
|
+
// Check if hsmcp command is available
|
|
55
|
+
try {
|
|
56
|
+
require('child_process').execSync(`which ${MCP_SERVER_COMMAND} 2>/dev/null`, {
|
|
57
|
+
encoding: 'utf8',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
logger_1.logger.error(en_1.commands.setupMcp.errors.serverNotFound);
|
|
62
|
+
logger_1.logger.error(en_1.commands.setupMcp.errors.installHint);
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
// Check if already configured
|
|
66
|
+
if (config.mcpServers && config.mcpServers['hubspot-cli-mcp']) {
|
|
67
|
+
logger_1.logger.info(en_1.commands.setupMcp.warnings.alreadyConfigured);
|
|
68
|
+
const { shouldOverwrite } = await (0, promptUtils_1.promptUser)([
|
|
69
|
+
{
|
|
70
|
+
type: 'confirm',
|
|
71
|
+
name: 'shouldOverwrite',
|
|
72
|
+
message: en_1.commands.setupMcp.prompts.overwrite,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
]);
|
|
76
|
+
if (!shouldOverwrite) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Configure the MCP server with the simple global command
|
|
81
|
+
if (!config.mcpServers) {
|
|
82
|
+
config.mcpServers = {};
|
|
83
|
+
}
|
|
84
|
+
config.mcpServers['hubspot-cli-mcp'] = {
|
|
85
|
+
command: MCP_SERVER_COMMAND,
|
|
86
|
+
args: [],
|
|
87
|
+
};
|
|
88
|
+
await writeCursorConfig(config, global);
|
|
89
|
+
const configType = global ? 'global' : 'project-specific';
|
|
90
|
+
logger_1.logger.success(en_1.commands.setupMcp.success.configured.replace('Claude', `Cursor (${configType})`));
|
|
91
|
+
logger_1.logger.info(en_1.commands.setupMcp.success.restartCursor);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
logger_1.logger.error(`${en_1.commands.setupMcp.errors.configurationFailed}: ${error}`);
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function displayInstructions(global = true) {
|
|
100
|
+
const configPath = getCursorMcpConfigPath(global);
|
|
101
|
+
const configType = global ? 'global' : 'project-specific';
|
|
102
|
+
logger_1.logger.log(en_1.commands.setupMcp.instructions.title.replace('Claude', `Cursor (${configType})`));
|
|
103
|
+
logger_1.logger.log('');
|
|
104
|
+
logger_1.logger.log(en_1.commands.setupMcp.instructions.step1);
|
|
105
|
+
logger_1.logger.log(` ${configPath}`);
|
|
106
|
+
logger_1.logger.log('');
|
|
107
|
+
logger_1.logger.log(en_1.commands.setupMcp.instructions.step2);
|
|
108
|
+
logger_1.logger.log(' {');
|
|
109
|
+
logger_1.logger.log(' "mcpServers": {');
|
|
110
|
+
logger_1.logger.log(' "hubspot-cli-mcp": {');
|
|
111
|
+
logger_1.logger.log(` "command": "${MCP_SERVER_COMMAND}",`);
|
|
112
|
+
logger_1.logger.log(' "args": []');
|
|
113
|
+
logger_1.logger.log(' }');
|
|
114
|
+
logger_1.logger.log(' }');
|
|
115
|
+
logger_1.logger.log(' }');
|
|
116
|
+
logger_1.logger.log('');
|
|
117
|
+
logger_1.logger.log(en_1.commands.setupMcp.instructions.step3.replace('Claude', 'Cursor'));
|
|
118
|
+
logger_1.logger.log('');
|
|
119
|
+
logger_1.logger.log(en_1.commands.setupMcp.instructions.documentation);
|
|
120
|
+
}
|
|
121
|
+
async function handler(args) {
|
|
122
|
+
const useGlobal = args.global !== false; // Default to global unless explicitly set to false
|
|
123
|
+
if (args.showInstructions) {
|
|
124
|
+
displayInstructions(useGlobal);
|
|
125
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (args.autoSetup) {
|
|
129
|
+
const success = await setupMcpServer(useGlobal);
|
|
130
|
+
process.exit(success ? exitCodes_1.EXIT_CODES.SUCCESS : exitCodes_1.EXIT_CODES.ERROR);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
// Interactive mode - determine scope first if not specified
|
|
134
|
+
let isGlobal = useGlobal;
|
|
135
|
+
if (args.global === undefined) {
|
|
136
|
+
const { scope } = await (0, promptUtils_1.promptUser)([
|
|
137
|
+
{
|
|
138
|
+
type: 'list',
|
|
139
|
+
name: 'scope',
|
|
140
|
+
message: en_1.commands.setupMcp.prompts.selectScope,
|
|
141
|
+
choices: [
|
|
142
|
+
{
|
|
143
|
+
name: en_1.commands.setupMcp.choices.global,
|
|
144
|
+
value: 'global',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: en_1.commands.setupMcp.choices.project,
|
|
148
|
+
value: 'project',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
]);
|
|
153
|
+
isGlobal = scope === 'global';
|
|
154
|
+
}
|
|
155
|
+
// Then ask what action to take
|
|
156
|
+
const { action } = await (0, promptUtils_1.promptUser)([
|
|
157
|
+
{
|
|
158
|
+
type: 'list',
|
|
159
|
+
name: 'action',
|
|
160
|
+
message: en_1.commands.setupMcp.prompts.selectAction,
|
|
161
|
+
choices: [
|
|
162
|
+
{
|
|
163
|
+
name: en_1.commands.setupMcp.choices.autoSetup,
|
|
164
|
+
value: 'auto',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: en_1.commands.setupMcp.choices.showInstructions,
|
|
168
|
+
value: 'instructions',
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
]);
|
|
173
|
+
if (action === 'auto') {
|
|
174
|
+
const success = await setupMcpServer(isGlobal);
|
|
175
|
+
process.exit(success ? exitCodes_1.EXIT_CODES.SUCCESS : exitCodes_1.EXIT_CODES.ERROR);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
displayInstructions(isGlobal);
|
|
179
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function setupMcpBuilder(yargs) {
|
|
183
|
+
yargs
|
|
184
|
+
.options({
|
|
185
|
+
'auto-setup': {
|
|
186
|
+
describe: en_1.commands.setupMcp.options.autoSetup.describe,
|
|
187
|
+
type: 'boolean',
|
|
188
|
+
default: false,
|
|
189
|
+
},
|
|
190
|
+
'show-instructions': {
|
|
191
|
+
describe: en_1.commands.setupMcp.options.showInstructions.describe,
|
|
192
|
+
type: 'boolean',
|
|
193
|
+
default: false,
|
|
194
|
+
},
|
|
195
|
+
global: {
|
|
196
|
+
describe: en_1.commands.setupMcp.options.global.describe,
|
|
197
|
+
type: 'boolean',
|
|
198
|
+
},
|
|
199
|
+
})
|
|
200
|
+
.example([
|
|
201
|
+
['$0 setup-mcp', en_1.commands.setupMcp.examples.default],
|
|
202
|
+
['$0 setup-mcp --auto-setup', en_1.commands.setupMcp.examples.autoSetup],
|
|
203
|
+
[
|
|
204
|
+
'$0 setup-mcp --auto-setup --global',
|
|
205
|
+
en_1.commands.setupMcp.examples.autoSetupGlobal,
|
|
206
|
+
],
|
|
207
|
+
[
|
|
208
|
+
'$0 setup-mcp --auto-setup --no-global',
|
|
209
|
+
en_1.commands.setupMcp.examples.autoSetupProject,
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
'$0 setup-mcp --show-instructions',
|
|
213
|
+
en_1.commands.setupMcp.examples.showInstructions,
|
|
214
|
+
],
|
|
215
|
+
]);
|
|
216
|
+
return yargs;
|
|
217
|
+
}
|
|
218
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(setupMcpBuilder, command, describe, {
|
|
219
|
+
useGlobalOptions: true,
|
|
220
|
+
});
|
|
221
|
+
const setupMcpCommand = {
|
|
222
|
+
command,
|
|
223
|
+
describe,
|
|
224
|
+
handler,
|
|
225
|
+
builder,
|
|
226
|
+
};
|
|
227
|
+
exports.default = setupMcpCommand;
|
|
228
|
+
// Legacy export for compatibility
|
|
229
|
+
module.exports = setupMcpCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "generate-selectors <path>";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type ThemeSelectorArgs = CommonArgs & {
|
|
6
3
|
path: string;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const themeSelectorsCommand: YargsCommandModule<unknown, ThemeSelectorArgs>;
|
|
6
|
+
export default themeSelectorsCommand;
|
|
@@ -3,14 +3,12 @@ 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 logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
8
|
const lang_1 = require("../../lib/lang");
|
|
12
9
|
const generateSelectors_1 = require("../../lib/generateSelectors");
|
|
13
10
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
14
12
|
const HUBL_EXPRESSION_REGEX = new RegExp(/{%\s*(.*)\s*%}/, 'g');
|
|
15
13
|
const HUBL_VARIABLE_NAME_REGEX = new RegExp(/{%\s*set\s*(\w*)/, 'i');
|
|
16
14
|
const HUBL_STATEMENT_REGEX = new RegExp(/{{\s*[\w.(,\d\-\s)|/~]*.*}}/, 'g');
|
|
@@ -20,8 +18,8 @@ const CSS_VARS_NAME_REGEX = new RegExp(/(--[\w.(,\d\-)]*)/, 'g');
|
|
|
20
18
|
const CSS_SELECTORS_REGEX = new RegExp(/([\s\w:.,\0-[\]]*){/, 'i');
|
|
21
19
|
const CSS_EXPRESSION_REGEX = new RegExp(/(?!\s)([^}])*(?![.#\s,>])[^}]*}/, 'g');
|
|
22
20
|
const THEME_PATH_REGEX = new RegExp(/=\s*.*(theme\.(\w|\.)*)/, 'i');
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const command = 'generate-selectors <path>';
|
|
22
|
+
const describe = (0, lang_1.i18n)('commands.theme.subcommands.generateSelectors.describe');
|
|
25
23
|
async function handler(args) {
|
|
26
24
|
const { path } = args;
|
|
27
25
|
const fieldsJsonPath = (0, generateSelectors_1.findFieldsJsonPath)(path);
|
|
@@ -158,7 +156,7 @@ async function handler(args) {
|
|
|
158
156
|
selectorsPath,
|
|
159
157
|
}));
|
|
160
158
|
}
|
|
161
|
-
function
|
|
159
|
+
function themeSelectorBuilder(yargs) {
|
|
162
160
|
yargs.positional('path', {
|
|
163
161
|
describe: (0, lang_1.i18n)('commands.theme.subcommands.generateSelectors.positionals.path.describe'),
|
|
164
162
|
type: 'string',
|
|
@@ -166,3 +164,13 @@ function builder(yargs) {
|
|
|
166
164
|
});
|
|
167
165
|
return yargs;
|
|
168
166
|
}
|
|
167
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeSelectorBuilder, command, describe, {
|
|
168
|
+
useGlobalOptions: true,
|
|
169
|
+
});
|
|
170
|
+
const themeSelectorsCommand = {
|
|
171
|
+
command,
|
|
172
|
+
describe,
|
|
173
|
+
handler,
|
|
174
|
+
builder,
|
|
175
|
+
};
|
|
176
|
+
exports.default = themeSelectorsCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "marketplace-validate <path>";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type ThemeValidateArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ThemeValidateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
path: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const themeValidateCommand: YargsCommandModule<unknown, ThemeValidateArgs>;
|
|
6
|
+
export default themeValidateCommand;
|