handoff-app 1.2.1-0 → 1.2.1-2

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.
@@ -16,7 +16,7 @@ exports.stableStringify = stableStringify;
16
16
  */
17
17
  const diffMapSnapshots = (oldSnapshot, newSnapshot) => {
18
18
  const affected = new Set();
19
- for (const [key, oldEntries] of oldSnapshot) {
19
+ for (const [key, oldEntries] of Array.from(oldSnapshot)) {
20
20
  const newEntries = newSnapshot.get(key);
21
21
  if (!newEntries) {
22
22
  affected.add(key);
@@ -26,14 +26,14 @@ const diffMapSnapshots = (oldSnapshot, newSnapshot) => {
26
26
  affected.add(key);
27
27
  continue;
28
28
  }
29
- for (const [subKey, oldValue] of oldEntries) {
29
+ for (const [subKey, oldValue] of Array.from(oldEntries)) {
30
30
  if (newEntries.get(subKey) !== oldValue) {
31
31
  affected.add(key);
32
32
  break;
33
33
  }
34
34
  }
35
35
  }
36
- for (const key of newSnapshot.keys()) {
36
+ for (const key of Array.from(newSnapshot.keys())) {
37
37
  if (!oldSnapshot.has(key)) {
38
38
  affected.add(key);
39
39
  }
package/dist/cli.js CHANGED
File without changes
@@ -199,7 +199,7 @@ function resolveComponentImportInfo(sourceCode) {
199
199
  };
200
200
  }
201
201
  const namedImportRegex = /import\s*{\s*([^}]+)\s*}\s*from\s*['"]([^'"]+)['"]/gm;
202
- for (const match of sourceCode.matchAll(namedImportRegex)) {
202
+ for (const match of Array.from(sourceCode.matchAll(namedImportRegex))) {
203
203
  const specifiers = match[1]
204
204
  .split(',')
205
205
  .map((specifier) => specifier.trim())
@@ -52,7 +52,7 @@ const getComponentPreviewKeys = (handoff, componentId) => __awaiter(void 0, void
52
52
  });
53
53
  const getArtifactComponentId = (fileName, componentIds) => {
54
54
  let match = null;
55
- for (const componentId of componentIds) {
55
+ for (const componentId of Array.from(componentIds)) {
56
56
  if (!fileName.startsWith(`${componentId}-`))
57
57
  continue;
58
58
  if (!match || componentId.length > match.length) {
@@ -95,7 +95,7 @@ const syncComponentArtifacts = (handoff) => __awaiter(void 0, void 0, void 0, fu
95
95
  validFiles.add(`${componentId}.css`);
96
96
  }
97
97
  const previewKeys = yield getComponentPreviewKeys(handoff, componentId);
98
- for (const previewKey of previewKeys) {
98
+ for (const previewKey of Array.from(previewKeys)) {
99
99
  validFiles.add(`${componentId}-${previewKey}.html`);
100
100
  validFiles.add(`${componentId}-${previewKey}-inspect.html`);
101
101
  }
@@ -62,9 +62,7 @@ function formatObjectLiteral(value) {
62
62
  if (entries.length === 0)
63
63
  return '{}';
64
64
  if (entries.length <= 3) {
65
- const inline = entries
66
- .map(([k, v]) => `${isValidIdentifier(k) ? k : JSON.stringify(k)}: ${JSON.stringify(v)}`)
67
- .join(', ');
65
+ const inline = entries.map(([k, v]) => `${isValidIdentifier(k) ? k : JSON.stringify(k)}: ${JSON.stringify(v)}`).join(', ');
68
66
  if (inline.length <= 60)
69
67
  return `{ ${inline} }`;
70
68
  }
@@ -121,7 +119,7 @@ function generateUsageSnippet(options) {
121
119
  // Merge all known prop keys: preview values first (preserve order), then
122
120
  // any additional keys from the property schema that weren't in the preview.
123
121
  const allKeys = new Set([...Object.keys(previewValues), ...Object.keys(properties)]);
124
- for (const key of allKeys) {
122
+ for (const key of Array.from(allKeys)) {
125
123
  const slot = properties[key];
126
124
  const inPreview = key in previewValues;
127
125
  const value = inPreview ? previewValues[key] : resolveSchemaValue(slot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handoff-app",
3
- "version": "1.2.1-0",
3
+ "version": "1.2.1-2",
4
4
  "description": "Automated documentation toolchain for building client side documentation from figma",
5
5
  "author ": {
6
6
  "name": "Convertiv",
@@ -23,7 +23,7 @@ export const diffMapSnapshots = (
23
23
  ): string[] => {
24
24
  const affected = new Set<string>();
25
25
 
26
- for (const [key, oldEntries] of oldSnapshot) {
26
+ for (const [key, oldEntries] of Array.from(oldSnapshot)) {
27
27
  const newEntries = newSnapshot.get(key);
28
28
  if (!newEntries) {
29
29
  affected.add(key);
@@ -33,7 +33,7 @@ export const diffMapSnapshots = (
33
33
  affected.add(key);
34
34
  continue;
35
35
  }
36
- for (const [subKey, oldValue] of oldEntries) {
36
+ for (const [subKey, oldValue] of Array.from(oldEntries)) {
37
37
  if (newEntries.get(subKey) !== oldValue) {
38
38
  affected.add(key);
39
39
  break;
@@ -41,7 +41,7 @@ export const diffMapSnapshots = (
41
41
  }
42
42
  }
43
43
 
44
- for (const key of newSnapshot.keys()) {
44
+ for (const key of Array.from(newSnapshot.keys())) {
45
45
  if (!oldSnapshot.has(key)) {
46
46
  affected.add(key);
47
47
  }
@@ -218,7 +218,7 @@ function resolveComponentImportInfo(sourceCode: string): ComponentImportInfo | n
218
218
  }
219
219
 
220
220
  const namedImportRegex = /import\s*{\s*([^}]+)\s*}\s*from\s*['"]([^'"]+)['"]/gm;
221
- for (const match of sourceCode.matchAll(namedImportRegex)) {
221
+ for (const match of Array.from(sourceCode.matchAll(namedImportRegex))) {
222
222
  const specifiers = match[1]
223
223
  .split(',')
224
224
  .map((specifier) => specifier.trim())
@@ -45,7 +45,7 @@ const getComponentPreviewKeys = async (handoff: Handoff, componentId: string): P
45
45
  const getArtifactComponentId = (fileName: string, componentIds: Iterable<string>): string | null => {
46
46
  let match: string | null = null;
47
47
 
48
- for (const componentId of componentIds) {
48
+ for (const componentId of Array.from(componentIds)) {
49
49
  if (!fileName.startsWith(`${componentId}-`)) continue;
50
50
  if (!match || componentId.length > match.length) {
51
51
  match = componentId;
@@ -95,7 +95,7 @@ export const syncComponentArtifacts = async (handoff: Handoff): Promise<void> =>
95
95
  }
96
96
 
97
97
  const previewKeys = await getComponentPreviewKeys(handoff, componentId);
98
- for (const previewKey of previewKeys) {
98
+ for (const previewKey of Array.from(previewKeys)) {
99
99
  validFiles.add(`${componentId}-${previewKey}.html`);
100
100
  validFiles.add(`${componentId}-${previewKey}-inspect.html`);
101
101
  }
@@ -65,9 +65,7 @@ function formatObjectLiteral(value: unknown): string {
65
65
  const entries = Object.entries(value as Record<string, unknown>);
66
66
  if (entries.length === 0) return '{}';
67
67
  if (entries.length <= 3) {
68
- const inline = entries
69
- .map(([k, v]) => `${isValidIdentifier(k) ? k : JSON.stringify(k)}: ${JSON.stringify(v)}`)
70
- .join(', ');
68
+ const inline = entries.map(([k, v]) => `${isValidIdentifier(k) ? k : JSON.stringify(k)}: ${JSON.stringify(v)}`).join(', ');
71
69
  if (inline.length <= 60) return `{ ${inline} }`;
72
70
  }
73
71
  return JSON.stringify(value, null, 2);
@@ -135,7 +133,7 @@ export function generateUsageSnippet(options: GenerateUsageSnippetOptions): stri
135
133
  // any additional keys from the property schema that weren't in the preview.
136
134
  const allKeys = new Set([...Object.keys(previewValues), ...Object.keys(properties)]);
137
135
 
138
- for (const key of allKeys) {
136
+ for (const key of Array.from(allKeys)) {
139
137
  const slot = properties[key];
140
138
  const inPreview = key in previewValues;
141
139
  const value = inPreview ? previewValues[key] : resolveSchemaValue(slot);