@hubspot/cli 5.2.1-beta.10 → 5.2.1-beta.12
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/functions/deploy.js +2 -2
- package/commands/project/__tests__/deploy.test.js +431 -0
- package/commands/project/cloneApp.js +161 -0
- package/commands/project/deploy.js +75 -21
- package/commands/project/listBuilds.js +1 -1
- package/commands/project/logs.js +1 -1
- package/commands/project/migrateApp.js +47 -27
- package/commands/project.js +2 -0
- package/commands/sandbox/create.js +6 -2
- package/commands/sandbox/delete.js +5 -2
- package/commands/sandbox/sync.js +2 -2
- package/commands/sandbox.js +2 -1
- package/lang/en.lyaml +36 -11
- package/lib/LocalDevManager.js +7 -3
- package/lib/constants.js +2 -1
- package/lib/polling.js +16 -11
- package/lib/projects.js +3 -3
- package/lib/prompts/buildIdPrompt.js +7 -16
- package/lib/prompts/cloneAppLocationPrompt.js +32 -0
- package/lib/prompts/installPublicAppPrompt.js +13 -4
- package/lib/prompts/selectPublicAppPrompt.js +34 -10
- package/lib/serverlessLogs.js +2 -2
- package/package.json +5 -4
|
@@ -12,20 +12,29 @@ const installPublicAppPrompt = async (
|
|
|
12
12
|
targetAccountId,
|
|
13
13
|
clientId,
|
|
14
14
|
scopes,
|
|
15
|
-
redirectUrls
|
|
15
|
+
redirectUrls,
|
|
16
|
+
isReinstall = false
|
|
16
17
|
) => {
|
|
17
18
|
logger.log('');
|
|
18
|
-
|
|
19
|
+
if (isReinstall) {
|
|
20
|
+
logger.log(i18n(`${i18nKey}.reinstallExplanation`));
|
|
21
|
+
} else {
|
|
22
|
+
logger.log(i18n(`${i18nKey}.explanation`));
|
|
23
|
+
}
|
|
19
24
|
|
|
20
25
|
const { shouldOpenBrowser } = await promptUser({
|
|
21
26
|
name: 'shouldOpenBrowser',
|
|
22
27
|
type: 'confirm',
|
|
23
|
-
message: i18n(
|
|
28
|
+
message: i18n(
|
|
29
|
+
isReinstall ? `${i18nKey}.reinstallPrompt` : `${i18nKey}.prompt`
|
|
30
|
+
),
|
|
24
31
|
});
|
|
25
32
|
|
|
26
|
-
if (!shouldOpenBrowser) {
|
|
33
|
+
if (!isReinstall && !shouldOpenBrowser) {
|
|
27
34
|
logger.log(i18n(`${i18nKey}.decline`));
|
|
28
35
|
process.exit(EXIT_CODES.SUCCESS);
|
|
36
|
+
} else if (!shouldOpenBrowser) {
|
|
37
|
+
return;
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
const websiteOrigin = getHubSpotWebsiteOrigin(env);
|
|
@@ -10,17 +10,35 @@ const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
|
10
10
|
|
|
11
11
|
const i18nKey = 'lib.prompts.selectPublicAppPrompt';
|
|
12
12
|
|
|
13
|
-
const fetchPublicAppOptions = async (
|
|
13
|
+
const fetchPublicAppOptions = async (
|
|
14
|
+
accountId,
|
|
15
|
+
accountName,
|
|
16
|
+
isMigratingApp = false
|
|
17
|
+
) => {
|
|
14
18
|
try {
|
|
15
19
|
const publicApps = await fetchPublicAppsForPortal(accountId);
|
|
16
20
|
const filteredPublicApps = publicApps.filter(
|
|
17
21
|
app => !app.projectId && !app.sourceId
|
|
18
22
|
);
|
|
19
23
|
|
|
20
|
-
if (
|
|
24
|
+
if (
|
|
25
|
+
!filteredPublicApps.length ||
|
|
26
|
+
(isMigratingApp &&
|
|
27
|
+
!filteredPublicApps.some(
|
|
28
|
+
app => !app.preventProjectMigrations || !app.listingInfo
|
|
29
|
+
))
|
|
30
|
+
) {
|
|
31
|
+
const headerTranslationKey = isMigratingApp
|
|
32
|
+
? 'noAppsMigration'
|
|
33
|
+
: 'noAppsClone';
|
|
34
|
+
const messageTranslationKey = isMigratingApp
|
|
35
|
+
? 'noAppsMigrationMessage'
|
|
36
|
+
: 'noAppsCloneMessage';
|
|
21
37
|
uiLine();
|
|
22
|
-
logger.error(i18n(`${i18nKey}.errors
|
|
23
|
-
logger.log(
|
|
38
|
+
logger.error(i18n(`${i18nKey}.errors.${headerTranslationKey}`));
|
|
39
|
+
logger.log(
|
|
40
|
+
i18n(`${i18nKey}.errors.${messageTranslationKey}`, { accountName })
|
|
41
|
+
);
|
|
24
42
|
uiLine();
|
|
25
43
|
process.exit(EXIT_CODES.SUCCESS);
|
|
26
44
|
}
|
|
@@ -35,10 +53,16 @@ const fetchPublicAppOptions = async (accountId, accountName) => {
|
|
|
35
53
|
const selectPublicAppPrompt = async ({
|
|
36
54
|
accountId,
|
|
37
55
|
accountName,
|
|
38
|
-
|
|
56
|
+
isMigratingApp = false,
|
|
39
57
|
}) => {
|
|
40
|
-
const publicApps = await fetchPublicAppOptions(
|
|
41
|
-
|
|
58
|
+
const publicApps = await fetchPublicAppOptions(
|
|
59
|
+
accountId,
|
|
60
|
+
accountName,
|
|
61
|
+
isMigratingApp
|
|
62
|
+
);
|
|
63
|
+
const translationKey = isMigratingApp
|
|
64
|
+
? 'selectAppIdMigrate'
|
|
65
|
+
: 'selectAppIdClone';
|
|
42
66
|
|
|
43
67
|
return promptUser([
|
|
44
68
|
{
|
|
@@ -48,10 +72,11 @@ const selectPublicAppPrompt = async ({
|
|
|
48
72
|
}),
|
|
49
73
|
type: 'list',
|
|
50
74
|
choices: publicApps.map(app => {
|
|
51
|
-
|
|
75
|
+
const { preventProjectMigrations, listingInfo } = app;
|
|
76
|
+
if (isMigratingApp && preventProjectMigrations && listingInfo) {
|
|
52
77
|
return {
|
|
53
78
|
name: `${app.name} (${app.id})`,
|
|
54
|
-
disabled: i18n(`${i18nKey}.errors.
|
|
79
|
+
disabled: i18n(`${i18nKey}.errors.cannotBeMigrated`),
|
|
55
80
|
};
|
|
56
81
|
}
|
|
57
82
|
return {
|
|
@@ -64,6 +89,5 @@ const selectPublicAppPrompt = async ({
|
|
|
64
89
|
};
|
|
65
90
|
|
|
66
91
|
module.exports = {
|
|
67
|
-
fetchPublicAppOptions,
|
|
68
92
|
selectPublicAppPrompt,
|
|
69
93
|
};
|
package/lib/serverlessLogs.js
CHANGED
|
@@ -52,7 +52,7 @@ const tailLogs = async ({
|
|
|
52
52
|
initialAfter = latestLog && base64EncodeString(latestLog.id);
|
|
53
53
|
} catch (e) {
|
|
54
54
|
// A 404 means no latest log exists(never executed)
|
|
55
|
-
if (e.
|
|
55
|
+
if (e.response && e.response.status !== 404) {
|
|
56
56
|
await logServerlessFunctionApiErrorInstance(
|
|
57
57
|
accountId,
|
|
58
58
|
e,
|
|
@@ -68,7 +68,7 @@ const tailLogs = async ({
|
|
|
68
68
|
latestLog = await tailCall(after);
|
|
69
69
|
nextAfter = latestLog.paging.next.after;
|
|
70
70
|
} catch (e) {
|
|
71
|
-
if (e.
|
|
71
|
+
if (e.response && e.response.status !== 404) {
|
|
72
72
|
logApiErrorInstance(
|
|
73
73
|
e,
|
|
74
74
|
new ApiErrorContext({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "5.2.1-beta.
|
|
3
|
+
"version": "5.2.1-beta.12",
|
|
4
4
|
"description": "CLI for working with HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"url": "https://github.com/HubSpot/hubspot-cms-tools"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@hubspot/local-dev-lib": "1.
|
|
12
|
-
"@hubspot/serverless-dev-runtime": "5.2.1-beta.
|
|
11
|
+
"@hubspot/local-dev-lib": "1.9.0",
|
|
12
|
+
"@hubspot/serverless-dev-runtime": "5.2.1-beta.11",
|
|
13
13
|
"@hubspot/theme-preview-dev-server": "0.0.7",
|
|
14
14
|
"@hubspot/ui-extensions-dev-server": "0.8.20",
|
|
15
15
|
"archiver": "^5.3.0",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"yargs": "15.4.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
+
"axios": "^1.7.2",
|
|
36
37
|
"mock-stdin": "^1.0.0"
|
|
37
38
|
},
|
|
38
39
|
"engines": {
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "24f25e7728f70ea9628e268a08f6d26916c94e40"
|
|
49
50
|
}
|