@hubspot/local-dev-lib 0.7.6-experimental.1 → 0.7.6-experimental.3

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.
@@ -106,3 +106,7 @@ export declare const HS_FOLDER = ".hs";
106
106
  export declare const HS_SETTINGS_FILENAME = "settings.json";
107
107
  export declare const HS_README_FILENAME = "README.txt";
108
108
  export declare const DEFAULT_HS_SETTINGS_PATH = ".hs/settings.json";
109
+ export declare const EMPTY_HS_SETTINGS_FILE: {
110
+ localDefaultAccount: undefined;
111
+ accounts: never[];
112
+ };
@@ -109,3 +109,7 @@ export const HS_FOLDER = '.hs';
109
109
  export const HS_SETTINGS_FILENAME = 'settings.json';
110
110
  export const HS_README_FILENAME = 'README.txt';
111
111
  export const DEFAULT_HS_SETTINGS_PATH = `${HS_FOLDER}/${HS_SETTINGS_FILENAME}`;
112
+ export const EMPTY_HS_SETTINGS_FILE = {
113
+ localDefaultAccount: undefined,
114
+ accounts: [],
115
+ };
package/enums/build.d.ts CHANGED
@@ -26,6 +26,7 @@ export declare const COMPONENT_TYPES: {
26
26
  };
27
27
  export declare const SUBCOMPONENT_TYPES: {
28
28
  readonly APP_ID: "APP_ID";
29
+ readonly PUBLIC_APP_ID: "PUBLIC_APP_ID";
29
30
  readonly PACKAGE_LOCK_FILE: "PACKAGE_LOCK_FILE";
30
31
  readonly CRM_CARD_V2: "CRM_CARD_V2";
31
32
  readonly CARD_V2: "CARD_V2";
@@ -35,4 +36,5 @@ export declare const SUBCOMPONENT_TYPES: {
35
36
  readonly APP_FUNCTION: "APP_FUNCTION";
36
37
  readonly AUTOMATION_ACTION: "AUTOMATION_ACTION";
37
38
  readonly REACT_EXTENSION: "REACT_EXTENSION";
39
+ readonly WEBHOOKS: "WEBHOOKS";
38
40
  };
package/enums/build.js CHANGED
@@ -26,6 +26,7 @@ export const COMPONENT_TYPES = {
26
26
  };
27
27
  export const SUBCOMPONENT_TYPES = {
28
28
  APP_ID: 'APP_ID',
29
+ PUBLIC_APP_ID: 'PUBLIC_APP_ID',
29
30
  PACKAGE_LOCK_FILE: 'PACKAGE_LOCK_FILE',
30
31
  CRM_CARD_V2: 'CRM_CARD_V2',
31
32
  CARD_V2: 'CARD_V2',
@@ -35,4 +36,5 @@ export const SUBCOMPONENT_TYPES = {
35
36
  APP_FUNCTION: 'APP_FUNCTION',
36
37
  AUTOMATION_ACTION: 'AUTOMATION_ACTION',
37
38
  REACT_EXTENSION: 'REACT_EXTENSION',
39
+ WEBHOOKS: 'WEBHOOKS',
38
40
  };
@@ -0,0 +1 @@
1
+ export declare function isUnicodeSupported(): boolean;
@@ -0,0 +1,14 @@
1
+ // Adapted from https://github.com/sindresorhus/is-unicode-supported (MIT)
2
+ export function isUnicodeSupported() {
3
+ if (process.platform !== 'win32') {
4
+ return process.env.TERM !== 'linux';
5
+ }
6
+ return (Boolean(process.env.WT_SESSION) ||
7
+ Boolean(process.env.TERMINUS_SUBLIME) ||
8
+ process.env.ConEmuTask === '{cmd::Cmder}' ||
9
+ process.env.TERM_PROGRAM === 'Terminus-Sublime' ||
10
+ process.env.TERM_PROGRAM === 'vscode' ||
11
+ process.env.TERM === 'xterm-256color' ||
12
+ process.env.TERM === 'alacritty' ||
13
+ process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm');
14
+ }
package/lib/logger.d.ts CHANGED
@@ -6,6 +6,14 @@ export declare const LOG_LEVEL: {
6
6
  WARN: number;
7
7
  ERROR: number;
8
8
  };
9
+ interface LogLabels {
10
+ success: string;
11
+ warning: string;
12
+ error: string;
13
+ info: string;
14
+ debug: string;
15
+ }
16
+ export declare function getLabels(): LogLabels;
9
17
  /**
10
18
  * Chalk styles for logger strings.
11
19
  */
@@ -42,3 +50,4 @@ export declare const logger: {
42
50
  group(...args: any[]): void;
43
51
  groupEnd(): void;
44
52
  };
53
+ export {};
package/lib/logger.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import chalk from 'chalk';
3
+ import { isUnicodeSupported } from './isUnicodeSupported.js';
3
4
  export const LOG_LEVEL = {
4
5
  NONE: 0,
5
6
  DEBUG: 1,
@@ -7,6 +8,23 @@ export const LOG_LEVEL = {
7
8
  WARN: 4,
8
9
  ERROR: 8,
9
10
  };
11
+ const UNICODE_LABELS = {
12
+ success: '✔ SUCCESS',
13
+ warning: '⚠ WARNING',
14
+ error: '✖ ERROR',
15
+ info: 'ℹ INFO',
16
+ debug: 'DEBUG',
17
+ };
18
+ const ASCII_LABELS = {
19
+ success: '[SUCCESS]',
20
+ warning: '[WARNING]',
21
+ error: '[ERROR]',
22
+ info: '[INFO]',
23
+ debug: '[DEBUG]',
24
+ };
25
+ export function getLabels() {
26
+ return isUnicodeSupported() ? UNICODE_LABELS : ASCII_LABELS;
27
+ }
10
28
  /**
11
29
  * Chalk styles for logger strings.
12
30
  */
@@ -28,22 +46,27 @@ export function stylize(label, style, args) {
28
46
  }
29
47
  export class Logger {
30
48
  error(...args) {
31
- console.error(...stylize('[ERROR]', Styles.error, args));
49
+ const labels = getLabels();
50
+ console.error(...stylize(labels.error, Styles.error, args));
32
51
  }
33
52
  warn(...args) {
34
- console.warn(...stylize('[WARNING]', Styles.warn, args));
53
+ const labels = getLabels();
54
+ console.warn(...stylize(labels.warning, Styles.warn, args));
35
55
  }
36
56
  log(...args) {
37
57
  console.log(...args);
38
58
  }
39
59
  success(...args) {
40
- console.log(...stylize('[SUCCESS]', Styles.success, args));
60
+ const labels = getLabels();
61
+ console.log(...stylize(labels.success, Styles.success, args));
41
62
  }
42
63
  info(...args) {
43
- console.info(...stylize('[INFO]', Styles.info, args));
64
+ const labels = getLabels();
65
+ console.info(...stylize(labels.info, Styles.info, args));
44
66
  }
45
67
  debug(...args) {
46
- console.debug(...stylize('[DEBUG]', Styles.log, args));
68
+ const labels = getLabels();
69
+ console.debug(...stylize(labels.debug, Styles.log, args));
47
70
  }
48
71
  group(...args) {
49
72
  console.group(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "0.7.6-experimental.1",
3
+ "version": "0.7.6-experimental.3",
4
4
  "type": "module",
5
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
6
6
  "files": [