@hubspot/cli 7.6.0-beta.6 → 7.6.0-beta.8

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.
Files changed (67) hide show
  1. package/README.md +0 -4
  2. package/commands/__tests__/testAccount.test.js +2 -0
  3. package/commands/project/__tests__/devUnifiedFlow.test.js +0 -21
  4. package/commands/project/dev/unifiedFlow.d.ts +1 -1
  5. package/commands/project/dev/unifiedFlow.js +2 -5
  6. package/commands/testAccount/__tests__/importData.test.js +93 -0
  7. package/commands/testAccount/importData.d.ts +9 -0
  8. package/commands/testAccount/importData.js +61 -0
  9. package/commands/testAccount.js +2 -0
  10. package/lang/en.d.ts +38 -1
  11. package/lang/en.js +39 -2
  12. package/lib/__tests__/importData.test.d.ts +1 -0
  13. package/lib/__tests__/importData.test.js +89 -0
  14. package/lib/accountTypes.js +2 -3
  15. package/lib/app/__tests__/migrate.test.js +5 -5
  16. package/lib/app/migrate.js +2 -3
  17. package/lib/constants.d.ts +1 -0
  18. package/lib/constants.js +1 -0
  19. package/lib/hasFeature.d.ts +1 -0
  20. package/lib/hasFeature.js +7 -0
  21. package/lib/importData.d.ts +3 -0
  22. package/lib/importData.js +50 -0
  23. package/lib/projects/__tests__/AppDevModeInterface.test.js +2 -3
  24. package/lib/projects/__tests__/LocalDevProcess.test.js +5 -25
  25. package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +6 -6
  26. package/lib/projects/__tests__/localDevHelpers.test.js +2 -1
  27. package/lib/projects/localDev/AppDevModeInterface.js +1 -1
  28. package/lib/projects/localDev/LocalDevLogger.d.ts +0 -3
  29. package/lib/projects/localDev/LocalDevLogger.js +2 -15
  30. package/lib/projects/localDev/LocalDevProcess.d.ts +1 -1
  31. package/lib/projects/localDev/LocalDevProcess.js +3 -3
  32. package/lib/projects/localDev/LocalDevState.d.ts +6 -4
  33. package/lib/projects/localDev/LocalDevState.js +16 -10
  34. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -0
  35. package/lib/projects/localDev/LocalDevWebsocketServer.js +17 -2
  36. package/lib/projects/localDev/helpers.js +1 -1
  37. package/lib/prompts/confirmImportDataPrompt.d.ts +1 -0
  38. package/lib/prompts/confirmImportDataPrompt.js +12 -0
  39. package/lib/prompts/importDataFilePathPrompt.d.ts +1 -0
  40. package/lib/prompts/importDataFilePathPrompt.js +24 -0
  41. package/lib/prompts/importDataTestAccountSelectPrompt.d.ts +3 -0
  42. package/lib/prompts/importDataTestAccountSelectPrompt.js +29 -0
  43. package/lib/ui/__tests__/removeAnsiCodes.test.d.ts +1 -0
  44. package/lib/ui/__tests__/removeAnsiCodes.test.js +84 -0
  45. package/lib/ui/removeAnsiCodes.d.ts +1 -0
  46. package/lib/ui/removeAnsiCodes.js +4 -0
  47. package/mcp-server/tools/index.js +4 -0
  48. package/mcp-server/tools/project/DocFetchTool.d.ts +17 -0
  49. package/mcp-server/tools/project/DocFetchTool.js +49 -0
  50. package/mcp-server/tools/project/DocsSearchTool.d.ts +26 -0
  51. package/mcp-server/tools/project/DocsSearchTool.js +62 -0
  52. package/mcp-server/tools/project/GetConfigValuesTool.js +3 -2
  53. package/mcp-server/tools/project/__tests__/DocFetchTool.test.d.ts +1 -0
  54. package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +117 -0
  55. package/mcp-server/tools/project/__tests__/DocsSearchTool.test.d.ts +1 -0
  56. package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +190 -0
  57. package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +1 -1
  58. package/mcp-server/tools/project/constants.d.ts +2 -0
  59. package/mcp-server/tools/project/constants.js +6 -0
  60. package/mcp-server/utils/toolUsageTracking.d.ts +3 -1
  61. package/mcp-server/utils/toolUsageTracking.js +2 -1
  62. package/package.json +2 -2
  63. package/types/LocalDev.d.ts +0 -1
  64. package/lib/utils/__tests__/isDeepEqual.test.js +0 -269
  65. package/lib/utils/isDeepEqual.d.ts +0 -1
  66. package/lib/utils/isDeepEqual.js +0 -31
  67. /package/{lib/utils/__tests__/isDeepEqual.test.d.ts → commands/testAccount/__tests__/importData.test.d.ts} +0 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.6.0-beta.6",
3
+ "version": "7.6.0-beta.8",
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
- "@hubspot/local-dev-lib": "3.16.0",
9
+ "@hubspot/local-dev-lib": "3.17.0",
10
10
  "@hubspot/project-parsing-lib": "0.7.0",
11
11
  "@hubspot/serverless-dev-runtime": "7.0.6",
12
12
  "@hubspot/theme-preview-dev-server": "0.0.10",
@@ -13,7 +13,6 @@ export type LocalDevStateConstructorOptions = {
13
13
  projectId: number;
14
14
  projectName: string;
15
15
  debug?: boolean;
16
- isGithubLinked: boolean;
17
16
  initialProjectNodes: {
18
17
  [key: string]: IntermediateRepresentationNodeLocalDev;
19
18
  };
@@ -1,269 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { isDeepEqual } from '../isDeepEqual.js';
3
- describe('isDeepEqual', () => {
4
- describe('primitive values', () => {
5
- it('should return true for identical primitives', () => {
6
- expect(isDeepEqual(1, 1)).toBe(true);
7
- expect(isDeepEqual('hello', 'hello')).toBe(true);
8
- expect(isDeepEqual(true, true)).toBe(true);
9
- expect(isDeepEqual(false, false)).toBe(true);
10
- });
11
- it('should return false for different primitives', () => {
12
- expect(isDeepEqual(1, 2)).toBe(false);
13
- expect(isDeepEqual('hello', 'world')).toBe(false);
14
- expect(isDeepEqual(true, false)).toBe(false);
15
- expect(isDeepEqual(1, '1')).toBe(false);
16
- });
17
- it('should handle zero and negative numbers correctly', () => {
18
- expect(isDeepEqual(0, 0)).toBe(true);
19
- expect(isDeepEqual(-1, -1)).toBe(true);
20
- expect(isDeepEqual(0, -0)).toBe(true);
21
- expect(isDeepEqual(0, 1)).toBe(false);
22
- expect(isDeepEqual(-1, 1)).toBe(false);
23
- });
24
- it('should handle empty strings', () => {
25
- expect(isDeepEqual('', '')).toBe(true);
26
- expect(isDeepEqual('', 'a')).toBe(false);
27
- });
28
- });
29
- describe('null and undefined', () => {
30
- it('should return true for null === null and undefined === undefined', () => {
31
- expect(isDeepEqual(null, null)).toBe(true);
32
- expect(isDeepEqual(undefined, undefined)).toBe(true);
33
- });
34
- it('should return false for null vs undefined', () => {
35
- expect(isDeepEqual(null, undefined)).toBe(false);
36
- expect(isDeepEqual(undefined, null)).toBe(false);
37
- });
38
- it('should return false for null/undefined vs other values', () => {
39
- expect(isDeepEqual(null, 0)).toBe(false);
40
- expect(isDeepEqual(undefined, 0)).toBe(false);
41
- expect(isDeepEqual(null, '')).toBe(false);
42
- expect(isDeepEqual(null, false)).toBe(false);
43
- expect(isDeepEqual(null, {})).toBe(false);
44
- });
45
- });
46
- describe('objects', () => {
47
- it('should return true for identical empty objects', () => {
48
- expect(isDeepEqual({}, {})).toBe(true);
49
- });
50
- it('should return true for objects with same properties', () => {
51
- const obj1 = { a: 1, b: 'hello' };
52
- const obj2 = { a: 1, b: 'hello' };
53
- expect(isDeepEqual(obj1, obj2)).toBe(true);
54
- });
55
- it('should return true for objects with same properties in different order', () => {
56
- const obj1 = { a: 1, b: 'hello' };
57
- const obj2 = { b: 'hello', a: 1 };
58
- expect(isDeepEqual(obj1, obj2)).toBe(true);
59
- });
60
- it('should return false for objects with different property values', () => {
61
- const obj1 = { a: 1, b: 'hello' };
62
- const obj2 = { a: 1, b: 'world' };
63
- expect(isDeepEqual(obj1, obj2)).toBe(false);
64
- });
65
- it('should return false for objects with different number of properties', () => {
66
- const obj1 = { a: 1 };
67
- const obj2 = { a: 1, b: 2 };
68
- expect(isDeepEqual(obj1, obj2)).toBe(false);
69
- });
70
- it('should return false for objects with different property keys', () => {
71
- const obj1 = { a: 1 };
72
- const obj2 = { b: 1 };
73
- expect(isDeepEqual(obj1, obj2)).toBe(false);
74
- });
75
- it('should return true for same object reference', () => {
76
- const obj = { a: 1, b: 'hello' };
77
- expect(isDeepEqual(obj, obj)).toBe(true);
78
- });
79
- });
80
- describe('nested objects', () => {
81
- it('should return true for deeply nested identical objects', () => {
82
- const obj1 = {
83
- a: 1,
84
- b: {
85
- c: 2,
86
- d: {
87
- e: 'nested',
88
- f: true,
89
- },
90
- },
91
- };
92
- const obj2 = {
93
- a: 1,
94
- b: {
95
- c: 2,
96
- d: {
97
- e: 'nested',
98
- f: true,
99
- },
100
- },
101
- };
102
- expect(isDeepEqual(obj1, obj2)).toBe(true);
103
- });
104
- it('should return false for deeply nested objects with differences', () => {
105
- const obj1 = {
106
- a: 1,
107
- b: {
108
- c: 2,
109
- d: {
110
- e: 'nested',
111
- f: true,
112
- },
113
- },
114
- };
115
- const obj2 = {
116
- a: 1,
117
- b: {
118
- c: 2,
119
- d: {
120
- e: 'nested',
121
- f: false, // Different value
122
- },
123
- },
124
- };
125
- expect(isDeepEqual(obj1, obj2)).toBe(false);
126
- });
127
- it('should handle objects with nested null/undefined values', () => {
128
- const obj1 = { a: null, b: { c: undefined } };
129
- const obj2 = { a: null, b: { c: undefined } };
130
- expect(isDeepEqual(obj1, obj2)).toBe(true);
131
- const obj3 = { a: null, b: { c: null } };
132
- expect(isDeepEqual(obj1, obj3)).toBe(false);
133
- });
134
- });
135
- describe('arrays', () => {
136
- it('should return true for identical empty arrays', () => {
137
- expect(isDeepEqual([], [])).toBe(true);
138
- });
139
- it('should return true for arrays with same elements', () => {
140
- expect(isDeepEqual([1, 2, 3], [1, 2, 3])).toBe(true);
141
- expect(isDeepEqual(['a', 'b'], ['a', 'b'])).toBe(true);
142
- });
143
- it('should return false for arrays with different elements', () => {
144
- expect(isDeepEqual([1, 2, 3], [1, 2, 4])).toBe(false);
145
- expect(isDeepEqual(['a', 'b'], ['a', 'c'])).toBe(false);
146
- });
147
- it('should return false for arrays with different lengths', () => {
148
- expect(isDeepEqual([1, 2], [1, 2, 3])).toBe(false);
149
- expect(isDeepEqual([1, 2, 3], [1, 2])).toBe(false);
150
- });
151
- it('should return false for arrays with same elements in different order', () => {
152
- expect(isDeepEqual([1, 2, 3], [3, 2, 1])).toBe(false);
153
- expect(isDeepEqual(['a', 'b'], ['b', 'a'])).toBe(false);
154
- });
155
- it('should handle nested arrays', () => {
156
- const arr1 = [1, [2, 3], [4, [5, 6]]];
157
- const arr2 = [1, [2, 3], [4, [5, 6]]];
158
- expect(isDeepEqual(arr1, arr2)).toBe(true);
159
- const arr3 = [1, [2, 3], [4, [5, 7]]];
160
- expect(isDeepEqual(arr1, arr3)).toBe(false);
161
- });
162
- it('should handle arrays with objects', () => {
163
- const arr1 = [{ a: 1 }, { b: 2 }];
164
- const arr2 = [{ a: 1 }, { b: 2 }];
165
- expect(isDeepEqual(arr1, arr2)).toBe(true);
166
- const arr3 = [{ a: 1 }, { b: 3 }];
167
- expect(isDeepEqual(arr1, arr3)).toBe(false);
168
- });
169
- });
170
- describe('mixed types', () => {
171
- it('should return false for object vs array', () => {
172
- expect(isDeepEqual({}, [])).toBe(false);
173
- expect(isDeepEqual({ 0: 'a', 1: 'b' }, ['a', 'b'])).toBe(false);
174
- });
175
- it('should return false for object vs primitive', () => {
176
- expect(isDeepEqual({}, null)).toBe(false);
177
- expect(isDeepEqual({ a: 1 }, 1)).toBe(false);
178
- expect(isDeepEqual({}, '')).toBe(false);
179
- });
180
- it('should return false for array vs primitive', () => {
181
- expect(isDeepEqual([], null)).toBe(false);
182
- expect(isDeepEqual([1], 1)).toBe(false);
183
- expect(isDeepEqual([], '')).toBe(false);
184
- });
185
- it('should handle complex mixed structures', () => {
186
- const obj1 = {
187
- number: 42,
188
- string: 'hello',
189
- boolean: true,
190
- null_value: null,
191
- array: [1, 'two', { three: 3 }],
192
- nested: {
193
- deep: {
194
- value: 'found',
195
- },
196
- },
197
- };
198
- const obj2 = {
199
- number: 42,
200
- string: 'hello',
201
- boolean: true,
202
- null_value: null,
203
- array: [1, 'two', { three: 3 }],
204
- nested: {
205
- deep: {
206
- value: 'found',
207
- },
208
- },
209
- };
210
- expect(isDeepEqual(obj1, obj2)).toBe(true);
211
- const obj3 = { ...obj2, number: 43 };
212
- expect(isDeepEqual(obj1, obj3)).toBe(false);
213
- });
214
- });
215
- describe('ignoreKeys functionality', () => {
216
- it('should ignore specified keys in comparison', () => {
217
- const obj1 = { a: 1, b: 2, c: 3 };
218
- const obj2 = { a: 1, b: 999, c: 3 }; // b is different
219
- expect(isDeepEqual(obj1, obj2)).toBe(false);
220
- expect(isDeepEqual(obj1, obj2, ['b'])).toBe(true);
221
- });
222
- it('should ignore multiple keys', () => {
223
- const obj1 = { a: 1, b: 2, c: 3, d: 4 };
224
- const obj2 = { a: 1, b: 999, c: 888, d: 4 }; // b and c are different
225
- expect(isDeepEqual(obj1, obj2, ['b', 'c'])).toBe(true);
226
- });
227
- it('should ignore keys in nested objects', () => {
228
- const obj1 = {
229
- top: 'same',
230
- nested: {
231
- keep: 'this',
232
- ignore: 'different1',
233
- deep: {
234
- keep: 'this',
235
- ignore: 'different2',
236
- },
237
- },
238
- };
239
- const obj2 = {
240
- top: 'same',
241
- nested: {
242
- keep: 'this',
243
- ignore: 'DIFFERENT1',
244
- deep: {
245
- keep: 'this',
246
- ignore: 'DIFFERENT2',
247
- },
248
- },
249
- };
250
- expect(isDeepEqual(obj1, obj2)).toBe(false);
251
- expect(isDeepEqual(obj1, obj2, ['ignore'])).toBe(true);
252
- });
253
- it('should handle ignoreKeys when one object has extra properties', () => {
254
- const obj1 = { a: 1, b: 2 };
255
- const obj2 = { a: 1, b: 2, c: 3 };
256
- expect(isDeepEqual(obj1, obj2, ['c'])).toBe(true);
257
- expect(isDeepEqual(obj2, obj1, ['c'])).toBe(true);
258
- });
259
- it('should ignore keys in arrays (array indices as keys)', () => {
260
- const arr1 = ['keep', 'ignore', 'keep'];
261
- const arr2 = ['keep', 'DIFFERENT', 'keep'];
262
- expect(isDeepEqual(arr1, arr2, ['1'])).toBe(true);
263
- });
264
- it('should not affect primitive comparisons', () => {
265
- expect(isDeepEqual(1, 2, ['any', 'keys'])).toBe(false);
266
- expect(isDeepEqual('hello', 'hello', ['any', 'keys'])).toBe(true);
267
- });
268
- });
269
- });
@@ -1 +0,0 @@
1
- export declare function isDeepEqual(object1: unknown, object2: unknown, ignoreKeys?: string[]): boolean;
@@ -1,31 +0,0 @@
1
- export function isDeepEqual(object1, object2, ignoreKeys) {
2
- if (object1 === object2) {
3
- return true;
4
- }
5
- if (object1 === null ||
6
- object2 === null ||
7
- typeof object1 !== 'object' ||
8
- typeof object2 !== 'object') {
9
- return object1 === object2;
10
- }
11
- if (typeof object1 !== typeof object2) {
12
- return false;
13
- }
14
- const isArray1 = Array.isArray(object1);
15
- const isArray2 = Array.isArray(object2);
16
- if (isArray1 !== isArray2) {
17
- return false;
18
- }
19
- const objKeys1 = Object.keys(object1).filter(key => !ignoreKeys?.includes(key));
20
- const objKeys2 = Object.keys(object2).filter(key => !ignoreKeys?.includes(key));
21
- if (objKeys1.length !== objKeys2.length)
22
- return false;
23
- for (const key of objKeys1) {
24
- const value1 = object1[key];
25
- const value2 = object2[key];
26
- if (!isDeepEqual(value1, value2, ignoreKeys)) {
27
- return false;
28
- }
29
- }
30
- return true;
31
- }