@wise/wds-codemods 1.0.0-experimental-0db39ee → 1.0.0-experimental-95d3c2e

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.
@@ -0,0 +1,431 @@
1
+ const require_constants = require('./constants-CcE2TmzN.js');
2
+ let node_child_process = require("node:child_process");
3
+ let node_path = require("node:path");
4
+ let _listr2_manager = require("@listr2/manager");
5
+ let node_fs = require("node:fs");
6
+ let listr2 = require("listr2");
7
+ let node_https = require("node:https");
8
+ node_https = require_constants.__toESM(node_https);
9
+ let _anthropic_ai_claude_agent_sdk = require("@anthropic-ai/claude-agent-sdk");
10
+
11
+ //#region src/transforms/list-item/constants.ts
12
+ const CLAUDE_SETTINGS_FILE = ".claude/settings.json";
13
+ const VPN_COUNTDOWN_TIMEOUT = 5;
14
+ const DIRECTORY_CONCURRENCY_LIMIT = 3;
15
+ const FILE_CONCURRENCY_LIMIT = 10;
16
+ const DEPRECATED_COMPONENT_NAMES = [
17
+ "ActionOption",
18
+ "NavigationOption",
19
+ "NavigationOptionList",
20
+ "Summary",
21
+ "SwitchOption",
22
+ "CheckboxOption",
23
+ "RadioOption"
24
+ ];
25
+ const GREP_PATTERN = new RegExp(`import\\s*\\{[\\s\\S]*?(${DEPRECATED_COMPONENT_NAMES.join("|")})[\\s\\S]*?\\}\\s*from\\s*['"]@transferwise/components['"]`, "u");
26
+ const MIGRATION_RULES = `Migration rules:
27
+ # Legacy Component → ListItem Migration Guide
28
+
29
+ ## Import Management
30
+ 1. Remove imports: \`{ ActionOption, NavigationOption, NavigationOptionList, Summary, SwitchOption, CheckboxOption, RadioOption }\` from \`'@transferwise/components'\`
31
+ 2. Add import: \`{ ListItem }\` from \`'@transferwise/components'\`
32
+ 3. For Summary with info: Add \`{ Modal }\` and/or \`{ Popover }\` from \`'@transferwise/components'\`
33
+ 4. For Summary with info: Add \`{ QuestionMarkCircle }\` from \`'@transferwise/icons'\`
34
+ 5. For Summary with info modal: Add \`{ useState }\` from \`'react'\`
35
+
36
+ ## Universal Rules
37
+ 1. \`title\` → \`title\` (direct)
38
+ 2. \`content\` or \`description\` → \`subtitle\`
39
+ 3. \`disabled\` stays on \`ListItem\` (not controls)
40
+ 4. \`id\` stays on \`ListItem\` (not controls)
41
+ 5. Remove deprecated props: \`as\`, \`complex\`, \`showMediaAtAllSizes\`, \`showMediaCircle\`, \`isContainerAligned\`
42
+ 6. Preserve string quotes exactly as they are (don't convert \`\` to \`'\` or \`"\`)
43
+ 7. When wrapping icons in \`ListItem.AvatarView\`: move \`size\` from icon to AvatarView (except Summary always uses 32)
44
+
45
+ ---
46
+
47
+ ## ActionOption → ListItem.Button
48
+
49
+ - \`action\` → Button children
50
+ - \`onClick\` → Button \`onClick\`
51
+ - Priority mapping:
52
+ - default or \`"primary"\` → \`"primary"\`
53
+ - \`"secondary"\` → \`"secondary-neutral"\`
54
+ - \`"secondary-send"\` → \`"secondary"\`
55
+ - \`"tertiary"\` → \`"tertiary"\`
56
+
57
+ \`\`\`tsx
58
+ <ActionOption title="Title" content="Text" action="Click" priority="secondary" onClick={fn} />
59
+
60
+ <ListItem title="Title" subtitle="Text" control={<ListItem.Button priority="secondary-neutral" onClick={fn}>Click</ListItem.Button>} />
61
+ \`\`\`
62
+
63
+ ---
64
+
65
+ ## CheckboxOption → ListItem.Checkbox
66
+
67
+ - \`name\` is moved to \`ListItem.Checkbox\`
68
+ - \`onChange\`: \`(checked: boolean) => void\` → \`(event: ChangeEvent<HTMLInputElement>) => void\`
69
+ - Update handler: \`(checked) => setX(checked)\` → \`(event) => setX(event.target.checked)\`
70
+
71
+ \`\`\`tsx
72
+ <CheckboxOption id="x" name="y" title="Title" content="Text" checked={v} onChange={(c) => set(c)} />
73
+
74
+ <ListItem id="x" title="Title" subtitle="Text" control={<ListItem.Checkbox name="y" checked={v} onChange={(e) => set(e.target.checked)} />} />
75
+ \`\`\`
76
+
77
+ ---
78
+
79
+ ## RadioOption → ListItem.Radio
80
+
81
+ - \`name\`, \`value\`, \`checked\`, \`onChange\` move to Radio
82
+
83
+ \`\`\`tsx
84
+ <RadioOption id="x" name="y" value="v" title="Title" content="Text" checked={v==='v'} onChange={set} />
85
+
86
+ <ListItem id="x" title="Title" subtitle="Text" control={<ListItem.Radio name="y" value="v" checked={v==='v'} onChange={set} />} />
87
+ \`\`\`
88
+
89
+ ---
90
+
91
+ ## SwitchOption → ListItem.Switch
92
+
93
+ - \`aria-label\` is moved to \`ListItem.Switch\`
94
+ - \`onChange\` → \`onClick\` with manual toggle: \`onChange={set}\` → \`onClick={() => set(!v)}\`
95
+
96
+ \`\`\`tsx
97
+ <SwitchOption id="x" title="Title" content="Text" checked={v} aria-label="Toggle" onChange={set} />
98
+
99
+ <ListItem id="x" title="Title" subtitle="Text" control={<ListItem.Switch checked={v} aria-label="Toggle" onClick={() => set(!v)} />} />
100
+ \`\`\`
101
+
102
+ ---
103
+
104
+ ## NavigationOption → ListItem.Navigation
105
+
106
+ - \`onClick\` or \`href\` move to Navigation
107
+
108
+ \`\`\`tsx
109
+ <NavigationOption title="Title" content="Text" onClick={fn} />
110
+
111
+ <ListItem title="Title" subtitle="Text" control={<ListItem.Navigation onClick={fn} />} />
112
+ \`\`\`
113
+
114
+ ---
115
+
116
+ ## NavigationOptionList → (remove wrapper)
117
+
118
+ - Convert \`NavigationOptionList\` wrapper to \`<List></List>\`
119
+ - Convert each child \`NavigationOption\` to \`ListItem\` with \`ListItem.Navigation\`
120
+
121
+ \`\`\`tsx
122
+ <NavigationOptionList>
123
+ <NavigationOption title="T1" content="C1" onClick={fn1} />
124
+ <NavigationOption title="T2" content="C2" href="/link" />
125
+ </NavigationOptionList>
126
+
127
+ <>
128
+ <ListItem title="T1" subtitle="C1" control={<ListItem.Navigation onClick={fn1} />} />
129
+ <ListItem title="T2" subtitle="C2" control={<ListItem.Navigation href="/link" />} />
130
+ </>
131
+ \`\`\`
132
+
133
+ ---
134
+
135
+ ## Option → ListItem
136
+
137
+ - Wrap \`media\` in \`ListItem.AvatarView\`
138
+ - Move \`size\` prop from icon to AvatarView (keeping same value)
139
+
140
+ \`\`\`tsx
141
+ <Option media={<Icon size={48} />} title="Title" />
142
+
143
+ <ListItem title="Title" media={<ListItem.AvatarView size={48}><Icon /></ListItem.AvatarView>} />
144
+ \`\`\`
145
+
146
+ ---
147
+
148
+ ## Summary → ListItem
149
+
150
+ ### Basic
151
+ - \`icon\` prop → wrap in \`ListItem.AvatarView\` with \`size={32}\` as \`media\`
152
+ - ALWAYS use \`size={32}\` on AvatarView (regardless of original icon size)
153
+ - ALWAYS remove \`size\` prop from child icon
154
+ - Summary-specific: always uses 32, while other components move size value from icon to AvatarView
155
+
156
+ ### Status mapping
157
+ - \`Status.DONE\` → \`badge={{ status: 'positive' }}\` on AvatarView
158
+ - \`Status.PENDING\` → \`badge={{ status: 'pending' }}\` on AvatarView
159
+ - \`Status.NOT_DONE\` → no badge
160
+
161
+ ### Action
162
+ - \`action.text\` → \`action.label\` in \`ListItem.AdditionalInfo\`
163
+ - Pass entire action object including \`href\`, \`onClick\`, \`target\`
164
+ - Remove \`aria-label\` from action (not supported)
165
+
166
+ ### Info with Modal (add state management)
167
+ - Add: \`const [open, setOpen] = useState(false)\`
168
+ - Create \`ListItem.IconButton\` with \`partiallyInteractive\` and \`onClick\`
169
+ - Render \`Modal\` separately with state
170
+ - Transfer \`aria-label\` to IconButton
171
+
172
+ ### Info with Popover
173
+ - \`Popover\` wraps \`ListItem.IconButton\` with \`partiallyInteractive\`
174
+ - Transfer \`aria-label\` to IconButton
175
+
176
+ \`\`\`tsx
177
+ // Basic (icon with or without size prop always becomes size={32} on AvatarView)
178
+ <Summary title="T" description="D" icon={<Icon size={24} />} />
179
+
180
+ <ListItem title="T" subtitle="D" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} />
181
+
182
+ // Status
183
+ <Summary title="T" description="D" icon={<Icon />} status={Status.DONE} />
184
+
185
+ <ListItem title="T" subtitle="D" media={<ListItem.AvatarView size={32} badge={{status:'positive'}}><Icon /></ListItem.AvatarView>} />
186
+
187
+ // Action
188
+ <Summary title="T" description="D" icon={<Icon />} action={{text:'Go', href:'/go', target:'_blank'}} />
189
+
190
+ <ListItem title="T" subtitle="D" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} additionalInfo={<ListItem.AdditionalInfo action={{label:'Go', href:'/go', target:'_blank'}} />} />
191
+
192
+ // Modal (requires state: const [open, setOpen] = useState(false))
193
+ <Summary title="T" description="D" icon={<Icon />} info={{title:'Help', content:'Text', presentation:'MODAL', 'aria-label':'Info'}} />
194
+
195
+ <>
196
+ <ListItem title="T" subtitle="D" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} control={
197
+ <ListItem.IconButton partiallyInteractive aria-label="Info" onClick={()=>setOpen(!open)}>
198
+ <QuestionMarkCircle />
199
+ </ListItem.IconButton>
200
+ } />
201
+ <Modal open={open} title="Help" body="Text" onClose={()=>setOpen(false)} />
202
+ </>
203
+
204
+ // Popover
205
+ <Summary title="T" description="D" icon={<Icon />} info={{title:'Help', content:'Text', presentation:'POPOVER', 'aria-label':'Info'}} />
206
+
207
+ <ListItem title="T" subtitle="D" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} control={
208
+ <Popover title="Help" content="Text" onClose={()=>setOpen(false)}>
209
+ <ListItem.IconButton partiallyInteractive aria-label="Info">
210
+ <QuestionMarkCircle />
211
+ </ListItem.IconButton>
212
+ </Popover>
213
+ } />
214
+ \`\`\`
215
+
216
+ `;
217
+ const SYSTEM_PROMPT = `You are a code migration assistant that helps migrate TypeScript/JSX code from deprecated Wise Design System (WDS) components to the new ListItem component and ListItem subcomponents from '@transferwise/components'.
218
+
219
+ Rules:
220
+ 1. Only ever modify files via the Edit tool - do not use the Write tool
221
+ 2. When identifying what code to migrate within a file, explain how you identified it first.
222
+ 3. Migrate components per provided migration rules
223
+ 4. Maintain TypeScript type safety and update types to match new API
224
+ 5. Map props: handle renamed, deprecated, new required, and changed types
225
+ 6. Update imports to new WDS components and types
226
+ 7. Preserve code style, formatting, and calculated logic
227
+ 8. Handle conditional rendering, spread props, and complex expressions
228
+ 9. Note: New components may lack feature parity with legacy versions
229
+ 10. Only modify code requiring changes per migration rules, and any impacted surrounding code for context.
230
+ 11. Final result response should just be whether the migration was successful overall, or if any errors were encountered
231
+ - Do not summarise or explain the changes made
232
+ 12. Explain your reasoning and justification before making changes, as you edit each file.
233
+ - Keep it concise and succinct, as only bullet points
234
+ 13. After modifying the file, do not summarise the changes made.
235
+ 14. If you do not have permission to edit a file, still attempt to edit it and then move onto the next file.
236
+
237
+ You'll receive:
238
+ - File paths to migrate in individual queries
239
+ - Deprecated component names at the end of this prompt
240
+ - Migration context and rules for each deprecated component
241
+
242
+ Deprecated components: ${DEPRECATED_COMPONENT_NAMES.join(", ")}.
243
+
244
+ ${MIGRATION_RULES}`;
245
+
246
+ //#endregion
247
+ //#region src/transforms/list-item/helpers.ts
248
+ /** Split the path to get the relative path after the directory, and wrap with ANSI color codes */
249
+ function formatPathOutput(directory, path, asDim) {
250
+ const relativePath = path ? path.split(directory.replace(".", ""))[1] ?? path : directory;
251
+ return asDim ? `\x1b[2m${relativePath}\x1b[0m` : `\x1b[32m${relativePath}\x1b[0m`;
252
+ }
253
+ /** Generates a formatted string representing the total elapsed time since the given start time */
254
+ function generateElapsedTime(startTime) {
255
+ const endTime = Date.now();
256
+ const elapsedTime = Math.floor((endTime - startTime) / 1e3);
257
+ const hours = Math.floor(elapsedTime / 3600);
258
+ const minutes = Math.floor(elapsedTime % 3600 / 60);
259
+ const seconds = elapsedTime % 60;
260
+ return `${hours ? `${hours}h ` : ""}${minutes ? `${minutes}m ` : ""}${seconds ? `${seconds}s` : ""}`;
261
+ }
262
+
263
+ //#endregion
264
+ //#region src/transforms/list-item/claude.ts
265
+ async function checkVPN(baseUrl, task) {
266
+ if (!baseUrl) return;
267
+ const checkOnce = async () => new Promise((resolveCheck) => {
268
+ const url = new URL("/health", baseUrl);
269
+ const req = node_https.default.get(url, {
270
+ timeout: 2e3,
271
+ rejectUnauthorized: false
272
+ }, (res) => {
273
+ const ok = !!(res.statusCode && res.statusCode >= 200 && res.statusCode < 400);
274
+ res.resume();
275
+ resolveCheck(ok);
276
+ });
277
+ req.on("timeout", () => {
278
+ req.destroy(/* @__PURE__ */ new Error("timeout"));
279
+ });
280
+ req.on("error", () => resolveCheck(false));
281
+ });
282
+ while (true) {
283
+ if (await checkOnce()) {
284
+ task.title = "Connected to VPN";
285
+ break;
286
+ }
287
+ for (let countdown = VPN_COUNTDOWN_TIMEOUT; countdown > 0; countdown -= 1) {
288
+ task.output = `Please connect to VPN... retrying in ${countdown}s`;
289
+ await new Promise((response) => {
290
+ setTimeout(response, 1e3);
291
+ });
292
+ }
293
+ }
294
+ }
295
+ function getQueryOptions(sessionId) {
296
+ const claudeSettingsPath = (0, node_path.resolve)(process.env.HOME || "", CLAUDE_SETTINGS_FILE);
297
+ const settings = JSON.parse((0, node_fs.readFileSync)(claudeSettingsPath, "utf-8"));
298
+ let apiKey;
299
+ try {
300
+ apiKey = (0, node_child_process.execSync)(`bash ${settings.apiKeyHelper}`, { encoding: "utf-8" }).trim();
301
+ } catch {}
302
+ if (!apiKey || !settings.env?.ANTHROPIC_BASE_URL) throw new Error("Failed to retrieve Anthropic API key or Base URL. Please check your Claude Code x LLM Gateway configuration - https://transferwise.atlassian.net/wiki/x/_YUe3Q");
303
+ const { ANTHROPIC_CUSTOM_HEADERS, ...restEnvVars } = settings?.env ?? {};
304
+ return {
305
+ resume: sessionId,
306
+ env: {
307
+ ANTHROPIC_AUTH_TOKEN: apiKey,
308
+ ANTHROPIC_CUSTOM_HEADERS,
309
+ ...restEnvVars,
310
+ PATH: process.env.PATH
311
+ },
312
+ permissionMode: "acceptEdits",
313
+ systemPrompt: {
314
+ type: "preset",
315
+ preset: "claude_code",
316
+ append: SYSTEM_PROMPT
317
+ },
318
+ allowedTools: ["Grep", "Read"],
319
+ settingSources: [
320
+ "local",
321
+ "project",
322
+ "user"
323
+ ]
324
+ };
325
+ }
326
+ /** Initiate a new Claude session/conversation and return reusable options */
327
+ async function initiateClaudeSessionOptions(manager) {
328
+ const options = getQueryOptions(void 0);
329
+ manager.add([{
330
+ title: "Checking VPN connection",
331
+ task: async (_, task) => checkVPN(options.env?.ANTHROPIC_BASE_URL, task)
332
+ }]);
333
+ await manager.runAll();
334
+ manager.add([{
335
+ title: "Starting Claude instance",
336
+ task: async (_, task) => {
337
+ task.output = "Your browser may open for Okta authentication if required";
338
+ const result = (0, _anthropic_ai_claude_agent_sdk.query)({
339
+ options,
340
+ prompt: `You'll be given file paths in additional individual queries to search in for files using deprecated Wise Design System (WDS) components. Migrate the code per the provided migration rules.`
341
+ });
342
+ for await (const message of result) switch (message.type) {
343
+ case "system":
344
+ if (message.subtype === "init" && !options.resume) {
345
+ task.title = "Successfully initialised Claude instance\n";
346
+ options.resume = message.session_id;
347
+ }
348
+ break;
349
+ default: if (message.type === "result" && message.subtype !== "success") throw new Error(`Claude encountered an error when initialising: ${message.errors.join("\n")}`);
350
+ }
351
+ task.task.complete();
352
+ }
353
+ }]);
354
+ await manager.runAll().finally(() => {
355
+ manager.options = { concurrent: DIRECTORY_CONCURRENCY_LIMIT };
356
+ });
357
+ return options;
358
+ }
359
+ async function queryClaude(directory, filePath, options, task, isDebug = false) {
360
+ const startTime = Date.now();
361
+ const result = (0, _anthropic_ai_claude_agent_sdk.query)({
362
+ options,
363
+ prompt: filePath
364
+ });
365
+ for await (const message of result) switch (message.type) {
366
+ case "result":
367
+ if (message.subtype === "success" && isDebug) {
368
+ task.title = `\x1b[2m${formatPathOutput(directory, filePath)}\x1b[0m]`;
369
+ task.output = `\x1b[2mMigrated in ${generateElapsedTime(startTime)}\x1b[0m`;
370
+ } else if (message.is_error) {
371
+ task.title = `\x1b[2m${formatPathOutput(directory, filePath)}\x1b[0m]`;
372
+ task.output = `${require_constants.CONSOLE_ICONS.error} Claude encountered an error: ${JSON.stringify(message)}`;
373
+ }
374
+ break;
375
+ default:
376
+ }
377
+ }
378
+
379
+ //#endregion
380
+ //#region src/transforms/list-item/transformer.ts
381
+ const transformer = async (targetPaths, isDebug = false) => {
382
+ process.setMaxListeners(20);
383
+ const startTime = Date.now();
384
+ const manager = new _listr2_manager.Manager({ concurrent: true });
385
+ const queryOptions = await initiateClaudeSessionOptions(manager);
386
+ for (const directory of targetPaths) {
387
+ const matchingFilePaths = (0, node_child_process.execSync)(`find "${directory}" -name "*.tsx" -type f`, { encoding: "utf-8" }).trim().split("\n").filter(Boolean).filter((filePath) => {
388
+ const content = (0, node_fs.readFileSync)(filePath, "utf-8");
389
+ return GREP_PATTERN.test(content);
390
+ });
391
+ if (matchingFilePaths.length === 0) manager.add([{
392
+ title: `\x1b[2m${formatPathOutput(directory)} - No files need migration\x1b[0m`,
393
+ task: (ctx) => {
394
+ ctx.skip = true;
395
+ }
396
+ }]);
397
+ else manager.add([{
398
+ title: `${formatPathOutput(directory)} - Found \x1b[32m${matchingFilePaths.length}\x1b[0m file(s) needing migration`,
399
+ task: async (_ctx, parentTask) => {
400
+ parentTask.title = `${formatPathOutput(directory)} - Migrating \x1b[32m${matchingFilePaths.length}\x1b[0m file(s)...`;
401
+ const completedFilesInDirectory = { count: 0 };
402
+ return parentTask.newListr(matchingFilePaths.map((filePath) => ({
403
+ title: "",
404
+ task: async (_fileCtx, fileTask) => {
405
+ await queryClaude(directory, filePath, queryOptions, fileTask, isDebug).finally(() => {
406
+ completedFilesInDirectory.count += 1;
407
+ const isDim = completedFilesInDirectory.count === matchingFilePaths.length;
408
+ parentTask.title = `${isDim ? "\x1B[2m" : ""}${formatPathOutput(directory)} - Migrated \x1b[32m${completedFilesInDirectory.count}\x1b[0m/\x1b[32m${matchingFilePaths.length}\x1b[0m files${isDim ? "\x1B[0m" : ""}`;
409
+ });
410
+ }
411
+ })), { concurrent: FILE_CONCURRENCY_LIMIT }).run();
412
+ }
413
+ }]);
414
+ }
415
+ await manager.runAll().finally(async () => {
416
+ await new listr2.Listr([{
417
+ title: `Finished migrating - elapsed time: \x1b[32m${generateElapsedTime(startTime)}\x1b[0m `,
418
+ task: async () => {}
419
+ }]).run();
420
+ });
421
+ };
422
+ var transformer_default = transformer;
423
+
424
+ //#endregion
425
+ Object.defineProperty(exports, 'transformer_default', {
426
+ enumerable: true,
427
+ get: function () {
428
+ return transformer_default;
429
+ }
430
+ });
431
+ //# sourceMappingURL=transformer-DakNFxg-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformer-DakNFxg-.js","names":["https","CONSOLE_ICONS","Manager","Listr"],"sources":["../src/transforms/list-item/constants.ts","../src/transforms/list-item/helpers.ts","../src/transforms/list-item/claude.ts","../src/transforms/list-item/transformer.ts"],"sourcesContent":["export const CLAUDE_SETTINGS_FILE = '.claude/settings.json';\nexport const VPN_COUNTDOWN_TIMEOUT = 5;\nexport const DIRECTORY_CONCURRENCY_LIMIT = 3;\nexport const FILE_CONCURRENCY_LIMIT = 10;\nconst DEPRECATED_COMPONENT_NAMES = [\n 'ActionOption',\n 'NavigationOption',\n 'NavigationOptionList',\n 'Summary',\n 'SwitchOption',\n 'CheckboxOption',\n 'RadioOption',\n];\nexport const GREP_PATTERN = new RegExp(\n `import\\\\s*\\\\{[\\\\s\\\\S]*?(${DEPRECATED_COMPONENT_NAMES.join('|')})[\\\\s\\\\S]*?\\\\}\\\\s*from\\\\s*['\"]@transferwise/components['\"]`,\n 'u',\n);\n\nconst MIGRATION_RULES = `Migration rules:\n# Legacy Component → ListItem Migration Guide\n\n## Import Management\n1. Remove imports: \\`{ ActionOption, NavigationOption, NavigationOptionList, Summary, SwitchOption, CheckboxOption, RadioOption }\\` from \\`'@transferwise/components'\\`\n2. Add import: \\`{ ListItem }\\` from \\`'@transferwise/components'\\`\n3. For Summary with info: Add \\`{ Modal }\\` and/or \\`{ Popover }\\` from \\`'@transferwise/components'\\`\n4. For Summary with info: Add \\`{ QuestionMarkCircle }\\` from \\`'@transferwise/icons'\\`\n5. For Summary with info modal: Add \\`{ useState }\\` from \\`'react'\\`\n\n## Universal Rules\n1. \\`title\\` → \\`title\\` (direct)\n2. \\`content\\` or \\`description\\` → \\`subtitle\\`\n3. \\`disabled\\` stays on \\`ListItem\\` (not controls)\n4. \\`id\\` stays on \\`ListItem\\` (not controls)\n5. Remove deprecated props: \\`as\\`, \\`complex\\`, \\`showMediaAtAllSizes\\`, \\`showMediaCircle\\`, \\`isContainerAligned\\`\n6. Preserve string quotes exactly as they are (don't convert \\`\\` to \\`'\\` or \\`\"\\`)\n7. When wrapping icons in \\`ListItem.AvatarView\\`: move \\`size\\` from icon to AvatarView (except Summary always uses 32)\n\n---\n\n## ActionOption → ListItem.Button\n\n- \\`action\\` → Button children\n- \\`onClick\\` → Button \\`onClick\\`\n- Priority mapping:\n - default or \\`\"primary\"\\` → \\`\"primary\"\\`\n - \\`\"secondary\"\\` → \\`\"secondary-neutral\"\\`\n - \\`\"secondary-send\"\\` → \\`\"secondary\"\\`\n - \\`\"tertiary\"\\` → \\`\"tertiary\"\\`\n\n\\`\\`\\`tsx\n<ActionOption title=\"Title\" content=\"Text\" action=\"Click\" priority=\"secondary\" onClick={fn} />\n→\n<ListItem title=\"Title\" subtitle=\"Text\" control={<ListItem.Button priority=\"secondary-neutral\" onClick={fn}>Click</ListItem.Button>} />\n\\`\\`\\`\n\n---\n\n## CheckboxOption → ListItem.Checkbox\n\n- \\`name\\` is moved to \\`ListItem.Checkbox\\`\n- \\`onChange\\`: \\`(checked: boolean) => void\\` → \\`(event: ChangeEvent<HTMLInputElement>) => void\\`\n - Update handler: \\`(checked) => setX(checked)\\` → \\`(event) => setX(event.target.checked)\\`\n\n\\`\\`\\`tsx\n<CheckboxOption id=\"x\" name=\"y\" title=\"Title\" content=\"Text\" checked={v} onChange={(c) => set(c)} />\n→\n<ListItem id=\"x\" title=\"Title\" subtitle=\"Text\" control={<ListItem.Checkbox name=\"y\" checked={v} onChange={(e) => set(e.target.checked)} />} />\n\\`\\`\\`\n\n---\n\n## RadioOption → ListItem.Radio\n\n- \\`name\\`, \\`value\\`, \\`checked\\`, \\`onChange\\` move to Radio\n\n\\`\\`\\`tsx\n<RadioOption id=\"x\" name=\"y\" value=\"v\" title=\"Title\" content=\"Text\" checked={v==='v'} onChange={set} />\n→\n<ListItem id=\"x\" title=\"Title\" subtitle=\"Text\" control={<ListItem.Radio name=\"y\" value=\"v\" checked={v==='v'} onChange={set} />} />\n\\`\\`\\`\n\n---\n\n## SwitchOption → ListItem.Switch\n\n- \\`aria-label\\` is moved to \\`ListItem.Switch\\`\n- \\`onChange\\` → \\`onClick\\` with manual toggle: \\`onChange={set}\\` → \\`onClick={() => set(!v)}\\`\n\n\\`\\`\\`tsx\n<SwitchOption id=\"x\" title=\"Title\" content=\"Text\" checked={v} aria-label=\"Toggle\" onChange={set} />\n→\n<ListItem id=\"x\" title=\"Title\" subtitle=\"Text\" control={<ListItem.Switch checked={v} aria-label=\"Toggle\" onClick={() => set(!v)} />} />\n\\`\\`\\`\n\n---\n\n## NavigationOption → ListItem.Navigation\n\n- \\`onClick\\` or \\`href\\` move to Navigation\n\n\\`\\`\\`tsx\n<NavigationOption title=\"Title\" content=\"Text\" onClick={fn} />\n→\n<ListItem title=\"Title\" subtitle=\"Text\" control={<ListItem.Navigation onClick={fn} />} />\n\\`\\`\\`\n\n---\n\n## NavigationOptionList → (remove wrapper)\n\n- Convert \\`NavigationOptionList\\` wrapper to \\`<List></List>\\`\n- Convert each child \\`NavigationOption\\` to \\`ListItem\\` with \\`ListItem.Navigation\\`\n\n\\`\\`\\`tsx\n<NavigationOptionList>\n <NavigationOption title=\"T1\" content=\"C1\" onClick={fn1} />\n <NavigationOption title=\"T2\" content=\"C2\" href=\"/link\" />\n</NavigationOptionList>\n→\n<>\n <ListItem title=\"T1\" subtitle=\"C1\" control={<ListItem.Navigation onClick={fn1} />} />\n <ListItem title=\"T2\" subtitle=\"C2\" control={<ListItem.Navigation href=\"/link\" />} />\n</>\n\\`\\`\\`\n\n---\n\n## Option → ListItem\n\n- Wrap \\`media\\` in \\`ListItem.AvatarView\\`\n- Move \\`size\\` prop from icon to AvatarView (keeping same value)\n\n\\`\\`\\`tsx\n<Option media={<Icon size={48} />} title=\"Title\" />\n→\n<ListItem title=\"Title\" media={<ListItem.AvatarView size={48}><Icon /></ListItem.AvatarView>} />\n\\`\\`\\`\n\n---\n\n## Summary → ListItem\n\n### Basic\n- \\`icon\\` prop → wrap in \\`ListItem.AvatarView\\` with \\`size={32}\\` as \\`media\\`\n- ALWAYS use \\`size={32}\\` on AvatarView (regardless of original icon size)\n- ALWAYS remove \\`size\\` prop from child icon\n- Summary-specific: always uses 32, while other components move size value from icon to AvatarView\n\n### Status mapping\n- \\`Status.DONE\\` → \\`badge={{ status: 'positive' }}\\` on AvatarView\n- \\`Status.PENDING\\` → \\`badge={{ status: 'pending' }}\\` on AvatarView\n- \\`Status.NOT_DONE\\` → no badge\n\n### Action\n- \\`action.text\\` → \\`action.label\\` in \\`ListItem.AdditionalInfo\\`\n- Pass entire action object including \\`href\\`, \\`onClick\\`, \\`target\\`\n- Remove \\`aria-label\\` from action (not supported)\n\n### Info with Modal (add state management)\n- Add: \\`const [open, setOpen] = useState(false)\\`\n- Create \\`ListItem.IconButton\\` with \\`partiallyInteractive\\` and \\`onClick\\`\n- Render \\`Modal\\` separately with state\n- Transfer \\`aria-label\\` to IconButton\n\n### Info with Popover\n- \\`Popover\\` wraps \\`ListItem.IconButton\\` with \\`partiallyInteractive\\`\n- Transfer \\`aria-label\\` to IconButton\n\n\\`\\`\\`tsx\n// Basic (icon with or without size prop always becomes size={32} on AvatarView)\n<Summary title=\"T\" description=\"D\" icon={<Icon size={24} />} />\n→\n<ListItem title=\"T\" subtitle=\"D\" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} />\n\n// Status\n<Summary title=\"T\" description=\"D\" icon={<Icon />} status={Status.DONE} />\n→\n<ListItem title=\"T\" subtitle=\"D\" media={<ListItem.AvatarView size={32} badge={{status:'positive'}}><Icon /></ListItem.AvatarView>} />\n\n// Action\n<Summary title=\"T\" description=\"D\" icon={<Icon />} action={{text:'Go', href:'/go', target:'_blank'}} />\n→\n<ListItem title=\"T\" subtitle=\"D\" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} additionalInfo={<ListItem.AdditionalInfo action={{label:'Go', href:'/go', target:'_blank'}} />} />\n\n// Modal (requires state: const [open, setOpen] = useState(false))\n<Summary title=\"T\" description=\"D\" icon={<Icon />} info={{title:'Help', content:'Text', presentation:'MODAL', 'aria-label':'Info'}} />\n→\n<>\n <ListItem title=\"T\" subtitle=\"D\" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} control={\n <ListItem.IconButton partiallyInteractive aria-label=\"Info\" onClick={()=>setOpen(!open)}>\n <QuestionMarkCircle />\n </ListItem.IconButton>\n } />\n <Modal open={open} title=\"Help\" body=\"Text\" onClose={()=>setOpen(false)} />\n</>\n\n// Popover\n<Summary title=\"T\" description=\"D\" icon={<Icon />} info={{title:'Help', content:'Text', presentation:'POPOVER', 'aria-label':'Info'}} />\n→\n<ListItem title=\"T\" subtitle=\"D\" media={<ListItem.AvatarView size={32}><Icon /></ListItem.AvatarView>} control={\n <Popover title=\"Help\" content=\"Text\" onClose={()=>setOpen(false)}>\n <ListItem.IconButton partiallyInteractive aria-label=\"Info\">\n <QuestionMarkCircle />\n </ListItem.IconButton>\n </Popover>\n} />\n\\`\\`\\`\n\n`;\n\nexport const SYSTEM_PROMPT = `You are a code migration assistant that helps migrate TypeScript/JSX code from deprecated Wise Design System (WDS) components to the new ListItem component and ListItem subcomponents from '@transferwise/components'.\n\nRules:\n1. Only ever modify files via the Edit tool - do not use the Write tool\n2. When identifying what code to migrate within a file, explain how you identified it first.\n3. Migrate components per provided migration rules\n4. Maintain TypeScript type safety and update types to match new API\n5. Map props: handle renamed, deprecated, new required, and changed types\n6. Update imports to new WDS components and types\n7. Preserve code style, formatting, and calculated logic\n8. Handle conditional rendering, spread props, and complex expressions\n9. Note: New components may lack feature parity with legacy versions\n10. Only modify code requiring changes per migration rules, and any impacted surrounding code for context.\n11. Final result response should just be whether the migration was successful overall, or if any errors were encountered\n - Do not summarise or explain the changes made\n12. Explain your reasoning and justification before making changes, as you edit each file.\n - Keep it concise and succinct, as only bullet points\n13. After modifying the file, do not summarise the changes made.\n14. If you do not have permission to edit a file, still attempt to edit it and then move onto the next file.\n\nYou'll receive:\n- File paths to migrate in individual queries\n- Deprecated component names at the end of this prompt\n- Migration context and rules for each deprecated component\n\nDeprecated components: ${DEPRECATED_COMPONENT_NAMES.join(', ')}.\n\n${MIGRATION_RULES}`;\n","/** Split the path to get the relative path after the directory, and wrap with ANSI color codes */\nexport function formatPathOutput(directory: string, path?: string, asDim?: boolean): string {\n const relativePath = path ? (path.split(directory.replace('.', ''))[1] ?? path) : directory;\n return asDim ? `\\x1b[2m${relativePath}\\x1b[0m` : `\\x1b[32m${relativePath}\\x1b[0m`;\n}\n\n/** Generates a formatted string representing the total elapsed time since the given start time */\nexport function generateElapsedTime(startTime: number): string {\n const endTime = Date.now();\n const elapsedTime = Math.floor((endTime - startTime) / 1000);\n const hours = Math.floor(elapsedTime / 3600);\n const minutes = Math.floor((elapsedTime % 3600) / 60);\n const seconds = elapsedTime % 60;\n\n return `${hours ? `${hours}h ` : ''}${minutes ? `${minutes}m ` : ''}${seconds ? `${seconds}s` : ''}`;\n}\n","/* eslint-disable no-param-reassign */\nimport https from 'node:https';\n\nimport { type Options, query } from '@anthropic-ai/claude-agent-sdk';\nimport type { Manager } from '@listr2/manager';\nimport { execSync } from 'child_process';\nimport { readFileSync } from 'fs';\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\nimport { resolve } from 'path';\n\nimport { CONSOLE_ICONS } from '../../constants';\nimport {\n CLAUDE_SETTINGS_FILE,\n DIRECTORY_CONCURRENCY_LIMIT,\n SYSTEM_PROMPT,\n VPN_COUNTDOWN_TIMEOUT,\n} from './constants';\nimport { formatPathOutput, generateElapsedTime } from './helpers';\nimport type { ClaudeSettings } from './types';\n\nasync function checkVPN(\n baseUrl: string | undefined,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n): Promise<void> {\n if (!baseUrl) return;\n\n const checkOnce = async (): Promise<boolean> =>\n new Promise<boolean>((resolveCheck) => {\n const url = new URL('/health', baseUrl);\n const req = https.get(url, { timeout: 2000, rejectUnauthorized: false }, (res) => {\n const ok = !!(res.statusCode && res.statusCode >= 200 && res.statusCode < 400);\n res.resume();\n resolveCheck(ok);\n });\n req.on('timeout', () => {\n req.destroy(new Error('timeout'));\n });\n req.on('error', () => resolveCheck(false));\n });\n\n while (true) {\n const ok = await checkOnce();\n if (ok) {\n task.title = 'Connected to VPN';\n break;\n }\n\n // Countdown from 5s\n for (let countdown = VPN_COUNTDOWN_TIMEOUT; countdown > 0; countdown -= 1) {\n task.output = `Please connect to VPN... retrying in ${countdown}s`;\n await new Promise<void>((response) => {\n setTimeout(response, 1000);\n });\n }\n }\n}\n\nexport function getQueryOptions(sessionId?: string): Options {\n // Read settings from ~/.claude/settings.json to get headers and apiKeyHelper\n const claudeSettingsPath = resolve(process.env.HOME || '', CLAUDE_SETTINGS_FILE);\n const settings = JSON.parse(readFileSync(claudeSettingsPath, 'utf-8')) as ClaudeSettings;\n\n // Get API key by executing the apiKeyHelper script, for authenticating with Okta via LLM Gateway\n let apiKey;\n try {\n apiKey = execSync(`bash ${settings.apiKeyHelper}`, {\n encoding: 'utf-8',\n }).trim();\n } catch {}\n\n if (!apiKey || !settings.env?.ANTHROPIC_BASE_URL) {\n throw new Error(\n 'Failed to retrieve Anthropic API key or Base URL. Please check your Claude Code x LLM Gateway configuration - https://transferwise.atlassian.net/wiki/x/_YUe3Q',\n );\n }\n\n const { ANTHROPIC_CUSTOM_HEADERS, ...restEnvVars } = settings?.env ?? {};\n\n const envVars = {\n ANTHROPIC_AUTH_TOKEN: apiKey,\n ANTHROPIC_CUSTOM_HEADERS,\n ...restEnvVars,\n PATH: process.env.PATH, // Specifying PATH, as Claude Agent SDK seems to struggle consuming the actual environment PATH\n };\n\n return {\n resume: sessionId,\n env: envVars,\n permissionMode: 'acceptEdits',\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: SYSTEM_PROMPT,\n },\n allowedTools: ['Grep', 'Read'],\n settingSources: ['local', 'project', 'user'],\n };\n}\n\n/** Initiate a new Claude session/conversation and return reusable options */\nexport async function initiateClaudeSessionOptions(manager: Manager): Promise<Options> {\n const options = getQueryOptions(undefined);\n\n manager.add([\n {\n title: 'Checking VPN connection',\n task: async (\n _,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => checkVPN(options.env?.ANTHROPIC_BASE_URL, task),\n },\n ]);\n\n await manager.runAll();\n\n manager.add([\n {\n title: 'Starting Claude instance',\n task: async (_, task) => {\n task.output = 'Your browser may open for Okta authentication if required';\n\n const result = query({\n options,\n prompt: `You'll be given file paths in additional individual queries to search in for files using deprecated Wise Design System (WDS) components. Migrate the code per the provided migration rules.`,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'system':\n if (message.subtype === 'init' && !options.resume) {\n task.title = 'Successfully initialised Claude instance\\n';\n // Set the session ID to resume the conversation in future queries\n options.resume = message.session_id;\n }\n break;\n default:\n if (message.type === 'result' && message.subtype !== 'success') {\n throw new Error(\n `Claude encountered an error when initialising: ${message.errors.join('\\n')}`,\n );\n }\n }\n }\n\n task.task.complete();\n },\n },\n ]);\n\n await manager.runAll().finally(() => {\n // Set manager to run tasks concurrently, once initialisation steps are done\n manager.options = {\n concurrent: DIRECTORY_CONCURRENCY_LIMIT,\n };\n });\n\n return options;\n}\n\n// Queries Claude with the given path and handles logging of tool uses and results\nexport async function queryClaude(\n directory: string,\n filePath: string,\n options: Options,\n task: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n isDebug = false,\n) {\n const startTime = Date.now();\n const result = query({\n options,\n prompt: filePath,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'result':\n if (message.subtype === 'success' && isDebug) {\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n task.output = `\\x1b[2mMigrated in ${generateElapsedTime(startTime)}\\x1b[0m`;\n } else if (message.is_error) {\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n task.output = `${CONSOLE_ICONS.error} Claude encountered an error: ${JSON.stringify(message)}`;\n }\n break;\n default:\n }\n }\n}\n","/* eslint-disable no-param-reassign */\n/* eslint-disable no-underscore-dangle */\nimport { Manager } from '@listr2/manager';\nimport { execSync } from 'child_process';\nimport { readFileSync } from 'fs';\nimport {\n type DefaultRenderer,\n Listr,\n type ListrTask,\n type ListrTaskWrapper,\n type SimpleRenderer,\n} from 'listr2';\n\nimport { initiateClaudeSessionOptions, queryClaude } from './claude';\nimport { FILE_CONCURRENCY_LIMIT, GREP_PATTERN } from './constants';\nimport { formatPathOutput, generateElapsedTime } from './helpers';\n\nconst transformer = async (targetPaths: string[], isDebug = false) => {\n process.setMaxListeners(20); // Resolves potential memory issues with how Claude handles it's own event listeners\n const startTime = Date.now();\n // Create manager for handling multiple listr instances\n const manager = new Manager({\n concurrent: true,\n });\n const queryOptions = await initiateClaudeSessionOptions(manager);\n\n // Process each directory\n for (const directory of targetPaths) {\n // Find all .tsx files in the directory\n const allTsxFiles = execSync(`find \"${directory}\" -name \"*.tsx\" -type f`, {\n encoding: 'utf-8',\n })\n .trim()\n .split('\\n')\n .filter(Boolean);\n\n // Filter files that match the pattern by reading and testing each file\n const matchingFilePaths = allTsxFiles.filter((filePath) => {\n const content = readFileSync(filePath, 'utf-8');\n return GREP_PATTERN.test(content);\n });\n\n // No files to process in this directory, so we add a task that's immediately skipped\n if (matchingFilePaths.length === 0) {\n manager.add([\n {\n title: `\\x1b[2m${formatPathOutput(directory)} - No files need migration\\x1b[0m`,\n task: (ctx: ListrTask): void => {\n ctx.skip = true;\n },\n },\n ]);\n } else {\n manager.add([\n {\n title: `${formatPathOutput(directory)} - Found \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s) needing migration`,\n task: async (_ctx, parentTask) => {\n parentTask.title = `${formatPathOutput(directory)} - Migrating \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s)...`;\n const completedFilesInDirectory = { count: 0 };\n return parentTask\n .newListr(\n matchingFilePaths.map((filePath) => ({\n title: '', // No title so it runs in the background without any console output\n task: async (\n _fileCtx,\n fileTask: ListrTaskWrapper<\n never,\n typeof DefaultRenderer,\n typeof SimpleRenderer\n >,\n ) => {\n await queryClaude(directory, filePath, queryOptions, fileTask, isDebug).finally(\n () => {\n // Update parent task title with progress for each completed file migration\n completedFilesInDirectory.count += 1;\n const isDim = completedFilesInDirectory.count === matchingFilePaths.length;\n parentTask.title = `${isDim ? '\\x1b[2m' : ''}${formatPathOutput(directory)} - Migrated \\x1b[32m${completedFilesInDirectory.count}\\x1b[0m/\\x1b[32m${matchingFilePaths.length}\\x1b[0m files${isDim ? '\\x1b[0m' : ''}`;\n },\n );\n },\n })),\n { concurrent: FILE_CONCURRENCY_LIMIT },\n )\n .run();\n },\n },\n ]);\n }\n }\n\n // Run all directory tasks, with final follow up/summary task\n await manager.runAll().finally(async () => {\n await new Listr([\n {\n title: `Finished migrating - elapsed time: \\x1b[32m${generateElapsedTime(startTime)}\\x1b[0m `,\n task: async () => {\n // Task completes immediately\n },\n },\n ]).run();\n });\n};\n\nexport default transformer;\n"],"mappings":";;;;;;;;;;;AAAA,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,8BAA8B;AAC3C,MAAa,yBAAyB;AACtC,MAAM,6BAA6B;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAa,eAAe,IAAI,OAC9B,2BAA2B,2BAA2B,KAAK,IAAI,CAAC,6DAChE,IACD;AAED,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M,oCAAuB,UAAU,QAAQ;AAC/C,UAAO,aAAa,KAAK,QAAQ;IACjC;AAGF,MAAI,kBAAkB,WAAW,EAC/B,SAAQ,IAAI,CACV;GACE,OAAO,UAAU,iBAAiB,UAAU,CAAC;GAC7C,OAAO,QAAyB;AAC9B,QAAI,OAAO;;GAEd,CACF,CAAC;MAEF,SAAQ,IAAI,CACV;GACE,OAAO,GAAG,iBAAiB,UAAU,CAAC,mBAAmB,kBAAkB,OAAO;GAClF,MAAM,OAAO,MAAM,eAAe;AAChC,eAAW,QAAQ,GAAG,iBAAiB,UAAU,CAAC,uBAAuB,kBAAkB,OAAO;IAClG,MAAM,4BAA4B,EAAE,OAAO,GAAG;AAC9C,WAAO,WACJ,SACC,kBAAkB,KAAK,cAAc;KACnC,OAAO;KACP,MAAM,OACJ,UACA,aAKG;AACH,YAAM,YAAY,WAAW,UAAU,cAAc,UAAU,QAAQ,CAAC,cAChE;AAEJ,iCAA0B,SAAS;OACnC,MAAM,QAAQ,0BAA0B,UAAU,kBAAkB;AACpE,kBAAW,QAAQ,GAAG,QAAQ,YAAY,KAAK,iBAAiB,UAAU,CAAC,sBAAsB,0BAA0B,MAAM,kBAAkB,kBAAkB,OAAO,eAAe,QAAQ,YAAY;QAElN;;KAEJ,EAAE,EACH,EAAE,YAAY,wBAAwB,CACvC,CACA,KAAK;;GAEX,CACF,CAAC;;AAKN,OAAM,QAAQ,QAAQ,CAAC,QAAQ,YAAY;AACzC,QAAM,IAAIC,aAAM,CACd;GACE,OAAO,8CAA8C,oBAAoB,UAAU,CAAC;GACpF,MAAM,YAAY;GAGnB,CACF,CAAC,CAAC,KAAK;GACR;;AAGJ,0BAAe"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_helpers = require('../../helpers-C6KebpWf.js');
2
+ const require_helpers = require('../../helpers-Du-iz0Iu.js');
3
3
 
4
4
  //#region src/helpers/addImport.ts
5
5
  /**