@venizia/dev-configs 0.5.0-10 → 0.5.0-12

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 (79) hide show
  1. package/README.md +3 -3
  2. package/dist/cli/codemod/async-context.d.ts +22 -0
  3. package/dist/cli/codemod/async-context.js +146 -0
  4. package/dist/cli/codemod/async-context.js.map +1 -0
  5. package/dist/cli/codemod/class-renames.d.ts +63 -0
  6. package/dist/cli/codemod/class-renames.js +208 -17
  7. package/dist/cli/codemod/class-renames.js.map +1 -1
  8. package/dist/cli/codemod/execution-class.d.ts +14 -0
  9. package/dist/cli/codemod/execution-class.js +46 -0
  10. package/dist/cli/codemod/execution-class.js.map +1 -0
  11. package/dist/cli/codemod/execution-scope.d.ts +68 -0
  12. package/dist/cli/codemod/execution-scope.js +727 -0
  13. package/dist/cli/codemod/execution-scope.js.map +1 -0
  14. package/dist/cli/codemod/index.js +25 -0
  15. package/dist/cli/codemod/index.js.map +1 -1
  16. package/dist/cli/codemod/namespace-functions/mapping.d.ts +6 -0
  17. package/dist/cli/codemod/namespace-functions/mapping.js.map +1 -1
  18. package/dist/cli/codemod/namespace-functions/mappings/connectors.d.ts +2 -0
  19. package/dist/cli/codemod/namespace-functions/mappings/connectors.js +19 -1
  20. package/dist/cli/codemod/namespace-functions/mappings/connectors.js.map +1 -1
  21. package/dist/cli/codemod/namespace-functions/mappings/guards.d.ts +4 -0
  22. package/dist/cli/codemod/namespace-functions/mappings/guards.js +15 -0
  23. package/dist/cli/codemod/namespace-functions/mappings/guards.js.map +1 -0
  24. package/dist/cli/codemod/namespace-functions/mappings/helpers.d.ts +3 -2
  25. package/dist/cli/codemod/namespace-functions/mappings/helpers.js +30 -9
  26. package/dist/cli/codemod/namespace-functions/mappings/helpers.js.map +1 -1
  27. package/dist/cli/codemod/namespace-functions/mappings/inversion.d.ts +6 -2
  28. package/dist/cli/codemod/namespace-functions/mappings/inversion.js +42 -3
  29. package/dist/cli/codemod/namespace-functions/mappings/inversion.js.map +1 -1
  30. package/dist/cli/codemod/namespace-functions/mappings/kernel.d.ts +4 -2
  31. package/dist/cli/codemod/namespace-functions/mappings/kernel.js +16 -3
  32. package/dist/cli/codemod/namespace-functions/mappings/kernel.js.map +1 -1
  33. package/dist/cli/codemod/namespace-functions/rewriter.d.ts +7 -0
  34. package/dist/cli/codemod/namespace-functions/rewriter.js +75 -8
  35. package/dist/cli/codemod/namespace-functions/rewriter.js.map +1 -1
  36. package/dist/cli/codemod/public-names.d.ts +25 -0
  37. package/dist/cli/codemod/public-names.js +134 -0
  38. package/dist/cli/codemod/public-names.js.map +1 -0
  39. package/dist/cli/index.js +1 -0
  40. package/dist/cli/index.js.map +1 -1
  41. package/dist/compilers/bun.js +8 -1
  42. package/dist/compilers/bun.js.map +1 -1
  43. package/dist/linters/eslint.js.map +1 -1
  44. package/dist/linters/house/configs.js +8 -4
  45. package/dist/linters/house/configs.js.map +1 -1
  46. package/dist/linters/house/execution-support.d.ts +66 -0
  47. package/dist/linters/house/execution-support.js +161 -0
  48. package/dist/linters/house/execution-support.js.map +1 -0
  49. package/dist/linters/house/framework-api-patterns.js +1 -1
  50. package/dist/linters/house/framework-api-patterns.js.map +1 -1
  51. package/dist/linters/house/index.d.ts +3 -1
  52. package/dist/linters/house/index.js +3 -1
  53. package/dist/linters/house/index.js.map +1 -1
  54. package/dist/linters/house/no-shadow-framework-type.rule.d.ts +1 -1
  55. package/dist/linters/house/no-shadow-framework-type.rule.js +1 -1
  56. package/dist/linters/house/no-shadow-framework-type.rule.js.map +1 -1
  57. package/dist/linters/house/plugin.js +6 -2
  58. package/dist/linters/house/plugin.js.map +1 -1
  59. package/dist/linters/house/prefer-execution-sleep.rule.d.ts +31 -0
  60. package/dist/linters/house/{prefer-promise-sleep.rule.js → prefer-execution-sleep.rule.js} +57 -20
  61. package/dist/linters/house/prefer-execution-sleep.rule.js.map +1 -0
  62. package/dist/linters/house/prefer-http-method.rule.d.ts +6 -3
  63. package/dist/linters/house/prefer-http-method.rule.js +116 -9
  64. package/dist/linters/house/prefer-http-method.rule.js.map +1 -1
  65. package/dist/linters/house/restrict-execution-call-sites.rule.d.ts +30 -0
  66. package/dist/linters/house/restrict-execution-call-sites.rule.js +142 -0
  67. package/dist/linters/house/restrict-execution-call-sites.rule.js.map +1 -0
  68. package/dist/linters/house/static-execution-reason.rule.d.ts +27 -0
  69. package/dist/linters/house/static-execution-reason.rule.js +152 -0
  70. package/dist/linters/house/static-execution-reason.rule.js.map +1 -0
  71. package/dist/linters/rules/naming-convention.rule.js +1 -1
  72. package/dist/linters/rules/naming-convention.rule.js.map +1 -1
  73. package/dist/linters/rules/no-restricted-imports.rule.d.ts +4 -2
  74. package/dist/linters/rules/no-restricted-imports.rule.js.map +1 -1
  75. package/dist/linters/rules/no-unused-vars.rule.d.ts +13 -2
  76. package/dist/linters/rules/no-unused-vars.rule.js.map +1 -1
  77. package/package.json +2 -2
  78. package/dist/linters/house/prefer-promise-sleep.rule.d.ts +0 -26
  79. package/dist/linters/house/prefer-promise-sleep.rule.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-scope.js","sourceRoot":"","sources":["../../../src/cli/codemod/execution-scope.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,yCAA8C;AAC9C,mDAA4E;AAC5E,wDAAoD;AAEpD,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAqCkD,CAAC;AAEjE,kDAAkD;AAClD,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AACrC,MAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;AAChE,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM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AAE,EAAE,CACjB,qBAAqB,CAAC,OAAO,CAAC;oBAC5B,GAAG,KAAK;oBACR,SAAS,EAAE,IAAA,oBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;oBAC/D,GAAG;oBACH,iBAAiB;iBAClB,CAAC;aACL;SACF,CAAC,CAAC;IACL,CAAC;;AAjEH,sDAkEC","sourcesContent":["import { readFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport { ClassRenamesCommand, type ICodemodRewrite } from './class-renames';\nimport { CliOutput } from '../../common/cli-output';\n\nconst USAGE = `Usage: devz codemod execution-scope --map <file.json> [paths...] [--write [--all] | --check] [--rewrite-nested]\n\nAn application's own scope helpers become Execution.run (@venizia/ignis). The map names them:\n\n {\n \"runElevated\": { \"mode\": \"system\" },\n \"runPinned\": { \"mode\": \"scoped\", \"values\": { \"tenantIds\": \"tenantIds\" } }\n }\n\nA key is the exported name of a helper, or \"Class.method\". \"values\" names the value of the frame (left) and the\noption of the helper that holds it (right). A helper is read when it is imported from a module of the application\n(a path starting \".\", \"@/\", \"~/\" or \"#\"); for one that comes from a package, name the package with \"from\":\n\n { \"runElevated\": { \"mode\": \"system\", \"from\": \"@acme/core\" } }\n\nWith \"from\", only that module is read. The same name imported from anywhere else is listed. It reads a call of an imported helper, an aliased import included, in\none of these shapes, where the task is an arrow or a function with no parameter, written in the call:\n\n helper(task) a helper with no \"values\"\n helper({ tenantIds, task }) the options of \"values\" and one other property, the task\n helper({ tenantIds }, task) the options of \"values\", then the task\n\nA system call gets the reason \"TODO: reason (<file>:<method>)\" for you to write. It lists by file and line what it\nleaves for you: those reasons, every call it cannot read (a helper passed as a value, a spread argument, a task by\nreference), and every system call lexically inside a scoped one, which would see more under \"the innermost frame\nwins\". It does not follow calls across functions. A file that defines a mapped helper is not touched. Event\nhandlers and queue consumers are listed as \"review\": they no longer inherit system rights.\n\nExecution.run always returns a promise: where a helper was synchronous, your typecheck and tests must confirm the call.\n\n --map the JSON file of your helpers (required), relative to the working directory\n --write write the changed files (without it, nothing is written); it needs a path, or --all\n --all with --write and no path: rewrite every source file under the working directory\n --check dry run that exits 1 while a file would change or a line is left for you (for CI)\n --rewrite-nested rewrite the system calls inside scoped ones too, after you reviewed them\n --help print this text and exit\n\nThere is no --reverse: a downgrade restores the files from git.`;\n\n/** A usage error: nothing was read or written. */\nconst USAGE_ERROR_CODE = 2;\n\nconst MAP_FLAG = '--map';\nconst NESTED_FLAG = '--rewrite-nested';\nconst TODO_PREFIX = 'TODO: reason (';\nconst IGNIS_MODULE = '@venizia/ignis';\nconst IGNIS_PACKAGES = [IGNIS_MODULE, '@venizia/ignis-helpers'];\nconst EXECUTION = 'Execution';\nconst EXECUTION_MODES = 'ExecutionModes';\nconst IDENTIFIER_PATTERN = /^[A-Za-z_$][\\w$]*$/;\nconst KEY_PATTERN = /^[A-Za-z_$][\\w$]*(\\.[A-Za-z_$][\\w$]*)?$/;\n\n/** The callbacks of a queue consumer: BullMQ, Kafka, MQTT and the in-memory queue. */\nconst CONSUMER_CALLBACKS: ReadonlySet<string> = new Set([\n 'onWorkerData',\n 'onWorkerDataCompleted',\n 'onWorkerDataFail',\n 'onMessage',\n 'onMessageDone',\n 'onMessageError',\n]);\n\n/** What a helper of the map is. */\nexport type TExecutionScopeEntry = (\n | { mode: 'system' }\n | { mode: 'scoped'; values?: Readonly<Record<string, string>> }\n) & {\n /** The module the helper is imported from. Without it, only a module of the application is read. */\n from?: string;\n};\n\n/** The helpers of an application, by exported name or \"Class.method\". */\nexport type TExecutionScopeMap = Readonly<Record<string, TExecutionScopeEntry>>;\n\n/** What `ExecutionScopeRewrite.rewrite` did to one file; `info` is always there. */\nexport interface IExecutionScopeRewrite extends ICodemodRewrite {\n info: NonNullable<ICodemodRewrite['info']>;\n}\n\ninterface ISpan {\n start: number;\n end: number;\n}\n\ninterface ITextEdit extends ISpan {\n text: string;\n}\n\n/** Reads and checks the JSON of `--map`. */\nexport class ExecutionScopeMapReader {\n private static isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n }\n\n /** The values of a scoped entry, or `undefined` when one is not an option name. */\n private static readValues(value: unknown): Record<string, string> | undefined {\n if (!ExecutionScopeMapReader.isRecord(value)) {\n return undefined;\n }\n\n const values: Record<string, string> = {};\n\n for (const [key, option] of Object.entries(value)) {\n if (typeof option !== 'string' || option === '') {\n return undefined;\n }\n\n values[key] = option;\n }\n\n return values;\n }\n\n private static readEntry(value: unknown): TExecutionScopeEntry | undefined {\n if (!ExecutionScopeMapReader.isRecord(value)) {\n return undefined;\n }\n\n const { mode, values, from, ...rest } = value;\n const isModule = from === undefined || (typeof from === 'string' && from !== '');\n\n if (Object.keys(rest).length > 0 || !isModule) {\n return undefined;\n }\n\n const origin = typeof from === 'string' ? { from } : {};\n\n if (mode === 'system') {\n return values === undefined ? { mode, ...origin } : undefined;\n }\n\n if (mode !== 'scoped') {\n return undefined;\n }\n\n if (values === undefined) {\n return { mode, ...origin };\n }\n\n const read = ExecutionScopeMapReader.readValues(values);\n\n return read ? { mode, values: read, ...origin } : undefined;\n }\n\n /** The map in `text`, or why it is not one. */\n static parse(opts: { text: string }): { map: TExecutionScopeMap } | { error: string } {\n let data: unknown;\n\n try {\n data = JSON.parse(opts.text);\n } catch (error) {\n return { error: `not JSON: ${String(error)}` };\n }\n\n if (!ExecutionScopeMapReader.isRecord(data) || Object.keys(data).length === 0) {\n return { error: 'an object with one entry per helper is expected' };\n }\n\n const map: Record<string, TExecutionScopeEntry> = {};\n\n for (const [name, value] of Object.entries(data)) {\n const entry = ExecutionScopeMapReader.readEntry(value);\n\n if (!KEY_PATTERN.test(name) || !entry) {\n return {\n error: `\"${name}\": the key is a name or \"Class.method\", the value { \"mode\": \"system\" } or { \"mode\": \"scoped\", \"values\"?: { \"<value>\": \"<option>\" } }, either with an optional \"from\"`,\n };\n }\n\n map[name] = entry;\n }\n\n return { map };\n }\n}\n\n/** Rewrites the calls of one file. */\nexport class ExecutionScopeRewrite {\n /** Whether a helper imported from `module` is the one the entry means: another package may use the same name. */\n private static isHelperModule(opts: { entry: TExecutionScopeEntry; module: string }): boolean {\n const { entry, module } = opts;\n\n return entry.from === undefined ? /^(\\.|@\\/|~\\/|#)/.test(module) : module === entry.from;\n }\n\n /** Whether `node` names a member or a property, and is no use of a binding. */\n private static isMemberName(opts: {\n typescript: typeof import('typescript');\n node: import('typescript').Identifier;\n }): boolean {\n const { typescript: ts, node } = opts;\n const parent = node.parent;\n\n if (ts.isQualifiedName(parent)) {\n return parent.right === node;\n }\n\n if (ts.isBindingElement(parent)) {\n return parent.propertyName === node;\n }\n\n return (\n (ts.isPropertyAccessExpression(parent) ||\n ts.isPropertyAssignment(parent) ||\n ts.isPropertyDeclaration(parent) ||\n ts.isPropertySignature(parent) ||\n ts.isMethodDeclaration(parent) ||\n ts.isMethodSignature(parent) ||\n ts.isGetAccessorDeclaration(parent) ||\n ts.isSetAccessorDeclaration(parent) ||\n ts.isEnumMember(parent) ||\n ts.isJsxAttribute(parent)) &&\n parent.name === node\n );\n }\n\n /** The mapped helpers this file defines itself: its calls are the helper's own, and stay. */\n private static definitions(opts: {\n typescript: typeof import('typescript');\n file: import('typescript').SourceFile;\n map: TExecutionScopeMap;\n }): Array<{ node: import('typescript').Node; name: string }> {\n const { typescript: ts, file, map } = opts;\n const found: Array<{ node: import('typescript').Node; name: string }> = [];\n\n const check = (node: import('typescript').Node, name: string) => {\n if (Object.hasOwn(map, name)) {\n found.push({ node, name });\n }\n };\n\n for (const statement of file.statements) {\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n check(statement, statement.name.text);\n }\n\n if (ts.isClassDeclaration(statement) && statement.name) {\n for (const member of statement.members) {\n check(member, `${statement.name.text}.${member.name?.getText(file)}`);\n }\n }\n\n if (!ts.isVariableStatement(statement)) {\n continue;\n }\n\n for (const { name, initializer } of statement.declarationList.declarations) {\n if (!ts.isIdentifier(name)) {\n continue;\n }\n\n check(statement, name.text);\n\n if (initializer && ts.isObjectLiteralExpression(initializer)) {\n for (const property of initializer.properties) {\n check(property, `${name.text}.${property.name?.getText(file)}`);\n }\n }\n }\n }\n\n return found;\n }\n\n /** The event handlers and queue consumers of the file: they ran with their starter's rights, and no longer do. */\n private static listeners(opts: {\n typescript: typeof import('typescript');\n file: import('typescript').SourceFile;\n }): Array<{ node: import('typescript').Node; note: string }> {\n const { typescript: ts, file } = opts;\n const found: Array<{ node: import('typescript').Node; note: string }> = [];\n const lost = 'it no longer inherits system rights';\n\n const visit = (node: import('typescript').Node): void => {\n if (\n ts.isHeritageClause(node) &&\n node.types.some((type) => type.expression.getText(file) === 'IEventHandler')\n ) {\n found.push({ node, note: `event handler: ${lost}` });\n }\n\n if (\n ts.isCallExpression(node) &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'register'\n ) {\n const [options] = node.arguments;\n const names =\n options && ts.isObjectLiteralExpression(options)\n ? options.properties.map((property) => property.name?.getText(file))\n : [];\n\n if (names.includes('name') && names.includes('handler')) {\n found.push({ node, note: `event handler registration: ${lost}` });\n }\n }\n\n const isMember =\n ts.isPropertyAssignment(node) ||\n ts.isShorthandPropertyAssignment(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isPropertyDeclaration(node);\n\n if (isMember && CONSUMER_CALLBACKS.has(node.name.getText(file))) {\n found.push({ node, note: `queue consumer (${node.name.getText(file)}): ${lost}` });\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(file);\n\n return found;\n }\n\n /** The method or function a node stands in; without one, the variable or property it is written under. */\n private static methodOf(opts: {\n typescript: typeof import('typescript');\n node: import('typescript').Node;\n file: import('typescript').SourceFile;\n }): string {\n const { typescript: ts, node, file } = opts;\n let holder: string | undefined;\n\n for (let at = node.parent; !ts.isSourceFile(at); at = at.parent) {\n if (ts.isConstructorDeclaration(at)) {\n return 'constructor';\n }\n\n if (\n (ts.isMethodDeclaration(at) ||\n ts.isFunctionDeclaration(at) ||\n ts.isGetAccessorDeclaration(at) ||\n ts.isSetAccessorDeclaration(at)) &&\n at.name\n ) {\n return at.name.getText(file);\n }\n\n if (\n (ts.isVariableDeclaration(at) ||\n ts.isPropertyDeclaration(at) ||\n ts.isPropertyAssignment(at)) &&\n ts.isIdentifier(at.name)\n ) {\n holder ??= at.name.text;\n }\n }\n\n return holder ?? 'module';\n }\n\n /** Whether a comment stands in a part of the call that the rewrite replaces. */\n private static hasComment(opts: {\n typescript: typeof import('typescript');\n source: string;\n span: ISpan;\n kept: ReadonlyArray<ISpan>;\n }): boolean {\n const { typescript: ts, source, span, kept } = opts;\n let text = '';\n let at = span.start;\n\n for (const part of [...kept].sort((a, b) => a.start - b.start)) {\n text += `${source.slice(at, part.start)} 0 `;\n at = part.end;\n }\n\n text += source.slice(at, span.end);\n\n const scanner = ts.createScanner(\n ts.ScriptTarget.Latest,\n false,\n ts.LanguageVariant.Standard,\n text,\n );\n\n for (\n let token = scanner.scan();\n token !== ts.SyntaxKind.EndOfFileToken;\n token = scanner.scan()\n ) {\n if (\n token === ts.SyntaxKind.SingleLineCommentTrivia ||\n token === ts.SyntaxKind.MultiLineCommentTrivia\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n /** The task and the values of a call, or why the call cannot be read. */\n private static readCall(opts: {\n typescript: typeof import('typescript');\n file: import('typescript').SourceFile;\n call: import('typescript').CallExpression;\n entry: TExecutionScopeEntry;\n }):\n | {\n task: import('typescript').Expression;\n values: Array<{ key: string; node: import('typescript').Node }>;\n }\n | { reason: string } {\n const { typescript: ts, file, call, entry } = opts;\n const wanted = Object.entries(entry.mode === 'scoped' ? (entry.values ?? {}) : {});\n const args = [...call.arguments];\n\n if (args.some((argument) => ts.isSpreadElement(argument))) {\n return { reason: 'a spread argument' };\n }\n\n const [first, second] = args;\n\n if (!first || args.length > 2) {\n return { reason: `${args.length} arguments` };\n }\n\n const values: Array<{ key: string; node: import('typescript').Node }> = [];\n const others: import('typescript').ObjectLiteralElementLike[] = [];\n\n if (ts.isObjectLiteralExpression(first)) {\n const options = new Map<string, import('typescript').Node>();\n\n for (const property of first.properties) {\n if (ts.isShorthandPropertyAssignment(property) && !property.objectAssignmentInitializer) {\n options.set(property.name.text, property.name);\n } else if (ts.isPropertyAssignment(property) && ts.isIdentifier(property.name)) {\n options.set(property.name.text, property.initializer);\n } else {\n return { reason: 'an option that is not \"name\" or \"name: value\"' };\n }\n\n if (!wanted.some(([, option]) => option === property.name?.getText(file))) {\n others.push(property);\n }\n }\n\n for (const [key, option] of wanted) {\n const node = options.get(option);\n\n if (!node) {\n return { reason: `no \"${option}\" option` };\n }\n\n values.push({ key, node });\n }\n } else if (second || wanted.length > 0) {\n return { reason: 'its options are not an object written in the call' };\n }\n\n let task: import('typescript').Expression | undefined = second;\n\n if (second && others.length > 0) {\n return { reason: 'an option the map does not name' };\n }\n\n if (!second && ts.isObjectLiteralExpression(first)) {\n const [property] = others;\n task =\n others.length === 1 && property && ts.isPropertyAssignment(property)\n ? property.initializer\n : undefined;\n } else if (!second) {\n task = first;\n }\n\n const isInline =\n task &&\n (ts.isArrowFunction(task) || (ts.isFunctionExpression(task) && !task.asteriskToken)) &&\n task.parameters.length === 0;\n\n if (!task || !isInline) {\n return { reason: 'the task is not one function with no parameter, written in the call' };\n }\n\n return { task, values };\n }\n\n static rewrite(opts: {\n typescript: typeof import('typescript');\n fileName: string;\n /** The file as the reason of a system call names it. */\n shownName: string;\n source: string;\n map: TExecutionScopeMap;\n isNestedRewritten: boolean;\n }): IExecutionScopeRewrite {\n const { typescript: ts, fileName, shownName, source, map, isNestedRewritten } = opts;\n const scriptKind = fileName.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS;\n const file = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, scriptKind);\n const manual: ICodemodRewrite['manual'] = [];\n const lineOf = (node: import('typescript').Node) =>\n file.getLineAndCharacterOfPosition(node.getStart(file)).line + 1;\n const info = ExecutionScopeRewrite.listeners({ typescript: ts, file }).map(\n ({ node, note }) => ({ line: lineOf(node), note }),\n );\n const definitions = ExecutionScopeRewrite.definitions({ typescript: ts, file, map });\n\n if (definitions.length > 0) {\n for (const { node, name } of definitions) {\n info.push({\n line: lineOf(node),\n note: `defines the mapped helper \"${name}\": the file is left as written`,\n });\n }\n\n return { output: source, changed: false, rewritten: 0, manual, info };\n }\n\n const imports = file.statements.filter((statement) => ts.isImportDeclaration(statement));\n const moduleOf = (node: import('typescript').ImportDeclaration) =>\n ts.isStringLiteralLike(node.moduleSpecifier) ? node.moduleSpecifier.text : '';\n const isIgnis = (node: import('typescript').ImportDeclaration) =>\n IGNIS_PACKAGES.some(\n (name) => moduleOf(node) === name || moduleOf(node).startsWith(`${name}/`),\n );\n\n /** Local name of an import to the name it was exported as, and the module. */\n const bindings = new Map<string, { imported: string; module: string }>();\n\n const bind = (binding: {\n node: import('typescript').ImportDeclaration;\n local: string;\n imported: string;\n }) => {\n const { node, local, imported } = binding;\n const module = moduleOf(node);\n bindings.set(local, { imported, module });\n const isForeign = Object.entries(map).some(\n ([key, entry]) =>\n key.split('.')[0] === imported &&\n !ExecutionScopeRewrite.isHelperModule({ entry, module }),\n );\n\n if (isForeign) {\n manual.push({\n line: lineOf(node),\n note: `\"${imported}\" is imported from \"${module}\": to rewrite its calls, name that module with \"from\" in the map`,\n });\n }\n };\n\n /** The local names `Execution` and `ExecutionModes` already have as values from the framework. */\n const framework = new Map<string, string>();\n\n for (const statement of imports) {\n const clause = statement.importClause;\n\n if (clause?.name) {\n bind({ node: statement, local: clause.name.text, imported: clause.name.text });\n }\n\n if (!clause?.namedBindings || !ts.isNamedImports(clause.namedBindings)) {\n continue;\n }\n\n for (const element of clause.namedBindings.elements) {\n const imported = (element.propertyName ?? element.name).text;\n\n if (!isIgnis(statement)) {\n bind({ node: statement, local: element.name.text, imported });\n } else if (!clause.isTypeOnly && !element.isTypeOnly) {\n framework.set(imported, element.name.text);\n }\n }\n }\n\n /** Every use of a name outside the imports, and every name the file declares. */\n const uses = new Map<string, import('typescript').Identifier[]>();\n const declared = new Set<string>();\n\n const collect = (node: import('typescript').Node): void => {\n if (ts.isImportDeclaration(node)) {\n return;\n }\n\n const isDeclaration =\n ts.isVariableDeclaration(node) ||\n ts.isBindingElement(node) ||\n ts.isParameter(node) ||\n ts.isFunctionDeclaration(node) ||\n ts.isClassDeclaration(node) ||\n ts.isInterfaceDeclaration(node) ||\n ts.isTypeAliasDeclaration(node) ||\n ts.isEnumDeclaration(node);\n\n if (isDeclaration && node.name && ts.isIdentifier(node.name)) {\n declared.add(node.name.text);\n }\n\n if (ts.isIdentifier(node) && !ExecutionScopeRewrite.isMemberName({ typescript: ts, node })) {\n const found = uses.get(node.text) ?? [];\n found.push(node);\n uses.set(node.text, found);\n }\n\n ts.forEachChild(node, collect);\n };\n\n collect(file);\n\n /** The mapped helper an expression names: `helper`, or `Class.method`. */\n const helperOf = (node: import('typescript').Node) => {\n let local: import('typescript').Identifier;\n let member = '';\n\n if (ts.isIdentifier(node)) {\n local = node;\n } else if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.expression)) {\n local = node.expression;\n member = `.${node.name.text}`;\n } else {\n return undefined;\n }\n\n const binding = bindings.get(local.text);\n\n if (!binding) {\n return undefined;\n }\n\n const { imported, module } = binding;\n const key = `${imported}${member}`;\n\n return Object.hasOwn(map, key) &&\n ExecutionScopeRewrite.isHelperModule({ entry: map[key], module })\n ? { key, local, entry: map[key] }\n : undefined;\n };\n\n /** Whether `call` opens a scoped frame: a mapped scoped helper, or `Execution.run` in scoped mode. */\n const isScopedCall = (call: import('typescript').CallExpression) => {\n if (helperOf(call.expression)?.entry.mode === 'scoped') {\n return true;\n }\n\n const [options] = call.arguments;\n const execution = framework.get(EXECUTION);\n\n if (\n !execution ||\n call.expression.getText(file) !== `${execution}.run` ||\n !options ||\n !ts.isObjectLiteralExpression(options)\n ) {\n return false;\n }\n\n return options.properties.some(\n (property) =>\n ts.isPropertyAssignment(property) &&\n property.name.getText(file) === 'mode' &&\n /(\\.SCOPED|^['\"]scoped['\"])$/.test(property.initializer.getText(file)),\n );\n };\n\n const isInsideScoped = (node: import('typescript').Node) => {\n for (let at = node; !ts.isSourceFile(at); at = at.parent) {\n const parent = at.parent;\n\n if (ts.isCallExpression(parent) && parent.expression !== at && isScopedCall(parent)) {\n return true;\n }\n }\n\n return false;\n };\n\n const mentionsHelper = (node: import('typescript').Node): boolean =>\n helperOf(node) !== undefined || (ts.forEachChild(node, mentionsHelper) ?? false);\n\n /** The local name for an export of the framework, and the import specifier to add when it has none. */\n const localOf = (name: string) => {\n const existing = framework.get(name);\n\n if (existing) {\n return { local: existing, specifier: undefined };\n }\n\n const isTaken = (candidate: string) => declared.has(candidate) || bindings.has(candidate);\n const local = isTaken(name) ? `Ignis${name}` : name;\n\n return { local, specifier: local === name ? name : `${name} as ${local}` };\n };\n\n const execution = localOf(EXECUTION);\n const modes = localOf(EXECUTION_MODES);\n const edits: ITextEdit[] = [];\n const consumed = new Map<string, number>();\n let rewritten = 0;\n\n /** Rewrites one call, or lists why it is left. */\n const handle = (\n call: import('typescript').CallExpression,\n helper: NonNullable<ReturnType<typeof helperOf>>,\n ) => {\n const { key, local, entry } = helper;\n const leave = (note: string) => manual.push({ line: lineOf(call), note });\n\n if (declared.has(local.text)) {\n leave(`${key} is left: the file declares \"${local.text}\" too`);\n\n return;\n }\n\n if (entry.mode === 'system' && !isNestedRewritten && isInsideScoped(call)) {\n leave(\n `${key} is a system call inside a scoped one, so it would see more: review it, then run with ${NESTED_FLAG}`,\n );\n\n return;\n }\n\n if (call.questionDotToken || (call.typeArguments?.length ?? 0) > 1) {\n leave(`cannot read this call of ${key}: an optional call or several type arguments`);\n\n return;\n }\n\n const read = ExecutionScopeRewrite.readCall({ typescript: ts, file, call, entry });\n\n if ('reason' in read) {\n leave(`cannot read this call of ${key}: ${read.reason}`);\n\n return;\n }\n\n const { task, values } = read;\n const spanOf = (node: import('typescript').Node) => ({\n start: node.getStart(file),\n end: node.getEnd(),\n });\n const taskSpan = spanOf(task);\n const kept = [...values.map(({ node }) => spanOf(node)), taskSpan];\n const typeArguments = call.typeArguments?.map(spanOf) ?? [];\n const span = { start: call.expression.getEnd(), end: call.getEnd() };\n\n if (\n ExecutionScopeRewrite.hasComment({\n typescript: ts,\n source,\n span,\n kept: [...kept, ...typeArguments],\n })\n ) {\n leave(`cannot read this call of ${key}: a comment between its arguments would be lost`);\n\n return;\n }\n\n if (values.some(({ node }) => mentionsHelper(node))) {\n leave(`cannot read this call of ${key}: a value uses a mapped helper`);\n\n return;\n }\n\n const parts = [`mode: ${modes.local}.${entry.mode.toUpperCase()}`];\n\n if (entry.mode === 'system') {\n const method = ExecutionScopeRewrite.methodOf({ typescript: ts, node: call, file });\n const reason = `${TODO_PREFIX}${shownName}:${method})`;\n parts.push(`reason: '${reason.replace(/[\\\\']/g, '\\\\$&')}'`);\n leave(`write the reason: '${reason}'`);\n }\n\n if (values.length > 0) {\n const written = values.map(({ key: name, node }) => {\n const value = node.getText(file);\n const property = IDENTIFIER_PATTERN.test(name) ? name : JSON.stringify(name);\n\n return property === value ? value : `${property}: ${value}`;\n });\n parts.push(`values: { ${written.join(', ')} }`);\n }\n\n edits.push(\n { ...spanOf(call.expression), text: `${execution.local}.run` },\n {\n start: call.arguments.pos,\n end: taskSpan.start,\n text: `{ ${parts.join(', ')}, task: `,\n },\n { start: taskSpan.end, end: call.getEnd() - 1, text: ' }' },\n );\n consumed.set(local.text, (consumed.get(local.text) ?? 0) + 1);\n rewritten += 1;\n };\n\n const visit = (node: import('typescript').Node): void => {\n if (ts.isImportDeclaration(node)) {\n return;\n }\n\n if (ts.isStringLiteralLike(node) && node.text.startsWith(TODO_PREFIX)) {\n manual.push({ line: lineOf(node), note: `write the reason: '${node.text}'` });\n }\n\n if (ts.isCallExpression(node)) {\n const callee = node.expression;\n const helper = helperOf(callee);\n\n if (helper) {\n handle(node, helper);\n // The callee is read: only the arguments may hold more.\n node.arguments.forEach(visit);\n\n return;\n }\n\n if (ts.isPropertyAccessExpression(callee) && Object.hasOwn(map, callee.name.text)) {\n manual.push({\n line: lineOf(node),\n note: `cannot read this call of ${callee.name.text}: it is called as a member`,\n });\n }\n }\n\n const isUse =\n (ts.isIdentifier(node) &&\n !ExecutionScopeRewrite.isMemberName({ typescript: ts, node }) &&\n !declared.has(node.text) &&\n !ts.isTypeQueryNode(node.parent)) ||\n ts.isPropertyAccessExpression(node);\n const passed = isUse ? helperOf(node) : undefined;\n\n if (passed) {\n manual.push({\n line: lineOf(node),\n note: `cannot read this use of ${passed.key}: it is passed as a value`,\n });\n\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(file);\n\n if (rewritten === 0) {\n return { output: source, changed: false, rewritten, manual, info };\n }\n\n /** The imports of the helpers nothing uses any more. */\n const isDone = (name: import('typescript').Identifier) =>\n consumed.has(name.text) && consumed.get(name.text) === uses.get(name.text)?.length;\n const added = [execution.specifier, modes.specifier].filter((entry) => entry !== undefined);\n const target = imports.find((statement) => {\n const clause = statement.importClause;\n\n return (\n moduleOf(statement) === IGNIS_MODULE &&\n !clause?.isTypeOnly &&\n clause?.namedBindings &&\n ts.isNamedImports(clause.namedBindings)\n );\n });\n const addedImport =\n added.length > 0 && !target\n ? `import { ${added.join(', ')} } from '${IGNIS_MODULE}';`\n : undefined;\n let isImportPlaced = false;\n\n if (added.length > 0 && target?.importClause?.namedBindings) {\n const named = target.importClause.namedBindings;\n\n if (ts.isNamedImports(named)) {\n const last = named.elements.at(-1);\n const at = last ? last.getEnd() : named.getStart(file) + 1;\n const text = last ? `, ${added.join(', ')}` : ` ${added.join(', ')} `;\n edits.push({ start: at, end: at, text });\n }\n }\n\n for (const statement of imports) {\n const clause = statement.importClause;\n\n if (!clause || isIgnis(statement)) {\n continue;\n }\n\n const named =\n clause.namedBindings && ts.isNamedImports(clause.namedBindings)\n ? clause.namedBindings\n : undefined;\n const elements = [...(named?.elements ?? [])];\n const remaining = elements.filter((element) => !isDone(element.name));\n const isDefaultDone = clause.name !== undefined && isDone(clause.name);\n\n if (remaining.length === elements.length && !isDefaultDone) {\n continue;\n }\n\n const defaultName = isDefaultDone ? undefined : clause.name?.text;\n const namespace = clause.namedBindings && !named;\n\n if (!defaultName && !namespace && remaining.length === 0) {\n // The whole statement goes: the new import takes its place, or its line goes with it.\n const start = statement.getStart(file);\n const newline = /^[ \\t]*\\r?\\n/.exec(source.slice(statement.getEnd()));\n\n if (addedImport && !isImportPlaced) {\n edits.push({ start, end: statement.getEnd(), text: addedImport });\n isImportPlaced = true;\n } else {\n edits.push({ start, end: statement.getEnd() + (newline?.[0].length ?? 0), text: '' });\n }\n\n continue;\n }\n\n const names = remaining.map((element) => element.getText(file));\n const braces = names.length > 0 ? `{ ${names.join(', ')} }` : undefined;\n const rest = namespace ? clause.namedBindings?.getText(file) : braces;\n const type = clause.isTypeOnly ? 'type ' : '';\n\n edits.push({\n start: clause.getStart(file),\n end: clause.getEnd(),\n text: `${type}${[defaultName, rest].filter(Boolean).join(', ')}`,\n });\n }\n\n if (addedImport && !isImportPlaced) {\n const last = imports.at(-1);\n const at = last ? last.getEnd() : (file.statements[0]?.getStart(file) ?? 0);\n const text = last ? `\\n${addedImport}` : `${addedImport}\\n`;\n edits.push({ start: at, end: at, text });\n }\n\n let output = source;\n\n for (const edit of edits.sort((a, b) => b.start - a.start || b.end - a.end)) {\n output = output.slice(0, edit.start) + edit.text + output.slice(edit.end);\n }\n\n return { output, changed: output !== source, rewritten, manual, info };\n }\n}\n\n/** `devz codemod execution-scope`: an application's own scope helpers to `Execution.run`. */\nexport class ExecutionScopeCommand {\n static readonly USAGE = USAGE;\n\n private static refuse(message: string): number {\n CliOutput.error(`devz codemod execution-scope: ${message}\\n${USAGE}`);\n\n return USAGE_ERROR_CODE;\n }\n\n static async run(opts: { root: string; args: string[] }): Promise<number> {\n const { root, args } = opts;\n const isNestedRewritten = args.includes(NESTED_FLAG);\n const rest = args.filter((argument) => argument !== NESTED_FLAG);\n const at = rest.indexOf(MAP_FLAG);\n const mapPath = at < 0 ? undefined : rest.splice(at, 2)[1];\n let map: TExecutionScopeMap = {};\n\n if (!args.includes('--help') && !args.includes('-h')) {\n if (!mapPath || mapPath.startsWith('-')) {\n return ExecutionScopeCommand.refuse(`${MAP_FLAG} <file.json> is required`);\n }\n\n let text: string;\n\n try {\n text = readFileSync(resolve(root, mapPath), 'utf8');\n } catch (error) {\n return ExecutionScopeCommand.refuse(`cannot read ${mapPath}: ${String(error)}`);\n }\n\n const parsed = ExecutionScopeMapReader.parse({ text });\n\n if ('error' in parsed) {\n return ExecutionScopeCommand.refuse(`${mapPath}: ${parsed.error}`);\n }\n\n map = parsed.map;\n }\n\n return ClassRenamesCommand.run({\n root,\n args: rest,\n codemod: {\n name: 'execution-scope',\n usage: USAGE,\n isReversible: false,\n unit: { noun: 'call(s)', verb: 'rewritten' },\n // The names of the helpers, and what marks a handler, a consumer or a reason still to write.\n marks: () => [\n ...Object.keys(map).flatMap((key) => key.split('.').slice(-1)),\n 'IEventHandler',\n '.register(',\n 'onWorkerData',\n 'onMessage',\n TODO_PREFIX,\n ],\n rewrite: (input) =>\n ExecutionScopeRewrite.rewrite({\n ...input,\n shownName: relative(root, input.fileName).split('\\\\').join('/'),\n map,\n isNestedRewritten,\n }),\n },\n });\n }\n}\n"]}
@@ -2,15 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CodemodCommand = void 0;
4
4
  const any_aliases_1 = require("./any-aliases");
5
+ const async_context_1 = require("./async-context");
5
6
  const async_style_1 = require("./async-style");
6
7
  const binding_keys_1 = require("./binding-keys");
7
8
  const class_renames_1 = require("./class-renames");
8
9
  const connector_imports_1 = require("./connector-imports");
9
10
  const const_classes_1 = require("./const-classes");
10
11
  const env_get_1 = require("./env-get");
12
+ const execution_class_1 = require("./execution-class");
13
+ const execution_scope_1 = require("./execution-scope");
11
14
  const function_to_arrow_1 = require("./function-to-arrow");
12
15
  const drop_redundant_casts_1 = require("./drop-redundant-casts");
13
16
  const namespace_functions_1 = require("./namespace-functions");
17
+ const public_names_1 = require("./public-names");
14
18
  const typed_route_context_1 = require("./typed-route-context");
15
19
  const cli_output_1 = require("../../common/cli-output");
16
20
  const USAGE = [
@@ -23,8 +27,12 @@ const USAGE = [
23
27
  any_aliases_1.AnyAliasesCommand.USAGE,
24
28
  binding_keys_1.BindingKeysCommand.USAGE,
25
29
  class_renames_1.ClassRenamesCommand.USAGE,
30
+ execution_class_1.ExecutionClassCommand.USAGE,
31
+ execution_scope_1.ExecutionScopeCommand.USAGE,
26
32
  function_to_arrow_1.FunctionToArrowCommand.USAGE,
27
33
  typed_route_context_1.TypedRouteContextCommand.USAGE,
34
+ async_context_1.AsyncContextCommand.USAGE,
35
+ public_names_1.PublicNamesCommand.USAGE,
28
36
  ].join('\n\n');
29
37
  /** The codemods `devz codemod <name>` runs. */
30
38
  const NAME_LIST = [
@@ -37,8 +45,12 @@ const NAME_LIST = [
37
45
  'any-aliases',
38
46
  'binding-keys',
39
47
  'class-renames',
48
+ 'execution-class',
49
+ 'execution-scope',
50
+ 'async-context',
40
51
  'function-to-arrow',
41
52
  'typed-route-context',
53
+ 'public-names',
42
54
  ];
43
55
  const NAMES = NAME_LIST.join(', ');
44
56
  /** A usage error: nothing was read or written. */
@@ -53,6 +65,7 @@ const NOT_REVERSIBLE = new Set([
53
65
  'binding-keys',
54
66
  'function-to-arrow',
55
67
  'typed-route-context',
68
+ 'public-names',
56
69
  ]);
57
70
  /** `devz codemod <name> [args]`: hands the arguments to the codemod called `name`. */
58
71
  class CodemodCommand {
@@ -97,6 +110,18 @@ class CodemodCommand {
97
110
  if (name === 'typed-route-context') {
98
111
  return typed_route_context_1.TypedRouteContextCommand.run({ root: opts.root, args: rest });
99
112
  }
113
+ if (name === 'execution-class') {
114
+ return execution_class_1.ExecutionClassCommand.run({ root: opts.root, args: rest });
115
+ }
116
+ if (name === 'execution-scope') {
117
+ return execution_scope_1.ExecutionScopeCommand.run({ root: opts.root, args: rest });
118
+ }
119
+ if (name === 'async-context') {
120
+ return async_context_1.AsyncContextCommand.run({ root: opts.root, args: rest });
121
+ }
122
+ if (name === 'public-names') {
123
+ return public_names_1.PublicNamesCommand.run({ root: opts.root, args: rest });
124
+ }
100
125
  if (name === 'class-renames') {
101
126
  return class_renames_1.ClassRenamesCommand.run({ root: opts.root, args: rest });
102
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/codemod/index.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,+CAAkD;AAClD,iDAAoD;AACpD,mDAAsD;AACtD,2DAA8D;AAC9D,mDAAsD;AACtD,uCAA0C;AAC1C,2DAA6D;AAC7D,iEAAmE;AACnE,+DAAkE;AAClE,+DAAiE;AACjE,wDAAoD;AAEpD,MAAM,KAAK,GAAG;IACZ,gDAAyB,CAAC,KAAK;IAC/B,mCAAmB,CAAC,KAAK;IACzB,+BAAiB,CAAC,KAAK;IACvB,+CAAyB,CAAC,KAAK;IAC/B,2CAAuB,CAAC,KAAK;IAC7B,uBAAa,CAAC,KAAK;IACnB,+BAAiB,CAAC,KAAK;IACvB,iCAAkB,CAAC,KAAK;IACxB,mCAAmB,CAAC,KAAK;IACzB,0CAAsB,CAAC,KAAK;IAC5B,8CAAwB,CAAC,KAAK;CAC/B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEf,+CAA+C;AAC/C,MAAM,SAAS,GAAG;IAChB,sBAAsB;IACtB,eAAe;IACf,aAAa;IACb,qBAAqB;IACrB,mBAAmB;IACnB,SAAS;IACT,aAAa;IACb,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,qBAAqB;CACtB,CAAC;AACF,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEnC,kDAAkD;AAClD,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,2FAA2F;AAC3F,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;I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,OAAO,mCAAmB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,sBAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAErB,OAAO,CAAC,CAAC;QACX,CAAC;QAED,sBAAS,CAAC,KAAK,CACb,kCAAkC,IAAI,IAAI,EAAE,yBAAyB,KAAK,OAAO,KAAK,EAAE,CACzF,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AAzED,wCAyEC","sourcesContent":["import { AnyAliasesCommand } from './any-aliases';\nimport { AsyncStyleCommand } from './async-style';\nimport { BindingKeysCommand } from './binding-keys';\nimport { ClassRenamesCommand } from './class-renames';\nimport { ConnectorImportsCommand } from './connector-imports';\nimport { ConstClassesCommand } from './const-classes';\nimport { EnvGetCommand } from './env-get';\nimport { FunctionToArrowCommand } from './function-to-arrow';\nimport { DropRedundantCastsCommand } from './drop-redundant-casts';\nimport { NamespaceFunctionsCommand } from './namespace-functions';\nimport { TypedRouteContextCommand } from './typed-route-context';\nimport { CliOutput } from '../../common/cli-output';\n\nconst USAGE = [\n DropRedundantCastsCommand.USAGE,\n ConstClassesCommand.USAGE,\n AsyncStyleCommand.USAGE,\n NamespaceFunctionsCommand.USAGE,\n ConnectorImportsCommand.USAGE,\n EnvGetCommand.USAGE,\n AnyAliasesCommand.USAGE,\n BindingKeysCommand.USAGE,\n ClassRenamesCommand.USAGE,\n FunctionToArrowCommand.USAGE,\n TypedRouteContextCommand.USAGE,\n].join('\\n\\n');\n\n/** The codemods `devz codemod <name>` runs. */\nconst NAME_LIST = [\n 'drop-redundant-casts',\n 'const-classes',\n 'async-style',\n 'namespace-functions',\n 'connector-imports',\n 'env-get',\n 'any-aliases',\n 'binding-keys',\n 'class-renames',\n 'function-to-arrow',\n 'typed-route-context',\n];\nconst NAMES = NAME_LIST.join(', ');\n\n/** A usage error: nothing was read or written. */\nconst USAGE_ERROR_CODE = 2;\n\n/** The codemods that are style rewrites, not migrations: there is no downgrade of them. */\nconst NOT_REVERSIBLE = new Set([\n 'drop-redundant-casts',\n 'const-classes',\n 'async-style',\n 'env-get',\n 'any-aliases',\n 'binding-keys',\n 'function-to-arrow',\n 'typed-route-context',\n]);\n\n/** `devz codemod <name> [args]`: hands the arguments to the codemod called `name`. */\nexport class CodemodCommand {\n static async run(opts: { root: string; args: string[] }): Promise<number> {\n const { args } = opts;\n const [name, ...rest] = args;\n\n if (name === '--list') {\n CliOutput.log(NAME_LIST.join('\\n'));\n\n return 0;\n }\n\n if (name !== undefined && NOT_REVERSIBLE.has(name) && rest.includes('--reverse')) {\n CliOutput.error(`devz codemod ${name}: not reversible`);\n\n return USAGE_ERROR_CODE;\n }\n\n if (name === 'drop-redundant-casts') {\n return DropRedundantCastsCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'const-classes') {\n return ConstClassesCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'async-style') {\n return AsyncStyleCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'namespace-functions') {\n return NamespaceFunctionsCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'connector-imports') {\n return ConnectorImportsCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'env-get') {\n return EnvGetCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'any-aliases') {\n return AnyAliasesCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'binding-keys') {\n return BindingKeysCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'function-to-arrow') {\n return FunctionToArrowCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'typed-route-context') {\n return TypedRouteContextCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'class-renames') {\n return ClassRenamesCommand.run({ root: opts.root, args: rest });\n }\n\n if (args.includes('--help') || args.includes('-h')) {\n CliOutput.log(USAGE);\n\n return 0;\n }\n\n CliOutput.error(\n `devz codemod: unknown codemod \"${name ?? ''}\" | the codemods are: ${NAMES}\\n\\n${USAGE}`,\n );\n\n return USAGE_ERROR_CODE;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/codemod/index.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,mDAAsD;AACtD,+CAAkD;AAClD,iDAAoD;AACpD,mDAAsD;AACtD,2DAA8D;AAC9D,mDAAsD;AACtD,uCAA0C;AAC1C,uDAA0D;AAC1D,uDAA0D;AAC1D,2DAA6D;AAC7D,iEAAmE;AACnE,+DAAkE;AAClE,iDAAoD;AACpD,+DAAiE;AACjE,wDAAoD;AAEpD,MAAM,KAAK,GAAG;IACZ,gDAAyB,CAAC,KAAK;IAC/B,mCAAmB,CAAC,KAAK;IACzB,+BAAiB,CAAC,KAAK;IACvB,+CAAyB,CAAC,KAAK;IAC/B,2CAAuB,CAAC,KAAK;IAC7B,uBAAa,CAAC,KAAK;IACnB,+BAAiB,CAAC,KAAK;IACvB,iCAAkB,CAAC,KAAK;IACxB,mCAAmB,CAAC,KAAK;IACzB,uCAAqB,CAAC,KAAK;IAC3B,uCAAqB,CAAC,KAAK;IAC3B,0CAAsB,CAAC,KAAK;IAC5B,8CAAwB,CAAC,KAAK;IAC9B,mCAAmB,CAAC,KAAK;IACzB,iCAAkB,CAAC,KAAK;CACzB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEf,+CAA+C;AAC/C,MAAM,SAAS,GAAG;IAChB,sBAAsB;IACtB,eAAe;IACf,aAAa;IACb,qBAAqB;IACrB,mBAAmB;IACnB,SAAS;IACT,aAAa;IACb,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,mBAAmB;IACnB,qBAAqB;IACrB,cAAc;CACf,CAAC;AACF,MAAM,K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E,yBAAyB,KAAK,OAAO,KAAK,EAAE,CACzF,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AAzFD,wCAyFC","sourcesContent":["import { AnyAliasesCommand } from './any-aliases';\nimport { AsyncContextCommand } from './async-context';\nimport { AsyncStyleCommand } from './async-style';\nimport { BindingKeysCommand } from './binding-keys';\nimport { ClassRenamesCommand } from './class-renames';\nimport { ConnectorImportsCommand } from './connector-imports';\nimport { ConstClassesCommand } from './const-classes';\nimport { EnvGetCommand } from './env-get';\nimport { ExecutionClassCommand } from './execution-class';\nimport { ExecutionScopeCommand } from './execution-scope';\nimport { FunctionToArrowCommand } from './function-to-arrow';\nimport { DropRedundantCastsCommand } from './drop-redundant-casts';\nimport { NamespaceFunctionsCommand } from './namespace-functions';\nimport { PublicNamesCommand } from './public-names';\nimport { TypedRouteContextCommand } from './typed-route-context';\nimport { CliOutput } from '../../common/cli-output';\n\nconst USAGE = [\n DropRedundantCastsCommand.USAGE,\n ConstClassesCommand.USAGE,\n AsyncStyleCommand.USAGE,\n NamespaceFunctionsCommand.USAGE,\n ConnectorImportsCommand.USAGE,\n EnvGetCommand.USAGE,\n AnyAliasesCommand.USAGE,\n BindingKeysCommand.USAGE,\n ClassRenamesCommand.USAGE,\n ExecutionClassCommand.USAGE,\n ExecutionScopeCommand.USAGE,\n FunctionToArrowCommand.USAGE,\n TypedRouteContextCommand.USAGE,\n AsyncContextCommand.USAGE,\n PublicNamesCommand.USAGE,\n].join('\\n\\n');\n\n/** The codemods `devz codemod <name>` runs. */\nconst NAME_LIST = [\n 'drop-redundant-casts',\n 'const-classes',\n 'async-style',\n 'namespace-functions',\n 'connector-imports',\n 'env-get',\n 'any-aliases',\n 'binding-keys',\n 'class-renames',\n 'execution-class',\n 'execution-scope',\n 'async-context',\n 'function-to-arrow',\n 'typed-route-context',\n 'public-names',\n];\nconst NAMES = NAME_LIST.join(', ');\n\n/** A usage error: nothing was read or written. */\nconst USAGE_ERROR_CODE = 2;\n\n/** The codemods that are style rewrites, not migrations: there is no downgrade of them. */\nconst NOT_REVERSIBLE = new Set([\n 'drop-redundant-casts',\n 'const-classes',\n 'async-style',\n 'env-get',\n 'any-aliases',\n 'binding-keys',\n 'function-to-arrow',\n 'typed-route-context',\n 'public-names',\n]);\n\n/** `devz codemod <name> [args]`: hands the arguments to the codemod called `name`. */\nexport class CodemodCommand {\n static async run(opts: { root: string; args: string[] }): Promise<number> {\n const { args } = opts;\n const [name, ...rest] = args;\n\n if (name === '--list') {\n CliOutput.log(NAME_LIST.join('\\n'));\n\n return 0;\n }\n\n if (name !== undefined && NOT_REVERSIBLE.has(name) && rest.includes('--reverse')) {\n CliOutput.error(`devz codemod ${name}: not reversible`);\n\n return USAGE_ERROR_CODE;\n }\n\n if (name === 'drop-redundant-casts') {\n return DropRedundantCastsCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'const-classes') {\n return ConstClassesCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'async-style') {\n return AsyncStyleCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'namespace-functions') {\n return NamespaceFunctionsCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'connector-imports') {\n return ConnectorImportsCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'env-get') {\n return EnvGetCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'any-aliases') {\n return AnyAliasesCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'binding-keys') {\n return BindingKeysCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'function-to-arrow') {\n return FunctionToArrowCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'typed-route-context') {\n return TypedRouteContextCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'execution-class') {\n return ExecutionClassCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'execution-scope') {\n return ExecutionScopeCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'async-context') {\n return AsyncContextCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'public-names') {\n return PublicNamesCommand.run({ root: opts.root, args: rest });\n }\n\n if (name === 'class-renames') {\n return ClassRenamesCommand.run({ root: opts.root, args: rest });\n }\n\n if (args.includes('--help') || args.includes('-h')) {\n CliOutput.log(USAGE);\n\n return 0;\n }\n\n CliOutput.error(\n `devz codemod: unknown codemod \"${name ?? ''}\" | the codemods are: ${NAMES}\\n\\n${USAGE}`,\n );\n\n return USAGE_ERROR_CODE;\n }\n}\n"]}
@@ -55,6 +55,12 @@ export interface INamespaceMapping {
55
55
  * `ObjectUtility.isEmpty({ value })`. `params` is empty and `restKey` unset for such an entry.
56
56
  */
57
57
  keepsOptions?: boolean;
58
+ /**
59
+ * A type guard row: every entry in `modules` exports the same class, so an import of the class from any of them
60
+ * serves a rewritten call, and a `type` import of it, as is common for a guard's class, becomes a value import.
61
+ * Without it, such a file is listed and left.
62
+ */
63
+ isTypeGuard?: boolean;
58
64
  }
59
65
  /** Checks a mapping table. */
60
66
  export declare class NamespaceMappings {
@@ -1 +1 @@
1
- {"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../../src/cli/codemod/namespace-functions/mapping.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;AA8BH,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,8BAA8B;AAC9B,MAAa,iBAAiB;IAC5B,4FAA4F;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAoD;QAClE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAE/B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,OAAO,OAAO,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YAE7E,KAAK,MAAM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C,GAAG,KAAK,KAAK,OAAO,CAAC,OAAO,SAAS,MAAM,kBAAkB,CAAC,CAAC;gBAC/E,CAAC;gBAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA9ED,8CA8EC","sourcesContent":["/**\n * The table behind `devz codemod namespace-functions`. One entry per public function that moved into\n * a class: the old name is no longer exported, and the codemod moves callers to the class form, so an\n * entry is the only upgrade path for that name.\n *\n * How an entry is written, in the file of the package that exports the old name\n * (`mappings/<package-dir>.ts`):\n *\n * ```ts\n * {\n * // Every module specifier the old name can be imported from: the root, a subpath, a re-export.\n * modules: ['@venizia/ignis-helpers', '@venizia/ignis-helpers/core'],\n * oldName: 'float',\n * className: 'ParseUtility',\n * method: 'toFloat',\n * // Where the class is imported from, when that is not where the old name came from. Optional.\n * newModules: ['@venizia/ignis-helpers'],\n * // The old positional parameters in order; each becomes a key of the options object. A parameter\n * // that has a default value in the old function is `optional`, and an optional one is never\n * // followed by a required one.\n * params: [{ key: 'input' }, { key: 'digit', optional: true }],\n * // The old rest parameter, if any (`float` has none): its arguments go under this key as one\n * // array, `[]` when the call passes none. Optional.\n * // restKey: 'values',\n * }\n * ```\n *\n * So `float(value, 3)` becomes `ParseUtility.toFloat({ input: value, digit: 3 })`, and `float(input)`\n * becomes `ParseUtility.toFloat({ input })`. Add the entry in the pull request that adds the class\n * and removes the old export, never before: the codemod would rewrite callers to a method that does not\n * exist yet. `NamespaceMappings.validate` checks every entry in the test suite.\n */\n\n/** One old positional parameter, and the key it becomes in the options object. */\nexport interface INamespaceMappingParameter {\n key: string;\n /** The old parameter has a default value: a call may leave it out, and then the key is left out. */\n optional?: boolean;\n}\n\n/** One function that moved into a class. */\nexport interface INamespaceMapping {\n /** Every module specifier the old name can be imported from. */\n modules: string[];\n oldName: string;\n className: string;\n method: string;\n /** Where the class is imported from; without it, from the module the old name was imported from. */\n newModules?: string[];\n /** The old positional parameters, in order. */\n params: INamespaceMappingParameter[];\n /** The old rest parameter: its arguments are passed as one array under this key. */\n restKey?: string;\n /**\n * The old function already takes ONE options object and the method takes the same one, so a call\n * keeps its arguments and only the callee changes: `isEmpty({ value })` becomes\n * `ObjectUtility.isEmpty({ value })`. `params` is empty and `restKey` unset for such an entry.\n */\n keepsOptions?: boolean;\n}\n\nconst IDENTIFIER = /^[A-Za-z_$][\\w$]*$/;\n\n/** Checks a mapping table. */\nexport class NamespaceMappings {\n /** What is wrong with the table, one line per problem; empty when every entry is usable. */\n static validate(opts: { mappings: ReadonlyArray<INamespaceMapping> }): string[] {\n const { mappings } = opts;\n const problems: string[] = [];\n const seen = new Set<string>();\n\n for (const mapping of mappings) {\n const label = `${mapping.oldName} -> ${mapping.className}.${mapping.method}`;\n\n for (const [field, value] of [\n ['oldName', mapping.oldName],\n ['className', mapping.className],\n ['method', mapping.method],\n ] as const) {\n if (!IDENTIFIER.test(value)) {\n problems.push(`${label}: ${field} \"${value}\" is not an identifier`);\n }\n }\n\n if (mapping.modules.length === 0 || mapping.modules.some((module) => module.trim() === '')) {\n problems.push(`${label}: modules must list at least one module specifier, none empty`);\n }\n\n if (mapping.newModules?.length === 0) {\n problems.push(`${label}: newModules, when given, lists at least one module specifier`);\n }\n\n const keys = new Set<string>();\n let isOptionalSeen = false;\n\n for (const parameter of mapping.params) {\n if (!IDENTIFIER.test(parameter.key)) {\n problems.push(`${label}: the parameter key \"${parameter.key}\" is not an identifier`);\n }\n\n if (keys.has(parameter.key)) {\n problems.push(`${label}: the parameter key \"${parameter.key}\" is listed twice`);\n }\n\n keys.add(parameter.key);\n\n if (isOptionalSeen && !parameter.optional) {\n problems.push(\n `${label}: the required parameter \"${parameter.key}\" follows an optional one`,\n );\n }\n\n isOptionalSeen = isOptionalSeen || parameter.optional === true;\n }\n\n if (mapping.restKey !== undefined) {\n if (!IDENTIFIER.test(mapping.restKey)) {\n problems.push(`${label}: restKey \"${mapping.restKey}\" is not an identifier`);\n }\n\n if (keys.has(mapping.restKey)) {\n problems.push(`${label}: restKey \"${mapping.restKey}\" is also a parameter key`);\n }\n }\n\n if (mapping.keepsOptions && (mapping.params.length > 0 || mapping.restKey !== undefined)) {\n problems.push(`${label}: keepsOptions leaves params empty and restKey unset`);\n }\n\n for (const module of mapping.modules) {\n const id = `${module}#${mapping.oldName}`;\n\n if (seen.has(id)) {\n problems.push(`${label}: ${mapping.oldName} from ${module} has two entries`);\n }\n\n seen.add(id);\n }\n }\n\n return problems;\n }\n}\n"]}
1
+ {"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../../src/cli/codemod/namespace-functions/mapping.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;AAoCH,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,8BAA8B;AAC9B,MAAa,iBAAiB;IAC5B,4FAA4F;IAC5F,MAAM,CAAC,QAAQ,CAAC,IAAoD;QAClE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;QAE/B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,OAAO,OAAO,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YAE7E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI;gBAC3B,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC;gBAC5B,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC;gBAChC,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;aAClB,EAAE,CAAC;gBACX,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK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AI,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC;YACjE,CAAC;YAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;gBAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,cAAc,OAAO,CAAC,OAAO,wBAAwB,CAAC,CAAC;gBAC/E,CAAC;gBAED,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,cAAc,OAAO,CAAC,OAAO,2BAA2B,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;YAED,IAAI,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,EAAE,CAAC;gBACzF,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,sDAAsD,CAAC,CAAC;YAChF,CAAC;YAED,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACrC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBAE1C,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;oBACjB,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,OAAO,CAAC,OAAO,SAAS,MAAM,kBAAkB,CAAC,CAAC;gBAC/E,CAAC;gBAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACf,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA9ED,8CA8EC","sourcesContent":["/**\n * The table behind `devz codemod namespace-functions`. One entry per public function that moved into\n * a class: the old name is no longer exported, and the codemod moves callers to the class form, so an\n * entry is the only upgrade path for that name.\n *\n * How an entry is written, in the file of the package that exports the old name\n * (`mappings/<package-dir>.ts`):\n *\n * ```ts\n * {\n * // Every module specifier the old name can be imported from: the root, a subpath, a re-export.\n * modules: ['@venizia/ignis-helpers', '@venizia/ignis-helpers/core'],\n * oldName: 'float',\n * className: 'ParseUtility',\n * method: 'toFloat',\n * // Where the class is imported from, when that is not where the old name came from. Optional.\n * newModules: ['@venizia/ignis-helpers'],\n * // The old positional parameters in order; each becomes a key of the options object. A parameter\n * // that has a default value in the old function is `optional`, and an optional one is never\n * // followed by a required one.\n * params: [{ key: 'input' }, { key: 'digit', optional: true }],\n * // The old rest parameter, if any (`float` has none): its arguments go under this key as one\n * // array, `[]` when the call passes none. Optional.\n * // restKey: 'values',\n * }\n * ```\n *\n * So `float(value, 3)` becomes `ParseUtility.toFloat({ input: value, digit: 3 })`, and `float(input)`\n * becomes `ParseUtility.toFloat({ input })`. Add the entry in the pull request that adds the class\n * and removes the old export, never before: the codemod would rewrite callers to a method that does not\n * exist yet. `NamespaceMappings.validate` checks every entry in the test suite.\n */\n\n/** One old positional parameter, and the key it becomes in the options object. */\nexport interface INamespaceMappingParameter {\n key: string;\n /** The old parameter has a default value: a call may leave it out, and then the key is left out. */\n optional?: boolean;\n}\n\n/** One function that moved into a class. */\nexport interface INamespaceMapping {\n /** Every module specifier the old name can be imported from. */\n modules: string[];\n oldName: string;\n className: string;\n method: string;\n /** Where the class is imported from; without it, from the module the old name was imported from. */\n newModules?: string[];\n /** The old positional parameters, in order. */\n params: INamespaceMappingParameter[];\n /** The old rest parameter: its arguments are passed as one array under this key. */\n restKey?: string;\n /**\n * The old function already takes ONE options object and the method takes the same one, so a call\n * keeps its arguments and only the callee changes: `isEmpty({ value })` becomes\n * `ObjectUtility.isEmpty({ value })`. `params` is empty and `restKey` unset for such an entry.\n */\n keepsOptions?: boolean;\n /**\n * A type guard row: every entry in `modules` exports the same class, so an import of the class from any of them\n * serves a rewritten call, and a `type` import of it, as is common for a guard's class, becomes a value import.\n * Without it, such a file is listed and left.\n */\n isTypeGuard?: boolean;\n}\n\nconst IDENTIFIER = /^[A-Za-z_$][\\w$]*$/;\n\n/** Checks a mapping table. */\nexport class NamespaceMappings {\n /** What is wrong with the table, one line per problem; empty when every entry is usable. */\n static validate(opts: { mappings: ReadonlyArray<INamespaceMapping> }): string[] {\n const { mappings } = opts;\n const problems: string[] = [];\n const seen = new Set<string>();\n\n for (const mapping of mappings) {\n const label = `${mapping.oldName} -> ${mapping.className}.${mapping.method}`;\n\n for (const [field, value] of [\n ['oldName', mapping.oldName],\n ['className', mapping.className],\n ['method', mapping.method],\n ] as const) {\n if (!IDENTIFIER.test(value)) {\n problems.push(`${label}: ${field} \"${value}\" is not an identifier`);\n }\n }\n\n if (mapping.modules.length === 0 || mapping.modules.some((module) => module.trim() === '')) {\n problems.push(`${label}: modules must list at least one module specifier, none empty`);\n }\n\n if (mapping.newModules?.length === 0) {\n problems.push(`${label}: newModules, when given, lists at least one module specifier`);\n }\n\n const keys = new Set<string>();\n let isOptionalSeen = false;\n\n for (const parameter of mapping.params) {\n if (!IDENTIFIER.test(parameter.key)) {\n problems.push(`${label}: the parameter key \"${parameter.key}\" is not an identifier`);\n }\n\n if (keys.has(parameter.key)) {\n problems.push(`${label}: the parameter key \"${parameter.key}\" is listed twice`);\n }\n\n keys.add(parameter.key);\n\n if (isOptionalSeen && !parameter.optional) {\n problems.push(\n `${label}: the required parameter \"${parameter.key}\" follows an optional one`,\n );\n }\n\n isOptionalSeen = isOptionalSeen || parameter.optional === true;\n }\n\n if (mapping.restKey !== undefined) {\n if (!IDENTIFIER.test(mapping.restKey)) {\n problems.push(`${label}: restKey \"${mapping.restKey}\" is not an identifier`);\n }\n\n if (keys.has(mapping.restKey)) {\n problems.push(`${label}: restKey \"${mapping.restKey}\" is also a parameter key`);\n }\n }\n\n if (mapping.keepsOptions && (mapping.params.length > 0 || mapping.restKey !== undefined)) {\n problems.push(`${label}: keepsOptions leaves params empty and restKey unset`);\n }\n\n for (const module of mapping.modules) {\n const id = `${module}#${mapping.oldName}`;\n\n if (seen.has(id)) {\n problems.push(`${label}: ${mapping.oldName} from ${module} has two entries`);\n }\n\n seen.add(id);\n }\n }\n\n return problems;\n }\n}\n"]}
@@ -1,4 +1,6 @@
1
1
  import type { INamespaceMapping } from '../mapping';
2
+ /** The type guards of `@venizia/ignis-connectors`, which keep their positional argument. */
3
+ export declare const CONNECTORS_GUARD_MAPPINGS: ReadonlyArray<INamespaceMapping>;
2
4
  /** The functions of `@venizia/ignis-connectors` that moved into a class. */
3
5
  export declare const CONNECTORS_MAPPINGS: ReadonlyArray<INamespaceMapping>;
4
6
  //# sourceMappingURL=connectors.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONNECTORS_MAPPINGS = void 0;
3
+ exports.CONNECTORS_MAPPINGS = exports.CONNECTORS_GUARD_MAPPINGS = void 0;
4
4
  const CONNECTORS = '@venizia/ignis-connectors';
5
5
  const CORE_SERVER = '@venizia/ignis';
6
6
  /**
@@ -49,8 +49,26 @@ const enricher = (opts) => [
49
49
  params: [{ key: opts.baseKey }, { key: 'opts', optional: !opts.isOptionsRequired }],
50
50
  },
51
51
  ];
52
+ /** The type guards of `@venizia/ignis-connectors`, which keep their positional argument. */
53
+ exports.CONNECTORS_GUARD_MAPPINGS = [
54
+ passthrough({
55
+ modules: [CONNECTORS, `${CONNECTORS}/relational`],
56
+ oldName: 'isRelationalTransaction',
57
+ className: 'AbstractRelationalDataSource',
58
+ method: 'isRelationalTransaction',
59
+ isTypeGuard: true,
60
+ }),
61
+ passthrough({
62
+ modules: [`${CONNECTORS}/postgres`, CORE_SERVER],
63
+ oldName: 'isDatabaseTransaction',
64
+ className: 'AbstractPostgresDataSource',
65
+ method: 'isDatabaseTransaction',
66
+ isTypeGuard: true,
67
+ }),
68
+ ];
52
69
  /** The functions of `@venizia/ignis-connectors` that moved into a class. */
53
70
  exports.CONNECTORS_MAPPINGS = [
71
+ ...exports.CONNECTORS_GUARD_MAPPINGS,
54
72
  ...enricher({
55
73
  modules: POSTGRES_MODULES,
56
74
  className: 'PostgresDataTypeEnricher',
@@ -1 +1 @@
1
- {"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/connectors.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAC/C,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAU,WAAW,EAAE,WAAW,EAAE,GAAG,WAAW,WAAW,CAAC,CAAC;AAC5F,MAAM,cAAc,GAAG,CAAC,GAAG,UAAU,SAAS,EAAE,GAAG,WAAW,SAAS,CAAC,CAAC;AACzE,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,GAAG,UAAU,aAAa,EAAE,GAAG,WAAW,aAAa,CAAC,CAAC;AACjG,MAAM,8BAA8B,GAAG;IACrC,GAAG,kBAAkB;IACrB,GAAG,UAAU,WAAW;IACxB,GAAG,UAAU,SAAS;IACtB,WAAW;IACX,GAAG,WAAW,WAAW;IACzB,GAAG,WAAW,SAAS;CACxB,CAAC;AACF,MAAM,cAAc,GAAG;IACrB,UAAU;IACV,GAAG,UAAU,SAAS;IACtB,GAAG,UAAU,YAAY;IACzB,GAAG,WAAW,SAAS;IACvB,GAAG,WAAW,YAAY;CAC3B,CAAC;AACF,MAAM,yBAAyB,GAAG;IAChC,GAAG,UAAU,qBAAqB;IAClC,GAAG,UAAU,wBAAwB;IACrC,GAAG,WAAW,qBAAqB;IACnC,GAAG,WAAW,wBAAwB;CACvC,CAAC;AAEF,wFAAwF;AACxF,MAAM,WAAW,GAAG,CAClB,OAA2D,EACxC,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzE,0GAA0G;AAC1G,M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AiB;QAC1B,SAAS,EAAE,aAAa;QACxB,MAAM,EAAE,iBAAiB;KAC1B,CAAC;IACF,WAAW,CAAC;QACV,OAAO,EAAE,yBAAyB;QAClC,OAAO,EAAE,0BAA0B;QACnC,SAAS,EAAE,yBAAyB;QACpC,MAAM,EAAE,oBAAoB;KAC7B,CAAC;IACF,WAAW,CAAC;QACV,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,wBAAwB;QACjC,SAAS,EAAE,yBAAyB;QACpC,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF,WAAW,CAAC;QACV,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,4BAA4B;QACrC,SAAS,EAAE,yBAAyB;QACpC,MAAM,EAAE,sBAAsB;KAC/B,CAAC;IACF;QACE,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,0BAA0B;QACrC,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;KAC3B;IACD,WAAW,CAAC;QACV,OAAO,EAAE,CAAC,GAAG,UAAU,cAAc,EAAE,GAAG,WAAW,cAAc,CAAC;QACpE,OAAO,EAAE,8BAA8B;QACvC,SAAS,EAAE,+BAA+B;QAC1C,MAAM,EAAE,SAAS;KAClB,CAAC;IACF,WAAW,CAAC;QACV,OAAO,EAAE,CAAC,GAAG,UAAU,YAAY,EAAE,GAAG,WAAW,YAAY,CAAC;QAChE,OAAO,EAAE,4BAA4B;QACrC,SAAS,EAAE,6BAA6B;QACxC,MAAM,EAAE,SAAS;KAClB,CAAC;CACH,CAAC","sourcesContent":["import type { INamespaceMapping } from '../mapping';\n\nconst CONNECTORS = '@venizia/ignis-connectors';\nconst CORE_SERVER = '@venizia/ignis';\n\n/**\n * `@venizia/ignis` (the root) re-exports `@venizia/ignis-connectors/postgres` only, and every other\n * core-server subpath mirrors the connectors subpath of the same name.\n */\nconst POSTGRES_MODULES = [`${CONNECTORS}/postgres`, CORE_SERVER, `${CORE_SERVER}/postgres`];\nconst SQLITE_MODULES = [`${CONNECTORS}/sqlite`, `${CORE_SERVER}/sqlite`];\nconst RELATIONAL_MODULES = [CONNECTORS, `${CONNECTORS}/relational`, `${CORE_SERVER}/relational`];\nconst RELATIONAL_AND_DIALECT_MODULES = [\n ...RELATIONAL_MODULES,\n `${CONNECTORS}/postgres`,\n `${CONNECTORS}/sqlite`,\n CORE_SERVER,\n `${CORE_SERVER}/postgres`,\n `${CORE_SERVER}/sqlite`,\n];\nconst SEARCH_MODULES = [\n CONNECTORS,\n `${CONNECTORS}/search`,\n `${CONNECTORS}/typesense`,\n `${CORE_SERVER}/search`,\n `${CORE_SERVER}/typesense`,\n];\nconst SEARCH_CONTROLLER_MODULES = [\n `${CONNECTORS}/search/controllers`,\n `${CONNECTORS}/typesense/controllers`,\n `${CORE_SERVER}/search/controllers`,\n `${CORE_SERVER}/typesense/controllers`,\n];\n\n/** The old function took one options object, so the class method takes it unchanged. */\nconst passthrough = (\n mapping: Omit<INamespaceMapping, 'params' | 'keepsOptions'>,\n): INamespaceMapping => ({ ...mapping, params: [], keepsOptions: true });\n\n/** The enricher functions of one dialect: `generate*ColumnDefs(opts)` and `enrich*(baseSchema, opts)`. */\nconst enricher = (opts: {\n modules: string[];\n className: string;\n generateName: string;\n enrichName: string;\n baseKey: 'baseColumns' | 'baseSchema';\n isOptionsRequired?: boolean;\n}): INamespaceMapping[] => [\n passthrough({\n modules: opts.modules,\n oldName: opts.generateName,\n className: opts.className,\n method: 'generateColumnDefs',\n }),\n {\n modules: opts.modules,\n oldName: opts.enrichName,\n className: opts.className,\n method: 'enrich',\n params: [{ key: opts.baseKey }, { key: 'opts', optional: !opts.isOptionsRequired }],\n },\n];\n\n/** The functions of `@venizia/ignis-connectors` that moved into a class. */\nexport const CONNECTORS_MAPPINGS: ReadonlyArray<INamespaceMapping> = [\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresDataTypeEnricher',\n generateName: 'generateDataTypeColumnDefs',\n enrichName: 'enrichDataTypes',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresIdEnricher',\n generateName: 'generateIdColumnDefs',\n enrichName: 'enrichId',\n baseKey: 'baseColumns',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresPrincipalEnricher',\n generateName: 'generatePrincipalColumnDefs',\n enrichName: 'enrichPrincipal',\n baseKey: 'baseSchema',\n isOptionsRequired: true,\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresTzEnricher',\n generateName: 'generateTzColumnDefs',\n enrichName: 'enrichTz',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresUserAuditEnricher',\n generateName: 'generateUserAuditColumnDefs',\n enrichName: 'enrichUserAudit',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteDataTypeEnricher',\n generateName: 'generateDataTypeColumnDefs',\n enrichName: 'enrichDataTypes',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteIdEnricher',\n generateName: 'generateIdColumnDefs',\n enrichName: 'enrichId',\n baseKey: 'baseColumns',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqlitePrincipalEnricher',\n generateName: 'generatePrincipalColumnDefs',\n enrichName: 'enrichPrincipal',\n baseKey: 'baseSchema',\n isOptionsRequired: true,\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteTzEnricher',\n generateName: 'generateTzColumnDefs',\n enrichName: 'enrichTz',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteUserAuditEnricher',\n generateName: 'generateUserAuditColumnDefs',\n enrichName: 'enrichUserAudit',\n baseKey: 'baseSchema',\n }),\n\n passthrough({\n modules: [CONNECTORS],\n oldName: 'assertScopeFilterSupported',\n className: 'ScopeFilterUtility',\n method: 'assertScopeFilterSupported',\n }),\n passthrough({\n modules: RELATIONAL_AND_DIALECT_MODULES,\n oldName: 'getIdType',\n className: 'RelationalEntityUtility',\n method: 'getIdType',\n }),\n passthrough({\n modules: RELATIONAL_MODULES,\n oldName: 'resolveAuditUserId',\n className: 'AuditUserResolver',\n method: 'resolveAuditUserId',\n }),\n passthrough({\n modules: RELATIONAL_AND_DIALECT_MODULES,\n oldName: 'toRelationConfigs',\n className: 'RelationDeclarations',\n method: 'toRelationConfigs',\n }),\n passthrough({\n modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],\n oldName: 'getCachedColumns',\n className: 'TableColumnCache',\n method: 'get',\n }),\n ...['isJsonPath', 'parseJsonPath', 'validateJsonPathComponents', 'validateJsonColumnType'].map(\n (oldName) =>\n passthrough({\n modules: RELATIONAL_MODULES,\n oldName,\n className: 'JsonPathUtility',\n method: oldName,\n }),\n ),\n passthrough({\n modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],\n oldName: 'createRelations',\n className: 'RelationsFactory',\n method: 'create',\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],\n oldName: 'buildPostgresJsOptions',\n className: 'SupabasePooler',\n method: 'buildPostgresJsOptions',\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],\n oldName: 'withAuthContext',\n className: 'SupabaseRls',\n method: 'withAuthContext',\n }),\n passthrough({\n modules: SEARCH_CONTROLLER_MODULES,\n oldName: 'defineSearchRouteConfigs',\n className: 'SearchControllerFactory',\n method: 'defineRouteConfigs',\n }),\n passthrough({\n modules: SEARCH_MODULES,\n oldName: 'defineSearchCollection',\n className: 'SearchCollectionFactory',\n method: 'define',\n }),\n passthrough({\n modules: SEARCH_MODULES,\n oldName: 'deriveSearchDocumentSchema',\n className: 'SearchCollectionFactory',\n method: 'deriveDocumentSchema',\n }),\n {\n modules: SEARCH_MODULES,\n oldName: 'toSearchQueryParams',\n className: 'SearchQueryParamsUtility',\n method: 'toSearchQueryParams',\n params: [{ key: 'input' }],\n },\n passthrough({\n modules: [`${CONNECTORS}/meilisearch`, `${CORE_SERVER}/meilisearch`],\n oldName: 'compileMeilisearchCollection',\n className: 'MeilisearchCollectionCompiler',\n method: 'compile',\n }),\n passthrough({\n modules: [`${CONNECTORS}/typesense`, `${CORE_SERVER}/typesense`],\n oldName: 'compileTypesenseCollection',\n className: 'TypesenseCollectionCompiler',\n method: 'compile',\n }),\n];\n"]}
1
+ {"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/connectors.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAC/C,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAU,WAAW,EAAE,WAAW,EAAE,GAAG,WAAW,WAAW,CAAC,CAAC;AAC5F,MAAM,cAAc,GAAG,CAAC,GAAG,UAAU,SAAS,EAAE,GAAG,WAAW,SAAS,CAAC,CAAC;AACzE,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,GAAG,UAAU,aAAa,EAAE,GAAG,WAAW,aAAa,CAAC,CAAC;AACjG,MAAM,8BAA8B,GAAG;IACrC,GAAG,kBAAkB;IACrB,GAAG,UAAU,WAAW;IACxB,GAAG,UAAU,SAAS;IACtB,WAAW;IACX,GAAG,WAAW,WAAW;IACzB,GAAG,WAAW,SAAS;CACxB,CAAC;AACF,MAAM,cAAc,GAAG;IACrB,UAAU;IACV,GAAG,UAAU,SAAS;IACtB,GAAG,UAAU,YAAY;IACzB,GAAG,WAAW,SAAS;IACvB,GAAG,WAAW,YAAY;CAC3B,CAAC;AACF,MAAM,yBAAyB,GAAG;IAChC,GAAG,UAAU,qBAAqB;IAClC,GAAG,UAAU,wBAAwB;IACrC,GAAG,WAAW,qBAAqB;IACnC,GAAG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,EAAE,qBAAqB;QAC7B,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;KAC3B;IACD,WAAW,CAAC;QACV,OAAO,EAAE,CAAC,GAAG,UAAU,cAAc,EAAE,GAAG,WAAW,cAAc,CAAC;QACpE,OAAO,EAAE,8BAA8B;QACvC,SAAS,EAAE,+BAA+B;QAC1C,MAAM,EAAE,SAAS;KAClB,CAAC;IACF,WAAW,CAAC;QACV,OAAO,EAAE,CAAC,GAAG,UAAU,YAAY,EAAE,GAAG,WAAW,YAAY,CAAC;QAChE,OAAO,EAAE,4BAA4B;QACrC,SAAS,EAAE,6BAA6B;QACxC,MAAM,EAAE,SAAS;KAClB,CAAC;CACH,CAAC","sourcesContent":["import type { INamespaceMapping } from '../mapping';\n\nconst CONNECTORS = '@venizia/ignis-connectors';\nconst CORE_SERVER = '@venizia/ignis';\n\n/**\n * `@venizia/ignis` (the root) re-exports `@venizia/ignis-connectors/postgres` only, and every other\n * core-server subpath mirrors the connectors subpath of the same name.\n */\nconst POSTGRES_MODULES = [`${CONNECTORS}/postgres`, CORE_SERVER, `${CORE_SERVER}/postgres`];\nconst SQLITE_MODULES = [`${CONNECTORS}/sqlite`, `${CORE_SERVER}/sqlite`];\nconst RELATIONAL_MODULES = [CONNECTORS, `${CONNECTORS}/relational`, `${CORE_SERVER}/relational`];\nconst RELATIONAL_AND_DIALECT_MODULES = [\n ...RELATIONAL_MODULES,\n `${CONNECTORS}/postgres`,\n `${CONNECTORS}/sqlite`,\n CORE_SERVER,\n `${CORE_SERVER}/postgres`,\n `${CORE_SERVER}/sqlite`,\n];\nconst SEARCH_MODULES = [\n CONNECTORS,\n `${CONNECTORS}/search`,\n `${CONNECTORS}/typesense`,\n `${CORE_SERVER}/search`,\n `${CORE_SERVER}/typesense`,\n];\nconst SEARCH_CONTROLLER_MODULES = [\n `${CONNECTORS}/search/controllers`,\n `${CONNECTORS}/typesense/controllers`,\n `${CORE_SERVER}/search/controllers`,\n `${CORE_SERVER}/typesense/controllers`,\n];\n\n/** The old function took one options object, so the class method takes it unchanged. */\nconst passthrough = (\n mapping: Omit<INamespaceMapping, 'params' | 'keepsOptions'>,\n): INamespaceMapping => ({ ...mapping, params: [], keepsOptions: true });\n\n/** The enricher functions of one dialect: `generate*ColumnDefs(opts)` and `enrich*(baseSchema, opts)`. */\nconst enricher = (opts: {\n modules: string[];\n className: string;\n generateName: string;\n enrichName: string;\n baseKey: 'baseColumns' | 'baseSchema';\n isOptionsRequired?: boolean;\n}): INamespaceMapping[] => [\n passthrough({\n modules: opts.modules,\n oldName: opts.generateName,\n className: opts.className,\n method: 'generateColumnDefs',\n }),\n {\n modules: opts.modules,\n oldName: opts.enrichName,\n className: opts.className,\n method: 'enrich',\n params: [{ key: opts.baseKey }, { key: 'opts', optional: !opts.isOptionsRequired }],\n },\n];\n\n/** The type guards of `@venizia/ignis-connectors`, which keep their positional argument. */\nexport const CONNECTORS_GUARD_MAPPINGS: ReadonlyArray<INamespaceMapping> = [\n passthrough({\n modules: [CONNECTORS, `${CONNECTORS}/relational`],\n oldName: 'isRelationalTransaction',\n className: 'AbstractRelationalDataSource',\n method: 'isRelationalTransaction',\n isTypeGuard: true,\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres`, CORE_SERVER],\n oldName: 'isDatabaseTransaction',\n className: 'AbstractPostgresDataSource',\n method: 'isDatabaseTransaction',\n isTypeGuard: true,\n }),\n];\n\n/** The functions of `@venizia/ignis-connectors` that moved into a class. */\nexport const CONNECTORS_MAPPINGS: ReadonlyArray<INamespaceMapping> = [\n ...CONNECTORS_GUARD_MAPPINGS,\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresDataTypeEnricher',\n generateName: 'generateDataTypeColumnDefs',\n enrichName: 'enrichDataTypes',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresIdEnricher',\n generateName: 'generateIdColumnDefs',\n enrichName: 'enrichId',\n baseKey: 'baseColumns',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresPrincipalEnricher',\n generateName: 'generatePrincipalColumnDefs',\n enrichName: 'enrichPrincipal',\n baseKey: 'baseSchema',\n isOptionsRequired: true,\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresTzEnricher',\n generateName: 'generateTzColumnDefs',\n enrichName: 'enrichTz',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: POSTGRES_MODULES,\n className: 'PostgresUserAuditEnricher',\n generateName: 'generateUserAuditColumnDefs',\n enrichName: 'enrichUserAudit',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteDataTypeEnricher',\n generateName: 'generateDataTypeColumnDefs',\n enrichName: 'enrichDataTypes',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteIdEnricher',\n generateName: 'generateIdColumnDefs',\n enrichName: 'enrichId',\n baseKey: 'baseColumns',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqlitePrincipalEnricher',\n generateName: 'generatePrincipalColumnDefs',\n enrichName: 'enrichPrincipal',\n baseKey: 'baseSchema',\n isOptionsRequired: true,\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteTzEnricher',\n generateName: 'generateTzColumnDefs',\n enrichName: 'enrichTz',\n baseKey: 'baseSchema',\n }),\n ...enricher({\n modules: SQLITE_MODULES,\n className: 'SqliteUserAuditEnricher',\n generateName: 'generateUserAuditColumnDefs',\n enrichName: 'enrichUserAudit',\n baseKey: 'baseSchema',\n }),\n\n passthrough({\n modules: [CONNECTORS],\n oldName: 'assertScopeFilterSupported',\n className: 'ScopeFilterUtility',\n method: 'assertScopeFilterSupported',\n }),\n passthrough({\n modules: RELATIONAL_AND_DIALECT_MODULES,\n oldName: 'getIdType',\n className: 'RelationalEntityUtility',\n method: 'getIdType',\n }),\n passthrough({\n modules: RELATIONAL_MODULES,\n oldName: 'resolveAuditUserId',\n className: 'AuditUserResolver',\n method: 'resolveAuditUserId',\n }),\n passthrough({\n modules: RELATIONAL_AND_DIALECT_MODULES,\n oldName: 'toRelationConfigs',\n className: 'RelationDeclarations',\n method: 'toRelationConfigs',\n }),\n passthrough({\n modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],\n oldName: 'getCachedColumns',\n className: 'TableColumnCache',\n method: 'get',\n }),\n ...['isJsonPath', 'parseJsonPath', 'validateJsonPathComponents', 'validateJsonColumnType'].map(\n (oldName) =>\n passthrough({\n modules: RELATIONAL_MODULES,\n oldName,\n className: 'JsonPathUtility',\n method: oldName,\n }),\n ),\n passthrough({\n modules: [...RELATIONAL_MODULES, ...POSTGRES_MODULES],\n oldName: 'createRelations',\n className: 'RelationsFactory',\n method: 'create',\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],\n oldName: 'buildPostgresJsOptions',\n className: 'SupabasePooler',\n method: 'buildPostgresJsOptions',\n }),\n passthrough({\n modules: [`${CONNECTORS}/postgres/supabase`, `${CORE_SERVER}/postgres/supabase`],\n oldName: 'withAuthContext',\n className: 'SupabaseRls',\n method: 'withAuthContext',\n }),\n passthrough({\n modules: SEARCH_CONTROLLER_MODULES,\n oldName: 'defineSearchRouteConfigs',\n className: 'SearchControllerFactory',\n method: 'defineRouteConfigs',\n }),\n passthrough({\n modules: SEARCH_MODULES,\n oldName: 'defineSearchCollection',\n className: 'SearchCollectionFactory',\n method: 'define',\n }),\n passthrough({\n modules: SEARCH_MODULES,\n oldName: 'deriveSearchDocumentSchema',\n className: 'SearchCollectionFactory',\n method: 'deriveDocumentSchema',\n }),\n {\n modules: SEARCH_MODULES,\n oldName: 'toSearchQueryParams',\n className: 'SearchQueryParamsUtility',\n method: 'toSearchQueryParams',\n params: [{ key: 'input' }],\n },\n passthrough({\n modules: [`${CONNECTORS}/meilisearch`, `${CORE_SERVER}/meilisearch`],\n oldName: 'compileMeilisearchCollection',\n className: 'MeilisearchCollectionCompiler',\n method: 'compile',\n }),\n passthrough({\n modules: [`${CONNECTORS}/typesense`, `${CORE_SERVER}/typesense`],\n oldName: 'compileTypesenseCollection',\n className: 'TypesenseCollectionCompiler',\n method: 'compile',\n }),\n];\n"]}
@@ -0,0 +1,4 @@
1
+ import type { INamespaceMapping } from '../mapping';
2
+ /** The type guards that became static methods: the rows `devz codemod public-names` applies on its own. */
3
+ export declare const GUARD_MAPPINGS: ReadonlyArray<INamespaceMapping>;
4
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GUARD_MAPPINGS = void 0;
4
+ const connectors_1 = require("./connectors");
5
+ const helpers_1 = require("./helpers");
6
+ const inversion_1 = require("./inversion");
7
+ const kernel_1 = require("./kernel");
8
+ /** The type guards that became static methods: the rows `devz codemod public-names` applies on its own. */
9
+ exports.GUARD_MAPPINGS = [
10
+ ...inversion_1.INVERSION_GUARD_MAPPINGS,
11
+ ...helpers_1.HELPERS_GUARD_MAPPINGS,
12
+ ...kernel_1.KERNEL_GUARD_MAPPINGS,
13
+ ...connectors_1.CONNECTORS_GUARD_MAPPINGS,
14
+ ];
15
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../../../../src/cli/codemod/namespace-functions/mappings/guards.ts"],"names":[],"mappings":";;;AACA,6CAAyD;AACzD,uCAAmD;AACnD,2CAAuD;AACvD,qCAAiD;AAEjD,2GAA2G;AAC9F,QAAA,cAAc,GAAqC;IAC9D,GAAG,oCAAwB;IAC3B,GAAG,gCAAsB;IACzB,GAAG,8BAAqB;IACxB,GAAG,sCAAyB;CAC7B,CAAC","sourcesContent":["import type { INamespaceMapping } from '../mapping';\nimport { CONNECTORS_GUARD_MAPPINGS } from './connectors';\nimport { HELPERS_GUARD_MAPPINGS } from './helpers';\nimport { INVERSION_GUARD_MAPPINGS } from './inversion';\nimport { KERNEL_GUARD_MAPPINGS } from './kernel';\n\n/** The type guards that became static methods: the rows `devz codemod public-names` applies on its own. */\nexport const GUARD_MAPPINGS: ReadonlyArray<INamespaceMapping> = [\n ...INVERSION_GUARD_MAPPINGS,\n ...HELPERS_GUARD_MAPPINGS,\n ...KERNEL_GUARD_MAPPINGS,\n ...CONNECTORS_GUARD_MAPPINGS,\n];\n"]}
@@ -1,4 +1,6 @@
1
1
  import type { INamespaceMapping } from '../mapping';
2
+ /** The type guards of `@venizia/ignis-helpers`, which keep their positional argument. */
3
+ export declare const HELPERS_GUARD_MAPPINGS: ReadonlyArray<INamespaceMapping>;
2
4
  /**
3
5
  * The functions of `@venizia/ignis-helpers` that moved into a class. `modules` lists the entries the
4
6
  * old name is importable from, not the ones that only carry the class: `core.ts` names the pure
@@ -11,8 +13,7 @@ import type { INamespaceMapping } from '../mapping';
11
13
  * Not here: `createRedisHelper`. It has no one method to move to: `RedisHelperFactory.single`, `.cluster` and `.sentinel` each take
12
14
  * the options of one topology, so the call is rewritten by hand.
13
15
  *
14
- * Not here, and still functions: `isPromiseLike`, `isRedisHelper` (type guards), and
15
- * `applicationLogFormatter` (a value, not a function). `ApplicationLogger` is removed: `logger-scope.ts` moves
16
+ * Not here, and still a function or value: `applicationLogFormatter` (a value, not a function). `ApplicationLogger` is removed: `logger-scope.ts` moves
16
17
  * its calls to `LoggerFactory.getLogger([scope])`, a call on a class that no table entry can carry.
17
18
  */
18
19
  export declare const HELPERS_MAPPINGS: ReadonlyArray<INamespaceMapping>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HELPERS_MAPPINGS = void 0;
3
+ exports.HELPERS_MAPPINGS = exports.HELPERS_GUARD_MAPPINGS = void 0;
4
4
  const ROOT = '@venizia/ignis-helpers';
5
5
  const CORE = '@venizia/ignis-helpers/core';
6
6
  const COMMON = '@venizia/ignis-helpers/common';
@@ -8,6 +8,27 @@ const UUID = '@venizia/ignis-helpers/uuid';
8
8
  const PINO = '@venizia/ignis-helpers/pino';
9
9
  const WINSTON = '@venizia/ignis-helpers/winston';
10
10
  const KAFKA = '@venizia/ignis-helpers/kafka';
11
+ /** The type guards of `@venizia/ignis-helpers`, which keep their positional argument. */
12
+ exports.HELPERS_GUARD_MAPPINGS = [
13
+ {
14
+ modules: [ROOT],
15
+ oldName: 'isPromiseLike',
16
+ className: 'Execution',
17
+ method: 'isPromiseLike',
18
+ params: [],
19
+ keepsOptions: true,
20
+ isTypeGuard: true,
21
+ },
22
+ {
23
+ modules: [ROOT],
24
+ oldName: 'isRedisHelper',
25
+ className: 'AbstractRedisHelper',
26
+ method: 'isRedisHelper',
27
+ params: [],
28
+ keepsOptions: true,
29
+ isTypeGuard: true,
30
+ },
31
+ ];
11
32
  /**
12
33
  * The functions of `@venizia/ignis-helpers` that moved into a class. `modules` lists the entries the
13
34
  * old name is importable from, not the ones that only carry the class: `core.ts` names the pure
@@ -20,11 +41,11 @@ const KAFKA = '@venizia/ignis-helpers/kafka';
20
41
  * Not here: `createRedisHelper`. It has no one method to move to: `RedisHelperFactory.single`, `.cluster` and `.sentinel` each take
21
42
  * the options of one topology, so the call is rewritten by hand.
22
43
  *
23
- * Not here, and still functions: `isPromiseLike`, `isRedisHelper` (type guards), and
24
- * `applicationLogFormatter` (a value, not a function). `ApplicationLogger` is removed: `logger-scope.ts` moves
44
+ * Not here, and still a function or value: `applicationLogFormatter` (a value, not a function). `ApplicationLogger` is removed: `logger-scope.ts` moves
25
45
  * its calls to `LoggerFactory.getLogger([scope])`, a call on a class that no table entry can carry.
26
46
  */
27
47
  exports.HELPERS_MAPPINGS = [
48
+ ...exports.HELPERS_GUARD_MAPPINGS,
28
49
  // utilities/performance.utility.ts
29
50
  {
30
51
  modules: [ROOT],
@@ -197,27 +218,27 @@ exports.HELPERS_MAPPINGS = [
197
218
  method: 'getDeepProperty',
198
219
  params: [{ key: 'source' }, { key: 'path' }],
199
220
  },
200
- // utilities/sleep.utility.ts, utilities/promise.utility.ts
221
+ // utilities/sleep.utility.ts, modules/execution
201
222
  {
202
223
  modules: [ROOT],
203
224
  oldName: 'sleep',
204
- className: 'PromiseUtility',
225
+ className: 'Execution',
205
226
  method: 'sleep',
206
227
  params: [{ key: 'ms' }],
207
228
  },
208
229
  {
209
230
  modules: [ROOT],
210
231
  oldName: 'executePromiseWithLimit',
211
- className: 'PromiseUtility',
212
- method: 'executeWithLimit',
232
+ className: 'Execution',
233
+ method: 'withLimit',
213
234
  params: [],
214
235
  keepsOptions: true,
215
236
  },
216
237
  {
217
238
  modules: [ROOT],
218
239
  oldName: 'voidExecution',
219
- className: 'PromiseUtility',
220
- method: 'voidExecution',
240
+ className: 'Execution',
241
+ method: 'fireAndForget',
221
242
  params: [],
222
243
  keepsOptions: true,
223
244
  },