@hubspot/cli 4.0.2-beta.5 → 4.0.2-beta.6

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.
@@ -15,7 +15,7 @@ const { loadAndValidateOptions } = require('../../lib/validation');
15
15
  const { getProjectConfig, pollDeployStatus } = require('../../lib/projects');
16
16
  const { projectNamePrompt } = require('../../lib/prompts/projectNamePrompt');
17
17
  const { i18n } = require('@hubspot/cli-lib/lib/lang');
18
- // const { getAccountConfig } = require('@hubspot/cli-lib');
18
+ const { getAccountConfig } = require('@hubspot/cli-lib');
19
19
 
20
20
  const i18nKey = 'cli.commands.project.subcommands.deploy';
21
21
  const { EXIT_CODES } = require('../../lib/enums/exitCodes');
@@ -27,11 +27,11 @@ exports.handler = async options => {
27
27
  await loadAndValidateOptions(options);
28
28
 
29
29
  const accountId = getAccountId(options);
30
- // const accountConfig = getAccountConfig(accountId);
30
+ const accountConfig = getAccountConfig(accountId);
31
31
  const { project, buildId } = options;
32
- // const sandboxType = accountConfig && accountConfig.sandboxAccountType;
32
+ const sandboxType = accountConfig && accountConfig.sandboxAccountType;
33
33
 
34
- trackCommandUsage('project-deploy', null, accountId);
34
+ trackCommandUsage('project-deploy', { type: sandboxType }, accountId);
35
35
 
36
36
  const { projectConfig } = await getProjectConfig();
37
37
 
@@ -19,7 +19,7 @@ const {
19
19
  validateProjectConfig,
20
20
  } = require('../../lib/projects');
21
21
  const { i18n } = require('@hubspot/cli-lib/lib/lang');
22
- // const { getAccountConfig } = require('@hubspot/cli-lib');
22
+ const { getAccountConfig } = require('@hubspot/cli-lib');
23
23
  const { EXIT_CODES } = require('../../lib/enums/exitCodes');
24
24
 
25
25
  const i18nKey = 'cli.commands.project.subcommands.upload';
@@ -32,10 +32,10 @@ exports.handler = async options => {
32
32
 
33
33
  const { forceCreate, path: projectPath } = options;
34
34
  const accountId = getAccountId(options);
35
- // const accountConfig = getAccountConfig(accountId);
36
- // const sandboxType = accountConfig && accountConfig.sandboxAccountType;
35
+ const accountConfig = getAccountConfig(accountId);
36
+ const sandboxType = accountConfig && accountConfig.sandboxAccountType;
37
37
 
38
- trackCommandUsage('project-upload', null, accountId);
38
+ trackCommandUsage('project-upload', { type: sandboxType }, accountId);
39
39
 
40
40
  const { projectConfig, projectDir } = await getProjectConfig(projectPath);
41
41
 
@@ -151,6 +151,8 @@ exports.handler = async options => {
151
151
  } catch (err) {
152
152
  debugErrorAndContext(err);
153
153
 
154
+ trackCommandUsage('sandbox-create', { successful: false }, accountId);
155
+
154
156
  spinnies.fail('sandboxCreate', {
155
157
  text: i18n(`${i18nKey}.loading.fail`, {
156
158
  sandboxName,
@@ -126,6 +126,12 @@ exports.handler = async options => {
126
126
  } catch (err) {
127
127
  debugErrorAndContext(err);
128
128
 
129
+ trackCommandUsage(
130
+ 'sandbox-delete',
131
+ { successful: false },
132
+ sandboxAccountId
133
+ );
134
+
129
135
  if (
130
136
  err.error &&
131
137
  err.error.category === OBJECT_NOT_FOUND &&
@@ -78,13 +78,16 @@ exports.handler = async options => {
78
78
  logger.error(i18n(`${i18nKey}.errors.destinationRequired`));
79
79
  return;
80
80
  }
81
- // The theme.json file must always be at the root of the project - so we look for that and determine the root path based on it.
82
- const projectRoot = path.dirname(getThemeJSONPath(absoluteSrcPath));
83
- const processFieldsJs = isProcessableFieldsJs(
84
- projectRoot,
85
- absoluteSrcPath,
86
- options.processFieldsJs
87
- );
81
+ // Check for theme.json file and determine the root path for the project based on it if it exists
82
+ const themeJsonPath = getThemeJSONPath(absoluteSrcPath);
83
+ const projectRoot = themeJsonPath && path.dirname(themeJsonPath);
84
+ const processFieldsJs =
85
+ projectRoot &&
86
+ isProcessableFieldsJs(
87
+ projectRoot,
88
+ absoluteSrcPath,
89
+ options.processFieldsJs
90
+ );
88
91
  let fieldsJs;
89
92
  if (processFieldsJs) {
90
93
  fieldsJs = await new FieldsJs(
package/lib/projects.js CHANGED
@@ -387,7 +387,7 @@ const makePollTaskStatusFunc = ({
387
387
  const subTaskName = subTask[statusText.SUBTASK_NAME_KEY];
388
388
 
389
389
  spinnies.add(subTaskName, {
390
- text: `${chalk.bold(subTaskName)} #${displayId} ${
390
+ text: `${chalk.bold(subTaskName)} ${
391
391
  statusText.STATUS_TEXT[statusText.STATES.ENQUEUED]
392
392
  }\n`,
393
393
  indent: 2,
@@ -410,7 +410,7 @@ const makePollTaskStatusFunc = ({
410
410
  return;
411
411
  }
412
412
 
413
- const updatedText = `${chalk.bold(subTaskName)} #${displayId} ${
413
+ const updatedText = `${chalk.bold(subTaskName)} ${
414
414
  statusText.STATUS_TEXT[subTask.status]
415
415
  }\n`;
416
416
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "4.0.2-beta.5",
3
+ "version": "4.0.2-beta.6",
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/cli-lib": "4.0.2-beta.5",
12
- "@hubspot/serverless-dev-runtime": "4.0.2-beta.5",
11
+ "@hubspot/cli-lib": "4.0.2-beta.6",
12
+ "@hubspot/serverless-dev-runtime": "4.0.2-beta.6",
13
13
  "archiver": "^5.3.0",
14
14
  "chalk": "^4.1.2",
15
15
  "express": "^4.17.1",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "3c4cd0095cfd6b115da0c91def008240386b52a5"
40
+ "gitHead": "e738be958be36d5ec5aa4957483cd096bef13ef0"
41
41
  }