@hubspot/cli 8.0.10-experimental.7 → 8.0.11-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +2 -0
- package/commands/account/auth.js +12 -22
- package/commands/account/clean.js +5 -6
- package/commands/account/createOverride.js +7 -7
- package/commands/account/info.js +2 -1
- package/commands/account/list.js +3 -5
- package/commands/account/remove.js +2 -3
- package/commands/account/removeOverride.js +8 -10
- package/commands/account/rename.js +5 -6
- package/commands/account/use.js +8 -19
- package/commands/api.d.ts +10 -0
- package/commands/api.js +164 -0
- package/commands/app/migrate.js +8 -8
- package/commands/app/secret/add.js +6 -7
- package/commands/app/secret/delete.js +9 -10
- package/commands/app/secret/list.js +6 -7
- package/commands/app/secret/update.js +8 -9
- package/commands/auth.js +12 -12
- package/commands/cms/app/create.js +9 -5
- package/commands/cms/convertFields.js +8 -8
- package/commands/cms/delete.js +2 -3
- package/commands/cms/fetch.js +7 -7
- package/commands/cms/function/create.js +9 -5
- package/commands/cms/function/deploy.js +2 -3
- package/commands/cms/function/list.js +11 -7
- package/commands/cms/function/logs.js +17 -23
- package/commands/cms/function/server.js +2 -3
- package/commands/cms/getReactModule.js +7 -8
- package/commands/cms/lighthouseScore.js +25 -24
- package/commands/cms/lint.js +4 -5
- package/commands/cms/list.js +5 -6
- package/commands/cms/module/create.js +9 -5
- package/commands/cms/module/marketplace-validate.js +7 -8
- package/commands/cms/mv.js +2 -3
- package/commands/cms/template/create.js +10 -6
- package/commands/cms/theme/create.js +5 -5
- package/commands/cms/theme/generate-selectors.js +5 -4
- package/commands/cms/theme/marketplace-validate.js +8 -9
- package/commands/cms/theme/preview.js +16 -8
- package/commands/cms/upload.js +15 -12
- package/commands/cms/watch.js +5 -5
- package/commands/cms/webpack/create.js +5 -5
- package/commands/completion.js +3 -5
- package/commands/config/migrate.js +6 -7
- package/commands/config/set.js +5 -6
- package/commands/customObject/create.js +4 -5
- package/commands/customObject/createSchema.js +4 -5
- package/commands/customObject/deleteSchema.js +4 -5
- package/commands/customObject/fetchAllSchemas.js +2 -3
- package/commands/customObject/fetchSchema.js +2 -3
- package/commands/customObject/listSchemas.js +2 -3
- package/commands/customObject/updateSchema.js +4 -5
- package/commands/doctor.js +8 -8
- package/commands/feedback.js +6 -4
- package/commands/filemanager/fetch.js +5 -6
- package/commands/filemanager/upload.js +5 -5
- package/commands/getStarted.js +14 -16
- package/commands/hubdb/clear.js +5 -6
- package/commands/hubdb/create.js +4 -5
- package/commands/hubdb/delete.js +8 -9
- package/commands/hubdb/fetch.js +5 -6
- package/commands/hubdb/list.js +16 -14
- package/commands/init.js +14 -17
- package/commands/mcp/setup.js +5 -6
- package/commands/mcp/start.js +2 -3
- package/commands/open.js +4 -5
- package/commands/project/add.js +10 -5
- package/commands/project/create.js +10 -10
- package/commands/project/delete.d.ts +7 -0
- package/commands/project/delete.js +74 -0
- package/commands/project/deploy.js +36 -34
- package/commands/project/dev/deprecatedFlow.js +42 -15
- package/commands/project/dev/index.d.ts +3 -3
- package/commands/project/dev/index.js +24 -30
- package/commands/project/dev/unifiedFlow.js +37 -14
- package/commands/project/download.js +10 -11
- package/commands/project/info.d.ts +4 -0
- package/commands/project/info.js +67 -0
- package/commands/project/installDeps.js +9 -6
- package/commands/project/lint.js +11 -8
- package/commands/project/list.js +14 -14
- package/commands/project/listBuilds.js +8 -6
- package/commands/project/logs.js +5 -6
- package/commands/project/migrate.js +8 -8
- package/commands/project/open.js +5 -6
- package/commands/project/profile/add.js +12 -8
- package/commands/project/profile/delete.js +15 -11
- package/commands/project/updateDeps.js +9 -6
- package/commands/project/upload.js +31 -17
- package/commands/project/validate.js +11 -11
- package/commands/project/watch.js +20 -20
- package/commands/project.js +4 -0
- package/commands/sandbox/create.js +15 -15
- package/commands/sandbox/delete.js +13 -14
- package/commands/secret/addSecret.js +6 -7
- package/commands/secret/deleteSecret.js +5 -6
- package/commands/secret/listSecret.js +2 -3
- package/commands/secret/updateSecret.js +4 -5
- package/commands/testAccount/create.d.ts +1 -1
- package/commands/testAccount/create.js +20 -16
- package/commands/testAccount/createConfig.js +7 -8
- package/commands/testAccount/delete.js +27 -18
- package/commands/testAccount/importData.js +6 -7
- package/commands/upgrade.js +9 -10
- package/lang/en.d.ts +123 -5
- package/lang/en.js +121 -6
- package/lib/accountAuth.js +2 -2
- package/lib/buildAccount.js +3 -3
- package/lib/constants.d.ts +0 -1
- package/lib/constants.js +0 -1
- package/lib/doctor/Diagnosis.js +5 -5
- package/lib/errorHandlers/index.js +4 -3
- package/lib/errorHandlers/suppressError.js +4 -0
- package/lib/errors/PromptExitError.d.ts +4 -2
- package/lib/errors/PromptExitError.js +3 -0
- package/lib/hasFeature.js +1 -2
- package/lib/middleware/autoUpdateMiddleware.js +6 -3
- package/lib/process.d.ts +1 -1
- package/lib/process.js +10 -3
- package/lib/projects/create/v2.js +1 -2
- package/lib/projects/delete.d.ts +13 -0
- package/lib/projects/delete.js +193 -0
- package/lib/projects/localDev/AppDevModeInterface.js +11 -11
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +3 -1
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +2 -2
- package/lib/projects/localDev/DevSessionManager.d.ts +6 -3
- package/lib/projects/localDev/DevSessionManager.js +31 -19
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.d.ts +3 -0
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +16 -12
- package/lib/projects/localDev/LocalDevProcess.js +6 -5
- package/lib/projects/localDev/LocalDevState.d.ts +3 -2
- package/lib/projects/localDev/LocalDevState.js +3 -1
- package/lib/projects/localDev/helpers/account.d.ts +4 -3
- package/lib/projects/localDev/helpers/account.js +16 -19
- package/lib/projects/localDev/helpers/process.d.ts +1 -1
- package/lib/projects/localDev/helpers/process.js +4 -10
- package/lib/projects/localDev/helpers/project.d.ts +4 -3
- package/lib/projects/localDev/helpers/project.js +31 -15
- package/lib/projects/projectInfo.d.ts +5 -0
- package/lib/projects/projectInfo.js +82 -0
- package/lib/projects/projectProfiles.d.ts +1 -2
- package/lib/projects/projectProfiles.js +5 -17
- package/lib/projects/upload.js +19 -0
- package/lib/projects/workspaces.d.ts +42 -0
- package/lib/projects/workspaces.js +350 -0
- package/lib/prompts/createApiSamplePrompt.js +4 -0
- package/lib/prompts/projectProfilePrompt.d.ts +2 -0
- package/lib/prompts/projectProfilePrompt.js +46 -0
- package/lib/prompts/promptUtils.js +3 -2
- package/lib/prompts/selectHubDBTablePrompt.js +2 -2
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +2 -2
- package/lib/theme/cmsDevServerProcess.d.ts +2 -0
- package/lib/theme/cmsDevServerProcess.js +7 -6
- package/lib/ui/SpinniesManager.d.ts +1 -0
- package/lib/ui/SpinniesManager.js +20 -6
- package/lib/ui/spinniesUtils.d.ts +0 -1
- package/lib/ui/spinniesUtils.js +6 -16
- package/lib/usageTracking.d.ts +3 -4
- package/lib/yargs/makeYargsBuilder.d.ts +13 -0
- package/lib/yargs/makeYargsBuilder.js +33 -0
- package/lib/yargs/makeYargsHandlerWithUsageTracking.d.ts +3 -0
- package/lib/yargs/makeYargsHandlerWithUsageTracking.js +95 -0
- package/lib/yargs/strictEnforceBoolean.d.ts +1 -0
- package/lib/yargs/strictEnforceBoolean.js +13 -0
- package/lib/yargsUtils.d.ts +3 -16
- package/lib/yargsUtils.js +3 -48
- package/package.json +5 -4
- package/types/LocalDev.d.ts +5 -0
- package/types/Projects.d.ts +19 -0
- package/types/Yargs.d.ts +18 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { makeYargsHandlerWithUsageTracking } from '../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
1
2
|
import { migrateApp } from '../../lib/app/migrate.js';
|
|
2
3
|
import { getProjectConfig } from '../../lib/projects/config.js';
|
|
3
4
|
import { PLATFORM_VERSIONS } from '@hubspot/local-dev-lib/constants/projects';
|
|
@@ -12,17 +13,16 @@ import { getWarningBox } from '../../ui/components/StatusMessageBoxes.js';
|
|
|
12
13
|
import { getHasMigratableThemes, migrateThemesV2, } from '../../lib/theme/migrate.js';
|
|
13
14
|
import { hasFeature } from '../../lib/hasFeature.js';
|
|
14
15
|
import { FEATURES } from '../../lib/constants.js';
|
|
15
|
-
import { trackCommandMetadataUsage
|
|
16
|
+
import { trackCommandMetadataUsage } from '../../lib/usageTracking.js';
|
|
16
17
|
const { v2025_2, v2026_03_beta, v2026_03 } = PLATFORM_VERSIONS;
|
|
17
18
|
const command = 'migrate';
|
|
18
19
|
const describe = commands.project.migrate.describe;
|
|
19
20
|
async function handler(args) {
|
|
20
|
-
const { platformVersion, unstable, derivedAccountId } = args;
|
|
21
|
-
await trackCommandUsage('project-migrate', {}, derivedAccountId);
|
|
21
|
+
const { platformVersion, unstable, derivedAccountId, exit } = args;
|
|
22
22
|
const projectConfig = await getProjectConfig();
|
|
23
23
|
if (!projectConfig.projectConfig) {
|
|
24
24
|
uiLogger.error(commands.project.migrate.errors.noProjectConfig(uiCommandReference('hs app migrate')));
|
|
25
|
-
return
|
|
25
|
+
return exit(EXIT_CODES.ERROR);
|
|
26
26
|
}
|
|
27
27
|
if (projectConfig?.projectConfig) {
|
|
28
28
|
await renderInline(getWarningBox({
|
|
@@ -36,7 +36,7 @@ async function handler(args) {
|
|
|
36
36
|
const hasThemeMigrationAccess = await hasFeature(derivedAccountId, FEATURES.THEME_MIGRATION_2025_2);
|
|
37
37
|
if (!hasThemeMigrationAccess) {
|
|
38
38
|
uiLogger.error(commands.project.migrate.errors.noThemeMigrationAccess(derivedAccountId));
|
|
39
|
-
return
|
|
39
|
+
return exit(EXIT_CODES.ERROR);
|
|
40
40
|
}
|
|
41
41
|
await migrateThemesV2(derivedAccountId, {
|
|
42
42
|
...args,
|
|
@@ -58,10 +58,10 @@ async function handler(args) {
|
|
|
58
58
|
catch (error) {
|
|
59
59
|
await trackCommandMetadataUsage('project-migrate', { successful: false }, derivedAccountId);
|
|
60
60
|
logError(error);
|
|
61
|
-
return
|
|
61
|
+
return exit(EXIT_CODES.ERROR);
|
|
62
62
|
}
|
|
63
63
|
await trackCommandMetadataUsage('project-migrate', { successful: true }, derivedAccountId);
|
|
64
|
-
return
|
|
64
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
65
65
|
}
|
|
66
66
|
function projectMigrateBuilder(yargs) {
|
|
67
67
|
yargs
|
|
@@ -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: makeYargsHandlerWithUsageTracking('project-migrate', handler),
|
|
89
89
|
builder,
|
|
90
90
|
};
|
|
91
91
|
export default migrateCommand;
|
package/commands/project/open.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import open from 'open';
|
|
2
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
3
2
|
import { commands } from '../../lang/en.js';
|
|
4
3
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
5
4
|
import { getProjectConfig } from '../../lib/projects/config.js';
|
|
@@ -7,12 +6,12 @@ import { ensureProjectExists } from '../../lib/projects/ensureProjectExists.js';
|
|
|
7
6
|
import { getProjectDetailUrl } from '../../lib/projects/urls.js';
|
|
8
7
|
import { projectNamePrompt } from '../../lib/prompts/projectNamePrompt.js';
|
|
9
8
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
9
|
+
import { makeYargsHandlerWithUsageTracking } from '../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
10
10
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
11
11
|
const command = 'open';
|
|
12
12
|
const describe = commands.project.open.describe;
|
|
13
13
|
async function handler(args) {
|
|
14
|
-
const { project, derivedAccountId } = args;
|
|
15
|
-
trackCommandUsage('project-open', undefined, derivedAccountId);
|
|
14
|
+
const { project, derivedAccountId, exit } = args;
|
|
16
15
|
const { projectConfig } = await getProjectConfig();
|
|
17
16
|
let projectName = project;
|
|
18
17
|
if (projectName) {
|
|
@@ -20,7 +19,7 @@ async function handler(args) {
|
|
|
20
19
|
allowCreate: false,
|
|
21
20
|
});
|
|
22
21
|
if (!projectExists) {
|
|
23
|
-
|
|
22
|
+
return exit(EXIT_CODES.ERROR);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
else if (!projectName && projectConfig) {
|
|
@@ -33,7 +32,7 @@ async function handler(args) {
|
|
|
33
32
|
const url = getProjectDetailUrl(projectName, derivedAccountId);
|
|
34
33
|
open(url, { url: true });
|
|
35
34
|
uiLogger.success(commands.project.open.success(projectName));
|
|
36
|
-
|
|
35
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
37
36
|
}
|
|
38
37
|
function projectOpenBuilder(yargs) {
|
|
39
38
|
yargs.options({
|
|
@@ -55,7 +54,7 @@ const builder = makeYargsBuilder(projectOpenBuilder, command, describe, {
|
|
|
55
54
|
const projectOpenCommand = {
|
|
56
55
|
command,
|
|
57
56
|
describe,
|
|
58
|
-
handler,
|
|
57
|
+
handler: makeYargsHandlerWithUsageTracking('project-open', handler),
|
|
59
58
|
builder,
|
|
60
59
|
};
|
|
61
60
|
export default projectOpenCommand;
|
|
@@ -2,11 +2,12 @@ import path from 'path';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { getConfigAccountIfExists, getAllConfigAccounts, } from '@hubspot/local-dev-lib/config';
|
|
4
4
|
import { getAllHsProfiles, getHsProfileFilename, loadHsProfileFile, } from '@hubspot/project-parsing-lib/profiles';
|
|
5
|
-
import { trackCommandUsage } from '../../../lib/usageTracking.js';
|
|
6
5
|
import { getProjectConfig } from '../../../lib/projects/config.js';
|
|
6
|
+
import { isV2Project } from '../../../lib/projects/platformVersion.js';
|
|
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 { makeYargsHandlerWithUsageTracking } from '../../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
10
11
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
11
12
|
import { commands } from '../../../lang/en.js';
|
|
12
13
|
import { promptUser, listPrompt, confirmPrompt, } from '../../../lib/prompts/promptUtils.js';
|
|
@@ -50,12 +51,15 @@ async function selectProfileToCopyVariablesFrom(existingProfiles) {
|
|
|
50
51
|
return profileToCopyVariablesFrom;
|
|
51
52
|
}
|
|
52
53
|
async function handler(args) {
|
|
53
|
-
const {
|
|
54
|
-
trackCommandUsage('project-profile-add', undefined, derivedAccountId);
|
|
54
|
+
const { exit } = args;
|
|
55
55
|
const { projectConfig, projectDir } = await getProjectConfig();
|
|
56
56
|
if (!projectConfig || !projectDir) {
|
|
57
57
|
uiLogger.error(commands.project.profile.add.errors.noProjectConfig);
|
|
58
|
-
|
|
58
|
+
return exit(EXIT_CODES.ERROR);
|
|
59
|
+
}
|
|
60
|
+
if (!isV2Project(projectConfig.platformVersion)) {
|
|
61
|
+
uiLogger.error(commands.project.profile.add.errors.unsupportedPlatformVersion);
|
|
62
|
+
return exit(EXIT_CODES.ERROR);
|
|
59
63
|
}
|
|
60
64
|
const projectSourceDir = path.join(projectDir, projectConfig.srcDir);
|
|
61
65
|
let profileName = args.name;
|
|
@@ -115,7 +119,7 @@ async function handler(args) {
|
|
|
115
119
|
const configuredAccounts = getAllConfigAccounts();
|
|
116
120
|
if (!configuredAccounts || !configuredAccounts.length) {
|
|
117
121
|
uiLogger.error(commands.project.profile.add.errors.noAccountsConfigured);
|
|
118
|
-
|
|
122
|
+
return exit(EXIT_CODES.ERROR);
|
|
119
123
|
}
|
|
120
124
|
const promptResponse = await listPrompt(commands.project.profile.add.prompts.targetAccountPrompt, {
|
|
121
125
|
choices: configuredAccounts.map(account => {
|
|
@@ -171,11 +175,11 @@ async function handler(args) {
|
|
|
171
175
|
}
|
|
172
176
|
catch (err) {
|
|
173
177
|
uiLogger.error(commands.project.profile.add.errors.failedToCreateProfile);
|
|
174
|
-
|
|
178
|
+
return exit(EXIT_CODES.ERROR);
|
|
175
179
|
}
|
|
176
180
|
uiLogger.log('');
|
|
177
181
|
uiLogger.log(commands.project.profile.add.logs.profileAdded(profileFilename));
|
|
178
|
-
|
|
182
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
179
183
|
}
|
|
180
184
|
function projectProfileAddBuilder(yargs) {
|
|
181
185
|
yargs.positional('name', {
|
|
@@ -197,7 +201,7 @@ const builder = makeYargsBuilder(projectProfileAddBuilder, command, verboseDescr
|
|
|
197
201
|
const projectProfileAddCommand = {
|
|
198
202
|
command,
|
|
199
203
|
describe,
|
|
200
|
-
handler,
|
|
204
|
+
handler: makeYargsHandlerWithUsageTracking('project-profile-add', handler),
|
|
201
205
|
builder,
|
|
202
206
|
};
|
|
203
207
|
export default projectProfileAddCommand;
|
|
@@ -3,10 +3,11 @@ import path from 'path';
|
|
|
3
3
|
import { getAllHsProfiles, getHsProfileFilename, loadHsProfileFile, } from '@hubspot/project-parsing-lib/profiles';
|
|
4
4
|
import { fetchProject, deleteProject, } from '@hubspot/local-dev-lib/api/projects';
|
|
5
5
|
import { getConfigAccountById } from '@hubspot/local-dev-lib/config';
|
|
6
|
-
import { trackCommandUsage } from '../../../lib/usageTracking.js';
|
|
7
6
|
import { getProjectConfig } from '../../../lib/projects/config.js';
|
|
7
|
+
import { isV2Project } from '../../../lib/projects/platformVersion.js';
|
|
8
8
|
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
9
9
|
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
10
|
+
import { makeYargsHandlerWithUsageTracking } from '../../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
10
11
|
import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
|
|
11
12
|
import { commands } from '../../../lang/en.js';
|
|
12
13
|
import { confirmPrompt, listPrompt } from '../../../lib/prompts/promptUtils.js';
|
|
@@ -16,12 +17,15 @@ import { isDeveloperTestAccount, isSandbox, } from '../../../lib/accountTypes.js
|
|
|
16
17
|
const command = 'delete [name]';
|
|
17
18
|
const describe = commands.project.profile.delete.describe;
|
|
18
19
|
async function handler(args) {
|
|
19
|
-
const {
|
|
20
|
-
trackCommandUsage('project-profile-delete', undefined, derivedAccountId);
|
|
20
|
+
const { exit } = args;
|
|
21
21
|
const { projectConfig, projectDir } = await getProjectConfig();
|
|
22
22
|
if (!projectConfig || !projectDir) {
|
|
23
23
|
uiLogger.error(commands.project.profile.delete.errors.noProjectConfig);
|
|
24
|
-
|
|
24
|
+
return exit(EXIT_CODES.ERROR);
|
|
25
|
+
}
|
|
26
|
+
if (!isV2Project(projectConfig.platformVersion)) {
|
|
27
|
+
uiLogger.error(commands.project.profile.delete.errors.unsupportedPlatformVersion);
|
|
28
|
+
return exit(EXIT_CODES.ERROR);
|
|
25
29
|
}
|
|
26
30
|
const projectSourceDir = path.join(projectDir, projectConfig.srcDir);
|
|
27
31
|
let profileName = undefined;
|
|
@@ -30,14 +34,14 @@ async function handler(args) {
|
|
|
30
34
|
const profileFilename = getHsProfileFilename(profileName);
|
|
31
35
|
if (!fileExists(path.join(projectSourceDir, profileFilename))) {
|
|
32
36
|
uiLogger.error(commands.project.profile.delete.errors.noProfileFound(profileFilename));
|
|
33
|
-
|
|
37
|
+
return exit(EXIT_CODES.ERROR);
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
else {
|
|
37
41
|
const existingProfiles = await getAllHsProfiles(projectSourceDir);
|
|
38
42
|
if (existingProfiles.length === 0) {
|
|
39
43
|
uiLogger.error(commands.project.profile.delete.errors.noProfilesFound);
|
|
40
|
-
|
|
44
|
+
return exit(EXIT_CODES.ERROR);
|
|
41
45
|
}
|
|
42
46
|
const promptResponse = await listPrompt(commands.project.profile.delete.prompts.deleteProfilePrompt, {
|
|
43
47
|
choices: existingProfiles.map(profile => ({
|
|
@@ -52,7 +56,7 @@ async function handler(args) {
|
|
|
52
56
|
}
|
|
53
57
|
// This should never happen
|
|
54
58
|
if (!profileName) {
|
|
55
|
-
|
|
59
|
+
return exit(EXIT_CODES.ERROR);
|
|
56
60
|
}
|
|
57
61
|
let targetAccountId;
|
|
58
62
|
try {
|
|
@@ -68,7 +72,7 @@ async function handler(args) {
|
|
|
68
72
|
}
|
|
69
73
|
catch (err) {
|
|
70
74
|
uiLogger.error(commands.project.profile.delete.errors.failedToDeleteProfile(profileFilename));
|
|
71
|
-
|
|
75
|
+
return exit(EXIT_CODES.ERROR);
|
|
72
76
|
}
|
|
73
77
|
uiLogger.log(commands.project.profile.delete.logs.profileDeleted(profileFilename));
|
|
74
78
|
if (targetAccountId) {
|
|
@@ -96,7 +100,7 @@ async function handler(args) {
|
|
|
96
100
|
catch (err) {
|
|
97
101
|
debugError(err);
|
|
98
102
|
uiLogger.error(commands.project.profile.delete.errors.failedToDeleteProject(targetAccountId));
|
|
99
|
-
|
|
103
|
+
return exit(EXIT_CODES.ERROR);
|
|
100
104
|
}
|
|
101
105
|
uiLogger.log(commands.project.profile.delete.logs.deletedProject(targetAccountId));
|
|
102
106
|
}
|
|
@@ -105,7 +109,7 @@ async function handler(args) {
|
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
|
-
|
|
112
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
109
113
|
}
|
|
110
114
|
function projectProfileDeleteBuilder(yargs) {
|
|
111
115
|
yargs.positional('name', {
|
|
@@ -123,7 +127,7 @@ const builder = makeYargsBuilder(projectProfileDeleteBuilder, command, describe,
|
|
|
123
127
|
const projectProfileDeleteCommand = {
|
|
124
128
|
command,
|
|
125
129
|
describe,
|
|
126
|
-
handler,
|
|
130
|
+
handler: makeYargsHandlerWithUsageTracking('project-profile-delete', handler),
|
|
127
131
|
builder,
|
|
128
132
|
};
|
|
129
133
|
export default projectProfileDeleteCommand;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { updatePackages, getProjectPackageJsonLocations, } from '../../lib/dependencyManagement.js';
|
|
2
2
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
3
|
+
import { isPromptExitError } from '../../lib/errors/PromptExitError.js';
|
|
3
4
|
import { getProjectConfig } from '../../lib/projects/config.js';
|
|
4
5
|
import { promptUser } from '../../lib/prompts/promptUtils.js';
|
|
5
6
|
import path from 'path';
|
|
6
7
|
import { commands } from '../../lang/en.js';
|
|
7
8
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
8
|
-
import {
|
|
9
|
+
import { makeYargsHandlerWithUsageTracking } from '../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
9
10
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
10
11
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
11
12
|
const command = 'update-deps [packages..]';
|
|
12
13
|
const describe = commands.project.updateDeps.help.describe;
|
|
13
14
|
async function handler(args) {
|
|
14
|
-
const {
|
|
15
|
+
const { packages, exit } = args;
|
|
15
16
|
try {
|
|
16
|
-
trackCommandUsage('project-update-deps', undefined, derivedAccountId);
|
|
17
17
|
const projectConfig = await getProjectConfig();
|
|
18
18
|
if (!projectConfig || !projectConfig.projectDir) {
|
|
19
19
|
uiLogger.error(commands.project.updateDeps.noProjectConfig);
|
|
20
|
-
return
|
|
20
|
+
return exit(EXIT_CODES.ERROR);
|
|
21
21
|
}
|
|
22
22
|
const { projectDir } = projectConfig;
|
|
23
23
|
let installLocations = await getProjectPackageJsonLocations();
|
|
@@ -50,8 +50,11 @@ async function handler(args) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
catch (e) {
|
|
53
|
+
if (isPromptExitError(e)) {
|
|
54
|
+
throw e;
|
|
55
|
+
}
|
|
53
56
|
logError(e);
|
|
54
|
-
return
|
|
57
|
+
return exit(EXIT_CODES.ERROR);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
function projectUpdateDepsBuilder(yargs) {
|
|
@@ -74,7 +77,7 @@ const builder = makeYargsBuilder(projectUpdateDepsBuilder, command, describe, {
|
|
|
74
77
|
const projectUpdateDepsCommand = {
|
|
75
78
|
command,
|
|
76
79
|
describe,
|
|
77
|
-
handler,
|
|
80
|
+
handler: makeYargsHandlerWithUsageTracking('project-update-deps', handler),
|
|
78
81
|
builder,
|
|
79
82
|
};
|
|
80
83
|
export default projectUpdateDepsCommand;
|
|
@@ -3,7 +3,6 @@ import { uiLogger } from '../../lib/ui/logger.js';
|
|
|
3
3
|
import { getConfigAccountById } from '@hubspot/local-dev-lib/config';
|
|
4
4
|
import { isSpecifiedError } from '@hubspot/local-dev-lib/errors/index';
|
|
5
5
|
import { isV2Project } from '../../lib/projects/platformVersion.js';
|
|
6
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
7
6
|
import { getProjectConfig, validateProjectConfig, } from '../../lib/projects/config.js';
|
|
8
7
|
import { logFeedbackMessage } from '../../lib/projects/ui.js';
|
|
9
8
|
import { handleProjectUpload } from '../../lib/projects/upload.js';
|
|
@@ -13,11 +12,13 @@ import { commands } from '../../lang/en.js';
|
|
|
13
12
|
import { PROJECT_ERROR_TYPES } from '../../lib/constants.js';
|
|
14
13
|
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
15
14
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
15
|
+
import { makeYargsHandlerWithUsageTracking } from '../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
16
16
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
|
+
import { projectProfilePrompt } from '../../lib/prompts/projectProfilePrompt.js';
|
|
17
18
|
const command = 'upload';
|
|
18
19
|
const describe = commands.project.upload.describe;
|
|
19
20
|
async function handler(args) {
|
|
20
|
-
const { forceCreate, message, derivedAccountId, skipValidation, formatOutputAsJson, profile, } = args;
|
|
21
|
+
const { forceCreate, message, derivedAccountId, skipValidation, formatOutputAsJson, profile: profileOption, useEnv: useEnvOption, exit, addUsageMetadata, } = args;
|
|
21
22
|
const jsonOutput = {};
|
|
22
23
|
const { projectConfig, projectDir } = await getProjectConfig();
|
|
23
24
|
try {
|
|
@@ -25,34 +26,47 @@ async function handler(args) {
|
|
|
25
26
|
}
|
|
26
27
|
catch (error) {
|
|
27
28
|
logError(error);
|
|
28
|
-
|
|
29
|
+
return exit(EXIT_CODES.ERROR);
|
|
30
|
+
}
|
|
31
|
+
if (!projectDir) {
|
|
32
|
+
uiLogger.error(commands.project.upload.errors.noProjectConfig);
|
|
33
|
+
return exit(EXIT_CODES.ERROR);
|
|
29
34
|
}
|
|
30
35
|
let targetAccountId;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
let profileName = args.profile;
|
|
37
|
+
if (isV2Project(projectConfig?.platformVersion)) {
|
|
38
|
+
try {
|
|
39
|
+
const profileNamePromptResult = await projectProfilePrompt(projectDir, projectConfig, profileOption, !!useEnvOption);
|
|
40
|
+
if (profileNamePromptResult) {
|
|
41
|
+
profileName = profileNamePromptResult;
|
|
42
|
+
const profile = await loadAndValidateProfile(projectConfig, projectDir, profileName);
|
|
43
|
+
targetAccountId = profile.accountId;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
logError(error);
|
|
48
|
+
return exit(EXIT_CODES.ERROR);
|
|
34
49
|
}
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
logError(err);
|
|
38
|
-
process.exit(EXIT_CODES.ERROR);
|
|
39
50
|
}
|
|
40
51
|
targetAccountId = targetAccountId || derivedAccountId;
|
|
41
52
|
const accountConfig = getConfigAccountById(targetAccountId);
|
|
42
53
|
const accountType = accountConfig && accountConfig.accountType;
|
|
43
|
-
|
|
54
|
+
addUsageMetadata({
|
|
55
|
+
type: accountType,
|
|
56
|
+
assetType: projectConfig.platformVersion,
|
|
57
|
+
});
|
|
44
58
|
try {
|
|
45
59
|
const { result, uploadError } = await handleProjectUpload({
|
|
46
60
|
accountId: targetAccountId,
|
|
47
61
|
projectConfig,
|
|
48
|
-
projectDir
|
|
62
|
+
projectDir,
|
|
49
63
|
callbackFunc: pollProjectBuildAndDeploy,
|
|
50
64
|
uploadMessage: message,
|
|
51
65
|
forceCreate,
|
|
52
66
|
isUploadCommand: true,
|
|
53
67
|
sendIR: isV2Project(projectConfig.platformVersion),
|
|
54
68
|
skipValidation,
|
|
55
|
-
profile:
|
|
69
|
+
profile: profileName,
|
|
56
70
|
});
|
|
57
71
|
if (uploadError) {
|
|
58
72
|
if (isSpecifiedError(uploadError, {
|
|
@@ -68,7 +82,7 @@ async function handler(args) {
|
|
|
68
82
|
request: 'project upload',
|
|
69
83
|
}));
|
|
70
84
|
}
|
|
71
|
-
|
|
85
|
+
return exit(EXIT_CODES.ERROR);
|
|
72
86
|
}
|
|
73
87
|
if (result && result.succeeded && !result.buildResult.isAutoDeployEnabled) {
|
|
74
88
|
uiLogger.log(chalk.bold(commands.project.upload.logs.buildSucceeded(result.buildId)));
|
|
@@ -88,12 +102,12 @@ async function handler(args) {
|
|
|
88
102
|
accountId: targetAccountId,
|
|
89
103
|
request: 'project upload',
|
|
90
104
|
}));
|
|
91
|
-
|
|
105
|
+
return exit(EXIT_CODES.ERROR);
|
|
92
106
|
}
|
|
93
107
|
if (formatOutputAsJson) {
|
|
94
108
|
uiLogger.json(jsonOutput);
|
|
95
109
|
}
|
|
96
|
-
|
|
110
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
97
111
|
}
|
|
98
112
|
function projectUploadBuilder(yargs) {
|
|
99
113
|
yargs.options({
|
|
@@ -139,7 +153,7 @@ const builder = makeYargsBuilder(projectUploadBuilder, command, describe, {
|
|
|
139
153
|
const projectUploadCommand = {
|
|
140
154
|
command,
|
|
141
155
|
describe,
|
|
142
|
-
handler,
|
|
156
|
+
handler: makeYargsHandlerWithUsageTracking('project-upload', handler),
|
|
143
157
|
builder,
|
|
144
158
|
};
|
|
145
159
|
export default projectUploadCommand;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { getConfigAccountById } from '@hubspot/local-dev-lib/config';
|
|
3
3
|
import { isV2Project } from '../../lib/projects/platformVersion.js';
|
|
4
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
5
4
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
6
5
|
import { getProjectConfig, validateProjectConfig, } from '../../lib/projects/config.js';
|
|
7
6
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
7
|
+
import { makeYargsHandlerWithUsageTracking } from '../../lib/yargs/makeYargsHandlerWithUsageTracking.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';
|
|
@@ -15,25 +15,25 @@ import SpinniesManager from '../../lib/ui/SpinniesManager.js';
|
|
|
15
15
|
const command = 'validate';
|
|
16
16
|
const describe = commands.project.validate.describe;
|
|
17
17
|
async function handler(args) {
|
|
18
|
-
const { derivedAccountId, profile } = args;
|
|
18
|
+
const { derivedAccountId, profile, exit, addUsageMetadata } = args;
|
|
19
19
|
const { projectConfig, projectDir } = await getProjectConfig();
|
|
20
20
|
const accountConfig = getConfigAccountById(derivedAccountId);
|
|
21
21
|
const accountType = accountConfig && accountConfig.accountType;
|
|
22
|
-
|
|
22
|
+
addUsageMetadata({ type: accountType });
|
|
23
23
|
if (!projectConfig || !projectDir) {
|
|
24
24
|
uiLogger.error(commands.project.validate.mustBeRanWithinAProject);
|
|
25
|
-
|
|
25
|
+
return exit(EXIT_CODES.ERROR);
|
|
26
26
|
}
|
|
27
|
-
if (!isV2Project(projectConfig
|
|
27
|
+
if (!isV2Project(projectConfig.platformVersion)) {
|
|
28
28
|
uiLogger.error(commands.project.validate.badVersion);
|
|
29
|
-
|
|
29
|
+
return exit(EXIT_CODES.ERROR);
|
|
30
30
|
}
|
|
31
31
|
try {
|
|
32
32
|
validateProjectConfig(projectConfig, projectDir);
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
35
|
logError(error);
|
|
36
|
-
|
|
36
|
+
return exit(EXIT_CODES.ERROR);
|
|
37
37
|
}
|
|
38
38
|
let validationSucceeded = true;
|
|
39
39
|
const srcDir = path.resolve(projectDir, projectConfig.srcDir);
|
|
@@ -100,17 +100,17 @@ async function handler(args) {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
if (!validationSucceeded) {
|
|
103
|
-
|
|
103
|
+
return exit(EXIT_CODES.ERROR);
|
|
104
104
|
}
|
|
105
105
|
try {
|
|
106
106
|
await validateSourceDirectory(srcDir, projectConfig, projectDir);
|
|
107
107
|
}
|
|
108
108
|
catch (e) {
|
|
109
109
|
logError(e);
|
|
110
|
-
|
|
110
|
+
return exit(EXIT_CODES.ERROR);
|
|
111
111
|
}
|
|
112
112
|
uiLogger.success(commands.project.validate.success(projectConfig.name));
|
|
113
|
-
|
|
113
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
114
114
|
}
|
|
115
115
|
function projectValidateBuilder(yargs) {
|
|
116
116
|
yargs.options({
|
|
@@ -150,7 +150,7 @@ const builder = makeYargsBuilder(projectValidateBuilder, command, describe, {
|
|
|
150
150
|
const projectValidateCommand = {
|
|
151
151
|
command,
|
|
152
152
|
describe,
|
|
153
|
-
handler,
|
|
153
|
+
handler: makeYargsHandlerWithUsageTracking('project-validate', handler),
|
|
154
154
|
builder,
|
|
155
155
|
};
|
|
156
156
|
export default projectValidateCommand;
|
|
@@ -6,16 +6,17 @@ import { createWatcher } from '../../lib/projects/watch.js';
|
|
|
6
6
|
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
7
7
|
import { uiLogger } from '../../lib/ui/logger.js';
|
|
8
8
|
import { PROJECT_ERROR_TYPES } from '../../lib/constants.js';
|
|
9
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
10
9
|
import { getProjectConfig, validateProjectConfig, } from '../../lib/projects/config.js';
|
|
11
10
|
import { logFeedbackMessage } from '../../lib/projects/ui.js';
|
|
12
11
|
import { handleProjectUpload } from '../../lib/projects/upload.js';
|
|
13
12
|
import { pollBuildStatus, pollDeployStatus, } from '../../lib/projects/pollProjectBuildAndDeploy.js';
|
|
14
13
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
15
14
|
import { handleKeypress, handleExit } from '../../lib/process.js';
|
|
15
|
+
import { makeYargsHandlerWithUsageTracking } from '../../lib/yargs/makeYargsHandlerWithUsageTracking.js';
|
|
16
16
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
17
|
+
import { uiDeprecatedTag } from '../../lib/ui/index.js';
|
|
17
18
|
const command = 'watch';
|
|
18
|
-
const describe = commands.project.watch.describe;
|
|
19
|
+
const describe = uiDeprecatedTag(commands.project.watch.describe, false);
|
|
19
20
|
async function handleBuildStatus(accountId, projectName, buildId) {
|
|
20
21
|
const { isAutoDeployEnabled, deployStatusTaskLocator } = await pollBuildStatus(accountId, projectName, buildId, null);
|
|
21
22
|
if (isAutoDeployEnabled && deployStatusTaskLocator) {
|
|
@@ -23,28 +24,28 @@ async function handleBuildStatus(accountId, projectName, buildId) {
|
|
|
23
24
|
}
|
|
24
25
|
logFeedbackMessage(buildId);
|
|
25
26
|
}
|
|
26
|
-
function handleUserInput(accountId, projectName, currentBuildId) {
|
|
27
|
+
function handleUserInput(accountId, projectName, currentBuildId, exit) {
|
|
27
28
|
const onTerminate = async () => {
|
|
28
29
|
uiLogger.log(commands.project.watch.logs.processExited);
|
|
29
30
|
if (currentBuildId) {
|
|
30
31
|
try {
|
|
31
32
|
await cancelStagedBuild(accountId, projectName);
|
|
32
|
-
|
|
33
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
33
34
|
}
|
|
34
35
|
catch (err) {
|
|
35
36
|
if (isSpecifiedError(err, {
|
|
36
37
|
subCategory: PROJECT_ERROR_TYPES.BUILD_NOT_IN_PROGRESS,
|
|
37
38
|
})) {
|
|
38
|
-
|
|
39
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
41
42
|
logError(err, new ApiErrorContext({ accountId }));
|
|
42
|
-
|
|
43
|
+
return exit(EXIT_CODES.ERROR);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
47
|
-
|
|
48
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
handleExit(onTerminate);
|
|
@@ -55,23 +56,22 @@ function handleUserInput(accountId, projectName, currentBuildId) {
|
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
async function handler(args) {
|
|
58
|
-
const { initialUpload, derivedAccountId } = args;
|
|
59
|
-
trackCommandUsage('project-watch', undefined, derivedAccountId);
|
|
59
|
+
const { initialUpload, derivedAccountId, exit } = args;
|
|
60
60
|
const { projectConfig, projectDir } = await getProjectConfig();
|
|
61
61
|
if (!projectConfig || !projectDir) {
|
|
62
62
|
uiLogger.error(commands.project.watch.errors.projectConfigNotFound);
|
|
63
|
-
return
|
|
63
|
+
return exit(EXIT_CODES.ERROR);
|
|
64
64
|
}
|
|
65
65
|
if (isV2Project(projectConfig.platformVersion)) {
|
|
66
|
-
uiLogger.error(projectConfig.platformVersion);
|
|
67
|
-
return
|
|
66
|
+
uiLogger.error(commands.project.watch.errors.v2ApiError(projectConfig.platformVersion));
|
|
67
|
+
return exit(EXIT_CODES.ERROR);
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
70
|
validateProjectConfig(projectConfig, projectDir);
|
|
71
71
|
}
|
|
72
72
|
catch (error) {
|
|
73
73
|
logError(error);
|
|
74
|
-
|
|
74
|
+
return exit(EXIT_CODES.ERROR);
|
|
75
75
|
}
|
|
76
76
|
try {
|
|
77
77
|
const { data: { results: builds }, } = await fetchProjectBuilds(derivedAccountId, projectConfig.name);
|
|
@@ -79,14 +79,14 @@ async function handler(args) {
|
|
|
79
79
|
const handleWatchTermination = (error) => {
|
|
80
80
|
if (error) {
|
|
81
81
|
logError(error, new ApiErrorContext({ accountId: derivedAccountId }));
|
|
82
|
-
|
|
82
|
+
return exit(EXIT_CODES.ERROR);
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
|
|
85
|
+
return exit(EXIT_CODES.SUCCESS);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
const startWatching = async () => {
|
|
89
|
-
await createWatcher(derivedAccountId, projectConfig, projectDir, handleBuildStatus, handleUserInput, handleWatchTermination);
|
|
89
|
+
await createWatcher(derivedAccountId, projectConfig, projectDir, handleBuildStatus, (accountId, projectName, buildId) => handleUserInput(accountId, projectName, buildId, exit), handleWatchTermination);
|
|
90
90
|
};
|
|
91
91
|
// Upload all files if no build exists for this project yet
|
|
92
92
|
if (initialUpload || hasNoBuilds) {
|
|
@@ -98,7 +98,7 @@ async function handler(args) {
|
|
|
98
98
|
isUploadCommand: false,
|
|
99
99
|
});
|
|
100
100
|
if (projectNotFound) {
|
|
101
|
-
|
|
101
|
+
return exit(EXIT_CODES.ERROR);
|
|
102
102
|
}
|
|
103
103
|
if (uploadError) {
|
|
104
104
|
if (isSpecifiedError(uploadError, {
|
|
@@ -114,7 +114,7 @@ async function handler(args) {
|
|
|
114
114
|
request: 'project upload',
|
|
115
115
|
}));
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
return exit(EXIT_CODES.ERROR);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
else {
|
|
@@ -123,7 +123,7 @@ async function handler(args) {
|
|
|
123
123
|
}
|
|
124
124
|
catch (e) {
|
|
125
125
|
logError(e, new ApiErrorContext({ accountId: derivedAccountId }));
|
|
126
|
-
|
|
126
|
+
return exit(EXIT_CODES.ERROR);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
function projectWatchBuilder(yargs) {
|
|
@@ -146,7 +146,7 @@ const builder = makeYargsBuilder(projectWatchBuilder, command, describe, {
|
|
|
146
146
|
const projectWatchCommand = {
|
|
147
147
|
command,
|
|
148
148
|
describe,
|
|
149
|
-
handler,
|
|
149
|
+
handler: makeYargsHandlerWithUsageTracking('project-watch', handler),
|
|
150
150
|
builder,
|
|
151
151
|
};
|
|
152
152
|
export default projectWatchCommand;
|
package/commands/project.js
CHANGED
|
@@ -17,6 +17,8 @@ import updateDeps from './project/updateDeps.js';
|
|
|
17
17
|
import profile from './project/profile.js';
|
|
18
18
|
import projectValidate from './project/validate.js';
|
|
19
19
|
import list from './project/list.js';
|
|
20
|
+
import info from './project/info.js';
|
|
21
|
+
import deleteProject from './project/delete.js';
|
|
20
22
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
21
23
|
import { getProjectConfig } from '../lib/projects/config.js';
|
|
22
24
|
import { isUnsupportedPlatformVersion, LATEST_SUPPORTED_PLATFORM_VERSION, } from '../lib/projects/platformVersion.js';
|
|
@@ -44,8 +46,10 @@ function projectBuilder(yargs) {
|
|
|
44
46
|
yargs
|
|
45
47
|
.command(create)
|
|
46
48
|
.command(add)
|
|
49
|
+
.command(deleteProject)
|
|
47
50
|
.command(watch)
|
|
48
51
|
.command(list)
|
|
52
|
+
.command(info)
|
|
49
53
|
.command(dev)
|
|
50
54
|
.command(upload)
|
|
51
55
|
.command(deploy)
|