@hubspot/cli 7.7.16-experimental.0 → 7.7.16-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +4 -0
- package/bin/hs +1 -1
- package/commands/getStarted.d.ts +9 -0
- package/commands/getStarted.js +227 -0
- package/commands/init.js +6 -1
- package/commands/mcp/setup.d.ts +2 -2
- package/commands/mcp/setup.js +2 -0
- package/commands/mcp/start.d.ts +2 -2
- package/commands/mcp/start.js +3 -1
- package/commands/project/deploy.d.ts +1 -0
- package/commands/project/deploy.js +29 -3
- package/commands/project/upload.d.ts +2 -2
- package/commands/project/upload.js +18 -23
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project.js +2 -0
- package/commands/testAccount/create.d.ts +6 -0
- package/commands/testAccount/create.js +110 -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/lang/en.d.ts +143 -29
- package/lang/en.js +143 -32
- package/lang/en.lyaml +9 -14
- package/lib/app/migrate.js +15 -3
- package/lib/commonOpts.d.ts +2 -0
- package/lib/commonOpts.js +21 -9
- package/lib/constants.d.ts +5 -0
- package/lib/constants.js +6 -1
- package/lib/doctor/Doctor.js +1 -1
- package/lib/errorHandlers/index.js +7 -0
- package/lib/mcp/setup.d.ts +9 -0
- package/lib/mcp/setup.js +23 -21
- package/lib/projectProfiles.d.ts +1 -0
- package/lib/projectProfiles.js +18 -0
- package/lib/projects/buildAndDeploy.js +1 -1
- package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -0
- package/lib/projects/localDev/AppDevModeInterface.js +45 -16
- package/lib/projects/localDev/LocalDevManager.js +1 -1
- package/lib/projects/upload.d.ts +3 -0
- package/lib/projects/upload.js +56 -22
- package/lib/projects/urls.d.ts +2 -0
- package/lib/projects/urls.js +10 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
- package/lib/prompts/installAppPrompt.d.ts +2 -1
- package/lib/prompts/installAppPrompt.js +12 -2
- package/lib/prompts/promptUtils.d.ts +1 -0
- package/lib/prompts/promptUtils.js +2 -0
- package/lib/ui/logger.d.ts +1 -0
- package/lib/ui/logger.js +1 -0
- package/lib/yargsUtils.d.ts +1 -0
- package/lib/yargsUtils.js +3 -0
- package/mcp-server/tools/index.js +2 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
- package/mcp-server/tools/project/CreateProjectTool.js +5 -1
- package/mcp-server/tools/project/DeployProject.js +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
- package/package.json +10 -9
- package/types/LocalDev.d.ts +1 -0
- package/types/Yargs.d.ts +4 -0
package/lib/ui/logger.js
CHANGED
package/lib/yargsUtils.d.ts
CHANGED
package/lib/yargsUtils.js
CHANGED
|
@@ -32,6 +32,9 @@ function makeYargsBuilder(callback, command, describe, options = {}) {
|
|
|
32
32
|
if (options.useTestingOptions) {
|
|
33
33
|
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
34
34
|
}
|
|
35
|
+
if (options.useJSONOutputOptions) {
|
|
36
|
+
(0, commonOpts_1.addJSONOutputOptions)(yargs);
|
|
37
|
+
}
|
|
35
38
|
if (options.useCmsPublishModeOptions) {
|
|
36
39
|
const opts = typeof options.useCmsPublishModeOptions === 'object'
|
|
37
40
|
? options.useCmsPublishModeOptions
|
|
@@ -6,6 +6,7 @@ const CreateProjectTool_1 = require("./project/CreateProjectTool");
|
|
|
6
6
|
const GuidedWalkthroughTool_1 = require("./project/GuidedWalkthroughTool");
|
|
7
7
|
const DeployProject_1 = require("./project/DeployProject");
|
|
8
8
|
const AddFeatureToProject_1 = require("./project/AddFeatureToProject");
|
|
9
|
+
const ValidateProjectTool_1 = require("./project/ValidateProjectTool");
|
|
9
10
|
function registerProjectTools(mcpServer) {
|
|
10
11
|
return [
|
|
11
12
|
new UploadProjectTools_1.UploadProjectTools(mcpServer).register(),
|
|
@@ -13,5 +14,6 @@ function registerProjectTools(mcpServer) {
|
|
|
13
14
|
new GuidedWalkthroughTool_1.GuidedWalkthroughTool(mcpServer).register(),
|
|
14
15
|
new DeployProject_1.DeployProject(mcpServer).register(),
|
|
15
16
|
new AddFeatureToProject_1.AddFeatureToProject(mcpServer).register(),
|
|
17
|
+
new ValidateProjectTool_1.ValidateProjectTool(mcpServer).register(),
|
|
16
18
|
];
|
|
17
19
|
}
|
|
@@ -3,26 +3,26 @@ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
5
5
|
absoluteCurrentWorkingDirectory: z.ZodString;
|
|
6
|
-
name: z.ZodString
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
7
7
|
destination: z.ZodString;
|
|
8
8
|
projectBase: z.ZodUnion<[z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
|
|
9
9
|
distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
|
|
10
10
|
auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
|
|
11
11
|
features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">]>, "many">>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
name: string;
|
|
14
13
|
projectBase: "app" | "empty";
|
|
15
14
|
absoluteCurrentWorkingDirectory: string;
|
|
16
15
|
destination: string;
|
|
17
16
|
auth?: "oauth" | "static" | undefined;
|
|
17
|
+
name?: string | undefined;
|
|
18
18
|
distribution?: "marketplace" | "private" | undefined;
|
|
19
19
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
name: string;
|
|
22
21
|
projectBase: "app" | "empty";
|
|
23
22
|
absoluteCurrentWorkingDirectory: string;
|
|
24
23
|
destination: string;
|
|
25
24
|
auth?: "oauth" | "static" | undefined;
|
|
25
|
+
name?: string | undefined;
|
|
26
26
|
distribution?: "marketplace" | "private" | undefined;
|
|
27
27
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
28
28
|
}>;
|
|
@@ -13,7 +13,8 @@ const inputSchema = {
|
|
|
13
13
|
absoluteCurrentWorkingDirectory: constants_2.absoluteCurrentWorkingDirectory,
|
|
14
14
|
name: zod_1.z
|
|
15
15
|
.string()
|
|
16
|
-
.describe('The name of the project to be created. This name is how your project will appear in HubSpot.')
|
|
16
|
+
.describe('The name of the project to be created. This name is how your project will appear in HubSpot. If not specified by the user, do not choose for them. Changing this is potentially destructive.')
|
|
17
|
+
.optional(),
|
|
17
18
|
destination: zod_1.z
|
|
18
19
|
.string()
|
|
19
20
|
.describe('Relative path to the directory the project will be created in. DO NOT use the current directory unless the user has explicitly stated to do so.'),
|
|
@@ -56,6 +57,9 @@ class CreateProjectTool extends types_1.Tool {
|
|
|
56
57
|
if (name) {
|
|
57
58
|
command = (0, command_1.addFlag)(command, 'name', name);
|
|
58
59
|
}
|
|
60
|
+
else {
|
|
61
|
+
content.push((0, content_1.formatTextContent)(`Ask the user what they would like to name the project.`));
|
|
62
|
+
}
|
|
59
63
|
if (destination) {
|
|
60
64
|
command = (0, command_1.addFlag)(command, 'dest', destination);
|
|
61
65
|
}
|
|
@@ -42,7 +42,7 @@ class DeployProject extends types_1.Tool {
|
|
|
42
42
|
register() {
|
|
43
43
|
return this.mcpServer.registerTool('deploy-hubspot-project', {
|
|
44
44
|
title: 'Deploy a build of HubSpot Project',
|
|
45
|
-
description: 'Takes a build number and a project name and deploys that build of the project',
|
|
45
|
+
description: 'Takes a build number and a project name and deploys that build of the project. DO NOT run this tool unless the user specifies they would like to deploy the project.',
|
|
46
46
|
inputSchema,
|
|
47
47
|
}, this.handler);
|
|
48
48
|
}
|
|
@@ -27,7 +27,7 @@ class UploadProjectTools extends types_1.Tool {
|
|
|
27
27
|
register() {
|
|
28
28
|
return this.mcpServer.registerTool('upload-hubspot-project', {
|
|
29
29
|
title: 'Upload HubSpot Project',
|
|
30
|
-
description: 'Uploads the HubSpot project in current working directory. If the project does not exist, it will be created. MUST be ran from within the project directory.',
|
|
30
|
+
description: 'Uploads the HubSpot project in current working directory. If the project does not exist, it will be created. MUST be ran from within the project directory. DO NOT run this tool unless the user specifies they would like to upload the project, it is potentially destructive',
|
|
31
31
|
inputSchema,
|
|
32
32
|
}, this.handler);
|
|
33
33
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TextContentResponse, Tool } from '../../types';
|
|
2
|
+
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
declare const inputSchemaZodObject: z.ZodObject<{
|
|
5
|
+
absoluteProjectPath: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
absoluteProjectPath: string;
|
|
8
|
+
}, {
|
|
9
|
+
absoluteProjectPath: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
12
|
+
export declare class ValidateProjectTool extends Tool<CreateProjectInputSchema> {
|
|
13
|
+
constructor(mcpServer: McpServer);
|
|
14
|
+
handler({ absoluteProjectPath, }: CreateProjectInputSchema): Promise<TextContentResponse>;
|
|
15
|
+
register(): RegisteredTool;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidateProjectTool = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const project_1 = require("../../utils/project");
|
|
8
|
+
const content_1 = require("../../utils/content");
|
|
9
|
+
const inputSchema = {
|
|
10
|
+
absoluteProjectPath: constants_1.absoluteProjectPath,
|
|
11
|
+
};
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
const inputSchemaZodObject = zod_1.z.object({ ...inputSchema });
|
|
14
|
+
class ValidateProjectTool extends types_1.Tool {
|
|
15
|
+
constructor(mcpServer) {
|
|
16
|
+
super(mcpServer);
|
|
17
|
+
}
|
|
18
|
+
async handler({ absoluteProjectPath, }) {
|
|
19
|
+
try {
|
|
20
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, 'hs project validate');
|
|
21
|
+
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
register() {
|
|
28
|
+
return this.mcpServer.registerTool('validate-hubspot-project', {
|
|
29
|
+
title: 'Validate HubSpot Project',
|
|
30
|
+
description: 'Validates the HubSpot project and its configuration files. This tool does not need to be ran before uploading the project',
|
|
31
|
+
inputSchema,
|
|
32
|
+
}, this.handler);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ValidateProjectTool = ValidateProjectTool;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.16-experimental.
|
|
3
|
+
"version": "7.7.16-experimental.1",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "3.
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.3.
|
|
8
|
+
"@hubspot/local-dev-lib": "3.10.0-beta.0",
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.3.2",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.6",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.9.2",
|
|
@@ -66,22 +66,23 @@
|
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "ts-node ./scripts/build.ts",
|
|
69
|
+
"build-docker": "docker image build --tag hs-cli-image . && docker image prune -f",
|
|
70
|
+
"circular-deps": "yarn madge --circular .",
|
|
69
71
|
"debug-mcp": "yarn build && npx @modelcontextprotocol/inspector node dist/mcp-server/server.js",
|
|
72
|
+
"hs": "yarn build && node ./dist/bin/hs",
|
|
73
|
+
"hs-debug": "yarn build && NODE_DEBUG=http* node --inspect-brk ./dist/bin/hs",
|
|
70
74
|
"lint": "echo 'Linting is disabled for Blazar'",
|
|
71
75
|
"lint:local": "eslint . && prettier --list-different './**/*.{ts,js,json}'",
|
|
72
76
|
"list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
|
|
73
77
|
"local-link": "yarn ts-node ./scripts/linking.ts",
|
|
78
|
+
"mcp-local": "yarn ts-node ./scripts/mcp-local.ts",
|
|
74
79
|
"prettier:write": "prettier --write './**/*.{ts,js,json}'",
|
|
80
|
+
"release": "yarn ts-node ./scripts/release.ts release",
|
|
75
81
|
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
|
|
76
82
|
"test-cli": "yarn build && yarn --cwd 'acceptance-tests' test-ci",
|
|
77
83
|
"test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
|
|
78
|
-
"test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
|
|
79
84
|
"test-cli-latest": "yarn build && yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn --cwd 'acceptance-tests' test-latest",
|
|
80
|
-
"
|
|
81
|
-
"circular-deps": "yarn madge --circular .",
|
|
82
|
-
"release": "yarn ts-node ./scripts/release.ts release",
|
|
83
|
-
"hs": "yarn build && node ./dist/bin/hs",
|
|
84
|
-
"hs-debug": "yarn build && NODE_DEBUG=http* node --inspect-brk ./dist/bin/hs",
|
|
85
|
+
"test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
|
|
85
86
|
"update-ldl": "yarn add --exact @hubspot/local-dev-lib@latest",
|
|
86
87
|
"view-unreleased-changes": "node ./scripts/unreleasedChanges.js"
|
|
87
88
|
},
|
package/types/LocalDev.d.ts
CHANGED
package/types/Yargs.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export type OverwriteArgs = Options & {
|
|
|
24
24
|
export type StringArgType = Options & {
|
|
25
25
|
type: 'string';
|
|
26
26
|
};
|
|
27
|
+
export type JSONOutputArgs = Options & {
|
|
28
|
+
json?: boolean;
|
|
29
|
+
formatOutputAsJson?: boolean;
|
|
30
|
+
};
|
|
27
31
|
export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs & {
|
|
28
32
|
profile?: string;
|
|
29
33
|
testingAccount?: string | number;
|