@hubspot/cli 8.18.0 → 8.19.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/commands/account/auth.js +2 -2
- package/commands/account/createOverride.js +2 -0
- package/commands/account/removeOverride.js +2 -0
- package/commands/app/secret/add.js +1 -1
- package/commands/app/secret/delete.js +1 -1
- package/commands/app/secret/list.js +1 -1
- package/commands/app/secret/update.js +1 -1
- package/commands/app/secret.js +1 -1
- package/commands/auth.js +3 -2
- package/commands/cms/function/create.js +5 -37
- package/commands/cms/function/deploy.js +8 -1
- package/commands/cms/function/list.js +4 -0
- package/commands/cms/function/logs.js +2 -0
- package/commands/cms/function/server.js +6 -0
- package/commands/cms/upload.js +6 -0
- package/commands/cms/watch.js +2 -0
- package/commands/cms/webpack/create.js +5 -32
- package/commands/customObject.js +2 -2
- package/commands/getStarted.js +4 -4
- package/commands/hubdb/list.js +2 -2
- package/commands/init.js +3 -2
- package/commands/mcp/setup.js +3 -2
- package/commands/project/dev/index.js +2 -2
- package/commands/project/logs.js +2 -2
- package/commands/project/upload.js +6 -2
- package/commands/project/watch.js +2 -2
- package/commands/sandbox/create.js +3 -3
- package/commands/sandbox/delete.js +1 -1
- package/commands/sandbox.js +1 -1
- package/lang/en.d.ts +26 -0
- package/lang/en.js +85 -43
- package/lib/accountAuth.js +12 -0
- package/lib/app/logSystemTypes.d.ts +4 -0
- package/lib/app/logSystemTypes.js +17 -0
- package/lib/app/logs.d.ts +2 -4
- package/lib/app/logs.js +2 -17
- package/lib/app/migrate.js +3 -3
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +4 -0
- package/lib/crossPlatformSpawn/escape.d.ts +2 -0
- package/lib/crossPlatformSpawn/escape.js +38 -0
- package/lib/crossPlatformSpawn/index.d.ts +7 -0
- package/lib/crossPlatformSpawn/index.js +43 -0
- package/lib/crossPlatformSpawn/resolveCommand.d.ts +1 -0
- package/lib/crossPlatformSpawn/resolveCommand.js +69 -0
- package/lib/errorHandlers/suppressError.js +3 -3
- package/lib/hints/hints.d.ts +9 -0
- package/lib/hints/hints.js +30 -0
- package/lib/hints/throttle.d.ts +4 -0
- package/lib/hints/throttle.js +9 -0
- package/lib/jsonOutput/projectUpload.d.ts +1 -0
- package/lib/jsonOutput/projectUpload.js +1 -0
- package/lib/mcp/promotion.js +15 -30
- package/lib/mcp/setup.d.ts +6 -1
- package/lib/mcp/setup.js +1 -1
- package/lib/middleware/deprecationWarningMiddleware.js +4 -9
- package/lib/projects/localDev/AppDevModeInterface.js +3 -3
- package/lib/projects/localDev/LocalDevLogger.js +5 -5
- package/lib/projects/localDev/helpers/project.js +3 -3
- package/lib/projects/pollProjectBuildAndDeploy.js +4 -4
- package/lib/projects/projectInfo.js +4 -4
- package/lib/projects/projectProfiles.js +3 -3
- package/lib/projects/ui.js +3 -3
- package/lib/projects/upload.d.ts +3 -1
- package/lib/projects/upload.js +23 -6
- package/lib/projects/watch.js +4 -2
- package/lib/projects/workspaces.js +4 -4
- package/lib/prompts/personalAccessKeyPrompt.js +2 -2
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +3 -3
- package/lib/serverlessSunset.d.ts +6 -0
- package/lib/serverlessSunset.js +32 -0
- package/lib/ui/appLogs.js +4 -4
- package/lib/ui/formatting.d.ts +13 -0
- package/lib/ui/formatting.js +39 -0
- package/lib/ui/git.js +3 -3
- package/lib/ui/index.d.ts +9 -23
- package/lib/ui/index.js +36 -69
- package/lib/ui/logger.d.ts +1 -0
- package/lib/ui/logger.js +2 -1
- package/lib/ui/uiMessages.js +1 -1
- package/mcp-server/server.js +13 -5
- package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -2
- package/mcp-server/tools/cms/HsListFunctionsTool.js +1 -1
- package/mcp-server/tools/cms/HsListTool.js +4 -1
- package/mcp-server/tools/index.js +0 -2
- package/mcp-server/utils/command.js +16 -5
- package/package.json +9 -9
- package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +0 -26
- package/mcp-server/tools/cms/HsCreateFunctionTool.js +0 -100
package/commands/account/auth.js
CHANGED
|
@@ -4,7 +4,7 @@ import { deleteConfigFileIfEmpty } from '@hubspot/local-dev-lib/config';
|
|
|
4
4
|
import { handleExit } from '../../lib/process.js';
|
|
5
5
|
import { trackAuthAction } from '../../lib/usageTracking.js';
|
|
6
6
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
7
|
-
import {
|
|
7
|
+
import { logUiFeatureHighlight } from '../../lib/ui/index.js';
|
|
8
8
|
import { parseStringToNumber } from '../../lib/parsing.js';
|
|
9
9
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
10
10
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
@@ -58,7 +58,7 @@ async function handler(args) {
|
|
|
58
58
|
authType: accountAuthType,
|
|
59
59
|
});
|
|
60
60
|
if (!formatOutputAsJson) {
|
|
61
|
-
|
|
61
|
+
logUiFeatureHighlight([
|
|
62
62
|
'getStartedCommand',
|
|
63
63
|
'helpCommand',
|
|
64
64
|
'accountAuthCommand',
|
|
@@ -12,12 +12,14 @@ import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler
|
|
|
12
12
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
13
13
|
import { commands } from '../../lang/en.js';
|
|
14
14
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
15
|
+
import { uiDeprecatedTag } from '../../lib/ui/index.js';
|
|
15
16
|
import { warnIfLinkedDirectory } from '../../lib/link/warnIfLinkedDirectory.js';
|
|
16
17
|
const command = 'create-override [account]';
|
|
17
18
|
const describe = commands.account.subcommands.createOverride.describe(DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME);
|
|
18
19
|
async function handler(args) {
|
|
19
20
|
const { exit } = args;
|
|
20
21
|
let overrideDefaultAccount = args.account;
|
|
22
|
+
uiLogger.log(uiDeprecatedTag(commands.account.subcommands.createOverride.logs.deprecated));
|
|
21
23
|
// TODO: Block this command when linked directory exists (next breaking change)
|
|
22
24
|
warnIfLinkedDirectory(args._);
|
|
23
25
|
const globalConfigExists = globalConfigFileExists();
|
|
@@ -8,12 +8,14 @@ import { logError } from '../../lib/errorHandlers/index.js';
|
|
|
8
8
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
9
9
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
10
10
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
11
|
+
import { uiDeprecatedTag } from '../../lib/ui/index.js';
|
|
11
12
|
import { commands } from '../../lang/en.js';
|
|
12
13
|
import { warnIfLinkedDirectory } from '../../lib/link/warnIfLinkedDirectory.js';
|
|
13
14
|
const command = 'remove-override';
|
|
14
15
|
const describe = commands.account.subcommands.removeOverride.describe(DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME);
|
|
15
16
|
async function handler(args) {
|
|
16
17
|
const { force, exit } = args;
|
|
18
|
+
uiLogger.log(uiDeprecatedTag(commands.account.subcommands.removeOverride.logs.deprecated));
|
|
17
19
|
// TODO: Block this command when linked directory exists (next breaking change)
|
|
18
20
|
warnIfLinkedDirectory(args._);
|
|
19
21
|
const globalConfigExists = globalConfigFileExists();
|
|
@@ -9,7 +9,7 @@ import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
|
9
9
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
10
10
|
import { uiBetaTag } from '../../../lib/ui/index.js';
|
|
11
11
|
const command = 'add [name]';
|
|
12
|
-
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.add.describe
|
|
12
|
+
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.add.describe);
|
|
13
13
|
async function handler(args) {
|
|
14
14
|
const { derivedAccountId, exit } = args;
|
|
15
15
|
try {
|
|
@@ -9,7 +9,7 @@ import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
|
9
9
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
10
10
|
import { uiBetaTag } from '../../../lib/ui/index.js';
|
|
11
11
|
const command = 'delete [name]';
|
|
12
|
-
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.delete.describe
|
|
12
|
+
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.delete.describe);
|
|
13
13
|
async function handler(args) {
|
|
14
14
|
const { derivedAccountId, force, exit } = args;
|
|
15
15
|
const appSecretApp = await selectAppPrompt(derivedAccountId, args.app);
|
|
@@ -8,7 +8,7 @@ import { selectAppPrompt } from '../../../lib/prompts/selectAppPrompt.js';
|
|
|
8
8
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
9
9
|
import { uiBetaTag } from '../../../lib/ui/index.js';
|
|
10
10
|
const command = 'list';
|
|
11
|
-
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.list.describe
|
|
11
|
+
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.list.describe);
|
|
12
12
|
async function handler(args) {
|
|
13
13
|
const { derivedAccountId, exit } = args;
|
|
14
14
|
const appSecretApp = await selectAppPrompt(derivedAccountId, args.app);
|
|
@@ -10,7 +10,7 @@ import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
|
10
10
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
11
11
|
import { uiBetaTag } from '../../../lib/ui/index.js';
|
|
12
12
|
const command = 'update [name]';
|
|
13
|
-
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.update.describe
|
|
13
|
+
const describe = uiBetaTag(commands.app.subcommands.secret.subcommands.update.describe);
|
|
14
14
|
async function handler(args) {
|
|
15
15
|
const { derivedAccountId, exit } = args;
|
|
16
16
|
const appSecretApp = await selectAppPrompt(derivedAccountId, args.app);
|
package/commands/app/secret.js
CHANGED
|
@@ -6,7 +6,7 @@ import listAppSecretsCommand from './secret/list.js';
|
|
|
6
6
|
import updateAppSecretCommand from './secret/update.js';
|
|
7
7
|
import { uiBetaTag } from '../../lib/ui/index.js';
|
|
8
8
|
const command = ['secret', 'secrets'];
|
|
9
|
-
const describe = uiBetaTag(commands.app.subcommands.secret.describe
|
|
9
|
+
const describe = uiBetaTag(commands.app.subcommands.secret.describe);
|
|
10
10
|
function appSecretBuilder(yargs) {
|
|
11
11
|
yargs
|
|
12
12
|
.command(addAppSecretCommand)
|
package/commands/auth.js
CHANGED
|
@@ -14,7 +14,7 @@ import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
|
14
14
|
import { trackAuthAction } from '../lib/usageTracking.js';
|
|
15
15
|
import { authenticateWithOauth } from '../lib/oauth.js';
|
|
16
16
|
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
17
|
-
import {
|
|
17
|
+
import { uiDeprecatedTag, logUiFeatureHighlight } from '../lib/ui/index.js';
|
|
18
18
|
import { logError } from '../lib/errorHandlers/index.js';
|
|
19
19
|
import { isPromptExitError } from '../lib/errors/PromptExitError.js';
|
|
20
20
|
import { makeWrappedYargsHandler } from '../lib/yargs/makeWrappedYargsHandler.js';
|
|
@@ -57,6 +57,7 @@ async function handler(args) {
|
|
|
57
57
|
uiLogger.error(commands.auth.errors.globalConfigFileExists('hs account auth'));
|
|
58
58
|
return exit(EXIT_CODES.ERROR);
|
|
59
59
|
}
|
|
60
|
+
uiLogger.log(uiDeprecatedTag(commands.auth.logs.deprecated));
|
|
60
61
|
if (!disableTracking) {
|
|
61
62
|
trackAuthAction('auth', authType, TRACKING_STATUS.STARTED, parsedUserProvidedAccountId);
|
|
62
63
|
}
|
|
@@ -134,7 +135,7 @@ async function handler(args) {
|
|
|
134
135
|
const accountName = (updatedConfig && updatedConfig.name) || validName || nameFromConfigData;
|
|
135
136
|
await setAsDefaultAccountPrompt(accountName);
|
|
136
137
|
uiLogger.success(commands.auth.success.configFileUpdated(accountName, DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, successAuthMethod));
|
|
137
|
-
|
|
138
|
+
logUiFeatureHighlight([
|
|
138
139
|
'getStartedCommand',
|
|
139
140
|
'accountsUseCommand',
|
|
140
141
|
'accountOption',
|
|
@@ -1,48 +1,16 @@
|
|
|
1
|
-
import fs from 'fs-extra';
|
|
2
|
-
import { logError } from '../../../lib/errorHandlers/index.js';
|
|
3
|
-
import { resolveLocalPath } from '../../../lib/filesystem.js';
|
|
4
1
|
import { commands } from '../../../lang/en.js';
|
|
5
|
-
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
6
2
|
import { HTTP_METHODS } from '../../../types/Cms.js';
|
|
7
3
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
8
4
|
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
9
5
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
10
|
-
import {
|
|
11
|
-
import assets from '../../../lib/cmsAssets/index.js';
|
|
6
|
+
import { logServerlessCreationBlocked } from '../../../lib/serverlessSunset.js';
|
|
12
7
|
const command = 'create [name] [dest]';
|
|
13
8
|
const describe = commands.cms.subcommands.function.subcommands.create.describe;
|
|
14
9
|
async function handler(args) {
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const argsToPass = {
|
|
20
|
-
commandArgs: args,
|
|
21
|
-
assetType,
|
|
22
|
-
name,
|
|
23
|
-
dest,
|
|
24
|
-
};
|
|
25
|
-
if (!argsToPass.dest) {
|
|
26
|
-
argsToPass.dest = resolveLocalPath(asset.dest(argsToPass));
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
await fs.ensureDir(argsToPass.dest);
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
uiLogger.error(commands.cms.subcommands.function.subcommands.create.errors.unusablePath(argsToPass.dest));
|
|
33
|
-
logError(e);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
await asset.execute(argsToPass);
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
if (isPromptExitError(e)) {
|
|
41
|
-
throw e;
|
|
42
|
-
}
|
|
43
|
-
logError(e);
|
|
44
|
-
return exit(EXIT_CODES.ERROR);
|
|
45
|
-
}
|
|
10
|
+
const { exit, addUsageMetadata } = args;
|
|
11
|
+
addUsageMetadata({ assetType: 'function' });
|
|
12
|
+
logServerlessCreationBlocked('hs cms function create');
|
|
13
|
+
return exit(EXIT_CODES.ERROR);
|
|
46
14
|
}
|
|
47
15
|
function functionCreateBuilder(yargs) {
|
|
48
16
|
yargs.positional('name', {
|
|
@@ -9,13 +9,20 @@ import { outputBuildLog } from '../../../lib/serverlessLogs.js';
|
|
|
9
9
|
import { commands } from '../../../lang/en.js';
|
|
10
10
|
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
12
|
+
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
13
|
+
import { isServerlessEditingDisabled, logServerlessDeprecation, logServerlessEditingDisabled, } from '../../../lib/serverlessSunset.js';
|
|
12
14
|
function isFunctionBuildError(e) {
|
|
13
15
|
return (typeof e === 'object' && e !== null && 'status' in e && e.status === 'ERROR');
|
|
14
16
|
}
|
|
15
17
|
const command = 'deploy <path>';
|
|
16
18
|
const describe = undefined; // Hidden command
|
|
17
19
|
async function handler(args) {
|
|
18
|
-
const { path: functionPath, derivedAccountId } = args;
|
|
20
|
+
const { path: functionPath, derivedAccountId, exit } = args;
|
|
21
|
+
if (isServerlessEditingDisabled()) {
|
|
22
|
+
logServerlessEditingDisabled('hs cms function deploy');
|
|
23
|
+
return exit(EXIT_CODES.ERROR);
|
|
24
|
+
}
|
|
25
|
+
logServerlessDeprecation('hs cms function deploy');
|
|
19
26
|
const splitFunctionPath = functionPath.split('.');
|
|
20
27
|
if (!splitFunctionPath.length ||
|
|
21
28
|
splitFunctionPath[splitFunctionPath.length - 1] !== 'functions') {
|
|
@@ -7,10 +7,14 @@ import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
|
7
7
|
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
8
8
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
9
9
|
import { renderTable } from '../../../ui/render.js';
|
|
10
|
+
import { logServerlessDeprecation } from '../../../lib/serverlessSunset.js';
|
|
10
11
|
const command = ['list', 'ls'];
|
|
11
12
|
const describe = commands.cms.subcommands.function.subcommands.list.describe;
|
|
12
13
|
async function handler(args) {
|
|
13
14
|
const { derivedAccountId, exit } = args;
|
|
15
|
+
if (!args.json) {
|
|
16
|
+
logServerlessDeprecation('hs cms function list');
|
|
17
|
+
}
|
|
14
18
|
uiLogger.debug(commands.cms.subcommands.function.subcommands.list.debug.gettingFunctions);
|
|
15
19
|
let routesResp;
|
|
16
20
|
try {
|
|
@@ -8,6 +8,7 @@ import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHand
|
|
|
8
8
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
9
9
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
10
10
|
import { commands } from '../../../lang/en.js';
|
|
11
|
+
import { logServerlessDeprecation } from '../../../lib/serverlessSunset.js';
|
|
11
12
|
const handleLogsError = (e, accountId, functionPath) => {
|
|
12
13
|
if (isHubSpotHttpError(e) && (e.status === 404 || e.status == 400)) {
|
|
13
14
|
uiLogger.error(commands.cms.subcommands.function.subcommands.logs.errors.noLogsFound(functionPath, accountId));
|
|
@@ -54,6 +55,7 @@ const describe = commands.cms.subcommands.function.subcommands.logs.describe;
|
|
|
54
55
|
const handler = async (options) => {
|
|
55
56
|
const { endpoint: endpointArgValue, latest, derivedAccountId, exit, addUsageMetadata, } = options;
|
|
56
57
|
addUsageMetadata(latest ? { action: 'latest' } : {});
|
|
58
|
+
logServerlessDeprecation('hs cms function logs');
|
|
57
59
|
const { endpointPromptValue } = await promptUser({
|
|
58
60
|
name: 'endpointPromptValue',
|
|
59
61
|
message: commands.cms.subcommands.function.subcommands.logs.endpointPrompt,
|
|
@@ -5,10 +5,16 @@ import { startServerlessDevRuntime } from '../../../lib/cms/serverlessDevRuntime
|
|
|
5
5
|
import { logError } from '../../../lib/errorHandlers/index.js';
|
|
6
6
|
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
7
7
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
8
|
+
import { isServerlessEditingDisabled, logServerlessDeprecation, logServerlessEditingDisabled, } from '../../../lib/serverlessSunset.js';
|
|
8
9
|
const command = 'server <path>';
|
|
9
10
|
const describe = undefined;
|
|
10
11
|
async function handler(args) {
|
|
11
12
|
const { path: functionPath, derivedAccountId, exit } = args;
|
|
13
|
+
if (isServerlessEditingDisabled()) {
|
|
14
|
+
logServerlessEditingDisabled('hs cms function server');
|
|
15
|
+
return exit(EXIT_CODES.ERROR);
|
|
16
|
+
}
|
|
17
|
+
logServerlessDeprecation('hs cms function server');
|
|
12
18
|
uiLogger.debug(commands.cms.subcommands.function.subcommands.server.debug.startingServer(functionPath));
|
|
13
19
|
try {
|
|
14
20
|
await startServerlessDevRuntime({
|
package/commands/cms/upload.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { uploadFolder, hasUploadErrors, } from '@hubspot/local-dev-lib/cms/uploadFolder';
|
|
4
|
+
import { FILE_UPLOAD_RESULT_TYPES } from '@hubspot/local-dev-lib/constants/files';
|
|
4
5
|
import { getFileMapperQueryValues } from '@hubspot/local-dev-lib/fileMapper';
|
|
5
6
|
import { upload, deleteFile } from '@hubspot/local-dev-lib/api/fileMapper';
|
|
6
7
|
import { getCwd, convertToUnixPath, isAllowedExtension, } from '@hubspot/local-dev-lib/path';
|
|
@@ -19,6 +20,7 @@ import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
|
19
20
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
20
21
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
21
22
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
23
|
+
import { logServerlessUploadBlockedHint } from '../../lib/serverlessSunset.js';
|
|
22
24
|
const command = 'upload [src] [dest]';
|
|
23
25
|
const describe = commands.cms.subcommands.upload.describe;
|
|
24
26
|
function logThemePreview(filePath, accountId) {
|
|
@@ -104,6 +106,7 @@ async function handler(args) {
|
|
|
104
106
|
request: normalizedDest,
|
|
105
107
|
payload: src,
|
|
106
108
|
}));
|
|
109
|
+
logServerlessUploadBlockedHint([src]);
|
|
107
110
|
return exit(EXIT_CODES.WARNING);
|
|
108
111
|
})
|
|
109
112
|
.finally(() => {
|
|
@@ -150,6 +153,9 @@ async function handler(args) {
|
|
|
150
153
|
}
|
|
151
154
|
else {
|
|
152
155
|
uiLogger.error(commands.cms.subcommands.upload.errors.someFilesFailed(dest));
|
|
156
|
+
logServerlessUploadBlockedHint(results
|
|
157
|
+
.filter(result => result.resultType === FILE_UPLOAD_RESULT_TYPES.FAILURE)
|
|
158
|
+
.map(result => result.file));
|
|
153
159
|
return exit(EXIT_CODES.WARNING);
|
|
154
160
|
}
|
|
155
161
|
})
|
package/commands/cms/watch.js
CHANGED
|
@@ -12,6 +12,7 @@ import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
|
12
12
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
13
13
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
14
14
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
15
|
+
import { logServerlessUploadBlockedHint } from '../../lib/serverlessSunset.js';
|
|
15
16
|
const command = 'watch [src] [dest]';
|
|
16
17
|
const describe = commands.cms.subcommands.watch.describe;
|
|
17
18
|
const handler = async (args) => {
|
|
@@ -57,6 +58,7 @@ const handler = async (args) => {
|
|
|
57
58
|
request: destPath,
|
|
58
59
|
payload: file,
|
|
59
60
|
}));
|
|
61
|
+
logServerlessUploadBlockedHint([file]);
|
|
60
62
|
};
|
|
61
63
|
watch(derivedAccountId, absoluteSrcPath, dest, {
|
|
62
64
|
cmsPublishMode,
|
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
import fs from 'fs-extra';
|
|
2
|
-
import { logError } from '../../../lib/errorHandlers/index.js';
|
|
3
|
-
import { resolveLocalPath } from '../../../lib/filesystem.js';
|
|
4
1
|
import { commands } from '../../../lang/en.js';
|
|
5
|
-
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
6
2
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
7
3
|
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
8
4
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
9
|
-
import
|
|
5
|
+
import { logServerlessCreationBlocked } from '../../../lib/serverlessSunset.js';
|
|
10
6
|
const command = 'create [dest]';
|
|
11
7
|
const describe = commands.cms.subcommands.webpack.subcommands.create.describe;
|
|
12
8
|
async function handler(args) {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const argsToPass = {
|
|
18
|
-
commandArgs: args,
|
|
19
|
-
assetType,
|
|
20
|
-
dest,
|
|
21
|
-
};
|
|
22
|
-
if (!argsToPass.dest) {
|
|
23
|
-
argsToPass.dest = resolveLocalPath(asset.dest(argsToPass));
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
await fs.ensureDir(argsToPass.dest);
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
uiLogger.error(commands.cms.subcommands.webpack.subcommands.create.errors.unusablePath(argsToPass.dest));
|
|
30
|
-
logError(e);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
await asset.execute(argsToPass);
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
logError(e);
|
|
38
|
-
return exit(EXIT_CODES.ERROR);
|
|
39
|
-
}
|
|
9
|
+
const { exit, addUsageMetadata } = args;
|
|
10
|
+
addUsageMetadata({ assetType: 'webpack-serverless' });
|
|
11
|
+
logServerlessCreationBlocked('hs cms webpack create');
|
|
12
|
+
return exit(EXIT_CODES.ERROR);
|
|
40
13
|
}
|
|
41
14
|
function webpackCreateBuilder(yargs) {
|
|
42
15
|
yargs.positional('dest', {
|
package/commands/customObject.js
CHANGED
|
@@ -10,9 +10,9 @@ import { uiBetaTag } from '../lib/ui/index.js';
|
|
|
10
10
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
11
11
|
import { uiLogger } from '../lib/ui/logger.js';
|
|
12
12
|
const command = ['custom-object', 'custom-objects', 'co'];
|
|
13
|
-
const describe = uiBetaTag(commands.customObject.describe
|
|
13
|
+
const describe = uiBetaTag(commands.customObject.describe);
|
|
14
14
|
function logBetaMessage() {
|
|
15
|
-
uiBetaTag(commands.customObject.betaMessage);
|
|
15
|
+
uiLogger.log(uiBetaTag(commands.customObject.betaMessage));
|
|
16
16
|
uiLogger.log(commands.customObject.seeMoreLink);
|
|
17
17
|
}
|
|
18
18
|
function customObjectBuilder(yargs) {
|
package/commands/getStarted.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getProjectConfig, writeProjectConfig, ProjectConfigValidationError, } f
|
|
|
11
11
|
import { handleProjectUpload } from '../lib/projects/upload.js';
|
|
12
12
|
import { projectNameAndDestPrompt } from '../lib/prompts/projectNameAndDestPrompt.js';
|
|
13
13
|
import { promptUser } from '../lib/prompts/promptUtils.js';
|
|
14
|
-
import { uiAccountDescription,
|
|
14
|
+
import { uiAccountDescription, logUiFeatureHighlight, logUiInfoSection, } from '../lib/ui/index.js';
|
|
15
15
|
import { uiLogger } from '../lib/ui/logger.js';
|
|
16
16
|
import { trackCommandMetadataUsage } from '../lib/usageTracking.js';
|
|
17
17
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
@@ -44,7 +44,7 @@ async function handler(args) {
|
|
|
44
44
|
return exit(EXIT_CODES.ERROR);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
logUiInfoSection(commands.getStarted.startTitle, () => {
|
|
48
48
|
uiLogger.log(commands.getStarted.startDescription);
|
|
49
49
|
uiLogger.log(commands.getStarted.guideOverview(accountName));
|
|
50
50
|
});
|
|
@@ -251,7 +251,7 @@ async function handler(args) {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
uiLogger.log(' ');
|
|
254
|
-
|
|
254
|
+
logUiFeatureHighlight(['projectDevCommand']);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
catch (err) {
|
|
@@ -268,7 +268,7 @@ async function handler(args) {
|
|
|
268
268
|
}
|
|
269
269
|
else {
|
|
270
270
|
uiLogger.log(' ');
|
|
271
|
-
|
|
271
|
+
logUiFeatureHighlight(['projectUploadCommand', 'projectDevCommand']);
|
|
272
272
|
return exit(EXIT_CODES.SUCCESS);
|
|
273
273
|
}
|
|
274
274
|
}
|
package/commands/hubdb/list.js
CHANGED
|
@@ -2,7 +2,7 @@ import { fetchTables } from '@hubspot/local-dev-lib/api/hubdb';
|
|
|
2
2
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
3
3
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
4
4
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
5
|
-
import {
|
|
5
|
+
import { logUiLine } from '../../lib/ui/index.js';
|
|
6
6
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
7
7
|
import { commands } from '../../lang/en.js';
|
|
8
8
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
@@ -51,7 +51,7 @@ async function handler(args) {
|
|
|
51
51
|
renderTable(tableHeader, tableUIData);
|
|
52
52
|
// if truncated is 0, it will be interpreted as falsy
|
|
53
53
|
const truncated = total - tables.length;
|
|
54
|
-
|
|
54
|
+
logUiLine();
|
|
55
55
|
uiLogger.log(commands.hubdb.subcommands.list.tablesDisplayed(tables.length, total, truncated));
|
|
56
56
|
}
|
|
57
57
|
else {
|
package/commands/init.js
CHANGED
|
@@ -19,7 +19,7 @@ import { OAUTH_FLOW, legacyPersonalAccessKeyPrompt as personalAccessKeyPrompt, }
|
|
|
19
19
|
import { cliAccountNamePrompt } from '../lib/prompts/accountNamePrompt.js';
|
|
20
20
|
import { authenticateWithOauth } from '../lib/oauth.js';
|
|
21
21
|
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
22
|
-
import { uiCommandReference,
|
|
22
|
+
import { uiCommandReference, uiDeprecatedTag, logUiFeatureHighlight, } from '../lib/ui/index.js';
|
|
23
23
|
import { makeWrappedYargsHandler } from '../lib/yargs/makeWrappedYargsHandler.js';
|
|
24
24
|
import { uiLogger } from '../lib/ui/logger.js';
|
|
25
25
|
import { commands } from '../lang/en.js';
|
|
@@ -103,6 +103,7 @@ async function handler(args) {
|
|
|
103
103
|
uiLogger.error(commands.init.errors.globalConfigFileExists);
|
|
104
104
|
return exit(EXIT_CODES.ERROR);
|
|
105
105
|
}
|
|
106
|
+
uiLogger.log(uiDeprecatedTag(commands.init.logs.deprecated));
|
|
106
107
|
// Check if the specific config file path already exists
|
|
107
108
|
if (existingConfigPath && existsSync(existingConfigPath)) {
|
|
108
109
|
uiLogger.error(commands.init.errors.configFileExists(existingConfigPath));
|
|
@@ -137,7 +138,7 @@ async function handler(args) {
|
|
|
137
138
|
uiLogger.log('');
|
|
138
139
|
uiLogger.success(commands.init.success.configFileCreated(configPath));
|
|
139
140
|
uiLogger.success(commands.init.success.configFileUpdated(AUTH_TYPE_NAMES[authType], name || accountId));
|
|
140
|
-
|
|
141
|
+
logUiFeatureHighlight([
|
|
141
142
|
'getStartedCommand',
|
|
142
143
|
'helpCommand',
|
|
143
144
|
'authCommand',
|
package/commands/mcp/setup.js
CHANGED
|
@@ -7,14 +7,15 @@ import { MCP_SKILL_NAMES } from '../../lib/mcp/skills.js';
|
|
|
7
7
|
const command = ['setup'];
|
|
8
8
|
const describe = commands.mcp.setup.describe;
|
|
9
9
|
async function handler(args) {
|
|
10
|
-
const { exit } = args;
|
|
10
|
+
const { exit, addUsageMetadata } = args;
|
|
11
11
|
try {
|
|
12
|
-
await configureMcpServer({
|
|
12
|
+
const { selectedSkills } = await configureMcpServer({
|
|
13
13
|
targets: args.client,
|
|
14
14
|
standalone: args.standalone,
|
|
15
15
|
cliVersion: args.cliVersion,
|
|
16
16
|
skills: args.skills,
|
|
17
17
|
});
|
|
18
|
+
addUsageMetadata({ assetType: selectedSkills.join(',') });
|
|
18
19
|
}
|
|
19
20
|
catch (e) {
|
|
20
21
|
return exit(EXIT_CODES.ERROR);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getConfigAccountIfExists } from '@hubspot/local-dev-lib/config';
|
|
2
2
|
import { getProjectConfig } from '../../../lib/projects/config.js';
|
|
3
3
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
4
|
-
import {
|
|
4
|
+
import { logUiLine } from '../../../lib/ui/index.js';
|
|
5
5
|
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
6
6
|
import { unifiedProjectDevFlow } from './unifiedFlow.js';
|
|
7
7
|
import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
@@ -53,7 +53,7 @@ async function handler(args) {
|
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
55
|
logError(error);
|
|
56
|
-
|
|
56
|
+
logUiLine();
|
|
57
57
|
return exit(EXIT_CODES.ERROR);
|
|
58
58
|
}
|
|
59
59
|
}
|
package/commands/project/logs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getHubSpotWebsiteOriginByAccountId } from '@hubspot/local-dev-lib/urls';
|
|
2
2
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { logUiLine } from '../../lib/ui/index.js';
|
|
4
4
|
import { projectLogsPrompt } from '../../lib/prompts/projectsLogsPrompt.js';
|
|
5
5
|
import { commands } from '../../lang/en.js';
|
|
6
6
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
@@ -44,7 +44,7 @@ function logPreamble() {
|
|
|
44
44
|
uiLogger.log(commands.project.logs.logs.hubspotLogsDirectLink(`${getPrivateAppsUrl(ProjectLogsManager.accountId)}/${ProjectLogsManager.appId}/logs/crm?serverlessFunction=${ProjectLogsManager.functionName}`));
|
|
45
45
|
}
|
|
46
46
|
uiLogger.log('');
|
|
47
|
-
|
|
47
|
+
logUiLine();
|
|
48
48
|
}
|
|
49
49
|
const command = 'logs';
|
|
50
50
|
const describe = commands.project.logs.describe;
|
|
@@ -39,7 +39,7 @@ async function handlePreview(accountId, projectId, buildId, targetPortalId) {
|
|
|
39
39
|
async function handler(args) {
|
|
40
40
|
const { force = false, forceCreate = false, message, derivedAccountId, skipValidation, skipNpmAudit, skipAutoDeploy, formatOutputAsJson, profile: profileOption, useEnv: useEnvOption, preview, target: targetPortalId, exit, addUsageMetadata, addJsonOutput, } = args;
|
|
41
41
|
if (forceCreate) {
|
|
42
|
-
uiDeprecatedTag(commands.project.upload.logs.forceCreateDeprecated);
|
|
42
|
+
uiLogger.log(uiDeprecatedTag(commands.project.upload.logs.forceCreateDeprecated));
|
|
43
43
|
}
|
|
44
44
|
let projectConfig;
|
|
45
45
|
let projectDir;
|
|
@@ -82,7 +82,7 @@ async function handler(args) {
|
|
|
82
82
|
uiLogger.log('');
|
|
83
83
|
}
|
|
84
84
|
try {
|
|
85
|
-
const { result, uploadError, projectId, userDeclined } = await handleProjectUpload({
|
|
85
|
+
const { result, uploadError, projectId, userDeclined, skippedHsMetaFiles } = await handleProjectUpload({
|
|
86
86
|
accountId: targetAccountId,
|
|
87
87
|
projectConfig,
|
|
88
88
|
projectDir,
|
|
@@ -98,10 +98,14 @@ async function handler(args) {
|
|
|
98
98
|
skipAutoDeploy,
|
|
99
99
|
profile: profileName,
|
|
100
100
|
force,
|
|
101
|
+
formatOutputAsJson,
|
|
101
102
|
});
|
|
102
103
|
if (userDeclined) {
|
|
103
104
|
return exit(EXIT_CODES.SUCCESS);
|
|
104
105
|
}
|
|
106
|
+
if (skippedHsMetaFiles) {
|
|
107
|
+
addJsonOutput({ skippedHsMetaFiles });
|
|
108
|
+
}
|
|
105
109
|
if (uploadError) {
|
|
106
110
|
if (isSpecifiedError(uploadError, {
|
|
107
111
|
subCategory: PROJECT_ERROR_TYPES.PROJECT_LOCKED,
|
|
@@ -14,7 +14,7 @@ import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
|
14
14
|
import { handleKeypress, handleExit } from '../../lib/process.js';
|
|
15
15
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
16
16
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
|
-
import {
|
|
17
|
+
import { logUiCommandRelocatedMessage, uiCommandRenamedDescription, } from '../../lib/ui/index.js';
|
|
18
18
|
const command = 'watch';
|
|
19
19
|
const describe = uiCommandRenamedDescription(commands.project.watch.describe, 'hs project dev');
|
|
20
20
|
async function handleBuildStatus(accountId, projectName, buildId) {
|
|
@@ -57,7 +57,7 @@ function handleUserInput(accountId, projectName, currentBuildId, exit) {
|
|
|
57
57
|
}
|
|
58
58
|
async function handler(args) {
|
|
59
59
|
const { initialUpload, derivedAccountId, exit } = args;
|
|
60
|
-
|
|
60
|
+
logUiCommandRelocatedMessage('hs project dev');
|
|
61
61
|
let projectConfig;
|
|
62
62
|
let projectDir;
|
|
63
63
|
try {
|
|
@@ -5,7 +5,7 @@ import { getHubSpotWebsiteOrigin } from '@hubspot/local-dev-lib/urls';
|
|
|
5
5
|
import { HUBSPOT_ACCOUNT_TYPES, HUBSPOT_ACCOUNT_TYPE_STRINGS, } from '@hubspot/local-dev-lib/constants/config';
|
|
6
6
|
import { commands, lib } from '../../lang/en.js';
|
|
7
7
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
8
|
-
import {
|
|
8
|
+
import { logUiFeatureHighlight, uiBetaTag } from '../../lib/ui/index.js';
|
|
9
9
|
import { SANDBOX_TYPE_MAP, validateSandboxUsageLimits, } from '../../lib/sandboxes.js';
|
|
10
10
|
import { sandboxTypePrompt } from '../../lib/prompts/sandboxesPrompt.js';
|
|
11
11
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
@@ -15,7 +15,7 @@ import { hubspotAccountNamePrompt } from '../../lib/prompts/accountNamePrompt.js
|
|
|
15
15
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
16
16
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
17
|
const command = 'create';
|
|
18
|
-
const describe = uiBetaTag(commands.sandbox.subcommands.create.describe
|
|
18
|
+
const describe = uiBetaTag(commands.sandbox.subcommands.create.describe);
|
|
19
19
|
async function handler(args) {
|
|
20
20
|
const { name, type, force, derivedAccountId, exit } = args;
|
|
21
21
|
const accountConfig = getConfigAccountById(derivedAccountId);
|
|
@@ -110,7 +110,7 @@ async function handler(args) {
|
|
|
110
110
|
else {
|
|
111
111
|
highlightItems.push('projectUploadCommand');
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
logUiFeatureHighlight(highlightItems);
|
|
114
114
|
return exit(EXIT_CODES.SUCCESS);
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
@@ -13,7 +13,7 @@ import { uiAuthCommandReference, uiBetaTag } from '../../lib/ui/index.js';
|
|
|
13
13
|
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
14
14
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
15
15
|
const command = 'delete';
|
|
16
|
-
const describe = uiBetaTag(commands.sandbox.subcommands.delete.describe
|
|
16
|
+
const describe = uiBetaTag(commands.sandbox.subcommands.delete.describe);
|
|
17
17
|
async function handler(args) {
|
|
18
18
|
const { userProvidedAccount, force, exit } = args;
|
|
19
19
|
let accountPrompt;
|
package/commands/sandbox.js
CHANGED
|
@@ -4,7 +4,7 @@ import create from './sandbox/create.js';
|
|
|
4
4
|
import del from './sandbox/delete.js';
|
|
5
5
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
6
6
|
const command = ['sandbox', 'sandboxes'];
|
|
7
|
-
const describe = uiBetaTag(commands.sandbox.describe
|
|
7
|
+
const describe = uiBetaTag(commands.sandbox.describe);
|
|
8
8
|
function sandboxBuilder(yargs) {
|
|
9
9
|
yargs.command(create).command(del).demandCommand(1, '');
|
|
10
10
|
return yargs;
|