@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
package/README.md CHANGED
@@ -173,7 +173,7 @@ and the blank-line padding rules (`paddingConfigs`, below); `reactHouseConfigs`
173
173
  | `MaxParamsOwnRule` | `@venizia/max-params-own` | `build({ max: 5 })` | A function we write takes at most `max` positional parameters. Not counted: an inline callback passed to a call or a JSX prop, a signature a declared type fixes, a constructor whose parameters are all `@inject`. A hook callback counts. |
174
174
  | `NoNewErrorRule` | `@venizia/no-new-error` | `error` | Throw through `getError` (or an `ApplicationError`), never `new Error(...)` / `Error(...)`. Off in tests. |
175
175
  | `PreferFrameworkApiRule` | `@venizia/prefer-framework-api` | `build({ hooks: false })` in `houseConfigs`, `hooks: true` in `reactHouseConfigs` | A form the framework replaces, one row each. Anywhere in a file: `instanceof ApplicationError`, an `APP_ENV_` read of `process.env` and a comparison of `AppEnvs.get(...)` with `'true'` or `'false'` (in a package that depends on `@venizia/ignis*`), a member of `localStorage` / `sessionStorage` (`@venizia/ardor*`), a `localhost` URL used as a fallback. An assignment to a name of `process.env` and a `delete` of it pass. With `hooks`, in a component or a hook: the browser APIs `@venizia/ardor-react` wraps. Options `hooks`, `ignore` (row ids), `extra` (your rows: `{ id, match, message, dependsOn?, owner? }`, match `path`, `member`, `selector`, `literal` or `import`). Message only. Off in tests. An entry that sets options replaces the earlier ones, so state `hooks` again.. `localhost-url` skips `vite.config.*` and `.configs/builders/**`, a dev tool's own configuration |
176
- | `NamingConventionRule` (type names) | `@typescript-eslint/naming-convention` | `error` | Also: a type alias starts with `T` or ends with `Type`, and an interface starts with `I`; `ValueOf`, `ValueOptional`, `ValueOptionalExcept`, `ValueOrPromise` and `PGliteCRUDRepository` (a type that shares its name with a class value) keep their names, and so do the interfaces `declare module` adds to (`ContextRenderer`, `ContextVariableMap`, `ImportMeta`, `ImportMetaEnv`, `Matchers`, `ProcessEnv`, `Register`, `Window`), listed by name because the rule cannot see where an interface is declared. Another name passes through an `extraSelectors` entry with a `filter` and `format: null`. |
176
+ | `NamingConventionRule` (type names) | `@typescript-eslint/naming-convention` | `error` | Also: a type alias starts with `T` or ends with `Type`, and an interface starts with `I`; `ValueOptional`, `ValueOptionalExcept` and `PGliteCRUDRepository` (a type that shares its name with a class value) keep their names, and so do the interfaces `declare module` adds to (`ContextRenderer`, `ContextVariableMap`, `ImportMeta`, `ImportMetaEnv`, `Matchers`, `ProcessEnv`, `Register`, `Window`), listed by name because the rule cannot see where an interface is declared. Another name passes through an `extraSelectors` entry with a `filter` and `format: null`. |
177
177
  | `TypedRouteContextRule` | `@venizia/typed-route-context` | `error` | A route handler left unchecked: a config declared as `IAuthRouteConfig` instead of `satisfies`, `valid<T>()` on a context typed from its route, a `TContextOf` that names another route than the decorator or the handler that forwards to it. Syntax only |
178
178
  | `PreferHttpMethodRule` | `@venizia/prefer-http-method` | `error` | A method written by hand (`'get'`) in a route config, a request or a `method` / `verb` variable is `HTTP.Methods.GET`; autofix for the exact lowercase value; only in a project depending on an IGNIS package; off in tests; option `source` |
179
179
  | `ZodSchemaConventionRule` | `@venizia/zod-schema-convention` | `error` | A zod schema const is PascalCase ending in `Schema`; a type inferred from `XSchema` is `TX` or `XType` (`TXInput` / `TXOutput` for two). In every file, `z.object().strict()` is `z.strictObject()` (fixed when the call has no argument and no comment) and `.passthrough()` is refused. `.passthrough()` is reported only where the file proves the schema is zod's (a chain or a local const that starts at an import of zod), so one on an imported schema passes. In `strictPaths`, an object is `z.strictObject`; in `noAnyPaths`, no `z.any()`; in `noCoercePaths`, no `z.coerce`. Options `schemaName`, `typeName`, `strictCall`, `noPassthrough`, `strictPaths`, `noAnyPaths`, `noCoercePaths` (globs from the working directory), `ignoreTests`, `ignore` (names the two name checks leave alone). Schemas are recognised file by file, without types: an imported schema under a name that does not end in `Schema`, `this.x.extend`, a factory's result and a schema held in an object are not followed. A schema of another library imported under a name ending in `Schema` (yup, mongoose) and derived with a method of the same name (`.pick`, `.omit`, ...) is reported: list it in `ignore`. |
@@ -411,8 +411,8 @@ The codemods are `drop-redundant-casts` (removes `as X` casts the compiler no lo
411
411
  `const-classes` (turns a string-literal union into a const class), `async-style` (applies the async style
412
412
  fixers and lists the rest), `namespace-functions` (moves calls of a function that moved into a class to the
413
413
  class form), `connector-imports` (moves `@venizia/ignis/<connector sub-path>` imports to
414
- `@venizia/ignis-connectors`), `class-renames` (renames the classes IGNIS renamed, such as `RejectionHelper` to `RejectionUtility`, at the import and every use), `typed-route-context` (types a route handler's context from its route config with `TContextOf`, and drops the `valid()` type arguments there) and `env-get` (strips the type arguments of `AppEnvs.get()`
415
- for the string-reading `get()`; the receiver is a name the call's scope resolves to an import of `applicationEnvironment` or `AppEnvs` from the store module, or a const initialised from one; every other `get<...>(key)` call is listed as skipped, and a call it cannot place as manual, with its file and line) and `any-aliases` (replaces the removed `AnyType` and `AnyObject` aliases by what they stood for, `any` and `Record<string | symbol | number, any>`, so no type changes, and drops them from the imports; `--strict` writes `unknown` and `Record<string, unknown>` instead; it reads imports from `@venizia/ignis`, `-helpers`, `-inversion`, and from `@venizia/ardor` and `-kernel`, which re-exported them).
414
+ `@venizia/ignis-connectors`), `class-renames` (renames the classes IGNIS renamed, such as `RejectionHelper` to `RejectionUtility`, at the import and every use), `public-names` (renames `ValueOf` and `ValueOrPromise` to `TValueOf` and `TValueOrPromise`, `TConstructor` to `TClass` and `TAbstractConstructor` to `TAbstractClass`, and moves a call of a type guard function such as `isPromiseLike` to the static method of its class; it lists a guard used as a value for you; no `--reverse`), `typed-route-context` (types a route handler's context from its route config with `TContextOf`, and drops the `valid()` type arguments there) and `env-get` (strips the type arguments of `AppEnvs.get()`
415
+ for the string-reading `get()`; the receiver is a name the call's scope resolves to an import of `applicationEnvironment` or `AppEnvs` from the store module, or a const initialised from one; every other `get<...>(key)` call is listed as skipped, and a call it cannot place as manual, with its file and line) `function-to-arrow` (writes a `function` declaration as an arrow and lists, with the reason, each one it leaves) and `any-aliases` (replaces the removed `AnyType` and `AnyObject` aliases by what they stood for, `any` and `Record<string | symbol | number, any>`, so no type changes, and drops them from the imports; `--strict` writes `unknown` and `Record<string, unknown>` instead; it reads imports from `@venizia/ignis`, `-helpers`, `-inversion`, and from `@venizia/ardor` and `-kernel`, which re-exported them).
416
416
 
417
417
  ## Where it sits
418
418
 
@@ -0,0 +1,22 @@
1
+ import { type ICodemodRewrite } from './class-renames';
2
+ /** Removes the `asyncContext` key of an application config. */
3
+ export declare class AsyncContextRemoval {
4
+ /** Whether `object` is an application config: by another key of it, by where it stands, or by its declared type. */
5
+ private static isConfig;
6
+ static rewrite(opts: {
7
+ typescript: typeof import('typescript');
8
+ fileName: string;
9
+ source: string;
10
+ }): ICodemodRewrite;
11
+ /** The text to cut for a property: its whole line when it has one to itself, else the property and one comma. */
12
+ private static spanOf;
13
+ }
14
+ /** `devz codemod async-context`: removes the `asyncContext` key of an application config. */
15
+ export declare class AsyncContextCommand {
16
+ static readonly USAGE = "Usage: devz codemod async-context [paths...] [--write [--all] | --check]\n\nThe application config no longer has \"asyncContext\": every request is an execution frame. It removes\n\"asyncContext: { enable: ... }\" and the comment above it from an application config: an object that has another\nconfig key (such as path, port or transports), stands under \"config\", or is typed ...ApplicationConfigs. It lists by\nfile and line what it leaves for you: any other \"asyncContext\" property (a shorthand, a quoted name, a variable), an\noverride of getDefaultAsyncContextEnabled, and a read of configs.asyncContext.\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 --check dry run that exits 1 while a file would change or a line is left for you (for CI)\n --help print this text and exit\n\nThere is no --reverse: a downgrade restores the files from git.";
17
+ static run(opts: {
18
+ root: string;
19
+ args: string[];
20
+ }): Promise<number>;
21
+ }
22
+ //# sourceMappingURL=async-context.d.ts.map
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncContextCommand = exports.AsyncContextRemoval = void 0;
4
+ const class_renames_1 = require("./class-renames");
5
+ const USAGE = `Usage: devz codemod async-context [paths...] [--write [--all] | --check]
6
+
7
+ The application config no longer has "asyncContext": every request is an execution frame. It removes
8
+ "asyncContext: { enable: ... }" and the comment above it from an application config: an object that has another
9
+ config key (such as path, port or transports), stands under "config", or is typed ...ApplicationConfigs. It lists by
10
+ file and line what it leaves for you: any other "asyncContext" property (a shorthand, a quoted name, a variable), an
11
+ override of getDefaultAsyncContextEnabled, and a read of configs.asyncContext.
12
+
13
+ --write write the changed files (without it, nothing is written); it needs a path, or --all
14
+ --all with --write and no path: rewrite every source file under the working directory
15
+ --check dry run that exits 1 while a file would change or a line is left for you (for CI)
16
+ --help print this text and exit
17
+
18
+ There is no --reverse: a downgrade restores the files from git.`;
19
+ /** The keys that tell an object is an application config. */
20
+ const CONFIG_KEYS = new Set([
21
+ 'artifacts',
22
+ 'bootChecks',
23
+ 'debug',
24
+ 'error',
25
+ 'favicon',
26
+ 'host',
27
+ 'middlewares',
28
+ 'path',
29
+ 'port',
30
+ 'projectRoot',
31
+ 'server',
32
+ 'transports',
33
+ ]);
34
+ /** Removes the `asyncContext` key of an application config. */
35
+ class AsyncContextRemoval {
36
+ /** Whether `object` is an application config: by another key of it, by where it stands, or by its declared type. */
37
+ static isConfig(opts) {
38
+ const { typescript: ts, object, file } = opts;
39
+ const hasKey = object.properties.some((property) => CONFIG_KEYS.has(property.name?.getText(file) ?? ''));
40
+ const parent = object.parent;
41
+ if (hasKey ||
42
+ (ts.isPropertyAssignment(parent) && /^configs?$/.test(parent.name.getText(file)))) {
43
+ return true;
44
+ }
45
+ const isTyped = ts.isVariableDeclaration(parent) ||
46
+ ts.isSatisfiesExpression(parent) ||
47
+ ts.isAsExpression(parent);
48
+ return isTyped && (parent.type?.getText(file).includes('ApplicationConfigs') ?? false);
49
+ }
50
+ static rewrite(opts) {
51
+ const { typescript: ts, fileName, source } = opts;
52
+ const scriptKind = fileName.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS;
53
+ const file = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, scriptKind);
54
+ const removals = [];
55
+ const manual = [];
56
+ const lineOf = (node) => file.getLineAndCharacterOfPosition(node.getStart(file)).line + 1;
57
+ /** Whether `node` is `asyncContext: { enable: ... }` and nothing more. */
58
+ const isKey = (node) => {
59
+ if (!ts.isPropertyAssignment(node) || node.name.getText(file) !== 'asyncContext') {
60
+ return false;
61
+ }
62
+ const value = node.initializer;
63
+ return (ts.isObjectLiteralExpression(value) &&
64
+ value.properties.length === 1 &&
65
+ value.properties[0].name?.getText(file) === 'enable');
66
+ };
67
+ const visit = (node) => {
68
+ if (isKey(node) &&
69
+ ts.isObjectLiteralExpression(node.parent) &&
70
+ AsyncContextRemoval.isConfig({ typescript: ts, object: node.parent, file })) {
71
+ removals.push(AsyncContextRemoval.spanOf({ typescript: ts, source, node, object: node.parent, file }));
72
+ return;
73
+ }
74
+ const isProperty = (ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) &&
75
+ node.name.getText(file).replace(/['"]/g, '') === 'asyncContext';
76
+ if (isProperty) {
77
+ manual.push({
78
+ line: lineOf(node),
79
+ note: 'asyncContext is left as written: remove it if this is an application config',
80
+ });
81
+ }
82
+ if (ts.isMethodDeclaration(node) &&
83
+ node.name.getText(file) === 'getDefaultAsyncContextEnabled') {
84
+ manual.push({
85
+ line: lineOf(node),
86
+ note: 'remove the getDefaultAsyncContextEnabled override',
87
+ });
88
+ }
89
+ if (ts.isPropertyAccessExpression(node) && node.name.text === 'asyncContext') {
90
+ manual.push({ line: lineOf(node), note: 'configs.asyncContext is gone' });
91
+ }
92
+ ts.forEachChild(node, visit);
93
+ };
94
+ visit(file);
95
+ let output = source;
96
+ for (const removal of removals.sort((a, b) => b.start - a.start)) {
97
+ output = output.slice(0, removal.start) + output.slice(removal.end);
98
+ }
99
+ return { output, changed: output !== source, rewritten: removals.length, manual };
100
+ }
101
+ /** The text to cut for a property: its whole line when it has one to itself, else the property and one comma. */
102
+ static spanOf(opts) {
103
+ const { typescript: ts, source, node, object, file } = opts;
104
+ const start = node.getStart(file);
105
+ const comma = /^\s*,/.exec(source.slice(node.getEnd()));
106
+ const end = node.getEnd() + (comma?.[0].length ?? 0);
107
+ const lineStart = source.lastIndexOf('\n', start) + 1;
108
+ const rest = /^[ \t]*\r?\n/.exec(source.slice(end));
109
+ if (source.slice(lineStart, start).trim() === '' && rest) {
110
+ // The comment lines above the key describe it: they go with it.
111
+ const [comment] = ts.getLeadingCommentRanges(source, node.pos) ?? [];
112
+ const commentLine = comment ? source.lastIndexOf('\n', comment.pos) + 1 : lineStart;
113
+ const isOwnLine = comment && source.slice(commentLine, comment.pos).trim() === '';
114
+ return { start: isOwnLine ? commentLine : lineStart, end: end + rest[0].length };
115
+ }
116
+ if (object.properties.length === 1) {
117
+ return { start: object.getStart(file) + 1, end: object.getEnd() - 1 };
118
+ }
119
+ if (comma) {
120
+ return { start, end: end + (/^[ \t]*/.exec(source.slice(end))?.[0].length ?? 0) };
121
+ }
122
+ // The last member of a one-line object: the comma before it goes instead.
123
+ const before = /,\s*$/.exec(source.slice(0, start));
124
+ return { start: start - (before?.[0].length ?? 0), end };
125
+ }
126
+ }
127
+ exports.AsyncContextRemoval = AsyncContextRemoval;
128
+ /** `devz codemod async-context`: removes the `asyncContext` key of an application config. */
129
+ class AsyncContextCommand {
130
+ static { this.USAGE = USAGE; }
131
+ static run(opts) {
132
+ return class_renames_1.ClassRenamesCommand.run({
133
+ ...opts,
134
+ codemod: {
135
+ name: 'async-context',
136
+ usage: USAGE,
137
+ marks: () => ['asyncContext', 'AsyncContext'],
138
+ isReversible: false,
139
+ isRemoval: true,
140
+ rewrite: (input) => AsyncContextRemoval.rewrite(input),
141
+ },
142
+ });
143
+ }
144
+ }
145
+ exports.AsyncContextCommand = AsyncContextCommand;
146
+ //# sourceMappingURL=async-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-context.js","sourceRoot":"","sources":["../../../src/cli/codemod/async-context.ts"],"names":[],"mappings":";;;AAAA,mDAA4E;AAE5E,MAAM,KAAK,GAAG;;;;;;;;;;;;;gEAakD,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IAC/C,WAAW;IACX,YAAY;IACZ,OAAO;IACP,OAAO;IACP,SAAS;IACT,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;IACN,aAAa;IACb,QAAQ;IACR,YAAY;CACb,CAAC,CAAC;AAEH,+DAA+D;AAC/D,MAAa,mBAAmB;IAC9B,oHAAoH;IAC5G,MAAM,CAAC,QAAQ,CAAC,IAIvB;QACC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjD,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CACp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OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC;aACvD;SACF,CAAC,CAAC;IACL,CAAC;;AAfH,kDAgBC","sourcesContent":["import { ClassRenamesCommand, type ICodemodRewrite } from './class-renames';\n\nconst USAGE = `Usage: devz codemod async-context [paths...] [--write [--all] | --check]\n\nThe application config no longer has \"asyncContext\": every request is an execution frame. It removes\n\"asyncContext: { enable: ... }\" and the comment above it from an application config: an object that has another\nconfig key (such as path, port or transports), stands under \"config\", or is typed ...ApplicationConfigs. It lists by\nfile and line what it leaves for you: any other \"asyncContext\" property (a shorthand, a quoted name, a variable), an\noverride of getDefaultAsyncContextEnabled, and a read of configs.asyncContext.\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 --check dry run that exits 1 while a file would change or a line is left for you (for CI)\n --help print this text and exit\n\nThere is no --reverse: a downgrade restores the files from git.`;\n\n/** The keys that tell an object is an application config. */\nconst CONFIG_KEYS: ReadonlySet<string> = new Set([\n 'artifacts',\n 'bootChecks',\n 'debug',\n 'error',\n 'favicon',\n 'host',\n 'middlewares',\n 'path',\n 'port',\n 'projectRoot',\n 'server',\n 'transports',\n]);\n\n/** Removes the `asyncContext` key of an application config. */\nexport class AsyncContextRemoval {\n /** Whether `object` is an application config: by another key of it, by where it stands, or by its declared type. */\n private static isConfig(opts: {\n typescript: typeof import('typescript');\n object: import('typescript').ObjectLiteralExpression;\n file: import('typescript').SourceFile;\n }) {\n const { typescript: ts, object, file } = opts;\n const hasKey = object.properties.some((property) =>\n CONFIG_KEYS.has(property.name?.getText(file) ?? ''),\n );\n const parent = object.parent;\n\n if (\n hasKey ||\n (ts.isPropertyAssignment(parent) && /^configs?$/.test(parent.name.getText(file)))\n ) {\n return true;\n }\n\n const isTyped =\n ts.isVariableDeclaration(parent) ||\n ts.isSatisfiesExpression(parent) ||\n ts.isAsExpression(parent);\n\n return isTyped && (parent.type?.getText(file).includes('ApplicationConfigs') ?? false);\n }\n\n static rewrite(opts: {\n typescript: typeof import('typescript');\n fileName: string;\n source: string;\n }): ICodemodRewrite {\n const { typescript: ts, fileName, source } = 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 removals: Array<{ start: number; end: number }> = [];\n const manual: ICodemodRewrite['manual'] = [];\n const lineOf = (node: import('typescript').Node) =>\n file.getLineAndCharacterOfPosition(node.getStart(file)).line + 1;\n\n /** Whether `node` is `asyncContext: { enable: ... }` and nothing more. */\n const isKey = (node: import('typescript').Node) => {\n if (!ts.isPropertyAssignment(node) || node.name.getText(file) !== 'asyncContext') {\n return false;\n }\n\n const value = node.initializer;\n\n return (\n ts.isObjectLiteralExpression(value) &&\n value.properties.length === 1 &&\n value.properties[0].name?.getText(file) === 'enable'\n );\n };\n\n const visit = (node: import('typescript').Node): void => {\n if (\n isKey(node) &&\n ts.isObjectLiteralExpression(node.parent) &&\n AsyncContextRemoval.isConfig({ typescript: ts, object: node.parent, file })\n ) {\n removals.push(\n AsyncContextRemoval.spanOf({ typescript: ts, source, node, object: node.parent, file }),\n );\n\n return;\n }\n\n const isProperty =\n (ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) &&\n node.name.getText(file).replace(/['\"]/g, '') === 'asyncContext';\n\n if (isProperty) {\n manual.push({\n line: lineOf(node),\n note: 'asyncContext is left as written: remove it if this is an application config',\n });\n }\n\n if (\n ts.isMethodDeclaration(node) &&\n node.name.getText(file) === 'getDefaultAsyncContextEnabled'\n ) {\n manual.push({\n line: lineOf(node),\n note: 'remove the getDefaultAsyncContextEnabled override',\n });\n }\n\n if (ts.isPropertyAccessExpression(node) && node.name.text === 'asyncContext') {\n manual.push({ line: lineOf(node), note: 'configs.asyncContext is gone' });\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(file);\n\n let output = source;\n\n for (const removal of removals.sort((a, b) => b.start - a.start)) {\n output = output.slice(0, removal.start) + output.slice(removal.end);\n }\n\n return { output, changed: output !== source, rewritten: removals.length, manual };\n }\n\n /** The text to cut for a property: its whole line when it has one to itself, else the property and one comma. */\n private static spanOf(opts: {\n typescript: typeof import('typescript');\n source: string;\n node: import('typescript').Node;\n object: import('typescript').ObjectLiteralExpression;\n file: import('typescript').SourceFile;\n }) {\n const { typescript: ts, source, node, object, file } = opts;\n const start = node.getStart(file);\n const comma = /^\\s*,/.exec(source.slice(node.getEnd()));\n const end = node.getEnd() + (comma?.[0].length ?? 0);\n const lineStart = source.lastIndexOf('\\n', start) + 1;\n const rest = /^[ \\t]*\\r?\\n/.exec(source.slice(end));\n\n if (source.slice(lineStart, start).trim() === '' && rest) {\n // The comment lines above the key describe it: they go with it.\n const [comment] = ts.getLeadingCommentRanges(source, node.pos) ?? [];\n const commentLine = comment ? source.lastIndexOf('\\n', comment.pos) + 1 : lineStart;\n const isOwnLine = comment && source.slice(commentLine, comment.pos).trim() === '';\n\n return { start: isOwnLine ? commentLine : lineStart, end: end + rest[0].length };\n }\n\n if (object.properties.length === 1) {\n return { start: object.getStart(file) + 1, end: object.getEnd() - 1 };\n }\n\n if (comma) {\n return { start, end: end + (/^[ \\t]*/.exec(source.slice(end))?.[0].length ?? 0) };\n }\n\n // The last member of a one-line object: the comma before it goes instead.\n const before = /,\\s*$/.exec(source.slice(0, start));\n\n return { start: start - (before?.[0].length ?? 0), end };\n }\n}\n\n/** `devz codemod async-context`: removes the `asyncContext` key of an application config. */\nexport class AsyncContextCommand {\n static readonly USAGE = USAGE;\n\n static run(opts: { root: string; args: string[] }): Promise<number> {\n return ClassRenamesCommand.run({\n ...opts,\n codemod: {\n name: 'async-context',\n usage: USAGE,\n marks: () => ['asyncContext', 'AsyncContext'],\n isReversible: false,\n isRemoval: true,\n rewrite: (input) => AsyncContextRemoval.rewrite(input),\n },\n });\n }\n}\n"]}
@@ -3,6 +3,8 @@ export interface IClassRename {
3
3
  newName: string;
4
4
  /** The packages that export it; a module specifier is theirs when it is the package or a sub-path of it. */
5
5
  packages: ReadonlyArray<string>;
6
+ /** Static members renamed with the class: old name to new. */
7
+ members?: Readonly<Record<string, string>>;
6
8
  }
7
9
  /** The renamed classes: add a row for the next rename. */
8
10
  export declare class ClassRenameTable {
@@ -13,15 +15,68 @@ export interface IClassRenamesResult {
13
15
  changed: boolean;
14
16
  /** How many identifiers were renamed. */
15
17
  rewritten: number;
18
+ /** The imports left for a person: their name is declared again further down the file. */
19
+ manual: ICodemodRewrite['manual'];
20
+ }
21
+ /** What a codemod did to one file. */
22
+ export interface ICodemodRewrite {
23
+ output: string;
24
+ changed: boolean;
25
+ rewritten: number;
26
+ /** The lines the codemod leaves to a person. */
27
+ manual: Array<{
28
+ line: number;
29
+ note: string;
30
+ }>;
31
+ /** Lines worth a review that are no work of the codemod: `--check` does not fail on them. */
32
+ info?: Array<{
33
+ line: number;
34
+ note: string;
35
+ }>;
36
+ }
37
+ /** A codemod that runs through the command of this file: which files it reads, and what it does to one. */
38
+ export interface IFileCodemod {
39
+ name: string;
40
+ usage: string;
41
+ isReversible: boolean;
42
+ /** Whether the codemod removes the names it counts, so the summary does not say it renamed them. */
43
+ isRemoval?: boolean;
44
+ /** What the summary counts, and what a write did to it; renamed names by default. */
45
+ unit?: {
46
+ noun: string;
47
+ verb: string;
48
+ };
49
+ /** A file holding none of these is not read. */
50
+ marks: (opts: {
51
+ reverse: boolean;
52
+ }) => ReadonlyArray<string>;
53
+ rewrite: (input: {
54
+ typescript: typeof import('typescript');
55
+ fileName: string;
56
+ source: string;
57
+ reverse: boolean;
58
+ }) => ICodemodRewrite;
16
59
  }
17
60
  /** Renames the classes of `ClassRenameTable` where a file imports them. */
18
61
  export declare class ClassRenames {
62
+ private static reversed;
63
+ /** The renamed class of `ns.Class`, for the members read through a namespace import. */
64
+ private static namespaceOwner;
65
+ /** The first declaration of `name` in the file, an import included; `except` is a name that does not count. */
66
+ private static findDeclaration;
67
+ /** Whether an import of one of the row's packages already brings in the new name, under that name. */
68
+ private static importsNewName;
69
+ private static owns;
70
+ /** The edit that drops one name from the braces of an import; a left-empty import goes whole. */
71
+ private static planRemoval;
19
72
  static rewrite(opts: {
20
73
  typescript: typeof import('typescript');
21
74
  fileName: string;
22
75
  source: string;
23
76
  /** Rename the new names back to the old ones. */
24
77
  reverse?: boolean;
78
+ /** The renames to apply; the class rename table by default. */
79
+ rows?: ReadonlyArray<IClassRename>;
25
80
  }): IClassRenamesResult;
26
81
  }
27
82
  /**
@@ -31,9 +86,17 @@ export declare class ClassRenames {
31
86
  */
32
87
  export declare class ClassRenamesCommand {
33
88
  static readonly USAGE = "Usage: devz codemod class-renames [paths...] [--write [--all] | --check] [--reverse]\n\nRenames the exports IGNIS renamed, at the import and at every use in the file: the zod schemas and types renamed\nwith the naming rules (such as trackableHeaders to TrackableHeadersSchema), and the classes RetryHelper, SlugHelper\nand CredentialHelper (@venizia/ignis-helpers) become RetryUtility, SlugUtility and CredentialUtility,\nRejectionHelper and SpawnHelper (@venizia/dev-configs/testing) become RejectionUtility and SpawnUtility. One\ntable, in this file; a later rename adds a row.\n\nIt reads TypeScript files (.ts, .tsx, .mts, .cts): a named import or re-export from the package that owns\nthe class is renamed, and so is each use of the name it brought in (an aliased import, \"Old as Alias\", keeps\nits alias and changes only the imported name). A namespace import's member (\"ns.Old\") is renamed too. A .js,\n.cjs or .mjs file is not read, and neither is \"import('pkg').Old\": edit those by hand. A property or method that\nhas the same name as a class is left alone.\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 --check dry run that exits 1 while a file would change (for CI)\n --reverse rename back, for a downgrade\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 git\nknows (tracked, or untracked and not ignored), and --write refuses a file with local changes (changed since staged, or untracked): commit, stash or \"git add\" it first, so git can undo the codemod.";
89
+ /** A table of renames as a codemod under its own command name. */
90
+ static ofRows(opts: {
91
+ name: string;
92
+ usage: string;
93
+ rows: ReadonlyArray<IClassRename>;
94
+ }): IFileCodemod;
34
95
  static run(opts: {
35
96
  root: string;
36
97
  args: string[];
98
+ /** Another codemod to run this way; the class renames by default. */
99
+ codemod?: IFileCodemod;
37
100
  }): Promise<number>;
38
101
  }
39
102
  //# sourceMappingURL=class-renames.d.ts.map