@venizia/dev-configs 0.4.8-9 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"any-aliases.js","sourceRoot":"","sources":["../../../src/cli/codemod/any-aliases.ts"],"names":[],"mappings":";;;AAAA,qCAAsD;AACtD,yCAA8C;AAC9C,mCAAuC;AAEvC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEA4CkD,CAAC;AAEjE,kDAAkD;AAClD,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B;;;GAGG;AACH,MAAM,cAAc,GAAG;IACrB,gBAAgB;IAChB,wBAAwB;IACxB,0BAA0B;IAC1B,gBAAgB;IAChB,uBAAuB;CACxB,CAAC;AAEF,MAAM,YAAY,GAAG,IAAI,MAAM,CAC7B,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAC1F,CAAC;AAEF,yHAAyH;AACzH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAiB;IAC3C,CAAC,SAAS,EAAE,KAAK,CAAC;IAClB,CAAC,WAAW,EAAE,uCAAuC,CAAC;CACvD,CAAC,CAAC;AAEH,mFAAmF;AACnF,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAiB;IAClD,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,WAAW,EAAE,yBAAyB,CAAC;CACzC,CAAC,CAAC;AAEH,8HAA8H;AAC9H,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAErD,MAAM,eAAe;aACH,UAAK,GAAG,SAAS,CAAC;aAClB,QAAG,GAAG,OAAO,CAAC;aACd,UAA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c,iBAAiB,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,KAAK,WAAW,YAAY,UAAU,QAAQ;YACrN,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CACxD,CAAC;QAEF,IAAI,CAAC,OAAO,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,GAAG,CACT,uCAAuC,eAAe,CAAC,KAAK,qCAAqC,QAAQ,CAAC,CAAC,CAAC,kFAAkF,CAAC,CAAC,CAAC,EAAE,GAAG,CACvM,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,OAAO,OAAO,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;;AA3IH,8CA4IC","sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport { CodemodFiles } from './files';\n\nconst USAGE = `Usage: devz codemod any-aliases [paths...] [--strict] [--write [--all] | --check]\n\nReplaces the AnyType and AnyObject aliases the @venizia/ignis-helpers and @venizia/ignis-inversion\nreleases deleted, by what they stood for, so a bump changes no type in your code:\n\n AnyType becomes any\n AnyObject becomes Record<string | symbol | number, any>\n\nin every file that imports them from @venizia/ignis, @venizia/ignis-helpers, @venizia/ignis-inversion,\n@venizia/ardor or @venizia/ardor-kernel (ARDOR re-exported the same two names; a sub-path such as\n@venizia/ignis-helpers/common too), whatever local name the import gives them\n(import { AnyType as Loose } ...). The names leave the import, and an import left empty is dropped.\n\nWith --strict it writes the tighter types instead of the default ones, for code that wants to stop using any:\n\n AnyType becomes unknown\n AnyObject becomes Record<string, unknown>\n\n--strict surfaces errors that any hid: an unknown value cannot be read, or passed as a narrower type, without a\ncheck; an interface-typed value is not assignable to Record<string, unknown> (an interface has no implicit\nindex signature); and a symbol key on a former AnyObject fails (TS2538). Declare the shape as a type\nalias, spread the value, or narrow it; run your typecheck after it.\n--strict acts only on the alias names: a file already rewritten to any is left alone, so run it instead of\nthe default run, on a path at a time, and tighten the rest by hand.\n\nIt lists, and leaves alone:\n manual a re-export (export { AnyType }, export type { AnyObject } from ...), an import(\"...\").AnyType\n type, and AnyType in a heritage clause (extends any and extends unknown are not valid)\n local a same-named type the file declares (in any scope: a namespace, a function, a block, a type\n parameter) or imports from somewhere else; a use that such a declaration shadows is left alone\n\nA name used in a heritage clause keeps its import, and so keeps all its other uses in that file: once you\nreplace the heritage use by hand, run the codemod again and the other uses are rewritten.\n\nIt reads TypeScript files (.ts, .tsx, .mts, .cts) and is idempotent: a second run changes nothing.\n\n --strict write unknown and Record<string, unknown> instead of any\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 manual case is left (for CI)\n --help print this text and exit\n\nWith no flag it lists what would change and writes nothing. Inside a git repository it reads the files\ngit knows, and --write refuses a file with local changes: commit or stash it first, so git can undo it.\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\n/**\n * The packages the aliases were exported from, each with or without a sub-path: the IGNIS root package, helpers and\n * inversion, and the ARDOR packages that re-exported the same two names (same names, same meaning).\n */\nconst ALIAS_PACKAGES = [\n '@venizia/ignis',\n '@venizia/ignis-helpers',\n '@venizia/ignis-inversion',\n '@venizia/ardor',\n '@venizia/ardor-kernel',\n];\n\nconst ALIAS_MODULE = new RegExp(\n `^(?:${ALIAS_PACKAGES.map((name) => name.replace(/[/.-]/g, '\\\\$&')).join('|')})(?:/.*)?$`,\n);\n\n/** The deleted aliases and what each becomes by default: what they stood for, so the types of the code do not change. */\nconst REPLACEMENTS = new Map<string, string>([\n ['AnyType', 'any'],\n ['AnyObject', 'Record<string | symbol | number, any>'],\n]);\n\n/** With `--strict`: the tighter types, for code that wants to stop using `any`. */\nconst STRICT_REPLACEMENTS = new Map<string, string>([\n ['AnyType', 'unknown'],\n ['AnyObject', 'Record<string, unknown>'],\n]);\n\n/** What `AnyType` becomes in either mode: neither `extends any` nor `extends unknown` is valid, so a heritage use is left. */\nconst HERITAGE_BLOCKED = new Set(['any', 'unknown']);\n\nclass AnyAliasesFlags {\n static readonly WRITE = '--write';\n static readonly ALL = '--all';\n static readonly CHECK = '--check';\n static readonly STRICT = '--strict';\n static readonly HELP = '--help';\n static readonly HELP_SHORT = '-h';\n\n static readonly SCHEME_SET = new Set<string>([\n this.WRITE,\n this.ALL,\n this.CHECK,\n this.STRICT,\n this.HELP,\n this.HELP_SHORT,\n ]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\nexport interface IAnyAliasesResult {\n output: string;\n changed: boolean;\n /** How many type references were rewritten. */\n rewritten: number;\n /** What the codemod cannot place: file line (1-based) and why. */\n manual: Array<{ line: number; reason: string }>;\n /** Same-named types that are not the IGNIS aliases: file line (1-based) and the name. */\n local: Array<{ line: number; name: string }>;\n}\n\n/** Replaces the deleted `AnyType` and `AnyObject` aliases by what they stood for (`any`), or with `isStrict` by the tighter types. */\nexport class AnyAliases {\n static rewrite(opts: {\n typescript: typeof import('typescript');\n fileName: string;\n source: string;\n /** Write `unknown` and `Record<string, unknown>` instead of `any`. */\n isStrict?: boolean;\n }): IAnyAliasesResult {\n const { typescript: ts, fileName, source, isStrict = false } = opts;\n const replacements = isStrict ? STRICT_REPLACEMENTS : REPLACEMENTS;\n const language = fileName.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS;\n const file = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, language);\n const edits: Array<{ start: number; end: number; text: string }> = [];\n const manual: Array<{ line: number; reason: string }> = [];\n const local: Array<{ line: number; name: string }> = [];\n let rewritten = 0;\n\n const lineOf = (node: import('typescript').Node): number =>\n file.getLineAndCharacterOfPosition(node.getStart(file)).line + 1;\n\n const addReplacement = (node: import('typescript').Node, replacement: string): void => {\n edits.push({ start: node.getStart(file), end: node.getEnd(), text: replacement });\n rewritten += 1;\n };\n\n // The local names bound to an alias (name -> replacement), the namespace imports of a module that held them\n // and the names the file exports.\n const aliasNames = new Map<string, string>();\n const namespaces = new Set<string>();\n const exportedNames = new Set<string>();\n\n /**\n * Whether a declaration in a scope that encloses `node` (below the file: a namespace, a function, a block, a\n * type parameter) binds `name`, so the name there is not the file-level import. `isNamespace` is what the use needs:\n * a namespace (the left side of `H.AnyType`) rather than a type.\n */\n const isShadowed = (\n node: import('typescript').Node,\n name: string,\n isNamespace: boolean,\n ): boolean => {\n const hasInfer = (type: import('typescript').Node): boolean =>\n (ts.isInferTypeNode(type) && type.typeParameter.name.text === name) ||\n ts.forEachChild(type, (child) => (hasInfer(child) ? true : undefined)) === true;\n\n // `child` is the node the walk came from: an `infer` name is bound in the true branch of its conditional type only.\n let child: import('typescript').Node = node;\n\n for (let scope: import('typescript').Node | undefined = node.parent; scope !== undefined;) {\n if (ts.isSourceFile(scope)) {\n return false;\n }\n\n if (!isNamespace) {\n if (\n (ts.isFunctionLike(scope) ||\n ts.isClassLike(scope) ||\n ts.isInterfaceDeclaration(scope) ||\n ts.isTypeAliasDeclaration(scope)) &&\n scope.typeParameters?.some((parameter) => parameter.name.text === name)\n ) {\n return true;\n }\n\n if (ts.isMappedTypeNode(scope) && scope.typeParameter.name.text === name) {\n return true;\n }\n\n if (\n ts.isConditionalTypeNode(scope) &&\n child === scope.trueType &&\n hasInfer(scope.extendsType)\n ) {\n return true;\n }\n }\n\n if (\n ts.isBlock(scope) ||\n ts.isModuleBlock(scope) ||\n ts.isCaseClause(scope) ||\n ts.isDefaultClause(scope)\n ) {\n for (const statement of scope.statements) {\n let declared: import('typescript').Node | undefined;\n\n if (\n ts.isTypeAliasDeclaration(statement) ||\n ts.isInterfaceDeclaration(statement) ||\n ts.isClassDeclaration(statement)\n ) {\n declared = !isNamespace ? statement.name : undefined;\n } else if (ts.isEnumDeclaration(statement) || ts.isImportEqualsDeclaration(statement)) {\n declared = statement.name;\n } else if (ts.isModuleDeclaration(statement)) {\n declared = isNamespace ? statement.name : undefined;\n }\n\n if (declared !== undefined && ts.isIdentifier(declared) && declared.text === name) {\n return true;\n }\n }\n }\n\n child = scope;\n scope = scope.parent;\n }\n\n return false;\n };\n\n // `export { AnyType }` keeps the import alive: that name is left to the user (reported below).\n for (const statement of file.statements) {\n if (\n ts.isExportDeclaration(statement) &&\n statement.moduleSpecifier === undefined &&\n statement.exportClause !== undefined &&\n ts.isNamedExports(statement.exportClause)\n ) {\n for (const element of statement.exportClause.elements) {\n exportedNames.add((element.propertyName ?? element.name).text);\n }\n }\n }\n\n // `extends any`, `extends unknown` and `implements` of either are not valid TypeScript: an alias used in a heritage\n // clause whose replacement is `any` or `unknown` is left (import and references) and reported where it is used.\n const heritageBlocked = new Set<string>();\n const importedReplacement = new Map<string, string>();\n\n for (const statement of file.statements) {\n if (\n ts.isImportDeclaration(statement) &&\n ts.isStringLiteral(statement.moduleSpecifier) &&\n ALIAS_MODULE.test(statement.moduleSpecifier.text) &&\n statement.importClause?.namedBindings !== undefined &&\n ts.isNamedImports(statement.importClause.namedBindings)\n ) {\n for (const element of statement.importClause.namedBindings.elements) {\n const replacement = replacements.get((element.propertyName ?? element.name).text);\n\n if (replacement !== undefined) {\n importedReplacement.set(element.name.text, replacement);\n }\n }\n }\n }\n\n const scanHeritage = (node: import('typescript').Node): void => {\n if (\n ts.isExpressionWithTypeArguments(node) &&\n ts.isIdentifier(node.expression) &&\n HERITAGE_BLOCKED.has(importedReplacement.get(node.expression.text) ?? '') &&\n !isShadowed(node, node.expression.text, false)\n ) {\n heritageBlocked.add(node.expression.text);\n }\n\n ts.forEachChild(node, scanHeritage);\n };\n\n scanHeritage(file);\n\n const removedRanges: Array<{ start: number; end: number }> = [];\n\n // Imports: which local names are the aliases, and how each import is rewritten.\n for (const statement of file.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) {\n continue;\n }\n\n const clause = statement.importClause;\n const isAliasSource = ALIAS_MODULE.test(statement.moduleSpecifier.text);\n\n if (clause === undefined) {\n continue;\n }\n\n if (clause.namedBindings !== undefined && ts.isNamespaceImport(clause.namedBindings)) {\n if (isAliasSource) {\n namespaces.add(clause.namedBindings.name.text);\n }\n\n continue;\n }\n\n if (clause.namedBindings === undefined || !ts.isNamedImports(clause.namedBindings)) {\n if (clause.name !== undefined && replacements.has(clause.name.text) && !isAliasSource) {\n local.push({ line: lineOf(clause.name), name: clause.name.text });\n }\n\n continue;\n }\n\n const named = clause.namedBindings;\n const kept: Array<{ text: string; trailing: string }> = [];\n\n // A comment that follows an element on its line (after its comma) belongs to that element: it goes with it\n // when the element is removed, and it is not part of the next element's leading comments.\n const trailings = named.elements.map((element) => {\n const match = /^[ \\t]*,?[ \\t]*(\\/\\/[^\\r\\n]*|\\/\\*[^\\r\\n]*?\\*\\/)/.exec(\n source.slice(element.getEnd()),\n );\n\n return { comment: match?.[1] ?? '', end: element.getEnd() + (match?.[0].length ?? 0) };\n });\n\n /** An element as it is kept: its text with its own leading comments, and the comment that follows it on its line. */\n const keep = (element: import('typescript').ImportSpecifier, index: number) => {\n const previous = trailings[index - 1];\n const from =\n previous === undefined || previous.comment === ''\n ? element.getFullStart()\n : Math.max(element.getFullStart(), previous.end);\n\n kept.push({\n text: source.slice(from, element.getEnd()).trim(),\n trailing: trailings[index]?.comment ?? '',\n });\n };\n\n let removed = 0;\n\n for (const [index, element] of named.elements.entries()) {\n const imported = (element.propertyName ?? element.name).text;\n const localName = element.name.text;\n const replacement = replacements.get(imported);\n\n if (replacement === undefined) {\n keep(element, index);\n\n continue;\n }\n\n if (!isAliasSource) {\n keep(element, index);\n local.push({ line: lineOf(element), name: localName });\n\n continue;\n }\n\n if (exportedNames.has(localName)) {\n keep(element, index);\n manual.push({\n line: lineOf(element),\n reason: `${localName}${localName === imported ? '' : ` (the alias ${imported})`} is re-exported by this file: the alias is gone, export the type you meant`,\n });\n\n continue;\n }\n\n if (heritageBlocked.has(localName)) {\n keep(element, index);\n\n continue;\n }\n\n aliasNames.set(localName, replacement);\n removed += 1;\n }\n\n if (removed === 0) {\n continue;\n }\n\n if (kept.length === 0 && clause.name === undefined) {\n const start = statement.getStart(file);\n let end = statement.getEnd();\n\n if (source.startsWith('\\r\\n', end)) {\n end += 2;\n } else if (source[end] === '\\n') {\n end += 1;\n }\n\n // A blank line that only separated this import from the next code (or from the top of the file) goes with it.\n // The imports removed before this one are not there any more: a file that starts with a removed import\n // must not start with a blank line.\n let before = source.slice(0, start);\n\n for (const range of [...removedRanges].reverse()) {\n before = before.slice(0, range.start) + before.slice(range.end);\n }\n\n const isOnlyLeading = before.trim() === '' || /\\n\\s*\\n$/.test(before);\n const blank = /^[ \\t]*\\r?\\n/.exec(source.slice(end));\n\n if (isOnlyLeading && blank !== null) {\n end += blank[0].length;\n }\n\n edits.push({ start, end, text: '' });\n removedRanges.push({ start, end });\n } else if (kept.length === 0 && clause.name !== undefined) {\n // A default import stays: `import Default, { AnyType } from ...` -> `import Default from ...`.\n edits.push({ start: clause.name.getEnd(), end: named.getEnd(), text: '' });\n } else {\n const isMultiline = /\\r?\\n/.test(source.slice(named.getStart(file), named.getEnd()));\n const hasTrailingComma = named.elements.hasTrailingComma;\n const lines = kept.map((item, index) => {\n const comma = index < kept.length - 1 || hasTrailingComma ? ',' : '';\n\n return ` ${item.text}${comma}${item.trailing === '' ? '' : ` ${item.trailing}`}`;\n });\n const text = isMultiline\n ? `{\\n${lines.join('\\n')}\\n}`\n : `{ ${kept.map((item) => item.text).join(', ')} }`;\n\n edits.push({ start: named.getStart(file), end: named.getEnd(), text });\n }\n }\n\n // Declarations of a same-named type that is not an import of the aliases.\n for (const statement of file.statements) {\n if (\n (ts.isTypeAliasDeclaration(statement) ||\n ts.isInterfaceDeclaration(statement) ||\n ts.isClassDeclaration(statement) ||\n ts.isEnumDeclaration(statement)) &&\n statement.name !== undefined &&\n replacements.has(statement.name.text) &&\n !aliasNames.has(statement.name.text)\n ) {\n local.push({ line: lineOf(statement.name), name: statement.name.text });\n }\n }\n\n const visit = (node: import('typescript').Node): void => {\n // A same-named type declared below the file level (a namespace, a function, a block, a type parameter) is a\n // different type: it is listed, and the uses it shadows are left alone (see isShadowed).\n if (\n (ts.isTypeAliasDeclaration(node) ||\n ts.isInterfaceDeclaration(node) ||\n ts.isClassDeclaration(node) ||\n ts.isEnumDeclaration(node) ||\n ts.isTypeParameterDeclaration(node)) &&\n node.name !== undefined &&\n replacements.has(node.name.text) &&\n !ts.isSourceFile(node.parent)\n ) {\n local.push({ line: lineOf(node.name), name: node.name.text });\n }\n\n if (ts.isTypeReferenceNode(node) && node.typeArguments === undefined) {\n const { typeName } = node;\n const byName =\n ts.isIdentifier(typeName) && !isShadowed(node, typeName.text, false)\n ? aliasNames.get(typeName.text)\n : undefined;\n const byNamespace =\n ts.isQualifiedName(typeName) &&\n ts.isIdentifier(typeName.left) &&\n namespaces.has(typeName.left.text) &&\n !isShadowed(node, typeName.left.text, true)\n ? replacements.get(typeName.right.text)\n : undefined;\n const replacement = byName ?? byNamespace;\n\n if (replacement !== undefined) {\n addReplacement(node, replacement);\n\n return;\n }\n }\n\n if (ts.isExpressionWithTypeArguments(node) && node.typeArguments === undefined) {\n const { expression } = node;\n const byName =\n ts.isIdentifier(expression) && !isShadowed(node, expression.text, false)\n ? aliasNames.get(expression.text)\n : undefined;\n const byNamespace =\n ts.isPropertyAccessExpression(expression) &&\n ts.isIdentifier(expression.expression) &&\n namespaces.has(expression.expression.text) &&\n !isShadowed(node, expression.expression.text, true)\n ? replacements.get(expression.name.text)\n : undefined;\n const replacement = byName ?? byNamespace;\n\n if (replacement !== undefined && HERITAGE_BLOCKED.has(replacement)) {\n manual.push({\n line: lineOf(node),\n reason: `${node.getText(file)} in a heritage clause: extends any, extends unknown and implements are not valid, name the members you mean`,\n });\n\n return;\n }\n\n if (replacement !== undefined) {\n addReplacement(node, replacement);\n\n return;\n }\n\n if (\n ts.isIdentifier(expression) &&\n heritageBlocked.has(expression.text) &&\n !isShadowed(node, expression.text, false)\n ) {\n manual.push({\n line: lineOf(node),\n reason: `${expression.text} in a heritage clause: extends any, extends unknown and implements are not valid, name the members you mean`,\n });\n\n return;\n }\n }\n\n if (\n ts.isImportTypeNode(node) &&\n node.qualifier !== undefined &&\n ts.isIdentifier(node.qualifier) &&\n replacements.has(node.qualifier.text) &&\n ts.isLiteralTypeNode(node.argument) &&\n ts.isStringLiteral(node.argument.literal) &&\n ALIAS_MODULE.test(node.argument.literal.text)\n ) {\n manual.push({\n line: lineOf(node),\n reason: `import(\"${node.argument.literal.text}\").${node.qualifier.text}: replace the whole type by hand`,\n });\n }\n\n if (\n ts.isExportDeclaration(node) &&\n node.exportClause !== undefined &&\n ts.isNamedExports(node.exportClause)\n ) {\n const isIgnisSource =\n node.moduleSpecifier !== undefined &&\n ts.isStringLiteral(node.moduleSpecifier) &&\n ALIAS_MODULE.test(node.moduleSpecifier.text);\n\n for (const element of node.exportClause.elements) {\n const exported = (element.propertyName ?? element.name).text;\n\n if (replacements.has(exported) && isIgnisSource) {\n manual.push({\n line: lineOf(element),\n reason: `a re-export of ${exported}: the alias is gone, export the type you meant`,\n });\n }\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(file);\n\n if (edits.length === 0) {\n return { output: source, changed: false, rewritten: 0, manual, local };\n }\n\n let output = source;\n\n for (const edit of [...edits].sort((left, right) => right.start - left.start)) {\n output = output.slice(0, edit.start) + edit.text + output.slice(edit.end);\n }\n\n return { output, changed: output !== source, rewritten, manual, local };\n }\n}\n\n/** `devz codemod any-aliases`: reads the sources, prints what changes, writes with `--write`. */\nexport class AnyAliasesCommand {\n static readonly USAGE = USAGE;\n\n static async run(opts: { root: string; args: string[] }): Promise<number> {\n const { root, args } = opts;\n\n if (args.includes(AnyAliasesFlags.HELP) || args.includes(AnyAliasesFlags.HELP_SHORT)) {\n console.log(USAGE);\n\n return 0;\n }\n\n const flags = args.filter((argument) => argument.startsWith('-'));\n const paths = args.filter((argument) => !argument.startsWith('-'));\n const unknown = flags.filter((flag) => !AnyAliasesFlags.isValid(flag));\n\n if (unknown.length > 0) {\n console.error(\n `devz codemod: unknown option ${unknown.map((flag) => `\"${flag}\"`).join(', ')}\\n${USAGE}`,\n );\n\n return USAGE_ERROR_CODE;\n }\n\n const isWrite = flags.includes(AnyAliasesFlags.WRITE);\n const isCheck = flags.includes(AnyAliasesFlags.CHECK);\n const isStrict = flags.includes(AnyAliasesFlags.STRICT);\n\n if (isWrite && isCheck) {\n console.error(\n `devz codemod: ${AnyAliasesFlags.WRITE} and ${AnyAliasesFlags.CHECK} contradict each other\\n${USAGE}`,\n );\n\n return USAGE_ERROR_CODE;\n }\n\n const refusal = CodemodFiles.refusal({\n command: 'any-aliases',\n isWrite,\n isAll: flags.includes(AnyAliasesFlags.ALL),\n paths,\n });\n\n if (refusal) {\n console.error(`${refusal}\\n${USAGE}`);\n\n return USAGE_ERROR_CODE;\n }\n\n let typescript: typeof import('typescript');\n\n try {\n const loaded = await import('typescript');\n typescript = loaded.default;\n } catch {\n console.error('devz codemod: the \"typescript\" package is required to read your sources');\n\n return 1;\n }\n\n const targets = (paths.length > 0 ? paths : ['.']).map((path) => resolve(root, path));\n let changedCount = 0;\n let referenceCount = 0;\n let manualCount = 0;\n let localCount = 0;\n let refusedCount = 0;\n\n for (const target of targets) {\n const files = CodemodFiles.collect({ target });\n const dirty = isWrite ? CodemodFiles.dirty({ target }) : undefined;\n\n if (files.length === 0 && paths.length > 0) {\n console.warn(\n `devz codemod: no source files under \"${relative(root, target) || target}\" (git ignores the path, or it holds none): nothing was read`,\n );\n }\n\n for (const file of files) {\n const source = readFileSync(file, 'utf8');\n\n if (!/\\bAny(?:Type|Object)\\b/.test(source)) {\n continue;\n }\n\n const result = AnyAliases.rewrite({ typescript, fileName: file, source, isStrict });\n const shown = relative(root, file).split('\\\\').join('/') || file;\n\n for (const item of result.manual) {\n manualCount += 1;\n console.warn(`manual ${shown}:${item.line} ${item.reason}`);\n }\n\n for (const item of result.local) {\n localCount += 1;\n console.warn(\n `local ${shown}:${item.line} ${item.name} is not the IGNIS alias (declared here or imported from elsewhere): left alone`,\n );\n }\n\n if (!result.changed) {\n continue;\n }\n\n if (dirty?.has(file)) {\n refusedCount += 1;\n console.warn(\n `refused ${shown} has local changes (commit or stash them, then run again)`,\n );\n continue;\n }\n\n changedCount += 1;\n referenceCount += result.rewritten;\n console.log(\n `${isWrite ? 'changed' : 'would change'} ${shown} (${result.rewritten} reference(s))`,\n );\n\n if (isWrite) {\n writeFileSync(file, result.output);\n }\n }\n }\n\n console.log(\n `devz codemod any-aliases: ${changedCount} file(s) ${isWrite ? 'changed' : 'would change'}, ${referenceCount} reference(s) ${isWrite ? 'rewritten' : 'would be rewritten'}, ${manualCount} manual, ${localCount} local` +\n (refusedCount > 0 ? `, ${refusedCount} refused` : ''),\n );\n\n if (!isWrite && changedCount > 0) {\n console.log(\n `Nothing was written. Run again with ${AnyAliasesFlags.WRITE} to apply, then run your typecheck${isStrict ? ': a value an alias used to accept may need a type alias, a spread or a narrowing' : ''}.`,\n );\n }\n\n if (isWrite && refusedCount > 0) {\n return 1;\n }\n\n return isCheck && (changedCount > 0 || manualCount > 0) ? 1 : 0;\n }\n}\n"]}
@@ -0,0 +1,56 @@
1
+ export interface IEnvGetResult {
2
+ output: string;
3
+ changed: boolean;
4
+ /** How many calls were rewritten. */
5
+ rewritten: number;
6
+ /** The store calls the codemod cannot rewrite: file line (1-based), the first type argument and, when the cause is not the type argument itself, the reason. */
7
+ manual: Array<{
8
+ line: number;
9
+ type: string;
10
+ reason?: string;
11
+ }>;
12
+ /** With `--numbers`: the lines of the number reads rewritten to a transform (they are counted in `rewritten` too). */
13
+ numbered: number[];
14
+ /** The `get<...>(key)` calls on a receiver the file does not bind to the store (or through an optional chain), left alone and listed: file line (1-based) and the receiver text. */
15
+ skipped: Array<{
16
+ line: number;
17
+ receiver: string;
18
+ }>;
19
+ }
20
+ /** Rewrites the type arguments of `applicationEnvironment.get()` calls. */
21
+ export declare class EnvGet {
22
+ /** The names a declaration in `node` binds, for `node` a scope: a block or file, a function, a loop or a catch clause. */
23
+ private static declarationIn;
24
+ /**
25
+ * Whether `identifier` refers to the environment store: the binding the name resolves to, from the
26
+ * innermost scope outwards, is an import of `applicationEnvironment` or `AppEnvs` from the store module
27
+ * (aliased or not), or a `const` that is initialised from such a name. A parameter, a local, an import
28
+ * from anywhere else and a name nothing declares are not the store.
29
+ */
30
+ static isStore(opts: {
31
+ typescript: typeof import('typescript');
32
+ identifier: import('typescript').Identifier;
33
+ }): boolean;
34
+ /** The import specifier of the store that `identifier` resolves to (through const aliases), or `undefined` when it is not the store. */
35
+ static storeImport(opts: {
36
+ typescript: typeof import('typescript');
37
+ identifier: import('typescript').Identifier;
38
+ seen?: Set<import('typescript').Node>;
39
+ }): import('typescript').ImportSpecifier | undefined;
40
+ static rewrite(opts: {
41
+ typescript: typeof import('typescript');
42
+ fileName: string;
43
+ source: string;
44
+ /** `--numbers`: rewrite `get<number>(key)` and `get<number>(key, { defaultValue })` to a `ParseUtility.toNumber` transform. */
45
+ numbers?: boolean;
46
+ }): IEnvGetResult;
47
+ }
48
+ /** `devz codemod env-get [paths...] [--write | --check]`: rewrites the type arguments of `applicationEnvironment.get()`. */
49
+ export declare class EnvGetCommand {
50
+ static readonly USAGE = "Usage: devz codemod env-get [paths...] [--write [--all] | --check]\n\nRewrites the type arguments of applicationEnvironment.get() (and its alias AppEnvs.get()) for the\n@venizia/ignis-helpers release where get() reads strings:\n\n get<string>(key) becomes get(key)\n get<string | undefined>(key) becomes get(key)\n get<string>(key, { defaultValue }) becomes get(key, { defaultValue })\n get<R, B>(key, { transform }) becomes get<R>(key, { transform })\n\nAny other type argument (get<number>(key), get<boolean>(key)) was a cast the new get() no longer allows:\nthe codemod lists it as \"manual\" and leaves it. Move the conversion into a transform, or read the\nstring and convert it where you use it: get(key, { transform: Number }).\n\nA call already in the new form (one type argument and an options literal with a transform) is left alone\nand not listed, and a second run changes nothing.\n\nIt reads TypeScript files (.ts, .tsx, .mts, .cts) and rewrites only calls whose receiver resolves, from the\nscope of the call, to the store: a name imported as applicationEnvironment or AppEnvs from @venizia/ignis,\n@venizia/ignis-helpers (or a sub-path), under any local name (import { AppEnvs as Envs } ...), or a const\ninitialised from such a name in the same or an enclosing scope. A parameter, a local variable, an import from\nanywhere else (a barrel of your own included) and a name nothing declares are not the store. Every other\nget<...>(key) call (a property, an optional chain, those names) is printed as skipped with its file and line,\nand a call with a type argument it cannot place as manual, so run your typecheck after it. A call with one type argument and options\nthat are not a literal (a variable) is left alone and not listed; one with two type arguments and such options is listed as manual, and so is a number read with such options under --numbers (the codemod cannot see what the options hold). A var declared in a nested block counts as block-scoped (a hoisted one is not followed). A comment between the method name and the parenthesis is dropped. A .js, .cjs or .mjs file\nis not read: edit it by hand.\n\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 --numbers also rewrite the number reads: get<number>(key) and get<number>(key, { defaultValue }) become\n get(key, { transform: (raw) => ParseUtility.toNumber({ input: raw }), defaultValue }) and\n ParseUtility joins the import of the store. Every rewrite is listed (\"numbers\"). The old call returned\n the environment STRING typed as a number: after the rewrite the read converts it to a number, an unset\n variable still answers undefined (or the default), and a non-numeric value throws at the read\n instead of flowing on as a string. A boolean (the \"false\" string is truthy) stays manual. So does a number\n read the rewrite would not compile: a defaultValue that is a literal but not a number ('10'), options that\n are a variable, a ParseUtility name the file already declares for something else (an import from another\n module, a type-only import, a local), and a parameter or local named ParseUtility at the call.\n --check dry run that exits 1 while a file would change or a manual call remains (for CI)\n --help print this text and exit\n\nWith no flag it lists what would change and writes nothing. Inside a git repository it reads the files\ngit knows, and --write refuses a file with local changes: commit or stash it first, so git can undo it.\nThere is no --reverse: a downgrade restores the files from git.";
51
+ static run(opts: {
52
+ root: string;
53
+ args: string[];
54
+ }): Promise<number>;
55
+ }
56
+ //# sourceMappingURL=env-get.d.ts.map