@hubspot/cli 7.1.1 → 7.2.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/commands/create/api-sample.js +14 -4
- package/commands/customObject/create.d.ts +11 -0
- package/commands/customObject/create.js +37 -28
- package/commands/customObject/schema/create.d.ts +10 -0
- package/commands/customObject/schema/create.js +40 -42
- package/commands/customObject/schema/delete.d.ts +11 -0
- package/commands/customObject/schema/delete.js +34 -27
- package/commands/customObject/schema/fetch-all.d.ts +10 -0
- package/commands/customObject/schema/fetch-all.js +31 -24
- package/commands/customObject/schema/fetch.d.ts +11 -0
- package/commands/customObject/schema/fetch.js +34 -42
- package/commands/customObject/schema/list.d.ts +7 -0
- package/commands/customObject/schema/list.js +23 -14
- package/commands/customObject/schema/update.d.ts +11 -0
- package/commands/customObject/schema/update.js +44 -46
- package/commands/customObject/schema.d.ts +5 -1
- package/commands/customObject/schema.js +49 -11
- package/commands/customObject.d.ts +4 -1
- package/commands/customObject.js +54 -21
- package/commands/filemanager/fetch.d.ts +12 -0
- package/commands/filemanager/fetch.js +33 -30
- package/commands/filemanager/upload.d.ts +11 -0
- package/commands/filemanager/upload.js +53 -47
- package/commands/filemanager.d.ts +4 -1
- package/commands/filemanager.js +41 -7
- package/commands/hubdb/clear.d.ts +11 -0
- package/commands/hubdb/clear.js +33 -30
- package/commands/hubdb/create.d.ts +10 -0
- package/commands/hubdb/create.js +46 -40
- package/commands/hubdb/delete.d.ts +10 -0
- package/commands/hubdb/delete.js +38 -35
- package/commands/hubdb/fetch.d.ts +11 -0
- package/commands/hubdb/fetch.js +30 -27
- package/commands/hubdb.d.ts +4 -1
- package/commands/hubdb.js +45 -11
- package/commands/project/add.js +62 -16
- package/commands/project/cloneApp.js +3 -3
- package/commands/project/create.js +70 -15
- package/commands/project/dev/deprecatedFlow.d.ts +5 -0
- package/commands/project/dev/deprecatedFlow.js +137 -0
- package/commands/project/dev/index.d.ts +6 -0
- package/commands/project/dev/index.js +52 -0
- package/commands/project/dev/unifiedFlow.d.ts +5 -0
- package/commands/project/dev/unifiedFlow.js +112 -0
- package/commands/project/migrateApp.js +3 -3
- package/commands/project/upload.js +7 -2
- package/commands/sandbox/create.d.ts +12 -0
- package/commands/sandbox/create.js +90 -72
- package/commands/sandbox/delete.d.ts +11 -0
- package/commands/sandbox/delete.js +112 -95
- package/commands/sandbox.d.ts +4 -1
- package/commands/sandbox.js +44 -10
- package/commands/secret/addSecret.d.ts +10 -0
- package/commands/secret/addSecret.js +32 -31
- package/commands/secret/deleteSecret.d.ts +11 -0
- package/commands/secret/deleteSecret.js +31 -29
- package/commands/secret/listSecret.d.ts +9 -0
- package/commands/secret/listSecret.js +41 -0
- package/commands/secret/updateSecret.d.ts +10 -0
- package/commands/secret/updateSecret.js +33 -31
- package/commands/secret.d.ts +4 -1
- package/commands/secret.js +46 -12
- package/commands/theme/generate-selectors.d.ts +9 -0
- package/commands/theme/generate-selectors.js +61 -43
- package/commands/theme/marketplace-validate.d.ts +10 -0
- package/commands/theme/marketplace-validate.js +32 -26
- package/commands/theme/preview.d.ts +16 -0
- package/commands/theme/preview.js +104 -97
- package/commands/theme.d.ts +4 -1
- package/commands/theme.js +44 -10
- package/lang/en.lyaml +36 -16
- package/lib/DevServerManagerV2.d.ts +34 -0
- package/lib/DevServerManagerV2.js +85 -0
- package/lib/LocalDevManager.d.ts +2 -2
- package/lib/LocalDevManagerV2.d.ts +64 -0
- package/lib/LocalDevManagerV2.js +382 -0
- package/lib/buildAccount.d.ts +2 -3
- package/lib/constants.d.ts +12 -3
- package/lib/constants.js +13 -4
- package/lib/customObject.d.ts +3 -0
- package/lib/customObject.js +15 -0
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +6 -0
- package/lib/doctor/DiagnosticInfoBuilder.js +5 -0
- package/lib/doctor/Doctor.d.ts +1 -0
- package/lib/doctor/Doctor.js +10 -0
- package/lib/localDev.d.ts +3 -2
- package/lib/localDev.js +2 -2
- package/lib/marketplaceValidate.d.ts +2 -2
- package/lib/process.d.ts +1 -0
- package/lib/process.js +11 -10
- package/lib/projects/buildAndDeploy.js +4 -1
- package/lib/projects/create.d.ts +5 -0
- package/lib/projects/create.js +51 -0
- package/lib/projects/index.d.ts +1 -5
- package/lib/projects/index.js +1 -62
- package/lib/projects/structure.d.ts +4 -0
- package/lib/projects/structure.js +9 -0
- package/lib/projects/upload.d.ts +1 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/createProjectPrompt.d.ts +6 -8
- package/lib/prompts/createProjectPrompt.js +26 -54
- package/lib/prompts/projectAddPrompt.d.ts +3 -3
- package/lib/prompts/projectAddPrompt.js +16 -6
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +3 -2
- package/lib/prompts/sandboxesPrompt.d.ts +3 -2
- package/lib/prompts/sandboxesPrompt.js +1 -1
- package/lib/sandboxSync.js +6 -2
- package/lib/sandboxes.d.ts +2 -5
- package/lib/testUtils.d.ts +12 -0
- package/lib/testUtils.js +10 -0
- package/lib/ui/index.d.ts +2 -2
- package/lib/ui/index.js +1 -0
- package/lib/upload.d.ts +1 -1
- package/lib/upload.js +20 -20
- package/lib/validation.d.ts +1 -1
- package/package.json +6 -5
- package/types/ProjectComponents.d.ts +38 -0
- package/types/ProjectComponents.js +3 -0
- package/types/Projects.d.ts +1 -6
- package/types/Prompts.d.ts +7 -0
- package/types/Sandboxes.d.ts +2 -0
- package/types/Yargs.d.ts +15 -0
- package/commands/project/dev.d.ts +0 -1
- package/commands/project/dev.js +0 -146
- package/commands/secret/listSecrets.d.ts +0 -1
- package/commands/secret/listSecrets.js +0 -39
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-beta.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "3.3.
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.
|
|
8
|
+
"@hubspot/local-dev-lib": "3.3.2",
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.1.1",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.2",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
|
-
"@hubspot/ui-extensions-dev-server": "0.8.
|
|
12
|
+
"@hubspot/ui-extensions-dev-server": "0.8.48",
|
|
13
13
|
"archiver": "7.0.1",
|
|
14
14
|
"chalk": "4.1.2",
|
|
15
15
|
"chokidar": "3.6.0",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/archiver": "^6.0.3",
|
|
35
|
+
"@types/cli-progress": "^3.11.6",
|
|
35
36
|
"@types/express": "^5.0.0",
|
|
36
37
|
"@types/findup-sync": "^4.0.5",
|
|
37
38
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"lint": "eslint . && prettier --list-different ./**/*.{js,json}",
|
|
65
66
|
"list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
|
|
66
67
|
"prettier:write": "prettier --write ./**/*.{ts,js,json}",
|
|
67
|
-
"test": "jest",
|
|
68
|
+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
|
68
69
|
"test-cli": "yarn build && yarn --cwd 'acceptance-tests' test-ci",
|
|
69
70
|
"test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
|
|
70
71
|
"test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IntermediateRepresentationNodeLocalDev } from '@hubspot/project-parsing-lib/src/lib/types';
|
|
2
|
+
import { IR_COMPONENT_TYPES, APP_DISTRIBUTION_TYPES, APP_AUTH_TYPES } from '../lib/constants';
|
|
3
|
+
import { ValueOf } from '@hubspot/local-dev-lib/types/Utils';
|
|
4
|
+
type AppDistributionType = ValueOf<typeof APP_DISTRIBUTION_TYPES>;
|
|
5
|
+
type AppAuthType = ValueOf<typeof APP_AUTH_TYPES>;
|
|
6
|
+
type AppConfig = {
|
|
7
|
+
description: string;
|
|
8
|
+
name: string;
|
|
9
|
+
logo: string;
|
|
10
|
+
distribution: AppDistributionType;
|
|
11
|
+
auth: {
|
|
12
|
+
type: AppAuthType;
|
|
13
|
+
redirectUrls: string[];
|
|
14
|
+
requiredScopes: string[];
|
|
15
|
+
optionalScopes: string[];
|
|
16
|
+
conditionallyRequiredScopes: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type CardConfig = {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
previewImage: {
|
|
23
|
+
file: string;
|
|
24
|
+
altText: string;
|
|
25
|
+
};
|
|
26
|
+
entrypoint: string;
|
|
27
|
+
location: string;
|
|
28
|
+
objectTypes: string[];
|
|
29
|
+
};
|
|
30
|
+
export interface AppIRNode extends IntermediateRepresentationNodeLocalDev {
|
|
31
|
+
componentType: typeof IR_COMPONENT_TYPES.APPLICATION;
|
|
32
|
+
config: AppConfig;
|
|
33
|
+
}
|
|
34
|
+
export interface CardIRNode extends IntermediateRepresentationNodeLocalDev {
|
|
35
|
+
componentType: typeof IR_COMPONENT_TYPES.CARD;
|
|
36
|
+
config: CardConfig;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
package/types/Projects.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export type ProjectTemplate = {
|
|
|
7
7
|
insertPath: string;
|
|
8
8
|
};
|
|
9
9
|
export type ComponentTemplate = {
|
|
10
|
-
label: string;
|
|
11
10
|
path: string;
|
|
11
|
+
label: string;
|
|
12
12
|
insertPath: string;
|
|
13
13
|
};
|
|
14
14
|
export type ProjectConfig = {
|
|
@@ -32,11 +32,6 @@ export type ProjectPollStatusFunctionText = {
|
|
|
32
32
|
TYPE_KEY: string;
|
|
33
33
|
SUBTASK_NAME_KEY: string;
|
|
34
34
|
};
|
|
35
|
-
export type ProjectAddComponentData = {
|
|
36
|
-
path: string;
|
|
37
|
-
label: string;
|
|
38
|
-
insertPath: string;
|
|
39
|
-
};
|
|
40
35
|
export type ProjectTemplateRepoConfig = {
|
|
41
36
|
projects?: ProjectTemplate[];
|
|
42
37
|
components?: ComponentTemplate[];
|
package/types/Prompts.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeveloperTestAccount } from '@hubspot/local-dev-lib/types/developerTestAccounts';
|
|
1
2
|
export type GenericPromptResponse = {
|
|
2
3
|
[key: string]: any;
|
|
3
4
|
};
|
|
@@ -22,4 +23,10 @@ export type PromptConfig<T extends GenericPromptResponse> = {
|
|
|
22
23
|
mask?: string;
|
|
23
24
|
filter?: (input: string) => string;
|
|
24
25
|
};
|
|
26
|
+
export type ProjectDevTargetAccountPromptResponse = {
|
|
27
|
+
targetAccountId: number | null;
|
|
28
|
+
createNestedAccount: boolean;
|
|
29
|
+
parentAccountId?: number | null;
|
|
30
|
+
notInConfigAccount?: DeveloperTestAccount | null;
|
|
31
|
+
};
|
|
25
32
|
export {};
|
package/types/Sandboxes.d.ts
CHANGED
package/types/Yargs.d.ts
CHANGED
|
@@ -9,6 +9,21 @@ export type ConfigArgs = {
|
|
|
9
9
|
c?: string;
|
|
10
10
|
config?: string;
|
|
11
11
|
};
|
|
12
|
+
export type AccountArgs = {
|
|
13
|
+
a?: string;
|
|
14
|
+
account?: string;
|
|
15
|
+
};
|
|
16
|
+
export type EnvironmentArgs = {
|
|
17
|
+
'use-env'?: string;
|
|
18
|
+
};
|
|
19
|
+
export type OverwriteArgs = Options & {
|
|
20
|
+
o?: boolean;
|
|
21
|
+
overwrite?: boolean;
|
|
22
|
+
};
|
|
12
23
|
export type StringArgType = Options & {
|
|
13
24
|
type: 'string';
|
|
14
25
|
};
|
|
26
|
+
export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs;
|
|
27
|
+
export type TestingArgs = {
|
|
28
|
+
qa?: boolean;
|
|
29
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/commands/project/dev.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
const { addAccountOptions, addConfigOptions, addUseEnvironmentOptions, addTestingOptions, } = require('../../lib/commonOpts');
|
|
5
|
-
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
6
|
-
const { handleExit } = require('../../lib/process');
|
|
7
|
-
const { i18n } = require('../../lib/lang');
|
|
8
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
9
|
-
const { getConfigAccounts, getAccountConfig, getEnv, } = require('@hubspot/local-dev-lib/config');
|
|
10
|
-
const { getProjectConfig, ensureProjectExists, validateProjectConfig, } = require('../../lib/projects');
|
|
11
|
-
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
12
|
-
const { uiBetaTag, uiCommandReference, uiLink } = require('../../lib/ui');
|
|
13
|
-
const SpinniesManager = require('../../lib/ui/SpinniesManager');
|
|
14
|
-
const LocalDevManager = require('../../lib/LocalDevManager');
|
|
15
|
-
const { isSandbox, isDeveloperTestAccount, isStandardAccount, isAppDeveloperAccount, } = require('../../lib/accountTypes');
|
|
16
|
-
const { getValidEnv } = require('@hubspot/local-dev-lib/environment');
|
|
17
|
-
const { ComponentTypes } = require('../../types/Projects');
|
|
18
|
-
const { findProjectComponents, getProjectComponentTypes, } = require('../../lib/projects/structure');
|
|
19
|
-
const { confirmDefaultAccountIsTarget, suggestRecommendedNestedAccount, checkIfDefaultAccountIsSupported, createSandboxForLocalDev, createDeveloperTestAccountForLocalDev, createNewProjectForLocalDev, createInitialBuildForNewProject, useExistingDevTestAccount, checkIfAccountFlagIsSupported, checkIfParentAccountIsAuthed, } = require('../../lib/localDev');
|
|
20
|
-
const i18nKey = 'commands.project.subcommands.dev';
|
|
21
|
-
exports.command = 'dev';
|
|
22
|
-
exports.describe = uiBetaTag(i18n(`${i18nKey}.describe`), false);
|
|
23
|
-
exports.handler = async (options) => {
|
|
24
|
-
const { derivedAccountId, providedAccountId } = options;
|
|
25
|
-
const accountConfig = getAccountConfig(derivedAccountId);
|
|
26
|
-
const env = getValidEnv(getEnv(derivedAccountId));
|
|
27
|
-
trackCommandUsage('project-dev', null, derivedAccountId);
|
|
28
|
-
const { projectConfig, projectDir } = await getProjectConfig();
|
|
29
|
-
uiBetaTag(i18n(`${i18nKey}.logs.betaMessage`));
|
|
30
|
-
logger.log(uiLink(i18n(`${i18nKey}.logs.learnMoreLocalDevServer`), 'https://developers.hubspot.com/docs/platform/project-cli-commands#start-a-local-development-server'));
|
|
31
|
-
if (!projectConfig) {
|
|
32
|
-
logger.error(i18n(`${i18nKey}.errors.noProjectConfig`));
|
|
33
|
-
process.exit(EXIT_CODES.ERROR);
|
|
34
|
-
}
|
|
35
|
-
validateProjectConfig(projectConfig, projectDir);
|
|
36
|
-
const components = await findProjectComponents(projectDir);
|
|
37
|
-
const runnableComponents = components.filter(component => component.runnable);
|
|
38
|
-
const componentTypes = getProjectComponentTypes(runnableComponents);
|
|
39
|
-
const hasPrivateApps = !!componentTypes[ComponentTypes.PrivateApp];
|
|
40
|
-
const hasPublicApps = !!componentTypes[ComponentTypes.PublicApp];
|
|
41
|
-
if (runnableComponents.length === 0) {
|
|
42
|
-
logger.error(i18n(`${i18nKey}.errors.noRunnableComponents`, {
|
|
43
|
-
projectDir,
|
|
44
|
-
command: uiCommandReference('hs project add'),
|
|
45
|
-
}));
|
|
46
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
47
|
-
}
|
|
48
|
-
else if (hasPrivateApps && hasPublicApps) {
|
|
49
|
-
logger.error(i18n(`${i18nKey}.errors.invalidProjectComponents`));
|
|
50
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
51
|
-
}
|
|
52
|
-
const accounts = getConfigAccounts();
|
|
53
|
-
const defaultAccountIsRecommendedType = isDeveloperTestAccount(accountConfig) ||
|
|
54
|
-
(!hasPublicApps && isSandbox(accountConfig));
|
|
55
|
-
// targetProjectAccountId and targetTestingAccountId are set to null if --account flag is not provided.
|
|
56
|
-
// By setting them to null, we can later check if they need to be assigned based on the default account configuration and the type of app.
|
|
57
|
-
let targetProjectAccountId = providedAccountId ? derivedAccountId : null;
|
|
58
|
-
// The account that we are locally testing against
|
|
59
|
-
let targetTestingAccountId = providedAccountId ? derivedAccountId : null;
|
|
60
|
-
// Check that the default account or flag option is valid for the type of app in this project
|
|
61
|
-
if (providedAccountId) {
|
|
62
|
-
checkIfAccountFlagIsSupported(accountConfig, hasPublicApps);
|
|
63
|
-
if (hasPublicApps) {
|
|
64
|
-
targetProjectAccountId = accountConfig.parentAccountId;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
checkIfDefaultAccountIsSupported(accountConfig, hasPublicApps);
|
|
69
|
-
}
|
|
70
|
-
// The user is targeting an account type that we recommend developing on
|
|
71
|
-
if (!targetProjectAccountId && defaultAccountIsRecommendedType) {
|
|
72
|
-
targetTestingAccountId = derivedAccountId;
|
|
73
|
-
await confirmDefaultAccountIsTarget(accountConfig, hasPublicApps);
|
|
74
|
-
if (hasPublicApps) {
|
|
75
|
-
checkIfParentAccountIsAuthed(accountConfig);
|
|
76
|
-
targetProjectAccountId = accountConfig.parentAccountId;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
targetProjectAccountId = derivedAccountId;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
let createNewSandbox = false;
|
|
83
|
-
let createNewDeveloperTestAccount = false;
|
|
84
|
-
if (!targetProjectAccountId) {
|
|
85
|
-
const { targetAccountId, parentAccountId, createNestedAccount, notInConfigAccount, } = await suggestRecommendedNestedAccount(accounts, accountConfig, hasPublicApps);
|
|
86
|
-
targetProjectAccountId = hasPublicApps ? parentAccountId : targetAccountId;
|
|
87
|
-
targetTestingAccountId = targetAccountId;
|
|
88
|
-
// Only used for developer test accounts that are not yet in the config
|
|
89
|
-
if (notInConfigAccount) {
|
|
90
|
-
await useExistingDevTestAccount(env, notInConfigAccount);
|
|
91
|
-
}
|
|
92
|
-
createNewSandbox = isStandardAccount(accountConfig) && createNestedAccount;
|
|
93
|
-
createNewDeveloperTestAccount =
|
|
94
|
-
isAppDeveloperAccount(accountConfig) && createNestedAccount;
|
|
95
|
-
}
|
|
96
|
-
if (createNewSandbox) {
|
|
97
|
-
targetProjectAccountId = await createSandboxForLocalDev(derivedAccountId, accountConfig, env);
|
|
98
|
-
// We will be running our tests against this new sandbox account
|
|
99
|
-
targetTestingAccountId = targetProjectAccountId;
|
|
100
|
-
}
|
|
101
|
-
if (createNewDeveloperTestAccount) {
|
|
102
|
-
targetTestingAccountId = await createDeveloperTestAccountForLocalDev(derivedAccountId, accountConfig, env);
|
|
103
|
-
targetProjectAccountId = derivedAccountId;
|
|
104
|
-
}
|
|
105
|
-
// eslint-disable-next-line prefer-const
|
|
106
|
-
let { projectExists, project } = await ensureProjectExists(targetProjectAccountId, projectConfig.name, {
|
|
107
|
-
allowCreate: false,
|
|
108
|
-
noLogs: true,
|
|
109
|
-
withPolling: createNewSandbox,
|
|
110
|
-
});
|
|
111
|
-
let deployedBuild;
|
|
112
|
-
let isGithubLinked;
|
|
113
|
-
SpinniesManager.init();
|
|
114
|
-
if (projectExists) {
|
|
115
|
-
deployedBuild = project.deployedBuild;
|
|
116
|
-
isGithubLinked =
|
|
117
|
-
project.sourceIntegration &&
|
|
118
|
-
project.sourceIntegration.source === 'GITHUB';
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
project = await createNewProjectForLocalDev(projectConfig, targetProjectAccountId, createNewSandbox, hasPublicApps);
|
|
122
|
-
deployedBuild = await createInitialBuildForNewProject(projectConfig, projectDir, targetProjectAccountId);
|
|
123
|
-
}
|
|
124
|
-
const LocalDev = new LocalDevManager({
|
|
125
|
-
runnableComponents,
|
|
126
|
-
debug: options.debug,
|
|
127
|
-
deployedBuild,
|
|
128
|
-
isGithubLinked,
|
|
129
|
-
parentAccountId: targetProjectAccountId,
|
|
130
|
-
projectConfig,
|
|
131
|
-
projectDir,
|
|
132
|
-
projectId: project.id,
|
|
133
|
-
targetAccountId: targetTestingAccountId,
|
|
134
|
-
env,
|
|
135
|
-
});
|
|
136
|
-
await LocalDev.start();
|
|
137
|
-
handleExit(({ isSIGHUP }) => LocalDev.stop(!isSIGHUP));
|
|
138
|
-
};
|
|
139
|
-
exports.builder = yargs => {
|
|
140
|
-
addConfigOptions(yargs);
|
|
141
|
-
addAccountOptions(yargs);
|
|
142
|
-
addUseEnvironmentOptions(yargs);
|
|
143
|
-
addTestingOptions(yargs);
|
|
144
|
-
yargs.example([['$0 project dev', i18n(`${i18nKey}.examples.default`)]]);
|
|
145
|
-
return yargs;
|
|
146
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
5
|
-
const { logError, ApiErrorContext } = require('../../lib/errorHandlers/index');
|
|
6
|
-
const { fetchSecrets } = require('@hubspot/local-dev-lib/api/secrets');
|
|
7
|
-
const { trackCommandUsage } = require('../../lib/usageTracking');
|
|
8
|
-
const { uiAccountDescription } = require('../../lib/ui');
|
|
9
|
-
const { addConfigOptions, addAccountOptions, addUseEnvironmentOptions, } = require('../../lib/commonOpts');
|
|
10
|
-
const { i18n } = require('../../lib/lang');
|
|
11
|
-
const i18nKey = 'commands.secret.subcommands.list';
|
|
12
|
-
exports.command = 'list';
|
|
13
|
-
exports.describe = i18n(`${i18nKey}.describe`);
|
|
14
|
-
exports.handler = async (options) => {
|
|
15
|
-
const { derivedAccountId } = options;
|
|
16
|
-
trackCommandUsage('secrets-list', null, derivedAccountId);
|
|
17
|
-
try {
|
|
18
|
-
const { data: { results }, } = await fetchSecrets(derivedAccountId);
|
|
19
|
-
const groupLabel = i18n(`${i18nKey}.groupLabel`, {
|
|
20
|
-
accountIdentifier: uiAccountDescription(derivedAccountId),
|
|
21
|
-
});
|
|
22
|
-
logger.group(groupLabel);
|
|
23
|
-
results.forEach(secret => logger.log(secret));
|
|
24
|
-
logger.groupEnd(groupLabel);
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
logger.error(i18n(`${i18nKey}.errors.list`));
|
|
28
|
-
logError(err, new ApiErrorContext({
|
|
29
|
-
request: 'add secret',
|
|
30
|
-
accountId: derivedAccountId,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.builder = yargs => {
|
|
35
|
-
addConfigOptions(yargs);
|
|
36
|
-
addAccountOptions(yargs);
|
|
37
|
-
addUseEnvironmentOptions(yargs);
|
|
38
|
-
return yargs;
|
|
39
|
-
};
|