@hubspot/local-dev-lib 5.3.2-beta.0 → 5.3.3-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/config/state.js CHANGED
@@ -7,6 +7,7 @@ import { STATE_FLAGS } from '../constants/config.js';
7
7
  const i18nKey = 'config.state';
8
8
  const DEFAULT_STATE = {
9
9
  [STATE_FLAGS.MCP_TOTAL_TOOL_CALLS]: 0,
10
+ [STATE_FLAGS.USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION]: undefined,
10
11
  };
11
12
  function ensureCLIDirectory() {
12
13
  try {
@@ -21,19 +22,16 @@ function ensureCLIDirectory() {
21
22
  }));
22
23
  }
23
24
  }
24
- function sanitizeAndMerge(parsed) {
25
+ function parseState(parsed) {
25
26
  if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
26
27
  return structuredClone(DEFAULT_STATE);
27
28
  }
28
- const state = parsed;
29
+ const record = parsed;
29
30
  const result = structuredClone(DEFAULT_STATE);
30
- for (const key in DEFAULT_STATE) {
31
- const typedKey = key;
32
- if (key in state &&
33
- typeof state[typedKey] === typeof DEFAULT_STATE[typedKey]) {
34
- result[typedKey] = state[typedKey];
31
+ for (const key of Object.keys(DEFAULT_STATE)) {
32
+ if (key in record && record[key] !== undefined) {
33
+ Object.assign(result, { [key]: record[key] });
35
34
  }
36
- // keys not in parsed file remain as DEFAULT values
37
35
  }
38
36
  return result;
39
37
  }
@@ -48,7 +46,7 @@ function getCurrentState() {
48
46
  return structuredClone(DEFAULT_STATE);
49
47
  }
50
48
  const parsed = JSON.parse(data);
51
- return sanitizeAndMerge(parsed);
49
+ return parseState(parsed);
52
50
  }
53
51
  catch (error) {
54
52
  logger.debug(i18n(`${i18nKey}.getCurrentState.errors.errorReading`, {
@@ -56,6 +56,7 @@ export declare const HUBSPOT_ACCOUNT_TYPE_STRINGS: {
56
56
  };
57
57
  export declare const STATE_FLAGS: {
58
58
  readonly MCP_TOTAL_TOOL_CALLS: "mcpTotalToolCalls";
59
+ readonly USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION: "usageTrackingMessageLastShowVersion";
59
60
  };
60
61
  export declare const CONFIG_FLAGS: {
61
62
  readonly DEFAULT_CMS_PUBLISH_MODE: "defaultCmsPublishMode";
@@ -59,6 +59,7 @@ export const HUBSPOT_ACCOUNT_TYPE_STRINGS = {
59
59
  };
60
60
  export const STATE_FLAGS = {
61
61
  MCP_TOTAL_TOOL_CALLS: 'mcpTotalToolCalls',
62
+ USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION: 'usageTrackingMessageLastShowVersion',
62
63
  };
63
64
  export const CONFIG_FLAGS = {
64
65
  DEFAULT_CMS_PUBLISH_MODE: 'defaultCmsPublishMode',
package/lib/logger.d.ts CHANGED
@@ -14,6 +14,7 @@ interface LogLabels {
14
14
  debug: string;
15
15
  }
16
16
  export declare function getLabels(): LogLabels;
17
+ export declare function getSymbols(): LogLabels;
17
18
  /**
18
19
  * Chalk styles for logger strings.
19
20
  */
package/lib/logger.js CHANGED
@@ -13,7 +13,14 @@ const UNICODE_LABELS = {
13
13
  warning: '⚠ WARNING',
14
14
  error: '✖ ERROR',
15
15
  info: 'ℹ INFO',
16
- debug: 'DEBUG',
16
+ debug: 'DEBUG',
17
+ };
18
+ const UNICODE_SYMBOLS = {
19
+ success: '✔',
20
+ warning: '⚠',
21
+ error: '✖',
22
+ info: 'ℹ',
23
+ debug: '⚙',
17
24
  };
18
25
  const ASCII_LABELS = {
19
26
  success: '[SUCCESS]',
@@ -25,14 +32,17 @@ const ASCII_LABELS = {
25
32
  export function getLabels() {
26
33
  return isUnicodeSupported() ? UNICODE_LABELS : ASCII_LABELS;
27
34
  }
35
+ export function getSymbols() {
36
+ return isUnicodeSupported() ? UNICODE_SYMBOLS : ASCII_LABELS;
37
+ }
28
38
  /**
29
39
  * Chalk styles for logger strings.
30
40
  */
31
41
  export const Styles = {
32
- debug: chalk.reset.blue,
42
+ debug: chalk.reset.grey,
33
43
  log: chalk.reset.white,
34
44
  success: chalk.reset.green,
35
- info: chalk.reset.white,
45
+ info: chalk.reset.blue,
36
46
  warn: chalk.reset.yellow,
37
47
  error: chalk.reset.red,
38
48
  };
@@ -66,7 +76,7 @@ export class Logger {
66
76
  }
67
77
  debug(...args) {
68
78
  const labels = getLabels();
69
- console.debug(...stylize(labels.debug, Styles.log, args));
79
+ console.debug(...stylize(labels.debug, Styles.debug, args));
70
80
  }
71
81
  group(...args) {
72
82
  console.group(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "5.3.2-beta.0",
3
+ "version": "5.3.3-beta.0",
4
4
  "type": "module",
5
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
6
6
  "files": [
package/types/Config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CONFIG_FLAGS, HUBSPOT_CONFIG_ERROR_TYPES, HUBSPOT_CONFIG_OPERATIONS } from '../constants/config.js';
1
+ import { CONFIG_FLAGS, HUBSPOT_CONFIG_ERROR_TYPES, HUBSPOT_CONFIG_OPERATIONS, STATE_FLAGS } from '../constants/config.js';
2
2
  import { DeprecatedHubSpotConfigAccountFields, Environment, HubSpotConfigAccount } from './Accounts.js';
3
3
  import { CmsPublishMode } from './Files.js';
4
4
  import { ValueOf } from './Utils.js';
@@ -28,7 +28,8 @@ export type GitInclusionResult = {
28
28
  };
29
29
  export type ConfigFlag = ValueOf<typeof CONFIG_FLAGS>;
30
30
  export type HubSpotState = {
31
- mcpTotalToolCalls: number;
31
+ [STATE_FLAGS.MCP_TOTAL_TOOL_CALLS]: number;
32
+ [STATE_FLAGS.USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION]?: string;
32
33
  };
33
34
  export type HubSpotConfigErrorType = ValueOf<typeof HUBSPOT_CONFIG_ERROR_TYPES>;
34
35
  export type HubSpotConfigOperation = ValueOf<typeof HUBSPOT_CONFIG_OPERATIONS>;
package/types/Config.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import { STATE_FLAGS, } from '../constants/config.js';