@wise/wds-codemods 1.3.0-experimental-5293866 → 1.3.0-experimental-33c4d23
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.
- package/dist/{claude-cHSlHbX1.js → claude-D6IwFmoz.js} +2 -2
- package/dist/{claude-cHSlHbX1.js.map → claude-D6IwFmoz.js.map} +1 -1
- package/dist/{common-nTdKnfMB.js → common-AexZXiET.js} +1 -1
- package/dist/{common-nTdKnfMB.js.map → common-AexZXiET.js.map} +1 -1
- package/dist/{helpers-CPecHtc3.js → helpers-CZ779nXI.js} +85 -49
- package/dist/helpers-CZ779nXI.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/transforms/button/transformer.js +1 -1
- package/dist/transforms/button/transformer.js.map +1 -1
- package/dist/transforms/info-prompt/transformer.js +1 -1
- package/dist/transforms/info-prompt/transformer.js.map +1 -1
- package/dist/transforms/list-item/transformer.js +1 -1
- package/dist/transforms/list-item/transformer.js.map +1 -1
- package/package.json +3 -3
- package/dist/helpers-CPecHtc3.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CONSOLE_ICONS } from "./common-
|
|
1
|
+
import { t as CONSOLE_ICONS } from "./common-AexZXiET.js";
|
|
2
2
|
import { execSync } from "node:child_process";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
@@ -236,4 +236,4 @@ const claudeTransformer = async ({ targetDirectories, componentGrepPattern, addi
|
|
|
236
236
|
//#endregion
|
|
237
237
|
export { claudeTransformer as t };
|
|
238
238
|
|
|
239
|
-
//# sourceMappingURL=claude-
|
|
239
|
+
//# sourceMappingURL=claude-D6IwFmoz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-cHSlHbX1.js","names":[],"sources":["../src/constants/claude.ts","../src/helpers/common/pathUtils.ts","../src/helpers/common/timerUtils.ts","../src/helpers/common/vpnUtils.ts","../src/helpers/claude/query.ts","../src/helpers/claude/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;\n\nexport const INITIAL_CLAUDE_PROMPT = `You are a code migration assistant that helps migrate TypeScript/JSX code of deprecated Wise Design System (WDS) components from '@transferwise/components', to their new replacement components as detailed in the relevant migration guide. The following is a list of rules that must always be followed throughout the migration process.\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\nAdditionally you'll receive:\n- File paths to migrate in individual queries\n- Deprecated component names at the end of this prompt\n- Migration context and guide for each deprecated component`;\n","/** Split the path string 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","/** 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","import https from 'node:https';\n\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport { VPN_COUNTDOWN_TIMEOUT } from '../../constants/claude';\n\n/** Checks VPN connectivity by pinging the provided base URL's /health endpoint, with countdown retries */\nexport async 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 // eslint-disable-next-line no-param-reassign\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 // eslint-disable-next-line no-param-reassign\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","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nimport { type Options, query } from '@anthropic-ai/claude-agent-sdk';\nimport type { Manager } from '@listr2/manager';\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport {\n CLAUDE_SETTINGS_FILE,\n DIRECTORY_CONCURRENCY_LIMIT,\n INITIAL_CLAUDE_PROMPT,\n} from '../../constants/claude';\nimport { CONSOLE_ICONS } from '../../constants/common';\nimport { checkVPN, formatPathOutput, generateElapsedTime } from '../common';\n\ninterface ClaudeSettings {\n apiKeyHelper?: string;\n env?: {\n ANTHROPIC_BASE_URL?: string;\n ANTHROPIC_CUSTOM_HEADERS?: string;\n ANTHROPIC_DEFAULT_SONNET_MODEL?: string;\n ANTHROPIC_DEFAULT_HAIKU_MODEL?: string;\n ANTHROPIC_DEFAULT_OPUS_MODEL?: string;\n API_TIMEOUT_MS?: string;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\ninterface QueryOptionProps {\n additionalPromptContext?: string;\n}\n\n/**\n * Creates reusable query options for Claude session, including authentication and system prompt\n */\nfunction getQueryOptions({ additionalPromptContext }: QueryOptionProps): 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 env: envVars,\n permissionMode: 'acceptEdits',\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: `${INITIAL_CLAUDE_PROMPT}\\n${additionalPromptContext}`,\n },\n allowedTools: ['Grep', 'Read'],\n settingSources: ['local', 'project', 'user'],\n };\n}\n\n/**\n * Initiate a new Claude session/conversation and return reusable options\n */\nexport async function initiateClaudeSessionOptions(\n manager: Manager,\n additionalPromptContext: string,\n): Promise<Options> {\n let options: Options = {};\n\n manager.add([\n {\n title: 'Configuring Claude connection and instance...',\n task: async (ctx, task) => {\n options = getQueryOptions({ additionalPromptContext });\n\n return task.newListr([\n {\n title: 'Checking VPN connection...',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => checkVPN(options.env?.ANTHROPIC_BASE_URL, subtask),\n },\n {\n title: 'Initialising Claude session',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => {\n // eslint-disable-next-line no-param-reassign\n subtask.output = 'Your browser may open for Okta authentication if required';\n\n const result = query({\n options,\n prompt: `This is an initialisation query to start a new Claude code migration session. No text response is needed.`,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'system':\n if (message.subtype === 'init' && !options.resume) {\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 // eslint-disable-next-line no-param-reassign\n task.title = 'Successfully configured and initialised Claude\\n';\n },\n },\n ]);\n },\n },\n ]);\n\n // Set manager to run tasks concurrently, once initialisation steps are done\n await manager.runAll().finally(() => {\n // eslint-disable-next-line no-param-reassign\n manager.options = {\n concurrent: DIRECTORY_CONCURRENCY_LIMIT,\n };\n });\n\n return options;\n}\n\n/**\n * Queries Claude with the given path and handles logging of success/error messages\n */\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 // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `\\x1b[2mMigrated in ${generateElapsedTime(startTime)}\\x1b[0m`;\n } else if (message.is_error) {\n // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `${CONSOLE_ICONS.error} Claude encountered an error: ${JSON.stringify(message)}`;\n }\n break;\n default:\n }\n }\n}\n","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\n\nimport { Manager } from '@listr2/manager';\nimport {\n type DefaultRenderer,\n Listr,\n type ListrTask,\n type ListrTaskWrapper,\n type SimpleRenderer,\n} from 'listr2';\n\nimport { FILE_CONCURRENCY_LIMIT } from '../../constants/claude';\nimport { formatPathOutput, generateElapsedTime } from '../common';\nimport { initiateClaudeSessionOptions, queryClaude } from './query';\n\ninterface ClaudeTransformerOptions {\n targetDirectories: string[];\n componentGrepPattern: RegExp;\n additionalPromptContext: string;\n isDebug?: boolean;\n}\n\n/**\n * Performs code migration using Claude for the specified target directories, for the provided deprecated components and migration guides.\n * @param targetDirectories - Array of directory paths to process\n * @param componentGrepPattern - RegExp pattern to identify files needing migration (e.g. via deprecated component imports)\n * @param isDebug - Whether to enable debug logging\n * @param additionalPromptContext - Additional context to include in the initial Claude prompt before processing files\n */\nexport const claudeTransformer = async ({\n targetDirectories,\n componentGrepPattern,\n additionalPromptContext,\n isDebug = false,\n}: ClaudeTransformerOptions) => {\n process.setMaxListeners(20); // Resolves potential memory issues with how Claude handles its 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, additionalPromptContext);\n\n manager.add([\n {\n title: 'Processing target directories for migration...',\n task: async (ctx, task) => {\n return task.newListr(\n targetDirectories.map((directory) => {\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 componentGrepPattern.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 return {\n title: `\\x1b[2m${formatPathOutput(directory)} - No files need migration\\x1b[0m`,\n task: (subCtx: ListrTask): void => {\n // eslint-disable-next-line no-param-reassign\n subCtx.skip = true;\n },\n };\n }\n\n return {\n title: `${formatPathOutput(directory)} - Found \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s) needing migration`,\n task: async (subCtx, parentTask) => {\n // eslint-disable-next-line no-param-reassign\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(\n directory,\n filePath,\n queryOptions,\n fileTask,\n isDebug,\n ).finally(() => {\n // Update parent task title with progress for each completed file migration\n completedFilesInDirectory.count += 1;\n const isDim =\n completedFilesInDirectory.count === matchingFilePaths.length;\n // eslint-disable-next-line no-param-reassign\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 { concurrent: FILE_CONCURRENCY_LIMIT },\n )\n .run();\n },\n };\n }),\n { rendererOptions: { suffixSkips: false, collapseSubtasks: false } },\n );\n },\n },\n ]);\n\n // Run all directory tasks concurrently, 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"],"mappings":";;;;;;;;;AAAA,MAAa,uBAAuB;AAKpC,MAAa,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJrC,SAAgB,iBAAiB,WAAmB,MAAe,OAAyB;CAC1F,MAAM,eAAe,OAAQ,KAAK,MAAM,UAAU,QAAQ,KAAK,GAAG,CAAC,CAAC,MAAM,OAAQ;AAClF,QAAO,QAAQ,UAAU,aAAa,WAAW,WAAW,aAAa;;;;;ACF3E,SAAgB,oBAAoB,WAA2B;CAE7D,MAAM,cAAc,KAAK,OADT,KAAK,KACkB,GAAG,aAAa,IAAK;CAC5D,MAAM,QAAQ,KAAK,MAAM,cAAc,KAAK;CAC5C,MAAM,UAAU,KAAK,MAAO,cAAc,OAAQ,GAAG;CACrD,MAAM,UAAU,cAAc;AAE9B,QAAO,GAAG,QAAQ,GAAG,MAAM,MAAM,KAAK,UAAU,GAAG,QAAQ,MAAM,KAAK,UAAU,GAAG,QAAQ,KAAK;;;;;ACDlG,eAAsB,SACpB,SACA,MACe;AACf,KAAI,CAAC,QAAS;CAEd,MAAM,YAAY,YAChB,IAAI,SAAkB,iBAAiB;EACrC,MAAM,MAAM,IAAI,IAAI,WAAW,QAAQ;EACvC,MAAM,MAAM,MAAM,IAAI,KAAK;GAAE,SAAS;GAAM,oBAAoB;GAAO,GAAG,QAAQ;GAChF,MAAM,KAAK,CAAC,EAAE,IAAI,cAAc,IAAI,cAAc,OAAO,IAAI,aAAa;AAC1E,OAAI,QAAQ;AACZ,gBAAa,GAAG;IAChB;AACF,MAAI,GAAG,iBAAiB;AACtB,OAAI,wBAAQ,IAAI,MAAM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O,8CAA8C,oBAAoB,UAAU,CAAC;GACpF,MAAM,YAAY;GAGnB,CACF,CAAC,CAAC,KAAK;GACR"}
|
|
1
|
+
{"version":3,"file":"claude-D6IwFmoz.js","names":[],"sources":["../src/constants/claude.ts","../src/helpers/common/pathUtils.ts","../src/helpers/common/timerUtils.ts","../src/helpers/common/vpnUtils.ts","../src/helpers/claude/query.ts","../src/helpers/claude/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;\n\nexport const INITIAL_CLAUDE_PROMPT = `You are a code migration assistant that helps migrate TypeScript/JSX code of deprecated Wise Design System (WDS) components from '@transferwise/components', to their new replacement components as detailed in the relevant migration guide. The following is a list of rules that must always be followed throughout the migration process.\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\nAdditionally you'll receive:\n- File paths to migrate in individual queries\n- Deprecated component names at the end of this prompt\n- Migration context and guide for each deprecated component`;\n","/** Split the path string 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","/** 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","import https from 'node:https';\n\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport { VPN_COUNTDOWN_TIMEOUT } from '../../constants/claude';\n\n/** Checks VPN connectivity by pinging the provided base URL's /health endpoint, with countdown retries */\nexport async 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 // eslint-disable-next-line no-param-reassign\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 // eslint-disable-next-line no-param-reassign\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","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nimport { type Options, query } from '@anthropic-ai/claude-agent-sdk';\nimport type { Manager } from '@listr2/manager';\nimport type { DefaultRenderer, ListrTaskWrapper, SimpleRenderer } from 'listr2';\n\nimport {\n CLAUDE_SETTINGS_FILE,\n DIRECTORY_CONCURRENCY_LIMIT,\n INITIAL_CLAUDE_PROMPT,\n} from '../../constants/claude';\nimport { CONSOLE_ICONS } from '../../constants/common';\nimport { checkVPN, formatPathOutput, generateElapsedTime } from '../common';\n\ninterface ClaudeSettings {\n apiKeyHelper?: string;\n env?: {\n ANTHROPIC_BASE_URL?: string;\n ANTHROPIC_CUSTOM_HEADERS?: string;\n ANTHROPIC_DEFAULT_SONNET_MODEL?: string;\n ANTHROPIC_DEFAULT_HAIKU_MODEL?: string;\n ANTHROPIC_DEFAULT_OPUS_MODEL?: string;\n API_TIMEOUT_MS?: string;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\ninterface QueryOptionProps {\n additionalPromptContext?: string;\n}\n\n/**\n * Creates reusable query options for Claude session, including authentication and system prompt\n */\nfunction getQueryOptions({ additionalPromptContext }: QueryOptionProps): 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 env: envVars,\n permissionMode: 'acceptEdits',\n systemPrompt: {\n type: 'preset',\n preset: 'claude_code',\n append: `${INITIAL_CLAUDE_PROMPT}\\n${additionalPromptContext}`,\n },\n allowedTools: ['Grep', 'Read'],\n settingSources: ['local', 'project', 'user'],\n };\n}\n\n/**\n * Initiate a new Claude session/conversation and return reusable options\n */\nexport async function initiateClaudeSessionOptions(\n manager: Manager,\n additionalPromptContext: string,\n): Promise<Options> {\n let options: Options = {};\n\n manager.add([\n {\n title: 'Configuring Claude connection and instance...',\n task: async (ctx, task) => {\n options = getQueryOptions({ additionalPromptContext });\n\n return task.newListr([\n {\n title: 'Checking VPN connection...',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => checkVPN(options.env?.ANTHROPIC_BASE_URL, subtask),\n },\n {\n title: 'Initialising Claude session',\n task: async (\n subCtx,\n subtask: ListrTaskWrapper<never, typeof DefaultRenderer, typeof SimpleRenderer>,\n ) => {\n // eslint-disable-next-line no-param-reassign\n subtask.output = 'Your browser may open for Okta authentication if required';\n\n const result = query({\n options,\n prompt: `This is an initialisation query to start a new Claude code migration session. No text response is needed.`,\n });\n\n for await (const message of result) {\n switch (message.type) {\n case 'system':\n if (message.subtype === 'init' && !options.resume) {\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 // eslint-disable-next-line no-param-reassign\n task.title = 'Successfully configured and initialised Claude\\n';\n },\n },\n ]);\n },\n },\n ]);\n\n // Set manager to run tasks concurrently, once initialisation steps are done\n await manager.runAll().finally(() => {\n // eslint-disable-next-line no-param-reassign\n manager.options = {\n concurrent: DIRECTORY_CONCURRENCY_LIMIT,\n };\n });\n\n return options;\n}\n\n/**\n * Queries Claude with the given path and handles logging of success/error messages\n */\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 // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `\\x1b[2mMigrated in ${generateElapsedTime(startTime)}\\x1b[0m`;\n } else if (message.is_error) {\n // eslint-disable-next-line no-param-reassign\n task.title = `\\x1b[2m${formatPathOutput(directory, filePath)}\\x1b[0m]`;\n // eslint-disable-next-line no-param-reassign\n task.output = `${CONSOLE_ICONS.error} Claude encountered an error: ${JSON.stringify(message)}`;\n }\n break;\n default:\n }\n }\n}\n","import { execSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\n\nimport { Manager } from '@listr2/manager';\nimport {\n type DefaultRenderer,\n Listr,\n type ListrTask,\n type ListrTaskWrapper,\n type SimpleRenderer,\n} from 'listr2';\n\nimport { FILE_CONCURRENCY_LIMIT } from '../../constants/claude';\nimport { formatPathOutput, generateElapsedTime } from '../common';\nimport { initiateClaudeSessionOptions, queryClaude } from './query';\n\ninterface ClaudeTransformerOptions {\n targetDirectories: string[];\n componentGrepPattern: RegExp;\n additionalPromptContext: string;\n isDebug?: boolean;\n}\n\n/**\n * Performs code migration using Claude for the specified target directories, for the provided deprecated components and migration guides.\n * @param targetDirectories - Array of directory paths to process\n * @param componentGrepPattern - RegExp pattern to identify files needing migration (e.g. via deprecated component imports)\n * @param isDebug - Whether to enable debug logging\n * @param additionalPromptContext - Additional context to include in the initial Claude prompt before processing files\n */\nexport const claudeTransformer = async ({\n targetDirectories,\n componentGrepPattern,\n additionalPromptContext,\n isDebug = false,\n}: ClaudeTransformerOptions) => {\n process.setMaxListeners(20); // Resolves potential memory issues with how Claude handles its 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, additionalPromptContext);\n\n manager.add([\n {\n title: 'Processing target directories for migration...',\n task: async (ctx, task) => {\n return task.newListr(\n targetDirectories.map((directory) => {\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 componentGrepPattern.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 return {\n title: `\\x1b[2m${formatPathOutput(directory)} - No files need migration\\x1b[0m`,\n task: (subCtx: ListrTask): void => {\n // eslint-disable-next-line no-param-reassign\n subCtx.skip = true;\n },\n };\n }\n\n return {\n title: `${formatPathOutput(directory)} - Found \\x1b[32m${matchingFilePaths.length}\\x1b[0m file(s) needing migration`,\n task: async (subCtx, parentTask) => {\n // eslint-disable-next-line no-param-reassign\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(\n directory,\n filePath,\n queryOptions,\n fileTask,\n isDebug,\n ).finally(() => {\n // Update parent task title with progress for each completed file migration\n completedFilesInDirectory.count += 1;\n const isDim =\n completedFilesInDirectory.count === matchingFilePaths.length;\n // eslint-disable-next-line no-param-reassign\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 { concurrent: FILE_CONCURRENCY_LIMIT },\n )\n .run();\n },\n };\n }),\n { rendererOptions: { suffixSkips: false, collapseSubtasks: false } },\n );\n },\n },\n ]);\n\n // Run all directory tasks concurrently, 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"],"mappings":";;;;;;;;;AAAA,MAAa,uBAAuB;AAKpC,MAAa,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJrC,SAAgB,iBAAiB,WAAmB,MAAe,OAAyB;CAC1F,MAAM,eAAe,OAAQ,KAAK,MAAM,UAAU,QAAQ,KAAK,EAAE,CAAC,EAAE,MAAM,OAAQ;CAClF,OAAO,QAAQ,UAAU,aAAa,WAAW,WAAW,aAAa;AAC3E;;;;ACHA,SAAgB,oBAAoB,WAA2B;CAE7D,MAAM,cAAc,KAAK,OADT,KAAK,IACiB,IAAI,aAAa,GAAI;CAC3D,MAAM,QAAQ,KAAK,MAAM,cAAc,IAAI;CAC3C,MAAM,UAAU,KAAK,MAAO,cAAc,OAAQ,EAAE;CACpD,MAAM,UAAU,cAAc;CAE9B,OAAO,GAAG,QAAQ,GAAG,MAAM,MAAM,KAAK,UAAU,GAAG,QAAQ,MAAM,KAAK,UAAU,GAAG,QAAQ,KAAK;AAClG;;;;ACFA,eAAsB,SACpB,SACA,MACe;CACf,IAAI,CAAC,SAAS;CAEd,MAAM,YAAY,YAChB,IAAI,SAAkB,iBAAiB;EACrC,MAAM,MAAM,IAAI,IAAI,WAAW,OAAO;EACtC,MAAM,MAAM,MAAM,IAAI,KAAK;GA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E,sBAAsB,0BAA0B,MAAM,kBAAkB,kBAAkB,OAAO,eAAe,QAAQ,YAAY;QACjN,CAAC;OACH;MACF,EAAE,GACF,EAAE,YAAA,GAAmC,CACvC,EACC,IAAI;KACT;IACF;GACF,CAAC,GACD,EAAE,iBAAiB;IAAE,aAAa;IAAO,kBAAkB;GAAM,EAAE,CACrE;EACF;CACF,CACF,CAAC;CAGD,MAAM,QAAQ,OAAO,EAAE,QAAQ,YAAY;EACzC,MAAM,IAAI,MAAM,CACd;GACE,OAAO,8CAA8C,oBAAoB,SAAS,EAAE;GACpF,MAAM,YAAY,CAElB;EACF,CACF,CAAC,EAAE,IAAI;CACT,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-
|
|
1
|
+
{"version":3,"file":"common-AexZXiET.js","names":[],"sources":["../src/constants/common.ts"],"sourcesContent":["export const CONSOLE_ICONS = {\n info: '\\x1b[34mℹ\\x1b[0m', // Blue info icon\n focus: '\\x1b[34m➙\\x1b[0m', // Blue arrow icon\n success: '\\x1b[32m✔\\x1b[0m', // Green checkmark\n warning: '\\x1b[33m⚠\\x1b[0m', // Yellow warning icon\n error: '\\x1b[31m✖\\x1b[0m', // Red cross icon\n claude: '\\x1b[35m💬\\x1b[0m', // Speech bubble\n};\n"],"mappings":";AAAA,MAAa,gBAAgB;CAC3B,MAAM;CACN,OAAO;CACP,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CONSOLE_ICONS } from "./common-
|
|
1
|
+
import { t as CONSOLE_ICONS } from "./common-AexZXiET.js";
|
|
2
2
|
import { exec, execSync } from "node:child_process";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path, { dirname, join, relative, resolve } from "node:path";
|
|
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
enumerable: true
|
|
29
29
|
}) : target, mod));
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region node_modules/.pnpm/semver@7.
|
|
31
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/constants.js
|
|
32
32
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33
33
|
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
34
34
|
const MAX_LENGTH = 256;
|
|
@@ -53,12 +53,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
53
53
|
};
|
|
54
54
|
}));
|
|
55
55
|
//#endregion
|
|
56
|
-
//#region node_modules/.pnpm/semver@7.
|
|
56
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/debug.js
|
|
57
57
|
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
58
58
|
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
59
59
|
}));
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region node_modules/.pnpm/semver@7.
|
|
61
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/re.js
|
|
62
62
|
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
63
63
|
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
64
64
|
const debug = require_debug();
|
|
@@ -137,7 +137,7 @@ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
137
137
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
138
138
|
}));
|
|
139
139
|
//#endregion
|
|
140
|
-
//#region node_modules/.pnpm/semver@7.
|
|
140
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/parse-options.js
|
|
141
141
|
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
142
142
|
const looseOption = Object.freeze({ loose: true });
|
|
143
143
|
const emptyOpts = Object.freeze({});
|
|
@@ -149,7 +149,7 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
149
149
|
module.exports = parseOptions;
|
|
150
150
|
}));
|
|
151
151
|
//#endregion
|
|
152
|
-
//#region node_modules/.pnpm/semver@7.
|
|
152
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/identifiers.js
|
|
153
153
|
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
154
154
|
const numeric = /^[0-9]+$/;
|
|
155
155
|
const compareIdentifiers = (a, b) => {
|
|
@@ -169,7 +169,7 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
169
169
|
};
|
|
170
170
|
}));
|
|
171
171
|
//#endregion
|
|
172
|
-
//#region node_modules/.pnpm/semver@7.
|
|
172
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/semver.js
|
|
173
173
|
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
174
174
|
const debug = require_debug();
|
|
175
175
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
@@ -347,7 +347,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
347
347
|
};
|
|
348
348
|
}));
|
|
349
349
|
//#endregion
|
|
350
|
-
//#region node_modules/.pnpm/semver@7.
|
|
350
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/parse.js
|
|
351
351
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
352
352
|
const SemVer = require_semver$1();
|
|
353
353
|
const parse = (version, options, throwErrors = false) => {
|
|
@@ -362,7 +362,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
362
362
|
module.exports = parse;
|
|
363
363
|
}));
|
|
364
364
|
//#endregion
|
|
365
|
-
//#region node_modules/.pnpm/semver@7.
|
|
365
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/valid.js
|
|
366
366
|
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
367
367
|
const parse = require_parse();
|
|
368
368
|
const valid = (version, options) => {
|
|
@@ -372,7 +372,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
372
372
|
module.exports = valid;
|
|
373
373
|
}));
|
|
374
374
|
//#endregion
|
|
375
|
-
//#region node_modules/.pnpm/semver@7.
|
|
375
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/clean.js
|
|
376
376
|
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
377
377
|
const parse = require_parse();
|
|
378
378
|
const clean = (version, options) => {
|
|
@@ -382,7 +382,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
382
382
|
module.exports = clean;
|
|
383
383
|
}));
|
|
384
384
|
//#endregion
|
|
385
|
-
//#region node_modules/.pnpm/semver@7.
|
|
385
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/inc.js
|
|
386
386
|
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
387
387
|
const SemVer = require_semver$1();
|
|
388
388
|
const inc = (version, release, options, identifier, identifierBase) => {
|
|
@@ -400,7 +400,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
400
400
|
module.exports = inc;
|
|
401
401
|
}));
|
|
402
402
|
//#endregion
|
|
403
|
-
//#region node_modules/.pnpm/semver@7.
|
|
403
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/diff.js
|
|
404
404
|
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
405
405
|
const parse = require_parse();
|
|
406
406
|
const diff = (version1, version2) => {
|
|
@@ -428,28 +428,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
428
428
|
module.exports = diff;
|
|
429
429
|
}));
|
|
430
430
|
//#endregion
|
|
431
|
-
//#region node_modules/.pnpm/semver@7.
|
|
431
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/major.js
|
|
432
432
|
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
433
433
|
const SemVer = require_semver$1();
|
|
434
434
|
const major = (a, loose) => new SemVer(a, loose).major;
|
|
435
435
|
module.exports = major;
|
|
436
436
|
}));
|
|
437
437
|
//#endregion
|
|
438
|
-
//#region node_modules/.pnpm/semver@7.
|
|
438
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/minor.js
|
|
439
439
|
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
440
440
|
const SemVer = require_semver$1();
|
|
441
441
|
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
442
442
|
module.exports = minor;
|
|
443
443
|
}));
|
|
444
444
|
//#endregion
|
|
445
|
-
//#region node_modules/.pnpm/semver@7.
|
|
445
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/patch.js
|
|
446
446
|
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
447
447
|
const SemVer = require_semver$1();
|
|
448
448
|
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
449
449
|
module.exports = patch;
|
|
450
450
|
}));
|
|
451
451
|
//#endregion
|
|
452
|
-
//#region node_modules/.pnpm/semver@7.
|
|
452
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/prerelease.js
|
|
453
453
|
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
454
454
|
const parse = require_parse();
|
|
455
455
|
const prerelease = (version, options) => {
|
|
@@ -459,28 +459,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
459
459
|
module.exports = prerelease;
|
|
460
460
|
}));
|
|
461
461
|
//#endregion
|
|
462
|
-
//#region node_modules/.pnpm/semver@7.
|
|
462
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/compare.js
|
|
463
463
|
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
464
464
|
const SemVer = require_semver$1();
|
|
465
465
|
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
466
466
|
module.exports = compare;
|
|
467
467
|
}));
|
|
468
468
|
//#endregion
|
|
469
|
-
//#region node_modules/.pnpm/semver@7.
|
|
469
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/rcompare.js
|
|
470
470
|
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
471
471
|
const compare = require_compare();
|
|
472
472
|
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
473
473
|
module.exports = rcompare;
|
|
474
474
|
}));
|
|
475
475
|
//#endregion
|
|
476
|
-
//#region node_modules/.pnpm/semver@7.
|
|
476
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/compare-loose.js
|
|
477
477
|
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
478
478
|
const compare = require_compare();
|
|
479
479
|
const compareLoose = (a, b) => compare(a, b, true);
|
|
480
480
|
module.exports = compareLoose;
|
|
481
481
|
}));
|
|
482
482
|
//#endregion
|
|
483
|
-
//#region node_modules/.pnpm/semver@7.
|
|
483
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/compare-build.js
|
|
484
484
|
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
485
485
|
const SemVer = require_semver$1();
|
|
486
486
|
const compareBuild = (a, b, loose) => {
|
|
@@ -491,63 +491,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
491
491
|
module.exports = compareBuild;
|
|
492
492
|
}));
|
|
493
493
|
//#endregion
|
|
494
|
-
//#region node_modules/.pnpm/semver@7.
|
|
494
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/sort.js
|
|
495
495
|
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
496
496
|
const compareBuild = require_compare_build();
|
|
497
497
|
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
498
498
|
module.exports = sort;
|
|
499
499
|
}));
|
|
500
500
|
//#endregion
|
|
501
|
-
//#region node_modules/.pnpm/semver@7.
|
|
501
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/rsort.js
|
|
502
502
|
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
503
503
|
const compareBuild = require_compare_build();
|
|
504
504
|
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
505
505
|
module.exports = rsort;
|
|
506
506
|
}));
|
|
507
507
|
//#endregion
|
|
508
|
-
//#region node_modules/.pnpm/semver@7.
|
|
508
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/gt.js
|
|
509
509
|
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
510
510
|
const compare = require_compare();
|
|
511
511
|
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
512
512
|
module.exports = gt;
|
|
513
513
|
}));
|
|
514
514
|
//#endregion
|
|
515
|
-
//#region node_modules/.pnpm/semver@7.
|
|
515
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/lt.js
|
|
516
516
|
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
517
517
|
const compare = require_compare();
|
|
518
518
|
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
519
519
|
module.exports = lt;
|
|
520
520
|
}));
|
|
521
521
|
//#endregion
|
|
522
|
-
//#region node_modules/.pnpm/semver@7.
|
|
522
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/eq.js
|
|
523
523
|
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
524
524
|
const compare = require_compare();
|
|
525
525
|
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
526
526
|
module.exports = eq;
|
|
527
527
|
}));
|
|
528
528
|
//#endregion
|
|
529
|
-
//#region node_modules/.pnpm/semver@7.
|
|
529
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/neq.js
|
|
530
530
|
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
531
531
|
const compare = require_compare();
|
|
532
532
|
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
533
533
|
module.exports = neq;
|
|
534
534
|
}));
|
|
535
535
|
//#endregion
|
|
536
|
-
//#region node_modules/.pnpm/semver@7.
|
|
536
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/gte.js
|
|
537
537
|
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
538
538
|
const compare = require_compare();
|
|
539
539
|
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
540
540
|
module.exports = gte;
|
|
541
541
|
}));
|
|
542
542
|
//#endregion
|
|
543
|
-
//#region node_modules/.pnpm/semver@7.
|
|
543
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/lte.js
|
|
544
544
|
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
545
545
|
const compare = require_compare();
|
|
546
546
|
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
547
547
|
module.exports = lte;
|
|
548
548
|
}));
|
|
549
549
|
//#endregion
|
|
550
|
-
//#region node_modules/.pnpm/semver@7.
|
|
550
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/cmp.js
|
|
551
551
|
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
552
552
|
const eq = require_eq();
|
|
553
553
|
const neq = require_neq();
|
|
@@ -579,7 +579,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
579
579
|
module.exports = cmp;
|
|
580
580
|
}));
|
|
581
581
|
//#endregion
|
|
582
|
-
//#region node_modules/.pnpm/semver@7.
|
|
582
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/coerce.js
|
|
583
583
|
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
584
584
|
const SemVer = require_semver$1();
|
|
585
585
|
const parse = require_parse();
|
|
@@ -607,7 +607,40 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
607
607
|
module.exports = coerce;
|
|
608
608
|
}));
|
|
609
609
|
//#endregion
|
|
610
|
-
//#region node_modules/.pnpm/semver@7.
|
|
610
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/truncate.js
|
|
611
|
+
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
612
|
+
const parse = require_parse();
|
|
613
|
+
const constants = require_constants();
|
|
614
|
+
const SemVer = require_semver$1();
|
|
615
|
+
const truncate = (version, truncation, options) => {
|
|
616
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
617
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
618
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
619
|
+
};
|
|
620
|
+
const cloneInputVersion = (version, options) => {
|
|
621
|
+
return parse(version instanceof SemVer ? version.version : version, options);
|
|
622
|
+
};
|
|
623
|
+
const doTruncation = (version, truncation) => {
|
|
624
|
+
if (isPrerelease(truncation)) return version.version;
|
|
625
|
+
version.prerelease = [];
|
|
626
|
+
switch (truncation) {
|
|
627
|
+
case "major":
|
|
628
|
+
version.minor = 0;
|
|
629
|
+
version.patch = 0;
|
|
630
|
+
break;
|
|
631
|
+
case "minor":
|
|
632
|
+
version.patch = 0;
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
return version.format();
|
|
636
|
+
};
|
|
637
|
+
const isPrerelease = (type) => {
|
|
638
|
+
return type.startsWith("pre");
|
|
639
|
+
};
|
|
640
|
+
module.exports = truncate;
|
|
641
|
+
}));
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/lrucache.js
|
|
611
644
|
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
612
645
|
var LRUCache = class {
|
|
613
646
|
constructor() {
|
|
@@ -640,7 +673,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
640
673
|
module.exports = LRUCache;
|
|
641
674
|
}));
|
|
642
675
|
//#endregion
|
|
643
|
-
//#region node_modules/.pnpm/semver@7.
|
|
676
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/range.js
|
|
644
677
|
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
645
678
|
const SPACE_CHARACTERS = /\s+/g;
|
|
646
679
|
module.exports = class Range {
|
|
@@ -694,6 +727,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
694
727
|
return this.range;
|
|
695
728
|
}
|
|
696
729
|
parseRange(range) {
|
|
730
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
697
731
|
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
698
732
|
const cached = cache.get(memoKey);
|
|
699
733
|
if (cached) return cached;
|
|
@@ -752,8 +786,9 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
752
786
|
const Comparator = require_comparator();
|
|
753
787
|
const debug = require_debug();
|
|
754
788
|
const SemVer = require_semver$1();
|
|
755
|
-
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
789
|
+
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
756
790
|
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
791
|
+
const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
757
792
|
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
758
793
|
const isAny = (c) => c.value === "";
|
|
759
794
|
const isSatisfiable = (comparators, options) => {
|
|
@@ -912,7 +947,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
912
947
|
};
|
|
913
948
|
}));
|
|
914
949
|
//#endregion
|
|
915
|
-
//#region node_modules/.pnpm/semver@7.
|
|
950
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/comparator.js
|
|
916
951
|
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
917
952
|
const ANY = Symbol("SemVer ANY");
|
|
918
953
|
module.exports = class Comparator {
|
|
@@ -982,7 +1017,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
982
1017
|
const Range = require_range();
|
|
983
1018
|
}));
|
|
984
1019
|
//#endregion
|
|
985
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1020
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/satisfies.js
|
|
986
1021
|
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
987
1022
|
const Range = require_range();
|
|
988
1023
|
const satisfies = (version, range, options) => {
|
|
@@ -996,14 +1031,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
996
1031
|
module.exports = satisfies;
|
|
997
1032
|
}));
|
|
998
1033
|
//#endregion
|
|
999
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1034
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/to-comparators.js
|
|
1000
1035
|
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1001
1036
|
const Range = require_range();
|
|
1002
1037
|
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1003
1038
|
module.exports = toComparators;
|
|
1004
1039
|
}));
|
|
1005
1040
|
//#endregion
|
|
1006
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1041
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/max-satisfying.js
|
|
1007
1042
|
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1008
1043
|
const SemVer = require_semver$1();
|
|
1009
1044
|
const Range = require_range();
|
|
@@ -1029,7 +1064,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
1029
1064
|
module.exports = maxSatisfying;
|
|
1030
1065
|
}));
|
|
1031
1066
|
//#endregion
|
|
1032
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1067
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/min-satisfying.js
|
|
1033
1068
|
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1034
1069
|
const SemVer = require_semver$1();
|
|
1035
1070
|
const Range = require_range();
|
|
@@ -1055,7 +1090,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
1055
1090
|
module.exports = minSatisfying;
|
|
1056
1091
|
}));
|
|
1057
1092
|
//#endregion
|
|
1058
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1093
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/min-version.js
|
|
1059
1094
|
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1060
1095
|
const SemVer = require_semver$1();
|
|
1061
1096
|
const Range = require_range();
|
|
@@ -1095,7 +1130,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1095
1130
|
module.exports = minVersion;
|
|
1096
1131
|
}));
|
|
1097
1132
|
//#endregion
|
|
1098
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1133
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/valid.js
|
|
1099
1134
|
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1100
1135
|
const Range = require_range();
|
|
1101
1136
|
const validRange = (range, options) => {
|
|
@@ -1108,7 +1143,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1108
1143
|
module.exports = validRange;
|
|
1109
1144
|
}));
|
|
1110
1145
|
//#endregion
|
|
1111
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1146
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/outside.js
|
|
1112
1147
|
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1113
1148
|
const SemVer = require_semver$1();
|
|
1114
1149
|
const Comparator = require_comparator();
|
|
@@ -1161,21 +1196,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1161
1196
|
module.exports = outside;
|
|
1162
1197
|
}));
|
|
1163
1198
|
//#endregion
|
|
1164
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1199
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/gtr.js
|
|
1165
1200
|
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1166
1201
|
const outside = require_outside();
|
|
1167
1202
|
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1168
1203
|
module.exports = gtr;
|
|
1169
1204
|
}));
|
|
1170
1205
|
//#endregion
|
|
1171
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1206
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/ltr.js
|
|
1172
1207
|
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1173
1208
|
const outside = require_outside();
|
|
1174
1209
|
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1175
1210
|
module.exports = ltr;
|
|
1176
1211
|
}));
|
|
1177
1212
|
//#endregion
|
|
1178
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1213
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/intersects.js
|
|
1179
1214
|
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1180
1215
|
const Range = require_range();
|
|
1181
1216
|
const intersects = (r1, r2, options) => {
|
|
@@ -1186,7 +1221,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1186
1221
|
module.exports = intersects;
|
|
1187
1222
|
}));
|
|
1188
1223
|
//#endregion
|
|
1189
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1224
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/simplify.js
|
|
1190
1225
|
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1191
1226
|
const satisfies = require_satisfies();
|
|
1192
1227
|
const compare = require_compare();
|
|
@@ -1216,7 +1251,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1216
1251
|
};
|
|
1217
1252
|
}));
|
|
1218
1253
|
//#endregion
|
|
1219
|
-
//#region node_modules/.pnpm/semver@7.
|
|
1254
|
+
//#region node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/subset.js
|
|
1220
1255
|
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1221
1256
|
const Range = require_range();
|
|
1222
1257
|
const Comparator = require_comparator();
|
|
@@ -1280,7 +1315,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1280
1315
|
if (c.operator === ">" || c.operator === ">=") {
|
|
1281
1316
|
higher = higherGT(gt, c, options);
|
|
1282
1317
|
if (higher === c && higher !== gt) return false;
|
|
1283
|
-
} else if (gt.operator === ">=" && !
|
|
1318
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
1284
1319
|
}
|
|
1285
1320
|
if (lt) {
|
|
1286
1321
|
if (needDomLTPre) {
|
|
@@ -1289,7 +1324,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1289
1324
|
if (c.operator === "<" || c.operator === "<=") {
|
|
1290
1325
|
lower = lowerLT(lt, c, options);
|
|
1291
1326
|
if (lower === c && lower !== lt) return false;
|
|
1292
|
-
} else if (lt.operator === "<=" && !
|
|
1327
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
1293
1328
|
}
|
|
1294
1329
|
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1295
1330
|
}
|
|
@@ -1341,6 +1376,7 @@ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
|
|
|
1341
1376
|
lte: require_lte(),
|
|
1342
1377
|
cmp: require_cmp(),
|
|
1343
1378
|
coerce: require_coerce(),
|
|
1379
|
+
truncate: require_truncate(),
|
|
1344
1380
|
Comparator: require_comparator(),
|
|
1345
1381
|
Range: require_range(),
|
|
1346
1382
|
satisfies: require_satisfies(),
|
|
@@ -1901,4 +1937,4 @@ function validateClaudeConfig() {
|
|
|
1901
1937
|
//#endregion
|
|
1902
1938
|
export { getOptions as a, assessPrerequisitesBatch as c, getCodemodConfig as d, loadTransformModules as i, findPackages as l, runTransformPrompts as n, logToInquirer as o, reportManualReview as r, assessPrerequisites as s, validateClaudeConfig as t, findProjectRoot as u };
|
|
1903
1939
|
|
|
1904
|
-
//# sourceMappingURL=helpers-
|
|
1940
|
+
//# sourceMappingURL=helpers-CZ779nXI.js.map
|