@hubspot/cli 7.8.0-beta.0 → 7.8.0-beta.2
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/commands/__tests__/project.test.js +2 -0
- package/commands/account/auth.js +1 -0
- package/commands/auth.js +1 -0
- package/commands/feedback.js +1 -1
- package/commands/project/__tests__/add.test.js +12 -12
- package/commands/project/__tests__/list.test.js +31 -0
- package/commands/project/__tests__/migrate.test.js +1 -0
- package/commands/project/add.d.ts +2 -2
- package/commands/project/add.js +3 -2
- package/commands/project/create.js +1 -1
- package/commands/project/dev/deprecatedFlow.js +2 -2
- package/commands/project/dev/index.js +5 -5
- package/commands/project/dev/unifiedFlow.js +6 -3
- package/commands/project/download.js +5 -2
- package/commands/project/installDeps.d.ts +2 -2
- package/commands/project/installDeps.js +1 -0
- package/commands/project/list.d.ts +4 -0
- package/commands/project/list.js +62 -0
- package/commands/project/migrate.js +5 -2
- package/commands/project.js +2 -0
- package/commands/sandbox/delete.js +5 -2
- package/commands/testAccount/create.js +2 -2
- package/commands/theme/preview.js +1 -4
- package/lang/en.d.ts +49 -14
- package/lang/en.js +121 -86
- package/lang/en.lyaml +2 -2
- package/lib/__tests__/buildAccount.test.js +2 -2
- package/lib/app/migrate.js +1 -1
- package/lib/buildAccount.d.ts +2 -2
- package/lib/buildAccount.js +7 -7
- package/lib/configMigrate.js +88 -9
- package/lib/constants.d.ts +8 -1
- package/lib/constants.js +8 -1
- package/lib/doctor/Doctor.js +2 -2
- package/lib/errorHandlers/suppressError.js +2 -2
- package/lib/middleware/commandTargetingUtils.d.ts +1 -1
- package/lib/middleware/commandTargetingUtils.js +16 -20
- package/lib/projects/__tests__/AppDevModeInterface.test.js +85 -90
- package/lib/projects/__tests__/LocalDevProcess.test.js +6 -5
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +6 -6
- package/lib/projects/__tests__/deploy.test.js +9 -9
- package/lib/projects/__tests__/upload.test.js +2 -2
- package/lib/projects/add/__tests__/{v3AddComponent.test.js → v2AddComponent.test.js} +35 -35
- package/lib/projects/add/{v3AddComponent.d.ts → v2AddComponent.d.ts} +1 -1
- package/lib/projects/add/{v3AddComponent.js → v2AddComponent.js} +5 -5
- package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
- package/lib/projects/create/__tests__/{v3.test.js → v2.test.js} +2 -2
- package/lib/projects/create/index.js +2 -2
- package/lib/projects/create/{v3.d.ts → v2.d.ts} +3 -3
- package/lib/projects/create/{v3.js → v2.js} +3 -3
- package/lib/projects/deploy.d.ts +1 -1
- package/lib/projects/deploy.js +2 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +8 -1
- package/lib/projects/localDev/AppDevModeInterface.js +106 -86
- package/lib/projects/localDev/DevServerManager.d.ts +11 -29
- package/lib/projects/localDev/DevServerManager.js +19 -61
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +40 -0
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +120 -0
- package/lib/projects/localDev/{LocalDevManager.js → LocalDevManager_DEPRECATED.js} +6 -6
- package/lib/projects/localDev/LocalDevProcess.js +3 -2
- package/lib/projects/localDev/LocalDevState.d.ts +3 -0
- package/lib/projects/localDev/LocalDevState.js +9 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +4 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +34 -2
- package/lib/projects/localDev/helpers/account.d.ts +1 -1
- package/lib/projects/localDev/helpers/account.js +2 -2
- package/lib/projects/localDev/helpers/project.js +2 -3
- package/lib/projects/localDev/localDevWebsocketServerUtils.d.ts +3 -0
- package/lib/projects/localDev/localDevWebsocketServerUtils.js +9 -0
- package/lib/projects/urls.d.ts +0 -1
- package/lib/projects/urls.js +0 -3
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +1 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.js +10 -10
- package/lib/prompts/installAppPrompt.d.ts +1 -6
- package/lib/prompts/installAppPrompt.js +1 -6
- package/lib/prompts/projectAddPrompt.d.ts +2 -2
- package/lib/prompts/projectAddPrompt.js +1 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +1 -1
- package/lib/theme/__tests__/migrate.test.js +4 -4
- package/lib/ui/index.d.ts +4 -0
- package/lib/ui/index.js +9 -1
- package/lib/ui/uiMessages.d.ts +4 -0
- package/lib/ui/uiMessages.js +4 -0
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +1 -1
- package/package.json +7 -6
- package/lib/projects/localDev/DevServerManagerV2.d.ts +0 -22
- package/lib/projects/localDev/DevServerManagerV2.js +0 -81
- /package/{lib/projects/add/__tests__/v3AddComponent.test.d.ts → commands/project/__tests__/list.test.d.ts} +0 -0
- /package/lib/projects/{create/__tests__/v3.test.d.ts → add/__tests__/v2AddComponent.test.d.ts} +0 -0
- /package/lib/projects/localDev/{LocalDevManager.d.ts → LocalDevManager_DEPRECATED.d.ts} +0 -0
package/lib/ui/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export declare function uiLink(linkText: string, url: string): string;
|
|
|
13
13
|
export declare function uiAccountDescription(accountId?: number | null, bold?: boolean): string;
|
|
14
14
|
export declare function uiInfoSection(title: string, logContent: () => void): void;
|
|
15
15
|
export declare function uiCommandReference(command: string, withQuotes?: boolean): string;
|
|
16
|
+
export declare function uiAuthCommandReference({ accountId, qa, }?: {
|
|
17
|
+
accountId?: number | string;
|
|
18
|
+
qa?: boolean;
|
|
19
|
+
}): string;
|
|
16
20
|
export declare function uiFeatureHighlight(features: string[], title?: string): void;
|
|
17
21
|
export declare function uiBetaTag(message: string, log?: true): undefined;
|
|
18
22
|
export declare function uiBetaTag(message: string, log: false): string;
|
package/lib/ui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { getAccountConfig } from '@hubspot/local-dev-lib/config';
|
|
2
|
+
import { getAccountConfig, configFileExists, } from '@hubspot/local-dev-lib/config';
|
|
3
3
|
import { uiLogger } from './logger.js';
|
|
4
4
|
import { supportsHyperlinkModule } from './supportHyperlinks.js';
|
|
5
5
|
import { supportsColor } from './supportsColor.js';
|
|
@@ -63,6 +63,14 @@ export function uiCommandReference(command, withQuotes = true) {
|
|
|
63
63
|
? chalk.hex(UI_COLORS.MARIGOLD_DARK)(commandReference)
|
|
64
64
|
: commandReference);
|
|
65
65
|
}
|
|
66
|
+
export function uiAuthCommandReference({ accountId, qa, } = {}) {
|
|
67
|
+
const userIsUsingGlobalConfig = configFileExists(true);
|
|
68
|
+
let command = 'hs auth';
|
|
69
|
+
if (userIsUsingGlobalConfig) {
|
|
70
|
+
command = 'hs account auth';
|
|
71
|
+
}
|
|
72
|
+
return uiCommandReference(`${command}${accountId ? ` --account=${accountId}` : ''}${qa ? ' --qa' : ''}`);
|
|
73
|
+
}
|
|
66
74
|
export function uiFeatureHighlight(features, title) {
|
|
67
75
|
uiInfoSection(title ? title : uiMessages.featureHighlight.defaultTitle, () => {
|
|
68
76
|
features.forEach(feature => {
|
package/lib/ui/uiMessages.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export declare const uiMessages: {
|
|
|
27
27
|
command: string;
|
|
28
28
|
message: (command: string) => string;
|
|
29
29
|
};
|
|
30
|
+
getStartedCommand: {
|
|
31
|
+
command: string;
|
|
32
|
+
message: (command: string) => string;
|
|
33
|
+
};
|
|
30
34
|
helpCommand: {
|
|
31
35
|
command: string;
|
|
32
36
|
message: (command: string) => string;
|
package/lib/ui/uiMessages.js
CHANGED
|
@@ -30,6 +30,10 @@ export const uiMessages = {
|
|
|
30
30
|
command: 'hs feedback',
|
|
31
31
|
message: (command) => `${command} - Report a bug or leave feedback`,
|
|
32
32
|
},
|
|
33
|
+
getStartedCommand: {
|
|
34
|
+
command: 'hs get-started',
|
|
35
|
+
message: (command) => `${command} - Get started with HubSpot development`,
|
|
36
|
+
},
|
|
33
37
|
helpCommand: {
|
|
34
38
|
command: 'hs help',
|
|
35
39
|
message: (command) => `${command} - See a list of available commands`,
|
|
@@ -6,7 +6,7 @@ vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
|
6
6
|
vi.mock('../../../utils/project');
|
|
7
7
|
vi.mock('../../../utils/command');
|
|
8
8
|
vi.mock('../../../../lib/constants');
|
|
9
|
-
vi.mock('../../../../lib/projects/create/
|
|
9
|
+
vi.mock('../../../../lib/projects/create/v2');
|
|
10
10
|
vi.mock('../../../utils/toolUsageTracking');
|
|
11
11
|
const mockRunCommandInDir = runCommandInDir;
|
|
12
12
|
const mockAddFlag = addFlag;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.8.0-beta.
|
|
3
|
+
"version": "7.8.0-beta.2",
|
|
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
|
"type": "module",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@hubspot/local-dev-lib": "3.20.
|
|
10
|
-
"@hubspot/project-parsing-lib": "0.
|
|
9
|
+
"@hubspot/local-dev-lib": "3.20.2",
|
|
10
|
+
"@hubspot/project-parsing-lib": "0.10.1",
|
|
11
11
|
"@hubspot/serverless-dev-runtime": "7.0.6",
|
|
12
12
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
13
13
|
"@hubspot/ui-extensions-dev-server": "0.10.1",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"react": "^18.0.0",
|
|
30
30
|
"strip-ansi": "7.1.0",
|
|
31
31
|
"table": "6.9.0",
|
|
32
|
-
"tmp": "0.2.
|
|
32
|
+
"tmp": "0.2.4",
|
|
33
33
|
"update-notifier": "7.3.1",
|
|
34
34
|
"ws": "^8.18.2",
|
|
35
35
|
"yargs": "17.7.2",
|
|
36
36
|
"yargs-parser": "21.1.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@hubspot/npm-scripts": "0.0.4",
|
|
39
40
|
"@types/archiver": "^6.0.3",
|
|
40
41
|
"@types/cli-progress": "^3.11.6",
|
|
41
42
|
"@types/express": "^5.0.0",
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"@types/yargs": "^17.0.33",
|
|
53
54
|
"@typescript-eslint/eslint-plugin": "^8.30.1",
|
|
54
55
|
"@typescript-eslint/parser": "^8.11.0",
|
|
55
|
-
"axios": "^1.
|
|
56
|
+
"axios": "^1.12.2",
|
|
56
57
|
"eslint": "^8.56.0",
|
|
57
58
|
"eslint-plugin-import": "^2.31.0",
|
|
58
59
|
"husky": "^4.3.8",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"lint": "echo 'Linting is disabled for Blazar'",
|
|
81
82
|
"lint:local": "eslint . && prettier --list-different './**/*.{ts,tsx,js,json}'",
|
|
82
83
|
"list-all-commands": "yarn tsx ./scripts/get-all-commands.ts",
|
|
83
|
-
"local-link": "
|
|
84
|
+
"local-link": "hubspot-linking",
|
|
84
85
|
"mcp-local": "yarn tsx ./scripts/mcp-local.ts",
|
|
85
86
|
"prettier:write": "prettier --write './**/*.{ts,js,json}'",
|
|
86
87
|
"release": "yarn tsx ./scripts/release.ts release",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import LocalDevState from './LocalDevState.js';
|
|
2
|
-
import LocalDevLogger from './LocalDevLogger.js';
|
|
3
|
-
type DevServerManagerV2ConstructorOptions = {
|
|
4
|
-
localDevState: LocalDevState;
|
|
5
|
-
logger: LocalDevLogger;
|
|
6
|
-
};
|
|
7
|
-
declare class DevServerManagerV2 {
|
|
8
|
-
private initialized;
|
|
9
|
-
private started;
|
|
10
|
-
private devServers;
|
|
11
|
-
private localDevState;
|
|
12
|
-
constructor(options: DevServerManagerV2ConstructorOptions);
|
|
13
|
-
private iterateDevServers;
|
|
14
|
-
setup(): Promise<void>;
|
|
15
|
-
start(): Promise<void>;
|
|
16
|
-
fileChange({ filePath, event, }: {
|
|
17
|
-
filePath: string;
|
|
18
|
-
event: string;
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
cleanup(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
export default DevServerManagerV2;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { logger } from '@hubspot/local-dev-lib/logger';
|
|
2
|
-
import { startPortManagerServer, stopPortManagerServer, } from '@hubspot/local-dev-lib/portManager';
|
|
3
|
-
import { getHubSpotApiOrigin, getHubSpotWebsiteOrigin, } from '@hubspot/local-dev-lib/urls';
|
|
4
|
-
import { getAccountConfig } from '@hubspot/local-dev-lib/config';
|
|
5
|
-
import AppDevModeInterface from './AppDevModeInterface.js';
|
|
6
|
-
import { lib } from '../../../lang/en.js';
|
|
7
|
-
class DevServerManagerV2 {
|
|
8
|
-
initialized;
|
|
9
|
-
started;
|
|
10
|
-
devServers;
|
|
11
|
-
localDevState;
|
|
12
|
-
constructor(options) {
|
|
13
|
-
this.initialized = false;
|
|
14
|
-
this.started = false;
|
|
15
|
-
this.localDevState = options.localDevState;
|
|
16
|
-
const AppsDevServer = new AppDevModeInterface({
|
|
17
|
-
localDevState: options.localDevState,
|
|
18
|
-
localDevLogger: options.logger,
|
|
19
|
-
});
|
|
20
|
-
this.devServers = [AppsDevServer];
|
|
21
|
-
}
|
|
22
|
-
async iterateDevServers(callback) {
|
|
23
|
-
await Promise.all(this.devServers.map(devServer => callback(devServer)));
|
|
24
|
-
}
|
|
25
|
-
async setup() {
|
|
26
|
-
let env;
|
|
27
|
-
const accountConfig = getAccountConfig(this.localDevState.targetTestingAccountId);
|
|
28
|
-
if (accountConfig) {
|
|
29
|
-
env = accountConfig.env;
|
|
30
|
-
}
|
|
31
|
-
await startPortManagerServer();
|
|
32
|
-
await this.iterateDevServers(async (serverInterface) => {
|
|
33
|
-
if (serverInterface.setup) {
|
|
34
|
-
// @TODO: In the future, update UIE Dev Server to use LocalDevState
|
|
35
|
-
await serverInterface.setup({
|
|
36
|
-
components: this.localDevState.projectNodes,
|
|
37
|
-
profileData: this.localDevState.projectProfileData,
|
|
38
|
-
logger,
|
|
39
|
-
urls: {
|
|
40
|
-
api: getHubSpotApiOrigin(env),
|
|
41
|
-
web: getHubSpotWebsiteOrigin(env),
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
this.initialized = true;
|
|
47
|
-
}
|
|
48
|
-
async start() {
|
|
49
|
-
if (this.initialized) {
|
|
50
|
-
await this.iterateDevServers(async (serverInterface) => {
|
|
51
|
-
if (serverInterface.start) {
|
|
52
|
-
await serverInterface.start();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new Error(lib.DevServerManager.notInitialized);
|
|
58
|
-
}
|
|
59
|
-
this.started = true;
|
|
60
|
-
}
|
|
61
|
-
async fileChange({ filePath, event, }) {
|
|
62
|
-
if (this.started) {
|
|
63
|
-
this.iterateDevServers(async (serverInterface) => {
|
|
64
|
-
if (serverInterface.fileChange) {
|
|
65
|
-
await serverInterface.fileChange(filePath, event);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async cleanup() {
|
|
71
|
-
if (this.started) {
|
|
72
|
-
await this.iterateDevServers(async (serverInterface) => {
|
|
73
|
-
if (serverInterface.cleanup) {
|
|
74
|
-
await serverInterface.cleanup();
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
await stopPortManagerServer();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export default DevServerManagerV2;
|
|
File without changes
|
/package/lib/projects/{create/__tests__/v3.test.d.ts → add/__tests__/v2AddComponent.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|