@hubspot/cli 7.8.10-experimental.0 → 7.8.11-experimental.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.
@@ -8,7 +8,7 @@ const command = ['custom-object', 'custom-objects', 'co'];
8
8
  const describe = uiBetaTag(i18n(`commands.customObject.describe`), false);
9
9
  function logBetaMessage() {
10
10
  uiBetaTag(i18n(`commands.customObject.betaMessage`));
11
- logger.log(uiLink(i18n(`commands.customObject.seeMoreLink`), 'https://developers.hubspot.com/docs/api/crm/crm-custom-objects'));
11
+ logger.log(uiLink(i18n(`commands.customObject.seeMoreLink`), 'https://developers.hubspot.com/docs/api-reference/crm-custom-objects-v3/guide#custom-objects-api-guide'));
12
12
  logger.log();
13
13
  }
14
14
  function customObjectBuilder(yargs) {
@@ -8,8 +8,8 @@ import { uiCommandReference } from '../../lib/ui/index.js';
8
8
  import { commands, lib } from '../../lang/en.js';
9
9
  import { uiLogger } from '../../lib/ui/logger.js';
10
10
  import { logInBox } from '../../lib/ui/boxen.js';
11
- import { renderInline } from '../../ui/index.js';
12
- import { getWarningBox } from '../../ui/components/StatusMessageBoxes.js';
11
+ // import { renderInline } from '../../ui/index.js';
12
+ // import { getWarningBox } from '../../ui/components/StatusMessageBoxes.js';
13
13
  import { getHasMigratableThemes, migrateThemes2025_2, } from '../../lib/theme/migrate.js';
14
14
  import { hasFeature } from '../../lib/hasFeature.js';
15
15
  import { FEATURES } from '../../lib/constants.js';
@@ -24,18 +24,20 @@ async function handler(args) {
24
24
  return process.exit(EXIT_CODES.ERROR);
25
25
  }
26
26
  if (projectConfig?.projectConfig) {
27
- if (!process.env.HUBSPOT_ENABLE_INK) {
28
- await logInBox({
29
- contents: lib.migrate.projectMigrationWarning,
30
- options: { title: lib.migrate.projectMigrationWarningTitle },
31
- });
32
- }
33
- else {
34
- await renderInline(getWarningBox({
35
- title: lib.migrate.projectMigrationWarningTitle,
36
- message: lib.migrate.projectMigrationWarning,
37
- }));
38
- }
27
+ // TODO: Restore ink
28
+ // if (!process.env.HUBSPOT_ENABLE_INK) {
29
+ await logInBox({
30
+ contents: lib.migrate.projectMigrationWarning,
31
+ options: { title: lib.migrate.projectMigrationWarningTitle },
32
+ });
33
+ // } else {
34
+ // await renderInline(
35
+ // getWarningBox({
36
+ // title: lib.migrate.projectMigrationWarningTitle,
37
+ // message: lib.migrate.projectMigrationWarning,
38
+ // })
39
+ // );
40
+ // }
39
41
  }
40
42
  const { derivedAccountId } = args;
41
43
  try {
@@ -23,7 +23,7 @@ function createPlatformVersionError(err, subCategory) {
23
23
  }));
24
24
  logger.log(i18n(`lib.errorHandlers.suppressErrors.platformVersionErrors.updateProject`));
25
25
  logger.log(i18n(`lib.errorHandlers.suppressErrors.platformVersionErrors.betaLink`, {
26
- docsLink: uiLink(i18n(`lib.errorHandlers.suppressErrors.platformVersionErrors.docsLink`), 'https://developers.hubspot.com/docs/platform/platform-versioning'),
26
+ docsLink: uiLink(i18n(`lib.errorHandlers.suppressErrors.platformVersionErrors.docsLink`), 'https://developers.hubspot.com/docs/developer-tooling/platform/versioning'),
27
27
  }));
28
28
  uiLine();
29
29
  }
@@ -3,8 +3,8 @@ import { fetchFireAlarms } from '@hubspot/local-dev-lib/api/fireAlarm';
3
3
  import { debugError } from '../errorHandlers/index.js';
4
4
  import pkg from '../../package.json' with { type: 'json' };
5
5
  import { logInBox } from '../ui/boxen.js';
6
- import { renderInline } from '../../ui/index.js';
7
- import { getWarningBox } from '../../ui/components/StatusMessageBoxes.js';
6
+ // import { renderInline } from '../../ui/index.js';
7
+ // import { getWarningBox } from '../../ui/components/StatusMessageBoxes.js';
8
8
  /*
9
9
  * Versions can be formatted like this:
10
10
  * =7.2.2 -> targets the exact version 7.2.2
@@ -100,20 +100,22 @@ async function logFireAlarms(accountId, command, version) {
100
100
  }
101
101
  return acc;
102
102
  }, '');
103
- if (!process.env.HUBSPOT_ENABLE_INK) {
104
- await logInBox({
105
- contents: notifications,
106
- options: {
107
- title: 'Notifications',
108
- },
109
- });
110
- }
111
- else {
112
- await renderInline(getWarningBox({
103
+ // TODO: Restore ink
104
+ // if (!process.env.HUBSPOT_ENABLE_INK) {
105
+ await logInBox({
106
+ contents: notifications,
107
+ options: {
113
108
  title: 'Notifications',
114
- message: notifications,
115
- }));
116
- }
109
+ },
110
+ });
111
+ // } else {
112
+ // await renderInline(
113
+ // getWarningBox({
114
+ // title: 'Notifications',
115
+ // message: notifications,
116
+ // })
117
+ // );
118
+ // }
117
119
  }
118
120
  }
119
121
  export async function checkFireAlarms(argv) {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.8.10-experimental.0",
3
+ "version": "7.8.11-experimental.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
  "type": "module",
8
8
  "dependencies": {
9
9
  "@hubspot/local-dev-lib": "3.19.1",
10
- "@hubspot/project-parsing-lib": "0.0.30-experimental.0",
10
+ "@hubspot/project-parsing-lib": "0.8.6",
11
11
  "@hubspot/serverless-dev-runtime": "7.0.6",
12
12
  "@hubspot/theme-preview-dev-server": "0.0.10",
13
13
  "@hubspot/ui-extensions-dev-server": "0.10.0",
@@ -20,7 +20,6 @@
20
20
  "express": "4.21.2",
21
21
  "findup-sync": "4.0.0",
22
22
  "fs-extra": "8.1.0",
23
- "ink": "5.2.1",
24
23
  "inquirer": "12.7.0",
25
24
  "js-yaml": "4.1.0",
26
25
  "moment": "2.30.1",
@@ -56,6 +55,7 @@
56
55
  "eslint": "^8.56.0",
57
56
  "eslint-plugin-import": "^2.31.0",
58
57
  "husky": "^4.3.8",
58
+ "ink": "5.2.1",
59
59
  "lint-staged": "^10.5.4",
60
60
  "madge": "^8.0.0",
61
61
  "mock-stdin": "^1.0.0",
@@ -1,8 +0,0 @@
1
- export interface BoxWithTitleProps {
2
- title: string;
3
- message: string;
4
- titleBackgroundColor?: string;
5
- borderColor?: string;
6
- }
7
- export declare function getBoxWithTitle(props: BoxWithTitleProps): React.ReactNode;
8
- export declare function BoxWithTitle({ title, message, titleBackgroundColor, borderColor, }: BoxWithTitleProps): React.ReactNode;
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import { CONTAINER_STYLES } from '../styles.js';
4
- export function getBoxWithTitle(props) {
5
- return _jsx(BoxWithTitle, { ...props });
6
- }
7
- export function BoxWithTitle({ title, message, titleBackgroundColor, borderColor, }) {
8
- return (_jsxs(Box, { ...CONTAINER_STYLES, borderStyle: "round", borderColor: borderColor, children: [_jsx(Box, { position: "absolute", marginTop: -2, paddingX: 0, alignSelf: "flex-start", justifyContent: "center", alignItems: "center", children: _jsx(Text, { backgroundColor: titleBackgroundColor, bold: true, children: ` ${title} ` }) }), _jsx(Box, { justifyContent: "center", alignItems: "center", children: _jsx(Text, { children: message }) })] }));
9
- }
@@ -1,8 +0,0 @@
1
- export interface HorizontalSelectPromptProps {
2
- defaultOption?: string;
3
- options: string[];
4
- onSelect: (value: string) => void;
5
- prompt?: string;
6
- }
7
- export declare function getHorizontalSelectPrompt(props: HorizontalSelectPromptProps): React.ReactNode;
8
- export declare function HorizontalSelectPrompt({ defaultOption, options, onSelect, prompt, }: HorizontalSelectPromptProps): React.ReactNode;
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text, useInput } from 'ink';
3
- import { useState } from 'react';
4
- import { CONTAINER_STYLES, INK_COLORS } from '../styles.js';
5
- export function getHorizontalSelectPrompt(props) {
6
- return _jsx(HorizontalSelectPrompt, { ...props });
7
- }
8
- export function HorizontalSelectPrompt({ defaultOption, options, onSelect, prompt, }) {
9
- const [selectedIndex, setSelectedIndex] = useState(defaultOption && options.indexOf(defaultOption) !== -1
10
- ? options.indexOf(defaultOption)
11
- : 0);
12
- const moveRight = () => {
13
- setSelectedIndex(prev => (prev < options.length - 1 ? prev + 1 : 0));
14
- };
15
- const moveLeft = () => {
16
- setSelectedIndex(prev => (prev > 0 ? prev - 1 : options.length - 1));
17
- };
18
- useInput((_, key) => {
19
- if (key.leftArrow) {
20
- moveLeft();
21
- }
22
- else if (key.rightArrow) {
23
- moveRight();
24
- }
25
- else if (key.return) {
26
- onSelect(options[selectedIndex]);
27
- }
28
- });
29
- return (_jsxs(Box, { ...CONTAINER_STYLES, flexDirection: "column", marginTop: 1, width: "100%", alignSelf: "center", justifyContent: "center", children: [prompt && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: prompt }) })), _jsx(Box, { flexDirection: "row", justifyContent: "center", flexWrap: "wrap", width: "100%", gap: 1, children: options.map((option, index) => (_jsx(Box, { children: _jsx(Text, { backgroundColor: index === selectedIndex ? INK_COLORS.INFO_BLUE : undefined, bold: index === selectedIndex, children: ` ${option} ` }) }, index))) }), _jsx(Box, { marginTop: 1, alignSelf: "center", justifyContent: "center", children: _jsx(Text, { dimColor: true, children: "Use arrow keys to navigate, Enter to select" }) })] }));
30
- }
@@ -1,12 +0,0 @@
1
- export interface StatusMessageBoxProps {
2
- title: string;
3
- message: string;
4
- }
5
- export declare function getWarningBox(props: StatusMessageBoxProps): React.ReactNode;
6
- export declare function WarningBox({ title, message, }: StatusMessageBoxProps): React.ReactNode;
7
- export declare function getAlertBox(props: StatusMessageBoxProps): React.ReactNode;
8
- export declare function AlertBox({ title, message, }: StatusMessageBoxProps): React.ReactNode;
9
- export declare function getSuccessBox(props: StatusMessageBoxProps): React.ReactNode;
10
- export declare function SuccessBox({ title, message, }: StatusMessageBoxProps): React.ReactNode;
11
- export declare function getInfoBox(props: StatusMessageBoxProps): React.ReactNode;
12
- export declare function InfoBox({ title, message, }: StatusMessageBoxProps): React.ReactNode;
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { INK_COLORS } from '../styles.js';
3
- import { BoxWithTitle } from './BoxWithTitle.js';
4
- export function getWarningBox(props) {
5
- return _jsx(WarningBox, { ...props });
6
- }
7
- export function WarningBox({ title, message, }) {
8
- const color = INK_COLORS.WARNING_YELLOW;
9
- return (_jsx(BoxWithTitle, { title: title, message: message, titleBackgroundColor: color, borderColor: color }));
10
- }
11
- export function getAlertBox(props) {
12
- return _jsx(AlertBox, { ...props });
13
- }
14
- export function AlertBox({ title, message, }) {
15
- const color = INK_COLORS.ALERT_RED;
16
- return (_jsx(BoxWithTitle, { title: title, message: message, titleBackgroundColor: color, borderColor: color }));
17
- }
18
- export function getSuccessBox(props) {
19
- return _jsx(SuccessBox, { ...props });
20
- }
21
- export function SuccessBox({ title, message, }) {
22
- const color = INK_COLORS.SUCCESS_GREEN;
23
- return (_jsx(BoxWithTitle, { title: title, message: message, titleBackgroundColor: color, borderColor: color }));
24
- }
25
- export function getInfoBox(props) {
26
- return _jsx(InfoBox, { ...props });
27
- }
28
- export function InfoBox({ title, message, }) {
29
- const color = INK_COLORS.INFO_BLUE;
30
- return (_jsx(BoxWithTitle, { title: title, message: message, titleBackgroundColor: color, borderColor: color }));
31
- }
package/ui/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function renderInline(component: React.ReactNode): Promise<void>;
package/ui/index.js DELETED
@@ -1,6 +0,0 @@
1
- import { render } from 'ink';
2
- // Ink components will be enabled by setting the HUBSPOT_ENABLE_INK environment variable
3
- export async function renderInline(component) {
4
- const { unmount } = render(component, { patchConsole: false });
5
- unmount();
6
- }
@@ -1,9 +0,0 @@
1
- export type ComponentPropPair = {
2
- component: React.ReactNode;
3
- signature: string;
4
- };
5
- /**
6
- * These components will be used by the sandbox ui. Please add any new components here.
7
- */
8
- export declare const populatedComponents: Record<string, ComponentPropPair>;
9
- export declare function getComponentOptions(): string[];
@@ -1,47 +0,0 @@
1
- import { getSuccessBox, getInfoBox, getWarningBox, getAlertBox, } from '../components/StatusMessageBoxes.js';
2
- import { getBoxWithTitle } from '../components/BoxWithTitle.js';
3
- import { SuccessBox, InfoBox, WarningBox, AlertBox, } from '../components/StatusMessageBoxes.js';
4
- import { BoxWithTitle } from '../components/BoxWithTitle.js';
5
- /**
6
- * These components will be used by the sandbox ui. Please add any new components here.
7
- */
8
- export const populatedComponents = {
9
- SuccessBox: {
10
- component: getSuccessBox({
11
- title: 'Success',
12
- message: 'This is a success message',
13
- }),
14
- signature: SuccessBox.toString(),
15
- },
16
- InfoBox: {
17
- component: getInfoBox({
18
- title: 'Info',
19
- message: 'This is an info message',
20
- }),
21
- signature: InfoBox.toString(),
22
- },
23
- WarningBox: {
24
- component: getWarningBox({
25
- title: 'Warning',
26
- message: 'This is a warning message',
27
- }),
28
- signature: WarningBox.toString(),
29
- },
30
- AlertBox: {
31
- component: getAlertBox({
32
- title: 'Alert',
33
- message: 'This is an alert message',
34
- }),
35
- signature: AlertBox.toString(),
36
- },
37
- BoxWithTitle: {
38
- component: getBoxWithTitle({
39
- title: 'Title',
40
- message: 'This is a box with a title',
41
- }),
42
- signature: BoxWithTitle.toString(),
43
- },
44
- };
45
- export function getComponentOptions() {
46
- return Object.keys(populatedComponents);
47
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * This hook is used to get the current terminal size.
3
- * It will return the current terminal size, and if a component is using this hook to set height/width,
4
- * it will re-render when the terminal size changes.
5
- * ONLY USE THIS HOOK WITH SCREENS. THIS HOOK WILL DESTROY ANY PRIOR LOG OUTPUT IF USED TO SET HEIGHT/WIDTH.
6
- * @param minHeight - The minimum height of the terminal.
7
- * @param minWidth - The minimum width of the terminal.
8
- * @returns The current terminal size.
9
- */
10
- export declare function useTerminalSize(minHeight?: number, minWidth?: number): {
11
- columns: number;
12
- rows: number;
13
- };
@@ -1,31 +0,0 @@
1
- import { useStdout } from 'ink';
2
- import { useEffect, useState } from 'react';
3
- /**
4
- * This hook is used to get the current terminal size.
5
- * It will return the current terminal size, and if a component is using this hook to set height/width,
6
- * it will re-render when the terminal size changes.
7
- * ONLY USE THIS HOOK WITH SCREENS. THIS HOOK WILL DESTROY ANY PRIOR LOG OUTPUT IF USED TO SET HEIGHT/WIDTH.
8
- * @param minHeight - The minimum height of the terminal.
9
- * @param minWidth - The minimum width of the terminal.
10
- * @returns The current terminal size.
11
- */
12
- export function useTerminalSize(minHeight, minWidth) {
13
- const { stdout } = useStdout();
14
- const [size, setSize] = useState({
15
- columns: Math.max(stdout.columns, minWidth ?? 0),
16
- rows: Math.max(stdout.rows, minHeight ?? 0),
17
- });
18
- useEffect(() => {
19
- const handleResize = () => {
20
- setSize({
21
- columns: Math.max(stdout.columns, minWidth ?? 0),
22
- rows: Math.max(stdout.rows, minHeight ?? 0),
23
- });
24
- };
25
- stdout.on('resize', handleResize);
26
- return () => {
27
- stdout.off('resize', handleResize);
28
- };
29
- }, [stdout]);
30
- return size;
31
- }
package/ui/styles.d.ts DELETED
@@ -1,18 +0,0 @@
1
- export declare const CONTAINER_STYLES: {
2
- readonly padding: 1;
3
- readonly marginY: 0.5;
4
- readonly flexDirection: "column";
5
- readonly flexWrap: "wrap";
6
- };
7
- /**
8
- * Any color that can be used well in both WHITE and BLACK terminals.
9
- * This is a best effort to ensure that the color is good looking in both
10
- * light and dark modes.
11
- */
12
- export declare const INK_COLORS: {
13
- ALERT_RED: string;
14
- SUCCESS_GREEN: string;
15
- INFO_BLUE: string;
16
- WARNING_YELLOW: string;
17
- WHITE: string;
18
- };
package/ui/styles.js DELETED
@@ -1,18 +0,0 @@
1
- export const CONTAINER_STYLES = {
2
- padding: 1,
3
- marginY: 0.5,
4
- flexDirection: 'column',
5
- flexWrap: 'wrap',
6
- };
7
- /**
8
- * Any color that can be used well in both WHITE and BLACK terminals.
9
- * This is a best effort to ensure that the color is good looking in both
10
- * light and dark modes.
11
- */
12
- export const INK_COLORS = {
13
- ALERT_RED: '#fc7272',
14
- SUCCESS_GREEN: '#4deb7a',
15
- INFO_BLUE: '#4dcbeb',
16
- WARNING_YELLOW: '#EEB117',
17
- WHITE: 'white',
18
- };
@@ -1,5 +0,0 @@
1
- export type UiSandboxProps = {
2
- componentName: string | undefined;
3
- };
4
- export declare function getUiSandbox(props: UiSandboxProps): React.ReactNode;
5
- export declare function UiSandbox({ componentName }: UiSandboxProps): React.ReactNode;
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import { useState } from 'react';
4
- import { HorizontalSelectPrompt } from '../components/HorizontalSelectPrompt.js';
5
- import { getComponentOptions, populatedComponents, } from '../lib/ui-testing-utils.js';
6
- import { useTerminalSize } from '../lib/useTerminalSize.js';
7
- import { CONTAINER_STYLES } from '../styles.js';
8
- export function getUiSandbox(props) {
9
- return _jsx(UiSandbox, { ...props });
10
- }
11
- export function UiSandbox({ componentName }) {
12
- const componentOptions = getComponentOptions();
13
- const [selectedComponent, setSelectedComponent] = useState(componentName ? populatedComponents[componentName] : undefined);
14
- const mapStringToComponent = (str) => {
15
- setSelectedComponent(populatedComponents[str] || undefined);
16
- };
17
- const getFunctionArguments = (signature) => {
18
- const startIndex = signature.indexOf('(');
19
- const endIndex = signature.indexOf(')');
20
- const functionArgs = signature.slice(startIndex, endIndex + 1);
21
- return functionArgs;
22
- };
23
- const size = useTerminalSize(20);
24
- return (_jsxs(Box, { flexDirection: "column", height: size.rows, children: [_jsx(HorizontalSelectPrompt, { defaultOption: componentName, options: componentOptions, onSelect: mapStringToComponent }), selectedComponent?.component, selectedComponent?.signature && (_jsxs(Box, { ...CONTAINER_STYLES, gap: 1, borderStyle: "classic", children: [_jsx(Text, { children: "Signature:" }), _jsx(Text, { children: getFunctionArguments(selectedComponent?.signature) })] }))] }));
25
- }