@hubspot/cli 8.1.1-experimental.0 → 8.1.2-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/api/releases.d.ts +36 -0
- package/api/releases.js +41 -0
- package/commands/account/auth.js +2 -2
- package/commands/account/clean.js +2 -2
- package/commands/account/createOverride.js +2 -2
- package/commands/account/info.js +2 -2
- package/commands/account/link.js +2 -2
- package/commands/account/list.js +2 -2
- package/commands/account/remove.js +2 -2
- package/commands/account/removeOverride.js +2 -2
- package/commands/account/rename.js +2 -2
- package/commands/account/unlink.js +2 -2
- package/commands/account/use.js +2 -2
- package/commands/api.js +2 -2
- package/commands/app/migrate.js +2 -2
- package/commands/app/secret/add.js +2 -2
- package/commands/app/secret/delete.js +2 -2
- package/commands/app/secret/list.js +2 -2
- package/commands/app/secret/update.js +2 -2
- package/commands/auth.js +2 -2
- package/commands/cms/app/create.js +2 -2
- package/commands/cms/convertFields.js +2 -2
- package/commands/cms/delete.js +2 -2
- package/commands/cms/fetch.js +2 -2
- package/commands/cms/function/create.js +2 -2
- package/commands/cms/function/deploy.js +2 -2
- package/commands/cms/function/list.js +2 -2
- package/commands/cms/function/logs.js +2 -2
- package/commands/cms/function/server.js +2 -2
- package/commands/cms/getReactModule.js +2 -2
- package/commands/cms/lighthouseScore.js +2 -2
- package/commands/cms/lint.js +2 -2
- package/commands/cms/list.js +2 -2
- package/commands/cms/module/create.js +7 -2
- package/commands/cms/module/marketplace-validate.js +2 -2
- package/commands/cms/mv.js +2 -2
- package/commands/cms/template/create.js +2 -2
- package/commands/cms/theme/create.js +2 -2
- package/commands/cms/theme/generate-selectors.js +2 -2
- package/commands/cms/theme/marketplace-validate.js +2 -2
- package/commands/cms/theme/preview.js +2 -2
- package/commands/cms/upload.js +2 -2
- package/commands/cms/watch.js +2 -2
- package/commands/cms/webpack/create.js +2 -2
- package/commands/completion.js +2 -2
- package/commands/config/migrate.js +2 -2
- package/commands/config/set.js +2 -2
- package/commands/customObject/create.js +2 -2
- package/commands/customObject/createSchema.js +2 -2
- package/commands/customObject/deleteSchema.js +2 -2
- package/commands/customObject/fetchAllSchemas.js +2 -2
- package/commands/customObject/fetchSchema.js +2 -2
- package/commands/customObject/listSchemas.js +2 -2
- package/commands/customObject/updateSchema.js +2 -2
- package/commands/doctor.js +2 -2
- package/commands/feedback.js +2 -2
- package/commands/filemanager/fetch.js +2 -2
- package/commands/filemanager/upload.js +2 -2
- package/commands/getStarted.js +2 -2
- package/commands/hubdb/clear.js +2 -2
- package/commands/hubdb/create.js +2 -2
- package/commands/hubdb/delete.js +2 -2
- package/commands/hubdb/fetch.js +2 -2
- package/commands/hubdb/list.js +2 -2
- package/commands/init.js +2 -2
- package/commands/mcp/setup.js +2 -2
- package/commands/mcp/start.js +2 -2
- package/commands/open.js +2 -2
- package/commands/project/add.js +2 -2
- package/commands/project/appInstallStatus.js +2 -2
- package/commands/project/create.js +2 -2
- package/commands/project/delete.js +2 -2
- package/commands/project/deploy.js +2 -2
- package/commands/project/dev/index.js +2 -2
- package/commands/project/download.js +2 -2
- package/commands/project/info.js +2 -2
- package/commands/project/installDeps.js +2 -2
- package/commands/project/lint.js +4 -2
- package/commands/project/list.js +2 -2
- package/commands/project/listBuilds.js +2 -2
- package/commands/project/logs.js +2 -2
- package/commands/project/migrate.js +2 -2
- package/commands/project/open.js +2 -2
- package/commands/project/profile/add.js +2 -2
- package/commands/project/profile/delete.js +2 -2
- package/commands/project/updateDeps.js +2 -2
- package/commands/project/upload.d.ts +2 -0
- package/commands/project/upload.js +62 -9
- package/commands/project/validate.js +2 -2
- package/commands/project/watch.js +2 -2
- package/commands/sandbox/create.js +2 -2
- package/commands/sandbox/delete.js +2 -2
- package/commands/secret/addSecret.js +2 -2
- package/commands/secret/deleteSecret.js +2 -2
- package/commands/secret/listSecret.js +2 -2
- package/commands/secret/updateSecret.js +2 -2
- package/commands/testAccount/create.js +2 -2
- package/commands/testAccount/createConfig.js +2 -2
- package/commands/testAccount/delete.js +2 -2
- package/commands/testAccount/importData.js +2 -2
- package/commands/upgrade.js +2 -2
- package/lang/en.d.ts +18 -0
- package/lang/en.js +18 -0
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +1 -0
- package/lib/projects/localDev/helpers/project.js +1 -1
- package/lib/projects/pollProjectBuildAndDeploy.d.ts +5 -1
- package/lib/projects/pollProjectBuildAndDeploy.js +3 -2
- package/lib/projects/preview.d.ts +7 -0
- package/lib/projects/preview.js +48 -0
- package/lib/projects/upload.d.ts +1 -0
- package/lib/projects/upload.js +5 -4
- package/lib/projects/workspaces.d.ts +11 -1
- package/lib/projects/workspaces.js +27 -12
- package/lib/yargs/makeWrappedYargsHandler.d.ts +3 -0
- package/lib/yargs/{makeYargsHandlerWithUsageTracking.js → makeWrappedYargsHandler.js} +1 -1
- package/mcp-server/tools/cms/HsCreateFunctionTool.js +2 -2
- package/mcp-server/tools/cms/HsCreateModuleTool.js +4 -5
- package/mcp-server/tools/cms/HsCreateTemplateTool.js +2 -2
- package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -3
- package/mcp-server/tools/cms/HsListFunctionsTool.js +2 -3
- package/mcp-server/tools/cms/HsListTool.js +2 -2
- package/package.json +1 -1
- package/lib/yargs/makeYargsHandlerWithUsageTracking.d.ts +0 -3
package/commands/hubdb/list.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fetchTables } from '@hubspot/local-dev-lib/api/hubdb';
|
|
2
|
-
import {
|
|
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
5
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
@@ -75,7 +75,7 @@ const builder = makeYargsBuilder(hubdbListBuilder, command, describe, {
|
|
|
75
75
|
const hubdbListCommand = {
|
|
76
76
|
command,
|
|
77
77
|
describe,
|
|
78
|
-
handler:
|
|
78
|
+
handler: makeWrappedYargsHandler('hubdb-list', handler),
|
|
79
79
|
builder,
|
|
80
80
|
};
|
|
81
81
|
export default hubdbListCommand;
|
package/commands/init.js
CHANGED
|
@@ -20,7 +20,7 @@ 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
22
|
import { uiCommandReference, uiFeatureHighlight } from '../lib/ui/index.js';
|
|
23
|
-
import {
|
|
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';
|
|
26
26
|
import { parseStringToNumber } from '../lib/parsing.js';
|
|
@@ -191,7 +191,7 @@ const builder = makeYargsBuilder(initBuilder, command, commands.init.verboseDesc
|
|
|
191
191
|
const initCommand = {
|
|
192
192
|
command,
|
|
193
193
|
describe,
|
|
194
|
-
handler:
|
|
194
|
+
handler: makeWrappedYargsHandler('init', handler),
|
|
195
195
|
builder,
|
|
196
196
|
};
|
|
197
197
|
export default initCommand;
|
package/commands/mcp/setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
2
2
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
3
3
|
import { commands } from '../../lang/en.js';
|
|
4
|
-
import {
|
|
4
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
5
5
|
import { addMcpServerToConfig, supportedTools } from '../../lib/mcp/setup.js';
|
|
6
6
|
const command = ['setup'];
|
|
7
7
|
const describe = commands.mcp.setup.describe;
|
|
@@ -29,7 +29,7 @@ const builder = makeYargsBuilder(setupBuilder, command, describe, {
|
|
|
29
29
|
const mcpSetupCommand = {
|
|
30
30
|
command,
|
|
31
31
|
describe,
|
|
32
|
-
handler:
|
|
32
|
+
handler: makeWrappedYargsHandler('mcp-setup', handler),
|
|
33
33
|
builder,
|
|
34
34
|
};
|
|
35
35
|
export default mcpSetupCommand;
|
package/commands/mcp/start.js
CHANGED
|
@@ -7,7 +7,7 @@ import { uiLogger } from '../../lib/ui/logger.js';
|
|
|
7
7
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
8
8
|
import { commands } from '../../lang/en.js';
|
|
9
9
|
import { handleExit } from '../../lib/process.js';
|
|
10
|
-
import {
|
|
10
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
12
|
const command = 'start';
|
|
13
13
|
const describe = undefined; // Leave hidden for now
|
|
@@ -65,7 +65,7 @@ const builder = makeYargsBuilder(startBuilder, command, describe, {
|
|
|
65
65
|
const mcpStartCommand = {
|
|
66
66
|
command,
|
|
67
67
|
describe,
|
|
68
|
-
handler:
|
|
68
|
+
handler: makeWrappedYargsHandler('mcp-start', handler),
|
|
69
69
|
builder,
|
|
70
70
|
};
|
|
71
71
|
export default mcpStartCommand;
|
package/commands/open.js
CHANGED
|
@@ -2,7 +2,7 @@ import { logSiteLinks, getSiteLinksAsArray, openLink } from '../lib/links.js';
|
|
|
2
2
|
import { promptUser } from '../lib/prompts/promptUtils.js';
|
|
3
3
|
import { commands } from '../lang/en.js';
|
|
4
4
|
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
5
|
-
import {
|
|
5
|
+
import { makeWrappedYargsHandler } from '../lib/yargs/makeWrappedYargsHandler.js';
|
|
6
6
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
7
7
|
const separator = ' => ';
|
|
8
8
|
async function createListPrompt(accountId) {
|
|
@@ -63,7 +63,7 @@ const builder = makeYargsBuilder(openBuilder, command, describe, {
|
|
|
63
63
|
const openCommand = {
|
|
64
64
|
command,
|
|
65
65
|
describe,
|
|
66
|
-
handler:
|
|
66
|
+
handler: makeWrappedYargsHandler('open', handler),
|
|
67
67
|
builder,
|
|
68
68
|
};
|
|
69
69
|
export default openCommand;
|
package/commands/project/add.js
CHANGED
|
@@ -2,7 +2,7 @@ import { logError } from '../../lib/errorHandlers/index.js';
|
|
|
2
2
|
import { getProjectConfig } from '../../lib/projects/config.js';
|
|
3
3
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
4
4
|
import { isPromptExitError } from '../../lib/errors/PromptExitError.js';
|
|
5
|
-
import {
|
|
5
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
6
6
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
7
7
|
import { commands } from '../../lang/en.js';
|
|
8
8
|
import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
@@ -78,7 +78,7 @@ const builder = makeYargsBuilder(projectAddBuilder, command, describe, {
|
|
|
78
78
|
const projectAddCommand = {
|
|
79
79
|
command,
|
|
80
80
|
describe,
|
|
81
|
-
handler:
|
|
81
|
+
handler: makeWrappedYargsHandler('project-add', handler),
|
|
82
82
|
builder,
|
|
83
83
|
};
|
|
84
84
|
export default projectAddCommand;
|
|
@@ -4,7 +4,7 @@ import { fetchProject } from '@hubspot/local-dev-lib/api/projects';
|
|
|
4
4
|
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
5
5
|
import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
6
6
|
import { translateForLocalDev } from '@hubspot/project-parsing-lib/translate';
|
|
7
|
-
import {
|
|
7
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
8
8
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
9
9
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
10
10
|
import { ApiErrorContext, debugError, logError, } from '../../lib/errorHandlers/index.js';
|
|
@@ -126,7 +126,7 @@ const builder = makeYargsBuilder(projectInstallStatusBuilder, command, describe,
|
|
|
126
126
|
const projectInstallStatusCommand = {
|
|
127
127
|
command,
|
|
128
128
|
describe,
|
|
129
|
-
handler:
|
|
129
|
+
handler: makeWrappedYargsHandler('project-app-install-status', handler),
|
|
130
130
|
builder,
|
|
131
131
|
};
|
|
132
132
|
export default projectInstallStatusCommand;
|
|
@@ -10,7 +10,7 @@ import { generateComponentPaths } from '../../lib/projects/create/v2.js';
|
|
|
10
10
|
import { debugError, logError } from '../../lib/errorHandlers/index.js';
|
|
11
11
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
12
12
|
import { PROJECT_CONFIG_FILE, HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, marketplaceDistribution, privateDistribution, oAuth, staticAuth, DEFAULT_PROJECT_TEMPLATE_BRANCH, PROJECT_WITH_APP, EMPTY_PROJECT, } from '../../lib/constants.js';
|
|
13
|
-
import {
|
|
13
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
14
14
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
15
15
|
import { commands } from '../../lang/en.js';
|
|
16
16
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
@@ -180,7 +180,7 @@ const builder = makeYargsBuilder(projectCreateBuilder, command, describe, {
|
|
|
180
180
|
const projectCreateCommand = {
|
|
181
181
|
command,
|
|
182
182
|
describe,
|
|
183
|
-
handler:
|
|
183
|
+
handler: makeWrappedYargsHandler('project-create', handler),
|
|
184
184
|
builder,
|
|
185
185
|
};
|
|
186
186
|
export default projectCreateCommand;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
2
|
-
import {
|
|
2
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
3
3
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
4
4
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
5
5
|
import { renderInline } from '../../ui/render.js';
|
|
@@ -68,7 +68,7 @@ const builder = makeYargsBuilder(projectDeleteBuilder, command, verboseDescribe,
|
|
|
68
68
|
const projectDeleteCommand = {
|
|
69
69
|
command,
|
|
70
70
|
describe,
|
|
71
|
-
handler:
|
|
71
|
+
handler: makeWrappedYargsHandler('project-delete', handler),
|
|
72
72
|
builder,
|
|
73
73
|
};
|
|
74
74
|
export default projectDeleteCommand;
|
|
@@ -9,7 +9,7 @@ import { projectProfilePrompt } from '../../lib/prompts/projectProfilePrompt.js'
|
|
|
9
9
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
10
10
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
11
11
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
12
|
-
import {
|
|
12
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
13
13
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
14
14
|
import { loadProfile } from '../../lib/projects/projectProfiles.js';
|
|
15
15
|
import { PROJECT_DEPLOY_TEXT } from '../../lib/constants.js';
|
|
@@ -194,6 +194,6 @@ const projectDeployCommand = {
|
|
|
194
194
|
command,
|
|
195
195
|
describe,
|
|
196
196
|
builder,
|
|
197
|
-
handler:
|
|
197
|
+
handler: makeWrappedYargsHandler('project-deploy', handler),
|
|
198
198
|
};
|
|
199
199
|
export default projectDeployCommand;
|
|
@@ -2,7 +2,7 @@ import { getConfigAccountIfExists } from '@hubspot/local-dev-lib/config';
|
|
|
2
2
|
import { getProjectConfig, validateProjectConfig, } from '../../../lib/projects/config.js';
|
|
3
3
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
4
4
|
import { uiLine } from '../../../lib/ui/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
6
6
|
import { deprecatedProjectDevFlow } from './deprecatedFlow.js';
|
|
7
7
|
import { unifiedProjectDevFlow } from './unifiedFlow.js';
|
|
8
8
|
import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
@@ -169,7 +169,7 @@ export const builder = makeYargsBuilder(projectDevBuilder, command, describe, {
|
|
|
169
169
|
const projectDevCommand = {
|
|
170
170
|
command,
|
|
171
171
|
describe,
|
|
172
|
-
handler:
|
|
172
|
+
handler: makeWrappedYargsHandler('project-dev', handler),
|
|
173
173
|
builder,
|
|
174
174
|
};
|
|
175
175
|
export default projectDevCommand;
|
|
@@ -9,7 +9,7 @@ import { downloadProjectPrompt } from '../../lib/prompts/downloadProjectPrompt.j
|
|
|
9
9
|
import { commands } from '../../lang/en.js';
|
|
10
10
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
11
11
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
12
|
-
import {
|
|
12
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
13
13
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
14
14
|
const command = 'download';
|
|
15
15
|
const describe = commands.project.download.describe;
|
|
@@ -88,7 +88,7 @@ const builder = makeYargsBuilder(projectDownloadBuilder, command, describe, {
|
|
|
88
88
|
const projectDownloadCommand = {
|
|
89
89
|
command,
|
|
90
90
|
describe,
|
|
91
|
-
handler:
|
|
91
|
+
handler: makeWrappedYargsHandler('project-download', handler),
|
|
92
92
|
builder,
|
|
93
93
|
};
|
|
94
94
|
export default projectDownloadCommand;
|
package/commands/project/info.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
2
2
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
3
3
|
import { fetchProject } from '@hubspot/local-dev-lib/api/projects';
|
|
4
4
|
import { debugError } from '../../lib/errorHandlers/index.js';
|
|
@@ -61,7 +61,7 @@ const builder = makeYargsBuilder(projectInfoBuilder, command, verboseDescribe, {
|
|
|
61
61
|
const projectInfoCommand = {
|
|
62
62
|
command,
|
|
63
63
|
describe,
|
|
64
|
-
handler:
|
|
64
|
+
handler: makeWrappedYargsHandler('project-info', handler),
|
|
65
65
|
builder,
|
|
66
66
|
};
|
|
67
67
|
export default projectInfoCommand;
|
|
@@ -6,7 +6,7 @@ import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { commands } from '../../lang/en.js';
|
|
8
8
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
9
|
-
import {
|
|
9
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
10
10
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
12
12
|
const command = 'install-deps [packages..]';
|
|
@@ -77,7 +77,7 @@ const builder = makeYargsBuilder(projectInstallDepsBuilder, command, describe, {
|
|
|
77
77
|
const projectInstallDepsCommand = {
|
|
78
78
|
command,
|
|
79
79
|
describe,
|
|
80
|
-
handler:
|
|
80
|
+
handler: makeWrappedYargsHandler('project-install-deps', handler),
|
|
81
81
|
builder,
|
|
82
82
|
};
|
|
83
83
|
export default projectInstallDepsCommand;
|
package/commands/project/lint.js
CHANGED
|
@@ -5,12 +5,13 @@ import { isPromptExitError } from '../../lib/errors/PromptExitError.js';
|
|
|
5
5
|
import { getProjectConfig } from '../../lib/projects/config.js';
|
|
6
6
|
import { commands } from '../../lang/en.js';
|
|
7
7
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
8
|
-
import {
|
|
8
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
9
9
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
10
10
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
11
11
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
12
12
|
import SpinniesManager from '../../lib/ui/SpinniesManager.js';
|
|
13
13
|
import { areAllLintPackagesInstalled, getMissingLintPackages, getMissingLintScripts, addLintScriptsToPackageJson, lintPackages, displayLintResults, hasEslintConfig, hasDeprecatedEslintConfig, getDeprecatedEslintConfigFiles, createEslintConfig, REQUIRED_PACKAGES_AND_MIN_VERSIONS, } from '../../lib/projects/uieLinting.js';
|
|
14
|
+
import { clearPackageJsonCache } from '../../lib/npm/packageJson.js';
|
|
14
15
|
const command = 'lint';
|
|
15
16
|
const describe = commands.project.lint.help.describe;
|
|
16
17
|
async function handler(args) {
|
|
@@ -69,6 +70,7 @@ async function handler(args) {
|
|
|
69
70
|
installLocations: locationsArray,
|
|
70
71
|
dev: true,
|
|
71
72
|
});
|
|
73
|
+
clearPackageJsonCache();
|
|
72
74
|
// Re-check which locations are now ready
|
|
73
75
|
for (const location of locationsArray) {
|
|
74
76
|
if (areAllLintPackagesInstalled(location)) {
|
|
@@ -193,7 +195,7 @@ const builder = makeYargsBuilder(projectLintBuilder, command, describe, {
|
|
|
193
195
|
const projectLintCommand = {
|
|
194
196
|
command,
|
|
195
197
|
describe,
|
|
196
|
-
handler:
|
|
198
|
+
handler: makeWrappedYargsHandler('project-lint', handler),
|
|
197
199
|
builder,
|
|
198
200
|
};
|
|
199
201
|
export default projectLintCommand;
|
package/commands/project/list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
2
2
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
3
3
|
import { fetchProjects } from '@hubspot/local-dev-lib/api/projects';
|
|
4
4
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
@@ -57,7 +57,7 @@ const builder = makeYargsBuilder(projectListBuilder, command, describe, {
|
|
|
57
57
|
const projectListCommand = {
|
|
58
58
|
command,
|
|
59
59
|
describe,
|
|
60
|
-
handler:
|
|
60
|
+
handler: makeWrappedYargsHandler('projects-list', handler),
|
|
61
61
|
builder,
|
|
62
62
|
};
|
|
63
63
|
export default projectListCommand;
|
|
@@ -7,7 +7,7 @@ import moment from 'moment';
|
|
|
7
7
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
8
8
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
9
9
|
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
10
|
-
import {
|
|
10
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
11
11
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
12
12
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
13
13
|
import { commands } from '../../lang/en.js';
|
|
@@ -116,7 +116,7 @@ const builder = makeYargsBuilder(projectListBuildsBuilder, command, describe, {
|
|
|
116
116
|
const projectListBuildsCommand = {
|
|
117
117
|
command,
|
|
118
118
|
describe,
|
|
119
|
-
handler:
|
|
119
|
+
handler: makeWrappedYargsHandler('project-list-builds', handler),
|
|
120
120
|
builder,
|
|
121
121
|
};
|
|
122
122
|
export default projectListBuildsCommand;
|
package/commands/project/logs.js
CHANGED
|
@@ -7,7 +7,7 @@ import { commands } from '../../lang/en.js';
|
|
|
7
7
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
8
8
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
9
9
|
import { ProjectLogsManager } from '../../lib/projects/ProjectLogsManager.js';
|
|
10
|
-
import {
|
|
10
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
12
12
|
import { renderTable } from '../../ui/render.js';
|
|
13
13
|
function getPrivateAppsUrl(accountId) {
|
|
@@ -112,7 +112,7 @@ const builder = makeYargsBuilder(projectLogsBuilder, command, describe, { useGlo
|
|
|
112
112
|
const projectLogsCommand = {
|
|
113
113
|
command,
|
|
114
114
|
describe,
|
|
115
|
-
handler:
|
|
115
|
+
handler: makeWrappedYargsHandler('project-logs', handler),
|
|
116
116
|
builder,
|
|
117
117
|
};
|
|
118
118
|
export default projectLogsCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
2
2
|
import { migrateApp } from '../../lib/app/migrate.js';
|
|
3
3
|
import { getProjectConfig } from '../../lib/projects/config.js';
|
|
4
4
|
import { PLATFORM_VERSIONS } from '@hubspot/project-parsing-lib/constants';
|
|
@@ -85,7 +85,7 @@ const builder = makeYargsBuilder(projectMigrateBuilder, command, commands.projec
|
|
|
85
85
|
const migrateCommand = {
|
|
86
86
|
command,
|
|
87
87
|
describe,
|
|
88
|
-
handler:
|
|
88
|
+
handler: makeWrappedYargsHandler('project-migrate', handler),
|
|
89
89
|
builder,
|
|
90
90
|
};
|
|
91
91
|
export default migrateCommand;
|
package/commands/project/open.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ensureProjectExists } from '../../lib/projects/ensureProjectExists.js';
|
|
|
6
6
|
import { getProjectDetailUrl } from '../../lib/projects/urls.js';
|
|
7
7
|
import { projectNamePrompt } from '../../lib/prompts/projectNamePrompt.js';
|
|
8
8
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
9
|
-
import {
|
|
9
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
10
10
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
11
11
|
const command = 'open';
|
|
12
12
|
const describe = commands.project.open.describe;
|
|
@@ -54,7 +54,7 @@ const builder = makeYargsBuilder(projectOpenBuilder, command, describe, {
|
|
|
54
54
|
const projectOpenCommand = {
|
|
55
55
|
command,
|
|
56
56
|
describe,
|
|
57
|
-
handler:
|
|
57
|
+
handler: makeWrappedYargsHandler('project-open', handler),
|
|
58
58
|
builder,
|
|
59
59
|
};
|
|
60
60
|
export default projectOpenCommand;
|
|
@@ -7,7 +7,7 @@ import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
|
7
7
|
import { uiAccountDescription } from '../../../lib/ui/index.js';
|
|
8
8
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
9
9
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
10
|
-
import {
|
|
10
|
+
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
12
12
|
import { commands } from '../../../lang/en.js';
|
|
13
13
|
import { promptUser, listPrompt, confirmPrompt, } from '../../../lib/prompts/promptUtils.js';
|
|
@@ -201,7 +201,7 @@ const builder = makeYargsBuilder(projectProfileAddBuilder, command, verboseDescr
|
|
|
201
201
|
const projectProfileAddCommand = {
|
|
202
202
|
command,
|
|
203
203
|
describe,
|
|
204
|
-
handler:
|
|
204
|
+
handler: makeWrappedYargsHandler('project-profile-add', handler),
|
|
205
205
|
builder,
|
|
206
206
|
};
|
|
207
207
|
export default projectProfileAddCommand;
|
|
@@ -7,7 +7,7 @@ import { getProjectConfig } from '../../../lib/projects/config.js';
|
|
|
7
7
|
import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
8
8
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
9
9
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
10
|
-
import {
|
|
10
|
+
import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
12
12
|
import { commands } from '../../../lang/en.js';
|
|
13
13
|
import { confirmPrompt, listPrompt } from '../../../lib/prompts/promptUtils.js';
|
|
@@ -127,7 +127,7 @@ const builder = makeYargsBuilder(projectProfileDeleteBuilder, command, describe,
|
|
|
127
127
|
const projectProfileDeleteCommand = {
|
|
128
128
|
command,
|
|
129
129
|
describe,
|
|
130
|
-
handler:
|
|
130
|
+
handler: makeWrappedYargsHandler('project-profile-delete', handler),
|
|
131
131
|
builder,
|
|
132
132
|
};
|
|
133
133
|
export default projectProfileDeleteCommand;
|
|
@@ -6,7 +6,7 @@ import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { commands } from '../../lang/en.js';
|
|
8
8
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
9
|
-
import {
|
|
9
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
10
10
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
11
11
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
12
12
|
const command = 'update-deps [packages..]';
|
|
@@ -77,7 +77,7 @@ const builder = makeYargsBuilder(projectUpdateDepsBuilder, command, describe, {
|
|
|
77
77
|
const projectUpdateDepsCommand = {
|
|
78
78
|
command,
|
|
79
79
|
describe,
|
|
80
|
-
handler:
|
|
80
|
+
handler: makeWrappedYargsHandler('project-update-deps', handler),
|
|
81
81
|
builder,
|
|
82
82
|
};
|
|
83
83
|
export default projectUpdateDepsCommand;
|
|
@@ -6,6 +6,8 @@ export type ProjectUploadArgs = CommonArgs & JSONOutputArgs & {
|
|
|
6
6
|
skipValidation: boolean;
|
|
7
7
|
skipNpmAudit: boolean;
|
|
8
8
|
profile?: string;
|
|
9
|
+
preview: boolean;
|
|
10
|
+
target?: number;
|
|
9
11
|
};
|
|
10
12
|
declare const projectUploadCommand: YargsCommandModule<unknown, ProjectUploadArgs>;
|
|
11
13
|
export default projectUploadCommand;
|
|
@@ -8,17 +8,32 @@ import { logFeedbackMessage } from '../../lib/projects/ui.js';
|
|
|
8
8
|
import { handleProjectUpload } from '../../lib/projects/upload.js';
|
|
9
9
|
import { loadAndValidateProfile } from '../../lib/projects/projectProfiles.js';
|
|
10
10
|
import { displayWarnLogs, pollProjectBuildAndDeploy, } from '../../lib/projects/pollProjectBuildAndDeploy.js';
|
|
11
|
-
import {
|
|
11
|
+
import { triggerAndPollPreview } from '../../lib/projects/preview.js';
|
|
12
|
+
import { commands, lib } from '../../lang/en.js';
|
|
12
13
|
import { PROJECT_ERROR_TYPES } from '../../lib/constants.js';
|
|
13
14
|
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
14
15
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
15
|
-
import {
|
|
16
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
16
17
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
18
|
import { projectProfilePrompt } from '../../lib/prompts/projectProfilePrompt.js';
|
|
18
19
|
const command = 'upload';
|
|
19
20
|
const describe = commands.project.upload.describe;
|
|
21
|
+
async function handlePreview(accountId, projectId, buildId, targetPortalId) {
|
|
22
|
+
if (!projectId) {
|
|
23
|
+
uiLogger.warn(lib.projectPreview.missingProjectId);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const previewResult = await triggerAndPollPreview(accountId, projectId, buildId, targetPortalId);
|
|
27
|
+
if (!previewResult.succeeded) {
|
|
28
|
+
uiLogger.warn(lib.projectPreview.warning);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
releaseTag: previewResult.releaseTag,
|
|
32
|
+
succeeded: previewResult.succeeded,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
20
35
|
async function handler(args) {
|
|
21
|
-
const { forceCreate, message, derivedAccountId, skipValidation, skipNpmAudit, formatOutputAsJson, profile: profileOption, useEnv: useEnvOption, exit, addUsageMetadata, } = args;
|
|
36
|
+
const { forceCreate, message, derivedAccountId, skipValidation, skipNpmAudit, formatOutputAsJson, profile: profileOption, useEnv: useEnvOption, preview, target: targetPortalId, exit, addUsageMetadata, } = args;
|
|
22
37
|
const jsonOutput = {};
|
|
23
38
|
const { projectConfig, projectDir } = await getProjectConfig();
|
|
24
39
|
try {
|
|
@@ -56,11 +71,13 @@ async function handler(args) {
|
|
|
56
71
|
assetType: projectConfig.platformVersion,
|
|
57
72
|
});
|
|
58
73
|
try {
|
|
59
|
-
const { result, uploadError } = await handleProjectUpload({
|
|
74
|
+
const { result, uploadError, projectId } = await handleProjectUpload({
|
|
60
75
|
accountId: targetAccountId,
|
|
61
76
|
projectConfig,
|
|
62
77
|
projectDir,
|
|
63
|
-
callbackFunc:
|
|
78
|
+
callbackFunc: preview
|
|
79
|
+
? (...args) => pollProjectBuildAndDeploy(...args, { skipDeploy: true })
|
|
80
|
+
: pollProjectBuildAndDeploy,
|
|
64
81
|
uploadMessage: message,
|
|
65
82
|
forceCreate,
|
|
66
83
|
isUploadCommand: true,
|
|
@@ -85,12 +102,22 @@ async function handler(args) {
|
|
|
85
102
|
}
|
|
86
103
|
return exit(EXIT_CODES.ERROR);
|
|
87
104
|
}
|
|
88
|
-
if (result &&
|
|
105
|
+
if (result &&
|
|
106
|
+
result.succeeded &&
|
|
107
|
+
(!result.buildResult.isAutoDeployEnabled || preview)) {
|
|
89
108
|
uiLogger.log(chalk.bold(commands.project.upload.logs.buildSucceeded(result.buildId)));
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
if (!preview) {
|
|
110
|
+
uiLogger.log(commands.project.upload.logs.autoDeployDisabled(`hs project deploy --build=${result.buildId}`));
|
|
111
|
+
logFeedbackMessage(result.buildId);
|
|
112
|
+
}
|
|
92
113
|
await displayWarnLogs(targetAccountId, projectConfig.name, result.buildId);
|
|
93
114
|
}
|
|
115
|
+
if (result && result.succeeded && preview && targetPortalId) {
|
|
116
|
+
const previewJson = await handlePreview(targetAccountId, projectId, result.buildId, targetPortalId);
|
|
117
|
+
if (previewJson && formatOutputAsJson) {
|
|
118
|
+
jsonOutput.preview = previewJson;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
94
121
|
if (result && result.succeeded && formatOutputAsJson) {
|
|
95
122
|
jsonOutput.buildId = result.buildId;
|
|
96
123
|
if (result.deployResult) {
|
|
@@ -138,6 +165,27 @@ function projectUploadBuilder(yargs) {
|
|
|
138
165
|
alias: 'p',
|
|
139
166
|
describe: commands.project.upload.options.profile.describe,
|
|
140
167
|
},
|
|
168
|
+
preview: {
|
|
169
|
+
describe: commands.project.upload.options.preview.describe,
|
|
170
|
+
type: 'boolean',
|
|
171
|
+
default: false,
|
|
172
|
+
hidden: true,
|
|
173
|
+
},
|
|
174
|
+
target: {
|
|
175
|
+
describe: commands.project.upload.options.target.describe,
|
|
176
|
+
type: 'number',
|
|
177
|
+
requiresArg: true,
|
|
178
|
+
hidden: true,
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
yargs.check(argv => {
|
|
182
|
+
if (argv.preview && argv.target == null) {
|
|
183
|
+
throw new Error(commands.project.upload.errors.previewRequiresTarget);
|
|
184
|
+
}
|
|
185
|
+
if (argv.target != null && !argv.preview) {
|
|
186
|
+
throw new Error(commands.project.upload.errors.targetRequiresPreview);
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
141
189
|
});
|
|
142
190
|
yargs.conflicts('profile', 'account');
|
|
143
191
|
yargs.example([
|
|
@@ -146,6 +194,11 @@ function projectUploadBuilder(yargs) {
|
|
|
146
194
|
'$0 project upload --profile=profileName',
|
|
147
195
|
commands.project.upload.examples.withProfile,
|
|
148
196
|
],
|
|
197
|
+
// TODO: Unhide when 2026.09 ships
|
|
198
|
+
// [
|
|
199
|
+
// '$0 project upload --preview --target=12345',
|
|
200
|
+
// commands.project.upload.examples.withPreview,
|
|
201
|
+
// ],
|
|
149
202
|
]);
|
|
150
203
|
return yargs;
|
|
151
204
|
}
|
|
@@ -159,7 +212,7 @@ const builder = makeYargsBuilder(projectUploadBuilder, command, describe, {
|
|
|
159
212
|
const projectUploadCommand = {
|
|
160
213
|
command,
|
|
161
214
|
describe,
|
|
162
|
-
handler:
|
|
215
|
+
handler: makeWrappedYargsHandler('project-upload', handler),
|
|
163
216
|
builder,
|
|
164
217
|
};
|
|
165
218
|
export default projectUploadCommand;
|
|
@@ -4,7 +4,7 @@ import { isLegacyProject } from '@hubspot/project-parsing-lib/projects';
|
|
|
4
4
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
5
5
|
import { getProjectConfig, validateProjectConfig, } from '../../lib/projects/config.js';
|
|
6
6
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
7
|
-
import {
|
|
7
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
8
8
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
9
9
|
import { validateSourceDirectory, handleTranslate, } from '../../lib/projects/upload.js';
|
|
10
10
|
import { commands } from '../../lang/en.js';
|
|
@@ -150,7 +150,7 @@ const builder = makeYargsBuilder(projectValidateBuilder, command, describe, {
|
|
|
150
150
|
const projectValidateCommand = {
|
|
151
151
|
command,
|
|
152
152
|
describe,
|
|
153
|
-
handler:
|
|
153
|
+
handler: makeWrappedYargsHandler('project-validate', handler),
|
|
154
154
|
builder,
|
|
155
155
|
};
|
|
156
156
|
export default projectValidateCommand;
|
|
@@ -12,7 +12,7 @@ import { handleProjectUpload } from '../../lib/projects/upload.js';
|
|
|
12
12
|
import { pollBuildStatus, pollDeployStatus, } from '../../lib/projects/pollProjectBuildAndDeploy.js';
|
|
13
13
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
14
14
|
import { handleKeypress, handleExit } from '../../lib/process.js';
|
|
15
|
-
import {
|
|
15
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
16
16
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
17
|
import { uiDeprecatedTag } from '../../lib/ui/index.js';
|
|
18
18
|
const command = 'watch';
|
|
@@ -146,7 +146,7 @@ const builder = makeYargsBuilder(projectWatchBuilder, command, describe, {
|
|
|
146
146
|
const projectWatchCommand = {
|
|
147
147
|
command,
|
|
148
148
|
describe,
|
|
149
|
-
handler:
|
|
149
|
+
handler: makeWrappedYargsHandler('project-watch', handler),
|
|
150
150
|
builder,
|
|
151
151
|
};
|
|
152
152
|
export default projectWatchCommand;
|
|
@@ -12,7 +12,7 @@ import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
|
12
12
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
13
13
|
import { buildV2Sandbox } from '../../lib/buildAccount.js';
|
|
14
14
|
import { hubspotAccountNamePrompt } from '../../lib/prompts/accountNamePrompt.js';
|
|
15
|
-
import {
|
|
15
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
16
16
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
17
|
const command = 'create';
|
|
18
18
|
const describe = uiBetaTag(commands.sandbox.subcommands.create.describe, false);
|
|
@@ -150,7 +150,7 @@ const builder = makeYargsBuilder(sandboxCreateBuilder, command, describe, {
|
|
|
150
150
|
const sandboxCreateCommand = {
|
|
151
151
|
command,
|
|
152
152
|
describe,
|
|
153
|
-
handler:
|
|
153
|
+
handler: makeWrappedYargsHandler('sandbox-create', handler),
|
|
154
154
|
builder,
|
|
155
155
|
};
|
|
156
156
|
export default sandboxCreateCommand;
|