@hubspot/cli 8.6.0 → 8.7.0-beta.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/bin/cli.js +3 -3
- 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 +8 -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.d.ts +2 -2
- package/commands/project/appInstallStatus.js +3 -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.d.ts +2 -2
- package/commands/project/info.js +3 -2
- package/commands/project/installDeps.js +2 -2
- package/commands/project/lint.js +7 -5
- package/commands/project/list.d.ts +2 -2
- package/commands/project/list.js +3 -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/release/create.d.ts +7 -0
- package/commands/project/release/create.js +159 -0
- package/commands/project/release/info.d.ts +6 -0
- package/commands/project/release/info.js +147 -0
- package/commands/project/release/list.d.ts +6 -0
- package/commands/project/release/list.js +111 -0
- package/commands/project/release.d.ts +3 -0
- package/commands/project/release.js +20 -0
- package/commands/project/updateDeps.js +2 -2
- package/commands/project/upload.d.ts +3 -0
- package/commands/project/upload.js +77 -9
- package/commands/project/validate.js +2 -2
- package/commands/project/watch.js +2 -2
- package/commands/project.js +2 -0
- 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 +92 -0
- package/lang/en.js +92 -0
- package/lib/api/usageTracking.d.ts +29 -0
- package/lib/api/usageTracking.js +28 -0
- package/lib/commonOpts.js +0 -1
- 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/npmAuditOnUpload.d.ts +10 -0
- package/lib/projects/npmAuditOnUpload.js +73 -0
- 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/uieLinting.d.ts +4 -0
- package/lib/projects/uieLinting.js +36 -1
- package/lib/projects/upload.d.ts +3 -1
- package/lib/projects/upload.js +26 -6
- package/lib/projects/validateLintConfigOnUpload.d.ts +9 -0
- package/lib/projects/validateLintConfigOnUpload.js +45 -0
- package/lib/projects/workspaces.d.ts +11 -1
- package/lib/projects/workspaces.js +27 -12
- package/lib/usageTracking.d.ts +7 -17
- package/lib/usageTracking.js +43 -29
- package/lib/yargs/makeWrappedYargsHandler.d.ts +3 -0
- package/lib/yargs/{makeYargsHandlerWithUsageTracking.js → makeWrappedYargsHandler.js} +29 -3
- 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/mcp-server/utils/toolUsageTracking.js +10 -6
- package/package.json +4 -4
- package/lib/yargs/makeYargsHandlerWithUsageTracking.d.ts +0 -3
package/commands/hubdb/fetch.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isPromptExitError } from '../../lib/errors/PromptExitError.js';
|
|
|
4
4
|
import { downloadHubDbTable } from '@hubspot/local-dev-lib/hubdb';
|
|
5
5
|
import { selectHubDBTablePrompt } from '../../lib/prompts/selectHubDBTablePrompt.js';
|
|
6
6
|
import { commands } from '../../lang/en.js';
|
|
7
|
-
import {
|
|
7
|
+
import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
|
|
8
8
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
9
9
|
const command = 'fetch [table-id] [dest]';
|
|
10
10
|
const describe = commands.hubdb.subcommands.fetch.describe;
|
|
@@ -48,7 +48,7 @@ const builder = makeYargsBuilder(hubdbFetchBuilder, command, describe, {
|
|
|
48
48
|
const hubdbFetchCommand = {
|
|
49
49
|
command,
|
|
50
50
|
describe,
|
|
51
|
-
handler:
|
|
51
|
+
handler: makeWrappedYargsHandler('hubdb-fetch', handler),
|
|
52
52
|
builder,
|
|
53
53
|
};
|
|
54
54
|
export default hubdbFetchCommand;
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountArgs, CommonArgs, ConfigArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
-
type ProjectInstallStatusArgs = CommonArgs & ConfigArgs & AccountArgs & JSONOutputArgs;
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
type ProjectInstallStatusArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & JSONOutputArgs;
|
|
3
3
|
declare const projectInstallStatusCommand: YargsCommandModule<unknown, ProjectInstallStatusArgs>;
|
|
4
4
|
export default projectInstallStatusCommand;
|
|
@@ -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';
|
|
@@ -121,12 +121,13 @@ const builder = makeYargsBuilder(projectInstallStatusBuilder, command, describe,
|
|
|
121
121
|
useGlobalOptions: true,
|
|
122
122
|
useConfigOptions: true,
|
|
123
123
|
useAccountOptions: true,
|
|
124
|
+
useEnvironmentOptions: true,
|
|
124
125
|
useJSONOutputOptions: true,
|
|
125
126
|
});
|
|
126
127
|
const projectInstallStatusCommand = {
|
|
127
128
|
command,
|
|
128
129
|
describe,
|
|
129
|
-
handler:
|
|
130
|
+
handler: makeWrappedYargsHandler('project-app-install-status', handler),
|
|
130
131
|
builder,
|
|
131
132
|
};
|
|
132
133
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountArgs, CommonArgs, ConfigArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
-
type ProjectInfoArgs = CommonArgs & ConfigArgs & AccountArgs & JSONOutputArgs;
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
type ProjectInfoArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & JSONOutputArgs;
|
|
3
3
|
declare const projectInfoCommand: YargsCommandModule<unknown, ProjectInfoArgs>;
|
|
4
4
|
export default projectInfoCommand;
|
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';
|
|
@@ -56,12 +56,13 @@ const builder = makeYargsBuilder(projectInfoBuilder, command, verboseDescribe, {
|
|
|
56
56
|
useGlobalOptions: true,
|
|
57
57
|
useConfigOptions: true,
|
|
58
58
|
useAccountOptions: true,
|
|
59
|
+
useEnvironmentOptions: true,
|
|
59
60
|
useJSONOutputOptions: true,
|
|
60
61
|
});
|
|
61
62
|
const projectInfoCommand = {
|
|
62
63
|
command,
|
|
63
64
|
describe,
|
|
64
|
-
handler:
|
|
65
|
+
handler: makeWrappedYargsHandler('project-info', handler),
|
|
65
66
|
builder,
|
|
66
67
|
};
|
|
67
68
|
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
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import {
|
|
2
|
+
import { installPackages } from '../../lib/dependencyManagement.js';
|
|
3
3
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
4
4
|
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
|
-
import { areAllLintPackagesInstalled,
|
|
13
|
+
import { addLintScriptsToPackageJson, areAllLintPackagesInstalled, createEslintConfig, displayLintResults, getDeprecatedEslintConfigFiles, getMissingLintPackages, getMissingLintScripts, getUieLintablePackageJsonLocations, hasDeprecatedEslintConfig, hasEslintConfig, lintPackages, 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) {
|
|
@@ -25,7 +26,7 @@ async function handler(args) {
|
|
|
25
26
|
SpinniesManager.add('lintCheck', {
|
|
26
27
|
text: commands.project.lint.loading.checking,
|
|
27
28
|
});
|
|
28
|
-
const lintLocations = await
|
|
29
|
+
const lintLocations = await getUieLintablePackageJsonLocations(projectConfig);
|
|
29
30
|
const locationsReadyToLint = [];
|
|
30
31
|
const locationsNeedingPackages = new Map();
|
|
31
32
|
for (const lintLocation of lintLocations) {
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountArgs, CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
-
type ProjectListArgs = CommonArgs & ConfigArgs & AccountArgs;
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
type ProjectListArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
3
3
|
declare const projectListCommand: YargsCommandModule<unknown, ProjectListArgs>;
|
|
4
4
|
export default projectListCommand;
|
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';
|
|
@@ -52,11 +52,12 @@ const builder = makeYargsBuilder(projectListBuilder, command, describe, {
|
|
|
52
52
|
useGlobalOptions: true,
|
|
53
53
|
useConfigOptions: true,
|
|
54
54
|
useAccountOptions: true,
|
|
55
|
+
useEnvironmentOptions: true,
|
|
55
56
|
});
|
|
56
57
|
const projectListCommand = {
|
|
57
58
|
command,
|
|
58
59
|
describe,
|
|
59
|
-
handler:
|
|
60
|
+
handler: makeWrappedYargsHandler('projects-list', handler),
|
|
60
61
|
builder,
|
|
61
62
|
};
|
|
62
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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, JSONOutputArgs, YargsCommandModule } from '../../../types/Yargs.js';
|
|
2
|
+
export type ProjectReleaseCreateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & JSONOutputArgs & {
|
|
3
|
+
build?: number;
|
|
4
|
+
force: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const projectReleaseCreateCommand: YargsCommandModule<unknown, ProjectReleaseCreateArgs>;
|
|
7
|
+
export default projectReleaseCreateCommand;
|