@kubb/cli 5.14.5 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/bin/kubb.js +2 -1
  2. package/dist/{Telemetry-Dc79_cIA.js → Telemetry-B3edcFoB.js} +12 -86
  3. package/dist/Telemetry-B3edcFoB.js.map +1 -0
  4. package/dist/{Telemetry-Dc9DVxKQ.cjs → Telemetry-COWGqYmh.cjs} +14 -118
  5. package/dist/Telemetry-COWGqYmh.cjs.map +1 -0
  6. package/dist/{background-v5pDy3IJ.cjs → background-B24lIehn.cjs} +5 -6
  7. package/dist/{background-v5pDy3IJ.cjs.map → background-B24lIehn.cjs.map} +1 -1
  8. package/dist/{background-C877JFxE.js → background-D-7OGjvg.js} +1 -1
  9. package/dist/{background-3_KudPH-.js → background-_dKcGjM7.js} +5 -6
  10. package/dist/{background-3_KudPH-.js.map → background-_dKcGjM7.js.map} +1 -1
  11. package/dist/banner-BdTTDFkG.js +140 -0
  12. package/dist/banner-BdTTDFkG.js.map +1 -0
  13. package/dist/banner-wJFk-L-c.cjs +163 -0
  14. package/dist/banner-wJFk-L-c.cjs.map +1 -0
  15. package/dist/config-BL3HnFhb.js +1 -0
  16. package/dist/config-BWj9jBVj.cjs +62 -0
  17. package/dist/config-BWj9jBVj.cjs.map +1 -0
  18. package/dist/{config-CNqgDSu3.js → config-CQTxXvIG.js} +6 -52
  19. package/dist/config-CQTxXvIG.js.map +1 -0
  20. package/dist/{config-BG_Nr2CZ.cjs → config-CRrmj88c.cjs} +15 -62
  21. package/dist/config-CRrmj88c.cjs.map +1 -0
  22. package/dist/config-Uk3rbZfb.js +49 -0
  23. package/dist/config-Uk3rbZfb.js.map +1 -0
  24. package/dist/configFile-C0DIXNMD.js +993 -0
  25. package/dist/configFile-C0DIXNMD.js.map +1 -0
  26. package/dist/configFile-CoEpHdXG.cjs +1028 -0
  27. package/dist/configFile-CoEpHdXG.cjs.map +1 -0
  28. package/dist/{credentials-C8tjAhTo.js → credentials-B77iJx9H.js} +1 -1
  29. package/dist/{credentials-DDaKqtJn.cjs → credentials-DEsGwcGD.cjs} +3 -4
  30. package/dist/{credentials-DDaKqtJn.cjs.map → credentials-DEsGwcGD.cjs.map} +1 -1
  31. package/dist/{credentials-CZK6zPLv.js → credentials-osgjujE_.js} +3 -4
  32. package/dist/{credentials-CZK6zPLv.js.map → credentials-osgjujE_.js.map} +1 -1
  33. package/dist/env-C3xHRMez.js +1 -0
  34. package/dist/env-eu3XyKqJ.cjs +55 -0
  35. package/dist/env-eu3XyKqJ.cjs.map +1 -0
  36. package/dist/env-rv-VgSGN.js +34 -0
  37. package/dist/env-rv-VgSGN.js.map +1 -0
  38. package/dist/{errors-Cl69p_vI.cjs → errors-BponpdjN.cjs} +3 -4
  39. package/dist/{errors-Cl69p_vI.cjs.map → errors-BponpdjN.cjs.map} +1 -1
  40. package/dist/{errors-DmC83ALX.js → errors-wzqmMpMo.js} +3 -4
  41. package/dist/{errors-DmC83ALX.js.map → errors-wzqmMpMo.js.map} +1 -1
  42. package/dist/index.cjs +37 -2719
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.cts +0 -2
  45. package/dist/index.d.ts +0 -2
  46. package/dist/index.js +35 -2713
  47. package/dist/index.js.map +1 -1
  48. package/dist/installWithSpinner-DpnpxHq5.js +49 -0
  49. package/dist/installWithSpinner-DpnpxHq5.js.map +1 -0
  50. package/dist/installWithSpinner-ONGfIVUJ.cjs +56 -0
  51. package/dist/installWithSpinner-ONGfIVUJ.cjs.map +1 -0
  52. package/dist/{text-CEyJhBnh.js → intro-9PB8sE8z.js} +8 -52
  53. package/dist/intro-9PB8sE8z.js.map +1 -0
  54. package/dist/{text-CC2xdpGL.cjs → intro-YPaf1Imr.cjs} +12 -80
  55. package/dist/intro-YPaf1Imr.cjs.map +1 -0
  56. package/dist/isCIEnvironment-D6xtAAZ2.js +14 -0
  57. package/dist/isCIEnvironment-D6xtAAZ2.js.map +1 -0
  58. package/dist/isCIEnvironment-DiVOMI5Q.cjs +20 -0
  59. package/dist/isCIEnvironment-DiVOMI5Q.cjs.map +1 -0
  60. package/dist/mascot--q1xjKw1.js +63 -0
  61. package/dist/mascot--q1xjKw1.js.map +1 -0
  62. package/dist/mascot-JSA0j3Q_.cjs +80 -0
  63. package/dist/mascot-JSA0j3Q_.cjs.map +1 -0
  64. package/dist/mcp-CYPOFKnP.cjs +20 -0
  65. package/dist/mcp-CYPOFKnP.cjs.map +1 -0
  66. package/dist/mcp-CxeZR5vb.js +21 -0
  67. package/dist/mcp-CxeZR5vb.js.map +1 -0
  68. package/dist/package-D3Yss9Bb.js +5 -0
  69. package/dist/package-D3Yss9Bb.js.map +1 -0
  70. package/dist/package-aX0q9SZr.cjs +10 -0
  71. package/dist/package-aX0q9SZr.cjs.map +1 -0
  72. package/dist/{registry-ov1RYcD4.js → registry-B3eYk4LN.js} +7 -67
  73. package/dist/registry-B3eYk4LN.js.map +1 -0
  74. package/dist/{registry-BInbtBm7.cjs → registry-YE1pFWL-.cjs} +4 -82
  75. package/dist/registry-YE1pFWL-.cjs.map +1 -0
  76. package/dist/{reporters-DQz--AdE.cjs → reporters-2cgjvXwR.cjs} +32 -40
  77. package/dist/{reporters-DQz--AdE.cjs.map → reporters-2cgjvXwR.cjs.map} +1 -1
  78. package/dist/{reporters-BtD41K-C.js → reporters-BM430HdQ.js} +19 -27
  79. package/dist/{reporters-BtD41K-C.js.map → reporters-BM430HdQ.js.map} +1 -1
  80. package/dist/{rolldown-runtime-CPE0t6oh.cjs → rolldown-runtime-C3-Zg-KD.cjs} +1 -2
  81. package/dist/{rolldown-runtime-CRm0XQPb.js → rolldown-runtime-xo6NMXYd.js} +1 -2
  82. package/dist/run-1H9TGT8v.js +77 -0
  83. package/dist/run-1H9TGT8v.js.map +1 -0
  84. package/dist/run-B4zvF9WY.cjs +233 -0
  85. package/dist/run-B4zvF9WY.cjs.map +1 -0
  86. package/dist/run-BYP_t9dR.cjs +324 -0
  87. package/dist/run-BYP_t9dR.cjs.map +1 -0
  88. package/dist/{run-1oXPIkli.cjs → run-Bb19PlwV.cjs} +44 -37
  89. package/dist/run-Bb19PlwV.cjs.map +1 -0
  90. package/dist/{run-B03V0Poj.cjs → run-BoO7H8RA.cjs} +49 -41
  91. package/dist/run-BoO7H8RA.cjs.map +1 -0
  92. package/dist/run-BrM7-NSV.js +181 -0
  93. package/dist/run-BrM7-NSV.js.map +1 -0
  94. package/dist/{run-UsAMlUyy.js → run-C0KI-NE3.js} +9 -9
  95. package/dist/{run-UsAMlUyy.js.map → run-C0KI-NE3.js.map} +1 -1
  96. package/dist/run-CCLPt4hr.js +1 -0
  97. package/dist/run-CCsdLz3X.js +385 -0
  98. package/dist/run-CCsdLz3X.js.map +1 -0
  99. package/dist/{run-YMSJnvYl.js → run-CbX6tpqB.js} +31 -23
  100. package/dist/run-CbX6tpqB.js.map +1 -0
  101. package/dist/run-CrM4jsix.cjs +80 -0
  102. package/dist/run-CrM4jsix.cjs.map +1 -0
  103. package/dist/run-CvFakE3B.cjs +185 -0
  104. package/dist/run-CvFakE3B.cjs.map +1 -0
  105. package/dist/run-D-nn9-Wq.js +319 -0
  106. package/dist/run-D-nn9-Wq.js.map +1 -0
  107. package/dist/{run-cBSr2F1q.cjs → run-D5Z6nfzK.cjs} +5 -6
  108. package/dist/{run-cBSr2F1q.cjs.map → run-D5Z6nfzK.cjs.map} +1 -1
  109. package/dist/{run-BUzdEUaE.cjs → run-DCqmf5W1.cjs} +10 -10
  110. package/dist/{run-BUzdEUaE.cjs.map → run-DCqmf5W1.cjs.map} +1 -1
  111. package/dist/{run-BK-A9JDf.js → run-DFXhBS64.js} +5 -6
  112. package/dist/{run-BK-A9JDf.js.map → run-DFXhBS64.js.map} +1 -1
  113. package/dist/run-DgGZOC_x.cjs +389 -0
  114. package/dist/run-DgGZOC_x.cjs.map +1 -0
  115. package/dist/{run-DDwdeHgU.js → run-KqdudiWQ.js} +26 -20
  116. package/dist/run-KqdudiWQ.js.map +1 -0
  117. package/dist/run-RN_31Q4u.js +228 -0
  118. package/dist/run-RN_31Q4u.js.map +1 -0
  119. package/dist/shared-C0EtrdUm.cjs +123 -0
  120. package/dist/shared-C0EtrdUm.cjs.map +1 -0
  121. package/dist/shared-Ct9stKpp.js +94 -0
  122. package/dist/shared-Ct9stKpp.js.map +1 -0
  123. package/dist/{snapshot-BrwynBfC.cjs → snapshot-D7Ytw8S0.cjs} +13 -14
  124. package/dist/{snapshot-BrwynBfC.cjs.map → snapshot-D7Ytw8S0.cjs.map} +1 -1
  125. package/dist/{snapshot-D2E7nhEf.js → snapshot-n7dJGCWv.js} +10 -11
  126. package/dist/{snapshot-D2E7nhEf.js.map → snapshot-n7dJGCWv.js.map} +1 -1
  127. package/dist/spinner-BZaln7O8.js +160 -0
  128. package/dist/spinner-BZaln7O8.js.map +1 -0
  129. package/dist/spinner-CfB0sIPy.cjs +208 -0
  130. package/dist/spinner-CfB0sIPy.cjs.map +1 -0
  131. package/dist/{status-CxzhvjKs.cjs → status-Bc0_4T41.cjs} +7 -8
  132. package/dist/{status-CxzhvjKs.cjs.map → status-Bc0_4T41.cjs.map} +1 -1
  133. package/dist/{status-BHIOMCM0.js → status-DxSkp1cH.js} +6 -7
  134. package/dist/{status-BHIOMCM0.js.map → status-DxSkp1cH.js.map} +1 -1
  135. package/dist/studio-BpYwgFb0.cjs +218 -0
  136. package/dist/studio-BpYwgFb0.cjs.map +1 -0
  137. package/dist/studio-mw6HaPkr.js +215 -0
  138. package/dist/studio-mw6HaPkr.js.map +1 -0
  139. package/dist/studioWorker.js +4 -5
  140. package/dist/{summary-B219y888.js → summary-CbmQKA8l.js} +5 -6
  141. package/dist/{summary-B219y888.js.map → summary-CbmQKA8l.js.map} +1 -1
  142. package/dist/{summary-BOYsqub3.cjs → summary-Clvl5Hxs.cjs} +7 -8
  143. package/dist/{summary-BOYsqub3.cjs.map → summary-Clvl5Hxs.cjs.map} +1 -1
  144. package/dist/table-BlRe9YTZ.cjs +15 -0
  145. package/dist/table-BlRe9YTZ.cjs.map +1 -0
  146. package/dist/table-CR7iZJGo.js +10 -0
  147. package/dist/table-CR7iZJGo.js.map +1 -0
  148. package/dist/text-BmiI4s6N.js +13 -0
  149. package/dist/text-BmiI4s6N.js.map +1 -0
  150. package/dist/text-Ep3AulAS.cjs +24 -0
  151. package/dist/text-Ep3AulAS.cjs.map +1 -0
  152. package/dist/time-3BKoci3G.cjs +82 -0
  153. package/dist/time-3BKoci3G.cjs.map +1 -0
  154. package/dist/time-C-wU7VhC.js +65 -0
  155. package/dist/time-C-wU7VhC.js.map +1 -0
  156. package/dist/utils-BdibacYq.js +244 -0
  157. package/dist/utils-BdibacYq.js.map +1 -0
  158. package/dist/utils-CO89mxRU.cjs +290 -0
  159. package/dist/utils-CO89mxRU.cjs.map +1 -0
  160. package/dist/utils-CbJ6hS_t.js +222 -0
  161. package/dist/utils-CbJ6hS_t.js.map +1 -0
  162. package/dist/utils-CcARPB45.cjs +286 -0
  163. package/dist/utils-CcARPB45.cjs.map +1 -0
  164. package/dist/validate-8ZcWXfMt.js +28 -0
  165. package/dist/validate-8ZcWXfMt.js.map +1 -0
  166. package/dist/validate-CMSeDpGT.cjs +27 -0
  167. package/dist/validate-CMSeDpGT.cjs.map +1 -0
  168. package/package.json +7 -7
  169. package/dist/Telemetry-Dc79_cIA.js.map +0 -1
  170. package/dist/Telemetry-Dc9DVxKQ.cjs.map +0 -1
  171. package/dist/config-BG_Nr2CZ.cjs.map +0 -1
  172. package/dist/config-CNqgDSu3.js.map +0 -1
  173. package/dist/config-DWDpFSn1.js +0 -1
  174. package/dist/registry-BInbtBm7.cjs.map +0 -1
  175. package/dist/registry-ov1RYcD4.js.map +0 -1
  176. package/dist/run-1oXPIkli.cjs.map +0 -1
  177. package/dist/run-B03V0Poj.cjs.map +0 -1
  178. package/dist/run-DDwdeHgU.js.map +0 -1
  179. package/dist/run-YMSJnvYl.js.map +0 -1
  180. package/dist/run-v5aW1jjQ.js +0 -1
  181. package/dist/text-CC2xdpGL.cjs.map +0 -1
  182. package/dist/text-CEyJhBnh.js.map +0 -1
  183. package/dist/utils-8E1nF4C1.cjs +0 -645
  184. package/dist/utils-8E1nF4C1.cjs.map +0 -1
  185. package/dist/utils-D8VN40bN.js +0 -536
  186. package/dist/utils-D8VN40bN.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configFile-C0DIXNMD.js","names":[],"sources":["../../../internals/utils/src/casing.ts","../../../internals/shared/src/configFile/ast.ts","../../../internals/shared/src/configFile/types.ts","../../../internals/shared/src/configFile/rules.ts","../../../internals/shared/src/configFile/text.ts","../../../internals/shared/src/configFile/configFile.ts"],"sourcesContent":["type Options = {\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction convert(text: string, pascal: boolean): string {\n return text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n .split(/[\\s\\-_./\\\\:]+/)\n .filter(Boolean)\n .map((word, i) => {\n if (word.length > 1 && word === word.toUpperCase()) return word\n const head = i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()\n return head + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n// Plugins case the same names on every visit. Clearing at the limit bounds a long-running host.\nconst cache = new Map<string, string>()\nconst cacheLimit = 100_000\n\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const key = `${pascal ? 'P' : 'c'}${text}`\n const cached = cache.get(key)\n if (cached !== undefined) return cached\n\n const result = convert(text, pascal)\n if (cache.size >= cacheLimit) cache.clear()\n cache.set(key, result)\n return result\n}\n\n/**\n * Converts `text` to camelCase.\n *\n * @example Word boundaries\n * `camelCase('hello-world') // 'helloWorld'`\n *\n * @example With a prefix\n * `camelCase('tag', { prefix: 'create' }) // 'createTag'`\n */\nexport function camelCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n *\n * @example Word boundaries\n * `pascalCase('hello-world') // 'HelloWorld'`\n *\n * @example With a suffix\n * `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`\n */\nexport function pascalCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n","import { getErrorMessage } from '@internals/utils'\nimport { type Comment, type Expression, type Program, parse } from 'yuku-parser'\n\nexport type {\n ArrayExpression,\n AssignmentExpression,\n BindingProperty,\n CallExpression,\n Comment,\n Expression,\n ImportDeclaration,\n ObjectExpression,\n ObjectPropertyKind,\n Program,\n RestElement,\n SpreadElement,\n VariableDeclaration,\n} from 'yuku-parser'\n\n/** Node types the config editor reads from the yuku AST. */\nexport const nodeTypes = {\n arrayExpression: 'ArrayExpression',\n arrowFunctionExpression: 'ArrowFunctionExpression',\n assignmentExpression: 'AssignmentExpression',\n blockStatement: 'BlockStatement',\n callExpression: 'CallExpression',\n exportDefaultDeclaration: 'ExportDefaultDeclaration',\n expressionStatement: 'ExpressionStatement',\n functionExpression: 'FunctionExpression',\n identifier: 'Identifier',\n importDeclaration: 'ImportDeclaration',\n importSpecifier: 'ImportSpecifier',\n literal: 'Literal',\n memberExpression: 'MemberExpression',\n objectExpression: 'ObjectExpression',\n objectPattern: 'ObjectPattern',\n property: 'Property',\n returnStatement: 'ReturnStatement',\n spreadElement: 'SpreadElement',\n tSAsExpression: 'TSAsExpression',\n tSSatisfiesExpression: 'TSSatisfiesExpression',\n templateLiteral: 'TemplateLiteral',\n unaryExpression: 'UnaryExpression',\n variableDeclaration: 'VariableDeclaration',\n} as const\n\nexport const commentTypes = { line: 'Line' } as const\nexport const propertyKinds = { init: 'init' } as const\nexport const unaryOperators = { minus: '-', plus: '+' } as const\nconst diagnosticSeverities = { error: 'error' } as const\n\n/** A parsed file: its statements and every comment in it, or why it could not be parsed. */\ntype ParsedSource = { program: Program; comments: Array<Comment> } | { reason: string }\n\n/**\n * Parses `source` as a TypeScript module. Never throws: a syntax error, or a native parser that\n * cannot load on this platform, comes back as a `reason`.\n */\nexport function parseSource(source: string): ParsedSource {\n try {\n // Parentheses are dropped, so `export default (defineConfig({}))` reads as the call itself.\n const { program, comments, diagnostics } = parse(source, { lang: 'ts', sourceType: 'module', preserveParens: false })\n if (diagnostics.some((diagnostic) => diagnostic.severity === diagnosticSeverities.error)) return { reason: 'the config file could not be parsed' }\n return { program, comments }\n } catch (error) {\n return { reason: `the config parser could not load on this platform: ${getErrorMessage(error)}` }\n }\n}\n\n/** Parses `source` as one expression, such as a commented-out `pluginTs({ ... })` call. */\nexport function parseExpression(source: string): Expression | undefined {\n const parsed = parseSource(source)\n if ('reason' in parsed) return undefined\n const [statement] = parsed.program.body\n return parsed.program.body.length === 1 && statement?.type === nodeTypes.expressionStatement ? statement.expression : undefined\n}\n","import type { ExtensionKind, ExtensionManifest } from '@kubb/core'\n\n/** Which `defineConfig(...)` entry an edit targets: its index or `name`, the first entry when omitted. */\nexport type ConfigRef = string | number\n\n/** A literal option value that survives a JSON round trip. */\nexport type OptionValue = string | number | boolean | null | Array<OptionValue> | { [key: string]: OptionValue }\n\nexport const extensionKinds = { plugin: 'plugin', adapter: 'adapter', parser: 'parser' } as const satisfies Record<string, ExtensionKind>\n\nexport const ConfigEditOperation = {\n SET_OPTION: 'set-option',\n REMOVE_OPTION: 'remove-option',\n ADD_PLUGIN: 'add-plugin',\n REMOVE_EXTENSION: 'remove-extension',\n DISABLE_PLUGIN: 'disable-plugin',\n ENABLE_PLUGIN: 'enable-plugin',\n SET_INPUT: 'set-input',\n SET_OUTPUT: 'set-output',\n REMOVE_OUTPUT: 'remove-output',\n} as const\nexport type ConfigEditOperation = (typeof ConfigEditOperation)[keyof typeof ConfigEditOperation]\n\n/**\n * One change to `kubb.config.ts`. `plugin` is the package name, and `kind` picks the `plugins` entry\n * (default), the `adapter`, or a `parsers` entry. `path` walks nested option objects.\n */\nexport type ConfigEdit =\n | { operation: typeof ConfigEditOperation.SET_OPTION; config?: ConfigRef; kind?: ExtensionKind; plugin: string; path: Array<string>; value: unknown }\n | { operation: typeof ConfigEditOperation.REMOVE_OPTION; config?: ConfigRef; kind?: ExtensionKind; plugin: string; path: Array<string> }\n /** With `kind: 'parser'`, adds to `parsers`. A config without `parsers` gets the defaults written next to it, so they keep running. */\n | {\n operation: typeof ConfigEditOperation.ADD_PLUGIN\n config?: ConfigRef\n kind?: typeof extensionKinds.plugin | typeof extensionKinds.parser\n plugin: string\n options?: Record<string, unknown>\n }\n /** Deletes every call of a plugin, or a parser with `kind: 'parser'`, a disabled block included, and the imports nothing else uses. */\n | {\n operation: typeof ConfigEditOperation.REMOVE_EXTENSION\n config?: ConfigRef\n kind?: typeof extensionKinds.plugin | typeof extensionKinds.parser\n plugin: string\n }\n | { operation: typeof ConfigEditOperation.DISABLE_PLUGIN; config?: ConfigRef; plugin: string }\n | { operation: typeof ConfigEditOperation.ENABLE_PLUGIN; config?: ConfigRef; plugin: string }\n | { operation: typeof ConfigEditOperation.SET_INPUT; config?: ConfigRef; input: string }\n | { operation: typeof ConfigEditOperation.SET_OUTPUT; config?: ConfigRef; path: Array<string>; value: unknown }\n | { operation: typeof ConfigEditOperation.REMOVE_OUTPUT; config?: ConfigRef; path: Array<string> }\n\n/** Option keys, each with whether Studio may write it. `locked` lists the code paths inside a partly literal object. */\nexport type OptionsView = Record<string, { literal: boolean; value?: OptionValue; locked?: Array<Array<string>> }>\n\n/** A factory call in `plugins`, `adapter`, or `parsers`. `importName` is the local name, alias included. */\nexport type PluginView = {\n importName: string\n packageName: string\n options: OptionsView\n /** The call is commented out by `disable-plugin`. */\n disabled?: true\n}\n\nexport type ConfigView = {\n name?: string\n plugins: Array<PluginView>\n adapter?: PluginView\n parsers?: Array<PluginView>\n /** The root `output` members Studio may set, absent when `output` is not an object literal. */\n output?: OptionsView\n}\n\n/** The config file as Studio may edit it, or why it cannot. */\nexport type ConfigFileView = { managed: true; configs: Array<ConfigView> } | { managed: false; reason: string }\n\nexport type ConfigEditOutcome = {\n edit: ConfigEdit\n applied: boolean\n reason?: string\n}\n\nexport type ExtensionEntry = {\n package: string\n version: string\n manifest: ExtensionManifest\n /** Ships with `kubb` at its version, so updating `kubb` updates it and `kubb update` cannot. */\n bundled?: true\n}\n\n/** Installed extensions by package name, the only ones Studio may import besides `@kubb/plugin-*`. */\nexport type InstalledExtensions = ReadonlyMap<string, ExtensionEntry>\n","import { type ExtensionKind, isPackageName } from '@kubb/core'\nimport { camelCase } from '@internals/utils'\nimport { extensionKinds, type InstalledExtensions, type OptionValue } from './types.ts'\n\n/** `@kubb/plugin-ts` becomes `plugin-ts`, the `name` Kubb plugin factories use. */\nexport function toPluginName(packageName: string): string {\n return packageName.split('/').pop() ?? packageName\n}\n\n/** `@kubb/plugin-react-query` becomes `pluginReactQuery`, the export a plugin package uses by convention. */\nexport function toExportName(packageName: string): string {\n return camelCase(toPluginName(packageName))\n}\n\nconst KUBB_PLUGIN_SPECIFIER = /^@kubb\\/plugin-[\\w.-]+$/\n\n/** Only a `@kubb/plugin-*` package or an installed extension of `kind` may be imported, never a path or URL. */\nexport function isAllowedPlugin({\n packageName,\n extensions,\n kind = extensionKinds.plugin,\n}: {\n packageName: string\n extensions: InstalledExtensions\n kind?: ExtensionKind\n}): boolean {\n if (!isPackageName(packageName)) return false\n return (kind === extensionKinds.plugin && KUBB_PLUGIN_SPECIFIER.test(packageName)) || extensions.get(packageName)?.manifest.kind === kind\n}\n\nconst UNSAFE_KEYS = new Set(['__proto__', 'constructor', 'prototype'])\n\n/** Whether `key` can be an option key without reaching the object's prototype. */\nexport function isSafeKey(key: string): boolean {\n return !UNSAFE_KEYS.has(key)\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) return false\n const prototype = Object.getPrototypeOf(value)\n return prototype === null || prototype === Object.prototype\n}\n\n/** Whether `value` survives a JSON round trip, so an edit never writes a lossy copy into the file. */\nexport function isOptionValue(value: unknown): value is OptionValue {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return true\n if (typeof value === 'number') return Number.isFinite(value)\n if (Array.isArray(value)) return value.every(isOptionValue)\n if (isPlainObject(value)) return Object.entries(value).every(([key, entry]) => isSafeKey(key) && isOptionValue(entry))\n\n return false\n}\n\n/** The root `output` members Studio may set, with the values each takes. */\nconst OUTPUT_VALUES: Record<string, (value: unknown) => boolean> = {\n barrel: (value) => value === false || (isPlainObject(value) && Object.keys(value).length === 1 && (value.type === 'named' || value.type === 'all')),\n format: (value) => value === false || ['auto', 'prettier', 'biome', 'oxfmt'].includes(value as string),\n lint: (value) => value === false || ['auto', 'eslint', 'biome', 'oxlint'].includes(value as string),\n clean: (value) => typeof value === 'boolean',\n defaultBanner: (value) => value === false || value === 'simple' || value === 'full',\n}\n\nexport function isOutputKey(key: string): boolean {\n return Object.hasOwn(OUTPUT_VALUES, key)\n}\n\nexport function isOutputValue({ key, value }: { key: string; value: unknown }): boolean {\n return isOutputKey(key) && OUTPUT_VALUES[key]!(value)\n}\n\nexport function pickOutput<T>(output: Record<string, T>): Record<string, T> {\n return Object.fromEntries(Object.entries(output).filter(([key]) => isOutputKey(key)))\n}\n","import { type ArrayExpression, nodeTypes, type ObjectExpression } from './ast.ts'\nimport type { OptionValue } from './types.ts'\n\n/**\n * A valid JavaScript identifier, so an import name can only ever print as `import { name } from`,\n * never as source that breaks out of the import statement.\n */\nexport const IDENTIFIER_PATTERN = /^[A-Za-z_$][\\w$]*$/\n\nexport const quotes = { single: `'`, double: `\"` } as const\nexport type Quote = (typeof quotes)[keyof typeof quotes]\n\n/** `source` with the text between `start` and `end` replaced by `text`. */\nexport function replaceText(source: string, start: number, end: number, text = ''): string {\n return `${source.slice(0, start)}${text}${source.slice(end)}`\n}\n\n/** The 1-based line and 0-based column of `offset` in `source`. */\nexport function getPosition(source: string, offset: number): { line: number; column: number } {\n return { line: source.slice(0, offset).split('\\n').length, column: offset - source.lastIndexOf('\\n', offset - 1) - 1 }\n}\n\n/** Writes `value` as a single-line literal with the file's quote style. */\nexport function printValue(value: OptionValue, quote: Quote): string {\n if (typeof value === 'string') {\n // JSON's escaping covers every character that could end the literal or the line.\n const escaped = JSON.stringify(value).slice(1, -1)\n return quote === quotes.double ? `\"${escaped}\"` : `'${escaped.replaceAll(`\\\\\"`, `\"`).replaceAll(`'`, `\\\\'`)}'`\n }\n if (value === null || typeof value !== 'object') return String(value)\n if (Array.isArray(value)) return `[${value.map((item) => printValue(item, quote)).join(', ')}]`\n\n const entries = Object.entries(value)\n return entries.length ? `{ ${entries.map(([key, item]) => `${printKey(key, quote)}: ${printValue(item, quote)}`).join(', ')} }` : '{}'\n}\n\n/** An object key as source text: bare when it is an identifier, quoted otherwise. */\nexport function printKey(key: string, quote: Quote): string {\n return IDENTIFIER_PATTERN.test(key) ? key : printValue(key, quote)\n}\n\n/** `value` wrapped in one object per key of `path`: `wrapPath(['enum', 'type'], 'enum')` is `{ enum: { type: 'enum' } }`. */\nexport function wrapPath(path: Array<string>, value: OptionValue): OptionValue {\n return path.reduceRight<OptionValue>((inner, key) => ({ [key]: inner }), value)\n}\n\n/**\n * Adds `text` as the last item of an object or array literal, following its layout: on a line of\n * its own with the last item's indentation when the literal spans lines, inline otherwise.\n */\nexport function appendItem(source: string, container: ObjectExpression | ArrayExpression, text: string): string {\n const { start, end } = container\n const items: Array<{ start: number; end: number } | null> = container.type === nodeTypes.objectExpression ? container.properties : container.elements\n const last = items.filter((item) => item !== null).at(-1)\n\n if (!last) {\n const inner = source.slice(start + 1, end - 1)\n // A comment inside the empty literal stays, after the new item.\n if (inner.trim()) return replaceText(source, start + 1, start + 1, /^\\s/.test(inner) ? `${text},` : `${text}, `)\n return replaceText(source, start, end, container.type === nodeTypes.objectExpression ? `{ ${text} }` : `[${text}]`)\n }\n\n const between = source.slice(last.end, end - 1)\n // The closing bracket shares the last item's line: add the item inline.\n if (!between.includes('\\n')) return replaceText(source, last.end, last.end, `, ${text}`)\n\n const lineStart = source.lastIndexOf('\\n', last.start - 1) + 1\n const indent = source.slice(lineStart).match(/^[ \\t]*/)?.[0] ?? ''\n // After the last item's comma and any comment on its line, so neither moves. `between` holds a\n // newline, so one always follows.\n const lineEnd = source.indexOf('\\n', last.end)\n const comma = /^\\s*,/.test(between)\n\n return `${source.slice(0, last.end)}${comma ? '' : ','}${source.slice(last.end, lineEnd)}\\n${indent}${text}${comma ? ',' : ''}${source.slice(lineEnd)}`\n}\n\n/** Drops the item at `index` from an object or array literal, with its own lines when it sits on them alone. */\nexport function removeItem(source: string, node: ObjectExpression | ArrayExpression, index: number): string {\n const items: Array<{ start: number; end: number }> =\n node.type === nodeTypes.objectExpression ? node.properties : node.elements.filter((element) => element !== null)\n if (items.length === 1) return replaceText(source, node.start, node.end, node.type === nodeTypes.objectExpression ? '{}' : '[]')\n\n const { start, end } = items[index]!\n const lineStart = source.lastIndexOf('\\n', start - 1) + 1\n const nextNewline = source.indexOf('\\n', end)\n const lineEnd = nextNewline === -1 ? source.length : nextNewline\n if (!source.slice(lineStart, start).trim() && /^\\s*,?\\s*(\\/\\/.*)?$/.test(source.slice(end, lineEnd))) {\n return replaceText(source, lineStart, Math.min(lineEnd + 1, source.length))\n }\n\n const next = items[index + 1]\n return next ? replaceText(source, start, next.start) : replaceText(source, items[index - 1]!.end, end)\n}\n","import type { ExtensionKind } from '@kubb/core'\nimport { getErrorMessage, read, writeRaw } from '@internals/utils'\nimport {\n type AssignmentExpression,\n type BindingProperty,\n type CallExpression,\n type Comment,\n type Expression,\n type ImportDeclaration,\n type ObjectExpression,\n type ObjectPropertyKind,\n type Program,\n type RestElement,\n type SpreadElement,\n type VariableDeclaration,\n commentTypes,\n nodeTypes,\n parseExpression,\n parseSource,\n propertyKinds,\n unaryOperators,\n} from './ast.ts'\nimport { isAllowedPlugin, isOptionValue, isOutputKey, isOutputValue, isSafeKey, pickOutput, toExportName } from './rules.ts'\nimport { appendItem, getPosition, IDENTIFIER_PATTERN, printKey, printValue, quotes, type Quote, removeItem, replaceText, wrapPath } from './text.ts'\nimport {\n type ConfigEdit,\n ConfigEditOperation,\n type ConfigEditOutcome,\n type ConfigFileView,\n type ConfigRef,\n type ConfigView,\n extensionKinds,\n type InstalledExtensions,\n type OptionsView,\n type OptionValue,\n type PluginView,\n} from './types.ts'\n\n/** The marker `disable-plugin` writes, with the block's line count so `enable-plugin` restores exactly those lines. */\nconst DISABLED_MARKER_PATTERN = /^kubb:disabled (.+)\\s+(\\d+)$/\n\nconst OPERATIONS = new Set<string>(Object.values(ConfigEditOperation))\nconst OPTION_OPERATIONS = new Set<string>([ConfigEditOperation.SET_OPTION, ConfigEditOperation.REMOVE_OPTION])\nconst OUTPUT_OPERATIONS = new Set<string>([ConfigEditOperation.SET_OUTPUT, ConfigEditOperation.REMOVE_OUTPUT])\nconst KINDS = new Set<string>(Object.values(extensionKinds))\n\n/** Identifiers the editor matches by name. */\nconst identifiers = { defineConfig: 'defineConfig', require: 'require', module: 'module', exports: 'exports' } as const\n\nconst moduleKinds = { esm: 'esm', cjs: 'cjs' } as const\ntype ModuleKind = (typeof moduleKinds)[keyof typeof moduleKinds]\n\ntype EditResult = { source: string } | { reason: string }\ntype ParsedConfig = { program: Program; comments: Array<Comment>; configs: Array<ObjectExpression>; kind: ModuleKind }\ntype ValueNode = Expression | SpreadElement | null | undefined\ntype Import = { from: string; exported: string }\ntype FactoryCall = { importName: string; exportName: string; packageName: string; call: CallExpression }\ntype DisabledBlock = { packageName: string; line: number; end: number; code: Array<string> }\ntype OutputEdit = Extract<ConfigEdit, { operation: typeof ConfigEditOperation.SET_OUTPUT | typeof ConfigEditOperation.REMOVE_OUTPUT }>\ntype OptionEdit = Extract<ConfigEdit, { operation: typeof ConfigEditOperation.SET_OPTION | typeof ConfigEditOperation.REMOVE_OPTION }>\ntype AddPluginEdit = Extract<ConfigEdit, { operation: typeof ConfigEditOperation.ADD_PLUGIN }>\ntype DisablePluginEdit = Extract<ConfigEdit, { operation: typeof ConfigEditOperation.DISABLE_PLUGIN }>\ntype RemoveExtensionEdit = Extract<ConfigEdit, { operation: typeof ConfigEditOperation.REMOVE_EXTENSION }>\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value !== ''\n}\n\n/** Edits cross the wire, so their shape is checked before anything reads them. */\nfunction validateEdit(edit: ConfigEdit): string | undefined {\n const { operation, plugin, config, path, kind, input } = (typeof edit === 'object' && edit !== null ? edit : {}) as Record<string, unknown>\n\n if (typeof operation !== 'string' || !OPERATIONS.has(operation)) return `unknown operation ${JSON.stringify(operation)}`\n if (config !== undefined && typeof config !== 'string' && !Number.isSafeInteger(config)) return 'config must name an entry or give its index'\n\n if (operation === ConfigEditOperation.SET_INPUT) {\n return typeof input === 'string' && input.trim() !== '' ? undefined : 'the edit names no input'\n }\n\n const isOption = OPTION_OPERATIONS.has(operation)\n const isOutput = OUTPUT_OPERATIONS.has(operation)\n\n if (!isOutput && !isNonEmptyString(plugin)) return 'the edit names no plugin'\n\n if (kind !== undefined) {\n if (typeof kind !== 'string' || !KINDS.has(kind)) return `unknown kind ${JSON.stringify(kind)}`\n const takesKind = operation === ConfigEditOperation.ADD_PLUGIN || operation === ConfigEditOperation.REMOVE_EXTENSION\n if (takesKind && kind === extensionKinds.adapter) return `${operation} takes a plugin or a parser, since a config has one adapter`\n if (!isOption && !takesKind) return `${operation} edits the plugins array, so it takes no kind`\n }\n\n if (!isOption && !isOutput) return undefined\n\n if (!Array.isArray(path) || !path.every(isNonEmptyString)) return 'path must be a list of option names'\n if (path.length === 0) return 'no option path given'\n\n const unsafe = path.find((key) => !isSafeKey(key))\n if (unsafe !== undefined) return `${unsafe} cannot be used as an option name`\n\n if (isOutput && !isOutputKey(path[0]!)) return `output.${path[0]} can only be changed in the config file`\n\n return undefined\n}\n\n// Finding the config\n\n/** Steps through `as`/`satisfies` and `() => ...` wrappers to the config object. */\nfunction unwrapValue(node: ValueNode): ValueNode {\n if (!node) return undefined\n if (node.type === nodeTypes.tSAsExpression || node.type === nodeTypes.tSSatisfiesExpression) return unwrapValue(node.expression)\n if (node.type !== nodeTypes.arrowFunctionExpression && node.type !== nodeTypes.functionExpression) return node\n if (node.body?.type !== nodeTypes.blockStatement) return unwrapValue(node.body as Expression | null)\n\n const returned = node.body.body.find((statement) => statement.type === nodeTypes.returnStatement)\n return unwrapValue(returned?.type === nodeTypes.returnStatement ? returned.argument : undefined)\n}\n\nfunction isModuleExports(node: AssignmentExpression['left']): boolean {\n return (\n node.type === nodeTypes.memberExpression &&\n !node.computed &&\n node.object.type === nodeTypes.identifier &&\n node.object.name === identifiers.module &&\n node.property.type === nodeTypes.identifier &&\n node.property.name === identifiers.exports\n )\n}\n\n/** The exported config value and how the file exports it. */\nfunction findExport(program: Program): { exported: ValueNode; kind: ModuleKind } {\n for (const node of program.body) {\n if (node.type === nodeTypes.exportDefaultDeclaration) {\n // A `function` or `class` declaration is never a `defineConfig(...)` call, so `findConfigs` refuses it.\n return { exported: node.declaration as Expression, kind: moduleKinds.esm }\n }\n if (node.type === nodeTypes.expressionStatement && node.expression.type === nodeTypes.assignmentExpression && isModuleExports(node.expression.left)) {\n return { exported: node.expression.right, kind: moduleKinds.cjs }\n }\n }\n return { exported: undefined, kind: moduleKinds.esm }\n}\n\n/** Every config object in `export default` or `module.exports = defineConfig(...)`, or why the file is unmanaged. */\nfunction findConfigs(source: string): ParsedConfig | { reason: string } {\n const parsed = parseSource(source)\n if ('reason' in parsed) return parsed\n\n const { exported, kind } = findExport(parsed.program)\n const value = unwrapValue(exported)\n if (!value) return { reason: 'no `export default` or `module.exports` found' }\n if (value.type !== nodeTypes.callExpression || value.callee.type !== nodeTypes.identifier || value.callee.name !== identifiers.defineConfig) {\n return { reason: 'the exported config is not a defineConfig(...) call' }\n }\n\n const argument = unwrapValue(value.arguments[0])\n if (!argument) return { reason: 'defineConfig(...) was called without a config' }\n\n const entries = argument.type === nodeTypes.arrayExpression ? argument.elements.map((element) => unwrapValue(element)) : [argument]\n const configs = entries.filter((entry): entry is ObjectExpression => entry?.type === nodeTypes.objectExpression)\n if (configs.length !== entries.length) return { reason: 'config is not an object literal' }\n\n return { ...parsed, configs, kind }\n}\n\nfunction findConfigEntry(configs: Array<ObjectExpression>, ref: ConfigRef | undefined): ObjectExpression | undefined {\n return typeof ref === 'string' ? configs.find((entry) => getConfigName(entry) === ref) : configs[ref ?? 0]\n}\n\n// Reading object literals\n\nfunction getKey(entry: ObjectPropertyKind | BindingProperty | RestElement): string | undefined {\n if (entry.type !== nodeTypes.property || entry.computed) return undefined\n if (entry.key.type === nodeTypes.identifier) return entry.key.name\n return entry.key.type === nodeTypes.literal && typeof entry.key.value === 'string' ? entry.key.value : undefined\n}\n\n/** The last one wins when the key repeats, as at runtime. */\nfunction findProperty(node: ObjectExpression, key: string): { member: ObjectPropertyKind; index: number } | undefined {\n const index = node.properties.findLastIndex((entry) => getKey(entry) === key)\n return index === -1 ? undefined : { member: node.properties[index]!, index }\n}\n\nfunction getValue(node: ObjectExpression, key: string): ValueNode {\n const member = findProperty(node, key)?.member\n return member?.type === nodeTypes.property ? member.value : member\n}\n\nfunction getConfigName(config: ObjectExpression): string | undefined {\n const name = getValue(config, 'name')\n return name?.type === nodeTypes.literal && typeof name.value === 'string' ? name.value : undefined\n}\n\nfunction isOverridden(node: ObjectExpression, index: number): boolean {\n return node.properties.slice(index + 1).some((entry) => entry.type === nodeTypes.spreadElement)\n}\n\n/** `key: value`, not a method, getter, setter, or `{ key }` shorthand. */\nfunction isPlainProperty(member: Extract<ObjectPropertyKind, { type: typeof nodeTypes.property }>): boolean {\n return !member.method && !member.shorthand && member.kind === propertyKinds.init\n}\n\n/** A literal's value, `undefined` for code. */\nfunction readLiteral(node: ValueNode): OptionValue | undefined {\n switch (node?.type) {\n case nodeTypes.literal:\n // A bigint or a regex is code, not a value JSON can carry. A regex Node cannot compile also has a `null` value.\n return 'regex' in node || 'bigint' in node ? undefined : (node.value as OptionValue)\n case nodeTypes.templateLiteral:\n return node.expressions.length ? undefined : (node.quasis[0]?.value.cooked ?? '')\n case nodeTypes.unaryExpression: {\n const value = readLiteral(node.argument)\n if (typeof value !== 'number') return undefined\n if (node.operator === unaryOperators.minus) return -value\n if (node.operator === unaryOperators.plus) return value\n return undefined\n }\n case nodeTypes.arrayExpression: {\n const values = node.elements.map((element) => readLiteral(element))\n return values.every((value) => value !== undefined) ? values : undefined\n }\n case nodeTypes.objectExpression: {\n const entries: Record<string, OptionValue> = {}\n for (const entry of node.properties) {\n if (entry.type !== nodeTypes.property) return undefined\n const key = getKey(entry)\n const value = readLiteral(entry.value)\n // A `__proto__` key would replace the object's prototype instead of adding an entry.\n if (key === undefined || !isSafeKey(key) || value === undefined) return undefined\n entries[key] = value\n }\n return entries\n }\n }\n return undefined\n}\n\n// Imports and factory calls\n\nfunction getRequirePath(node: ValueNode): string | undefined {\n if (node?.type !== nodeTypes.callExpression || node.callee.type !== nodeTypes.identifier || node.callee.name !== identifiers.require) return undefined\n const [argument] = node.arguments\n return argument?.type === nodeTypes.literal && typeof argument.value === 'string' ? argument.value : undefined\n}\n\n/** `import { exported as local } from '...'`. A default or namespace import has no exported name, so its local name stands in. */\nfunction importBindings(statement: ImportDeclaration): Array<[string, Import]> {\n return statement.specifiers.map((specifier) => {\n const imported = specifier.type === nodeTypes.importSpecifier ? specifier.imported : specifier.local\n const exported = imported.type === nodeTypes.identifier ? imported.name : imported.value\n return [specifier.local.name, { from: statement.source.value, exported }]\n })\n}\n\n/** `const { exported: local } = require('...')`. */\nfunction requireBindings(statement: VariableDeclaration): Array<[string, Import]> {\n return statement.declarations.flatMap((declarator): Array<[string, Import]> => {\n const from = getRequirePath(declarator.init)\n if (from === undefined || declarator.id.type !== nodeTypes.objectPattern) return []\n\n return declarator.id.properties.flatMap((entry): Array<[string, Import]> => {\n if (entry.type !== nodeTypes.property || entry.value.type !== nodeTypes.identifier) return []\n return [[entry.value.name, { from, exported: getKey(entry) ?? entry.value.name }]]\n })\n })\n}\n\nfunction getImports(program: Program): Map<string, Import> {\n return new Map(\n program.body.flatMap((statement) => {\n if (statement.type === nodeTypes.importDeclaration) return importBindings(statement)\n if (statement.type === nodeTypes.variableDeclaration) return requireBindings(statement)\n return []\n }),\n )\n}\n\nfunction isImportStatement(node: Program['body'][number], kind: ModuleKind): boolean {\n if (kind === moduleKinds.esm) return node.type === nodeTypes.importDeclaration\n return node.type === nodeTypes.variableDeclaration && node.declarations.some((declarator) => getRequirePath(declarator.init) !== undefined)\n}\n\n/** The quote of the first string literal in the file, so new code matches it. */\nfunction detectQuote(node: unknown): Quote | undefined {\n if (!node || typeof node !== 'object') return undefined\n const { type, raw } = node as { type?: string; raw?: unknown }\n if (type === nodeTypes.literal && typeof raw === 'string' && (raw[0] === quotes.single || raw[0] === quotes.double)) return raw[0]\n for (const child of Object.values(node)) {\n const quote = detectQuote(child)\n if (quote) return quote\n }\n return undefined\n}\n\n/** The `adapter` value, or the elements of the `plugins` or `parsers` array. */\nfunction factoryNodes(config: ObjectExpression, kind: ExtensionKind): Array<ValueNode> {\n if (kind === extensionKinds.adapter) return [getValue(config, 'adapter')]\n const array = getValue(config, `${kind}s`)\n return array?.type === nodeTypes.arrayExpression ? array.elements : []\n}\n\n/** The factory calls of one kind whose callee the file imports. */\nfunction findCalls(program: Program, config: ObjectExpression, kind: ExtensionKind = extensionKinds.plugin): Array<FactoryCall> {\n const imports = getImports(program)\n return factoryNodes(config, kind).flatMap((node) => {\n if (node?.type !== nodeTypes.callExpression || node.callee.type !== nodeTypes.identifier) return []\n const imported = imports.get(node.callee.name)\n return imported ? [{ importName: node.callee.name, exportName: imported.exported, packageName: imported.from, call: node }] : []\n })\n}\n\n// Disabled plugins\n\n/** Whether nothing but whitespace precedes `offset` on its line. */\nfunction startsLine(source: string, offset: number): boolean {\n return source.slice(source.lastIndexOf('\\n', offset - 1) + 1, offset).trim() === ''\n}\n\n/** The `disable-plugin` blocks in this config, read from marker comments since the call is no longer a node. */\nfunction findDisabled(source: string, comments: Array<Comment>, config: ObjectExpression): Array<DisabledBlock> {\n const lines = source.split('\\n')\n\n return comments.flatMap((comment) => {\n const match = comment.type === commentTypes.line ? comment.value.trim().match(DISABLED_MARKER_PATTERN) : null\n // Only markers inside this entry, on a line of their own, so another entry or a trailing comment never matches.\n if (!match || comment.start < config.start || comment.end > config.end || !startsLine(source, comment.start)) return []\n\n const line = getPosition(source, comment.start).line\n const end = line + Number(match[2])\n const code = lines.slice(line, end).map((text) => text.replace(/^(\\s*)\\/\\/ ?/, '$1').replace(/^\\s+$/, ''))\n return [{ packageName: match[1]!, line, end, code }]\n })\n}\n\n// Reading options\n\n/** Literal members as `value` and code paths as `locked`, `undefined` for a computed key. */\nfunction readEditable(node: ObjectExpression, prefix: Array<string> = []): { value: Record<string, OptionValue>; locked: Array<Array<string>> } | undefined {\n const value: Record<string, OptionValue> = {}\n const locked: Array<Array<string>> = []\n\n for (const [index, entry] of node.properties.entries()) {\n if (entry.type === nodeTypes.spreadElement) continue\n const key = getKey(entry)\n if (key === undefined) return undefined\n if (findProperty(node, key)?.index !== index) continue\n\n const path = [...prefix, key]\n // A `__proto__` key replaces the prototype, so it reads as code.\n if (!isSafeKey(key)) {\n locked.push(path)\n continue\n }\n\n const member = isOverridden(node, index) ? undefined : entry.value\n const literal = readLiteral(member)\n if (literal !== undefined) {\n value[key] = literal\n continue\n }\n if (member?.type !== nodeTypes.objectExpression) {\n locked.push(path)\n continue\n }\n\n const nested = readEditable(member, path)\n if (!nested) return undefined\n value[key] = nested.value\n locked.push(...nested.locked)\n }\n return { value, locked }\n}\n\nfunction readObjectOptions(options: ObjectExpression): OptionsView {\n const entries: OptionsView = {}\n for (const [index, entry] of options.properties.entries()) {\n const key = getKey(entry)\n if (key === undefined || !isSafeKey(key)) continue\n\n const member = entry.type === nodeTypes.property && !isOverridden(options, index) ? entry.value : undefined\n const value = readLiteral(member)\n if (value !== undefined) {\n entries[key] = { literal: true, value }\n continue\n }\n entries[key] = { literal: false, ...(member?.type === nodeTypes.objectExpression ? readEditable(member) : undefined) }\n }\n return entries\n}\n\nfunction readCallOptions(call: CallExpression): OptionsView {\n const options = call.arguments[0]\n return options?.type === nodeTypes.objectExpression ? readObjectOptions(options) : {}\n}\n\nfunction readDisabledOptions(code: Array<string>): OptionsView {\n const call = parseExpression(code.join('\\n').trim().replace(/,$/, ''))\n return call?.type === nodeTypes.callExpression ? readCallOptions(call) : {}\n}\n\nfunction toPluginView({ importName, packageName, call }: FactoryCall): PluginView {\n return { importName, packageName, options: readCallOptions(call) }\n}\n\n/** Active and disabled plugins, in source order so a disabled plugin keeps its place. */\nfunction readPlugins({ source, parsed, config }: { source: string; parsed: ParsedConfig; config: ObjectExpression }): Array<PluginView> {\n const importNames = new Map([...getImports(parsed.program)].map(([local, { from }]) => [from, local]))\n\n const active = findCalls(parsed.program, config).map((call) => ({ line: getPosition(source, call.call.start).line, plugin: toPluginView(call) }))\n const disabled = findDisabled(source, parsed.comments, config).map(({ packageName, line, code }) => ({\n line,\n plugin: {\n importName: importNames.get(packageName) ?? toExportName(packageName),\n packageName,\n options: readDisabledOptions(code),\n disabled: true as const,\n },\n }))\n\n return [...active, ...disabled].sort((a, b) => a.line - b.line).map(({ plugin }) => plugin)\n}\n\nfunction readConfigView({ source, parsed, config }: { source: string; parsed: ParsedConfig; config: ObjectExpression }): ConfigView {\n const [adapter] = findCalls(parsed.program, config, extensionKinds.adapter).map(toPluginView)\n const parsers = findCalls(parsed.program, config, extensionKinds.parser).map(toPluginView)\n const output = getOutput(config)\n\n return {\n name: getConfigName(config),\n plugins: readPlugins({ source, parsed, config }),\n ...(adapter && { adapter }),\n ...(parsers.length ? { parsers } : {}),\n ...(!('reason' in output) && { output: pickOutput(readObjectOptions(output.object)) }),\n }\n}\n\n/** Which plugins the file declares and which options Studio may write. */\nexport function readConfig(source: string): ConfigFileView {\n const parsed = findConfigs(source)\n if ('reason' in parsed) return { managed: false, reason: parsed.reason }\n\n return { managed: true, configs: parsed.configs.map((config) => readConfigView({ source, parsed, config })) }\n}\n\n/** The modules the file imports, empty when it cannot be parsed. */\nexport function readImports(source: string): Array<string> {\n const parsed = parseSource(source)\n if ('reason' in parsed) return []\n return [...new Set([...getImports(parsed.program).values()].map(({ from }) => from))]\n}\n\n// Editing options\n\ntype FoundPath = { object: ObjectExpression; index: number; value: Expression } | { object: ObjectExpression; missing: number } | { reason: string }\n\n/** Follows `path` to its literal, or to the first missing key. Refuses a value set in code. */\nfunction findPath(options: ObjectExpression, path: Array<string>): FoundPath {\n let object = options\n\n for (const [depth, key] of path.entries()) {\n const found = findProperty(object, key)\n if (!found) return { object, missing: depth }\n if (isOverridden(object, found.index)) {\n return { reason: `${path.slice(0, depth + 1).join('.')} can be overridden by a spread after it, so it is customized in code` }\n }\n\n const { member, index } = found\n const isLast = depth === path.length - 1\n if (isLast) {\n return member.type === nodeTypes.property && readLiteral(member.value) !== undefined\n ? { object, index, value: member.value }\n : { reason: `${path.join('.')} is customized in code` }\n }\n if (member.type !== nodeTypes.property || member.value.type !== nodeTypes.objectExpression) {\n return { reason: `${key} is not an object, so ${path.join('.')} cannot be reached` }\n }\n object = member.value\n }\n return { reason: 'no option path given' }\n}\n\nfunction setAtPath({\n source,\n options,\n path,\n value,\n quote,\n}: {\n source: string\n options: ObjectExpression\n path: Array<string>\n value: OptionValue\n quote: Quote\n}): EditResult {\n const target = findPath(options, path)\n if ('reason' in target) return target\n if ('missing' in target) {\n const [key, ...rest] = path.slice(target.missing)\n return { source: appendItem(source, target.object, `${printKey(key!, quote)}: ${printValue(wrapPath(rest, value), quote)}`) }\n }\n return { source: replaceText(source, target.value.start, target.value.end, printValue(value, quote)) }\n}\n\nfunction removeAtPath({ source, options, path }: { source: string; options: ObjectExpression; path: Array<string> }): EditResult {\n const target = findPath(options, path)\n if ('reason' in target) return target\n if ('missing' in target) return { source }\n return { source: removeItem(source, target.object, target.index) }\n}\n\nfunction setOption(source: string, call: CallExpression, path: Array<string>, value: unknown, quote: Quote): EditResult {\n if (!isOptionValue(value)) return { reason: 'the value is not a literal that can be written to a config file' }\n\n const options = call.arguments[0]\n if (!options) {\n const closing = call.end - 1\n if (source[closing] !== ')') return { reason: 'the factory call could not be located in the file' }\n return { source: replaceText(source, closing, closing, printValue(wrapPath(path, value), quote)) }\n }\n if (options.type !== nodeTypes.objectExpression) return { reason: 'the factory was not called with an object literal' }\n return setAtPath({ source, options, path, value, quote })\n}\n\nfunction removeOption(source: string, call: CallExpression, path: Array<string>): EditResult {\n const options = call.arguments[0]\n if (!options) return { source }\n if (options.type !== nodeTypes.objectExpression) return { reason: 'the factory was not called with an object literal' }\n return removeAtPath({ source, options, path })\n}\n\nfunction editOption({\n source,\n parsed,\n config,\n edit,\n quote,\n extensions,\n}: {\n source: string\n parsed: ParsedConfig\n config: ObjectExpression\n edit: OptionEdit\n quote: Quote\n extensions: InstalledExtensions\n}): EditResult {\n const kind = edit.kind ?? extensionKinds.plugin\n // A package can ship several factories (`parserTs`, `parserTsx`), so prefer the export its manifest names.\n const calls = findCalls(parsed.program, config, kind).filter((entry) => entry.packageName === edit.plugin)\n const exportName = extensions.get(edit.plugin)?.manifest.export ?? toExportName(edit.plugin)\n const call = (calls.find((entry) => entry.exportName === exportName) ?? calls[0])?.call\n\n if (!call) {\n if (kind === extensionKinds.adapter) return { reason: `${edit.plugin} is not the config's adapter` }\n const disabled = kind === extensionKinds.plugin && findDisabled(source, parsed.comments, config).some((block) => block.packageName === edit.plugin)\n return { reason: disabled ? `${edit.plugin} is disabled, enable it first` : `${edit.plugin} is not in the ${kind}s array` }\n }\n\n if (edit.operation === ConfigEditOperation.SET_OPTION) return setOption(source, call, edit.path, edit.value, quote)\n return removeOption(source, call, edit.path)\n}\n\n// Editing the config's own fields\n\nfunction setInput(source: string, config: ObjectExpression, input: string, quote: Quote): EditResult {\n const value = printValue(input, quote)\n const found = findProperty(config, 'input')\n if (!found) return { source: appendItem(source, config, `input: ${value}`) }\n if (found.member.type !== nodeTypes.property || !isPlainProperty(found.member)) return { reason: 'input is not a plain property' }\n if (isOverridden(config, found.index)) return { reason: 'a spread after input could override it' }\n return { source: replaceText(source, found.member.value.start, found.member.value.end, value) }\n}\n\nfunction getOutput(config: ObjectExpression): { object: ObjectExpression } | { reason: string } {\n const found = findProperty(config, 'output')\n if (found?.member.type !== nodeTypes.property || found.member.value.type !== nodeTypes.objectExpression) return { reason: 'output is not an object literal' }\n if (isOverridden(config, found.index)) return { reason: 'a spread after output could override it' }\n return { object: found.member.value }\n}\n\nfunction editOutput({ source, config, edit, quote }: { source: string; config: ObjectExpression; edit: OutputEdit; quote: Quote }): EditResult {\n const output = getOutput(config)\n if ('reason' in output) return output\n if (edit.operation === ConfigEditOperation.REMOVE_OUTPUT) return removeAtPath({ source, options: output.object, path: edit.path })\n\n const [key, ...rest] = edit.path\n if (!isOptionValue(edit.value) || !isOutputValue({ key: key!, value: wrapPath(rest, edit.value) }))\n return { reason: `the value is not one output.${key} takes` }\n return setAtPath({ source, options: output.object, path: edit.path, value: edit.value, quote })\n}\n\n// Adding, disabling, and enabling plugins\n\n/** Adds the import after the last one, matching its semicolon style. */\nfunction addImport({\n source,\n parsed,\n importNames,\n moduleSpecifier,\n quote,\n}: {\n source: string\n parsed: ParsedConfig\n importNames: Array<string>\n moduleSpecifier: string\n quote: Quote\n}): string {\n const lastImport = parsed.program.body.findLast((node) => isImportStatement(node, parsed.kind))\n const afterLine = lastImport ? getPosition(source, lastImport.end).line : 0\n const lines = source.split('\\n')\n\n const semicolon = afterLine > 0 && lines[afterLine - 1]?.trimEnd().endsWith(';') ? ';' : ''\n const specifier = `${quote}${moduleSpecifier}${quote}`\n const statement =\n parsed.kind === moduleKinds.esm ? `import { ${importNames.join(', ')} } from ${specifier}` : `const { ${importNames.join(', ')} } = require(${specifier})`\n\n lines.splice(afterLine, 0, `${statement}${semicolon}`)\n if (afterLine === 0) lines.splice(1, 0, '')\n\n return lines.join('\\n')\n}\n\n/**\n * The parsers `defineConfig` applies when a config sets no `parsers`, by import name. Adding a parser\n * to such a config writes these too, or the new array would replace them.\n */\nconst DEFAULT_PARSERS = [\n { importName: 'parserTs', packageName: '@kubb/parser-ts' },\n { importName: 'parserTsx', packageName: '@kubb/parser-ts' },\n { importName: 'parserMd', packageName: '@kubb/parser-md' },\n] as const\n\n/**\n * Adds a plugin to `plugins`, or with `kind: 'parser'` a parser to `parsers`. Replaying the same add\n * is a no-op, while an import name taken by another package is an error.\n */\nfunction addPlugin({\n source,\n parsed,\n config,\n edit,\n quote,\n extensions,\n}: {\n source: string\n parsed: ParsedConfig\n config: ObjectExpression\n edit: AddPluginEdit\n quote: Quote\n extensions: InstalledExtensions\n}): EditResult {\n const kind = edit.kind ?? extensionKinds.plugin\n const isParser = kind === extensionKinds.parser\n if (!isAllowedPlugin({ packageName: edit.plugin, extensions, kind })) {\n return {\n reason: isParser ? `\"${edit.plugin}\" is not an installed Kubb parser` : `\"${edit.plugin}\" is not a @kubb/plugin-* package or an installed Kubb plugin`,\n }\n }\n\n const importName = extensions.get(edit.plugin)?.manifest.export ?? toExportName(edit.plugin)\n if (!IDENTIFIER_PATTERN.test(importName)) return { reason: `\"${importName}\" is not a valid import name` }\n // A package can ship several parsers (`parserTs` and `parserTsx`), so a parser is matched by its export too.\n if (findCalls(parsed.program, config, kind).some((entry) => entry.packageName === edit.plugin && (!isParser || entry.exportName === importName))) {\n return { source }\n }\n\n const options = edit.options ?? {}\n if (!isOptionValue(options)) return { reason: 'the options are not literals that can be written to a config file' }\n\n const key = `${kind}s`\n const array = getValue(config, key)\n if (array ? array.type !== nodeTypes.arrayExpression : !isParser) return { reason: `${key} is not an array literal` }\n // A config without `parsers` runs the defaults, so the new array lists them before the added parser.\n const defaults = isParser && !array ? DEFAULT_PARSERS.filter((parser) => parser.importName !== importName) : []\n\n // The missing imports by package, so `parserTs` and `parserTsx` share one line.\n const imports = getImports(parsed.program)\n const missing = new Map<string, Array<string>>()\n for (const item of [...defaults, { importName, packageName: edit.plugin }]) {\n const from = imports.get(item.importName)?.from\n if (from && from !== item.packageName) return { reason: `${item.importName} is already imported from ${from}` }\n if (!from) missing.set(item.packageName, [...(missing.get(item.packageName) ?? []), item.importName])\n }\n\n // The array sits below the imports, so adding to it first leaves the import lines where they are.\n const call = `${importName}(${Object.keys(options).length ? printValue(options, quote) : ''})`\n const next =\n array?.type === nodeTypes.arrayExpression\n ? appendItem(source, array, call)\n : appendItem(source, config, `parsers: [${[...defaults.map((parser) => `${parser.importName}()`), call].join(', ')}]`)\n\n return {\n source: [...missing].reduceRight(\n (current, [moduleSpecifier, importNames]) => addImport({ source: current, parsed, importNames, moduleSpecifier, quote }),\n next,\n ),\n }\n}\n\n/** One item per line, so a call can be commented out alone. Skipped when comments sit between items. */\nfunction splitPlugins(source: string, config: ObjectExpression): string | undefined {\n const array = getValue(config, 'plugins')\n if (array?.type !== nodeTypes.arrayExpression) return undefined\n\n const items = array.elements.flatMap((element) => (element ? [element] : []))\n const { start, end } = array\n const gaps = [source.slice(start + 1, items[0]?.start ?? end - 1), ...items.map((item, index) => source.slice(item.end, items[index + 1]?.start ?? end - 1))]\n if (!items.length || gaps.some((gap) => !/^[\\s,]*$/.test(gap))) return undefined\n\n const lineStart = source.lastIndexOf('\\n', start - 1) + 1\n const indent = source.slice(lineStart).match(/^[ \\t]*/)?.[0] ?? ''\n const lines = items.map((item) => `${indent} ${source.slice(item.start, item.end)},`)\n\n return replaceText(source, start, end, `[\\n${lines.join('\\n')}\\n${indent}]`)\n}\n\nfunction disablePlugin(source: string, program: Program, config: ObjectExpression, plugin: string): EditResult {\n const call = findCalls(program, config).find((entry) => entry.packageName === plugin)?.call\n if (!call) return { reason: `${plugin} is not in the plugins array` }\n\n const start = getPosition(source, call.start)\n const end = getPosition(source, call.end)\n const lines = source.split('\\n')\n const from = start.line - 1\n const to = end.line - 1\n const firstLine = lines[from] ?? ''\n\n // Only safe when the call sits alone on its lines: anything else on its first line, or on its last\n // line besides a trailing comma, would be swallowed into the comment and corrupt the file.\n if (firstLine.slice(0, start.column).trim() || !/^,?\\s*$/.test((lines[to] ?? '').slice(end.column))) {\n return { reason: `${plugin} shares a line with other code, so it cannot be commented out safely` }\n }\n\n const indent = firstLine.match(/^\\s*/)?.[0] ?? ''\n const commented = lines.slice(from, to + 1).map((line) => (line.trim() ? `${indent}// ${line.slice(indent.length)}` : `${indent}//`))\n lines.splice(from, commented.length, `${indent}// kubb:disabled ${plugin} ${commented.length}`, ...commented)\n\n return { source: lines.join('\\n') }\n}\n\n/** Disables the plugin, first putting a one-line `plugins: [a(), b()]` (what `add-plugin` writes) on separate lines. */\nfunction disablePluginInConfig({\n source,\n parsed,\n config,\n edit,\n}: {\n source: string\n parsed: ParsedConfig\n config: ObjectExpression\n edit: DisablePluginEdit\n}): EditResult {\n const result = disablePlugin(source, parsed.program, config, edit.plugin)\n if (!('reason' in result) || !result.reason.includes('shares a line')) return result\n\n const split = splitPlugins(source, config)\n if (split === undefined) return result\n\n const reparsed = findConfigs(split)\n const reparsedConfig = 'reason' in reparsed ? undefined : findConfigEntry(reparsed.configs, edit.config)\n if ('reason' in reparsed || !reparsedConfig) return result\n\n return disablePlugin(split, reparsed.program, reparsedConfig, edit.plugin)\n}\n\nfunction enablePlugin(source: string, comments: Array<Comment>, config: ObjectExpression, plugin: string): EditResult {\n const block = findDisabled(source, comments, config).find((entry) => entry.packageName === plugin)\n if (!block) return { reason: `${plugin} is not disabled` }\n\n const lines = source.split('\\n')\n lines.splice(block.line - 1, block.end - block.line + 1, ...block.code)\n return { source: lines.join('\\n') }\n}\n\n// Removing extensions\n\n/** Drops the import statements of `packageName` once nothing else in the file uses their names. */\nfunction removeUnusedImports(source: string, packageName: string): string {\n const parsed = parseSource(source)\n if ('reason' in parsed) return source\n\n // From the last statement up, so the offsets of the earlier ones stay valid.\n return parsed.program.body.reduceRight((current, statement) => {\n const bindings =\n statement.type === nodeTypes.importDeclaration\n ? importBindings(statement)\n : statement.type === nodeTypes.variableDeclaration\n ? requireBindings(statement)\n : []\n if (!bindings.length || bindings.some(([, { from }]) => from !== packageName)) return current\n\n const rest = replaceText(current, statement.start, statement.end)\n if (bindings.some(([local]) => new RegExp(`(?<![\\\\w$])${local.replaceAll('$', '\\\\$')}(?![\\\\w$])`).test(rest))) return current\n\n const lineStart = current.lastIndexOf('\\n', statement.start - 1) + 1\n const lineEnd = current.indexOf('\\n', statement.end)\n const after = lineEnd === -1 ? current.length : lineEnd + 1\n // At the top of the file, the blank line after the import goes too, so the file does not start with one.\n return replaceText(current, lineStart, lineStart === 0 && current[after] === '\\n' ? after + 1 : after)\n }, source)\n}\n\n/**\n * Removes every call of a plugin or parser package, and the block `disable-plugin` commented out,\n * then its unused imports. Removing what the config does not hold is a no-op. Refuses to empty\n * `parsers`, since a config with no parser cannot print files.\n */\nfunction removeExtension(source: string, edit: RemoveExtensionEdit): EditResult {\n const kind = edit.kind ?? extensionKinds.plugin\n let current = source\n\n // One call at a time, re-parsing in between, since each removal moves the ones after it.\n for (;;) {\n const parsed = findConfigs(current)\n if ('reason' in parsed) return parsed\n const config = findConfigEntry(parsed.configs, edit.config)\n if (!config) return { reason: `no config entry found for ${JSON.stringify(edit.config)}` }\n\n const array = getValue(config, `${kind}s`)\n const calls = findCalls(parsed.program, config, kind).filter((entry) => entry.packageName === edit.plugin)\n const block = findDisabled(current, parsed.comments, config).find((entry) => entry.packageName === edit.plugin)\n\n if (calls[0] && array?.type === nodeTypes.arrayExpression) {\n const elements = array.elements.filter((element) => element !== null)\n if (kind === extensionKinds.parser && elements.length === calls.length) return { reason: `${edit.plugin} is the last parser in the parsers array` }\n current = removeItem(current, array, elements.indexOf(calls[0].call))\n continue\n }\n if (block && kind === extensionKinds.plugin) {\n const lines = current.split('\\n')\n lines.splice(block.line - 1, block.end - block.line + 1)\n current = lines.join('\\n')\n continue\n }\n return { source: current === source ? source : removeUnusedImports(current, edit.plugin) }\n }\n}\n\n// Applying edits\n\n/** Every edit re-parses the file, since the previous one rewrote it. */\nfunction applyEdit({ source, edit, extensions }: { source: string; edit: ConfigEdit; extensions: InstalledExtensions }): EditResult {\n const parsed = findConfigs(source)\n if ('reason' in parsed) return parsed\n\n const config = findConfigEntry(parsed.configs, edit.config)\n if (!config) return { reason: `no config entry found for ${JSON.stringify(edit.config)}` }\n const quote = detectQuote(parsed.program) ?? quotes.single\n\n switch (edit.operation) {\n case ConfigEditOperation.SET_INPUT:\n return setInput(source, config, edit.input, quote)\n case ConfigEditOperation.SET_OUTPUT:\n case ConfigEditOperation.REMOVE_OUTPUT:\n return editOutput({ source, config, edit, quote })\n case ConfigEditOperation.DISABLE_PLUGIN:\n return disablePluginInConfig({ source, parsed, config, edit })\n case ConfigEditOperation.ENABLE_PLUGIN:\n return enablePlugin(source, parsed.comments, config, edit.plugin)\n case ConfigEditOperation.ADD_PLUGIN:\n return addPlugin({ source, parsed, config, edit, quote, extensions })\n case ConfigEditOperation.REMOVE_EXTENSION:\n return removeExtension(source, edit)\n case ConfigEditOperation.SET_OPTION:\n case ConfigEditOperation.REMOVE_OPTION:\n return editOption({ source, parsed, config, edit, quote, extensions })\n }\n}\n\n/** Applies edits in place, touching only the text each targets. A refused edit is reported and the rest still run. */\nexport function editConfig({ source, edits, extensions = new Map() }: { source: string; edits: Array<ConfigEdit>; extensions?: InstalledExtensions }): {\n source: string\n outcomes: Array<ConfigEditOutcome>\n changed: boolean\n} {\n let current = source\n\n const outcomes = edits.map((edit): ConfigEditOutcome => {\n const invalid = validateEdit(edit)\n if (invalid) return { edit, applied: false, reason: invalid }\n\n try {\n const result = applyEdit({ source: current, edit, extensions })\n if ('reason' in result) return { edit, applied: false, reason: result.reason }\n current = result.source\n return { edit, applied: true }\n } catch (error) {\n return { edit, applied: false, reason: getErrorMessage(error) }\n }\n })\n\n return { source: current, outcomes, changed: current !== source }\n}\n\n/** Applies `edits` to `filePath`, writing only when something changed. */\nexport async function editConfigFile({ filePath, edits, extensions }: { filePath: string; edits: Array<ConfigEdit>; extensions?: InstalledExtensions }) {\n const current = await read(filePath)\n const result = editConfig({ source: current, edits, extensions })\n if (result.changed) await writeRaw(filePath, result.source)\n return result\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAS,QAAQ,MAAc,QAAyB;CACtD,OAAO,KACJ,KAAK,CAAC,CACN,QAAQ,qBAAqB,OAAO,CAAC,CACrC,QAAQ,yBAAyB,OAAO,CAAC,CACzC,QAAQ,gBAAgB,OAAO,CAAC,CAChC,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO,CAAC,CACf,KAAK,MAAM,MAAM;EAChB,IAAI,KAAK,SAAS,KAAK,SAAS,KAAK,YAAY,GAAG,OAAO;EAE3D,QADa,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,KAC9E,KAAK,MAAM,CAAC;CAC5B,CAAC,CAAC,CACD,KAAK,EAAE,CAAC,CACR,QAAQ,iBAAiB,EAAE;AAChC;AAGA,MAAM,wBAAQ,IAAI,IAAoB;AACtC,MAAM,aAAa;AAEnB,SAAS,gBAAgB,MAAc,QAAyB;CAC9D,MAAM,MAAM,GAAG,SAAS,MAAM,MAAM;CACpC,MAAM,SAAS,MAAM,IAAI,GAAG;CAC5B,IAAI,WAAW,KAAA,GAAW,OAAO;CAEjC,MAAM,SAAS,QAAQ,MAAM,MAAM;CACnC,IAAI,MAAM,QAAQ,YAAY,MAAM,MAAM;CAC1C,MAAM,IAAI,KAAK,MAAM;CACrB,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,UAAU,MAAc,EAAE,SAAS,IAAI,SAAS,OAAgB,CAAC,GAAW;CAC1F,OAAO,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAA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