miniread 1.96.1 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/cli/find-input-files.d.ts +3 -4
- package/dist/cli/find-input-files.js +19 -19
- package/dist/cli/install-stdout-error-handler.js +4 -13
- package/dist/cli/parse-cli-options.d.ts +6 -0
- package/dist/cli/parse-cli-options.js +48 -0
- package/dist/cli/run-transforms.d.ts +1 -1
- package/dist/cli/run-transforms.js +23 -9
- package/dist/cli.js +102 -25
- package/dist/transforms/_generated/manifest.js +10 -38
- package/dist/transforms/_generated/registry.js +2 -12
- package/dist/transforms/dynamic-name-lookup/detect-dynamic-name-lookup.d.ts +5 -0
- package/dist/transforms/dynamic-name-lookup/detect-dynamic-name-lookup.js +18 -0
- package/dist/transforms/{shared/url/is-allowed-url-constructor-in-scope.js → is-allowed-url-constructor-in-scope.js} +1 -2
- package/dist/transforms/{shared/url/is-allowed-url-namespace-binding-in-scope.js → is-allowed-url-namespace-binding-in-scope.js} +1 -2
- package/dist/transforms/{shared/url/is-require-from-url-module.d.ts → is-require-from-url-module.d.ts} +3 -1
- package/dist/transforms/{shared/node/is-node-require-in-scope.js → is-require-from-url-module.js} +80 -0
- package/dist/transforms/recommended-transform-order.d.ts +1 -3
- package/dist/transforms/recommended-transform-order.js +2 -12
- package/dist/transforms/rename-charcode-variables-v2/manifest.json +5 -5
- package/dist/transforms/rename-charcode-variables-v2/rename-charcode-variables-v2-transform.js +1 -29
- package/dist/transforms/rename-object-property-value-variables/get-object-property-value-base-name.d.ts +2 -0
- package/dist/transforms/rename-object-property-value-variables/get-object-property-value-base-name.js +76 -0
- package/dist/transforms/rename-object-property-value-variables/manifest.json +13 -0
- package/dist/transforms/rename-object-property-value-variables/rename-object-property-value-variables-transform.d.ts +2 -0
- package/dist/transforms/rename-object-property-value-variables/rename-object-property-value-variables-transform.js +121 -0
- package/dist/transforms/rename-parameters-to-match-properties-v2/manifest.json +2 -3
- package/dist/transforms/rename-platform-win32-flags/is-safe-process-binding.js +1 -1
- package/dist/transforms/rename-safe-property-accessor-parameters/is-member-access.js +1 -1
- package/dist/transforms/rename-safe-property-accessor-parameters/is-nullish-check.js +1 -1
- package/dist/transforms/rename-safe-property-accessor-parameters/match-safe-property-accessor-factory.js +1 -1
- package/dist/transforms/rename-safe-property-accessor-parameters/unwrap-parentheses.js +7 -0
- package/dist/transforms/rename-search-parameters-variables/rename-search-parameters-variables-transform.js +2 -2
- package/dist/transforms/rename-url-parameters/rename-url-parameters-transform.js +1 -1
- package/dist/transforms/rename-url-variables/rename-url-variables-transform.js +3 -3
- package/dist/transforms/rename-worker-handles/rename-worker-handles-transform.js +1 -1
- package/dist/transforms/{rename-worker-handles → shared}/is-type-only-reference.js +2 -2
- package/dist/transforms/use-optional-chaining/is-nullish-check.js +1 -1
- package/dist/transforms/use-optional-chaining/is-undefined-expression.js +1 -1
- package/dist/transforms/use-optional-chaining/unwrap-parentheses.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cli/create-program.d.ts +0 -24
- package/dist/cli/create-program.js +0 -61
- package/dist/cli/parse-ignored-directories.d.ts +0 -1
- package/dist/cli/parse-ignored-directories.js +0 -18
- package/dist/cli/run-input-mode.d.ts +0 -14
- package/dist/cli/run-input-mode.js +0 -46
- package/dist/cli/run-stdin-mode.d.ts +0 -10
- package/dist/cli/run-stdin-mode.js +0 -22
- package/dist/cli/should-unsafe-stabilize.d.ts +0 -1
- package/dist/cli/should-unsafe-stabilize.js +0 -13
- package/dist/cli/write-transform-summaries.d.ts +0 -2
- package/dist/cli/write-transform-summaries.js +0 -18
- package/dist/transforms/rename-dirent-parameters/get-member-property-name.d.ts +0 -3
- package/dist/transforms/rename-dirent-parameters/get-member-property-name.js +0 -10
- package/dist/transforms/rename-dirent-parameters/is-dirent-callback-parameter-binding.d.ts +0 -2
- package/dist/transforms/rename-dirent-parameters/is-dirent-callback-parameter-binding.js +0 -111
- package/dist/transforms/rename-dirent-parameters/is-dirent-method-call.d.ts +0 -3
- package/dist/transforms/rename-dirent-parameters/is-dirent-method-call.js +0 -26
- package/dist/transforms/rename-dirent-parameters/manifest.json +0 -13
- package/dist/transforms/rename-dirent-parameters/rename-dirent-parameters-transform.d.ts +0 -2
- package/dist/transforms/rename-dirent-parameters/rename-dirent-parameters-transform.js +0 -70
- package/dist/transforms/rename-memoized-instance-variables/manifest.json +0 -12
- package/dist/transforms/rename-memoized-instance-variables/rename-memoized-instance-variables-transform.d.ts +0 -2
- package/dist/transforms/rename-memoized-instance-variables/rename-memoized-instance-variables-transform.js +0 -130
- package/dist/transforms/rename-parameters-to-match-properties-v3/get-assignment-property-name.d.ts +0 -2
- package/dist/transforms/rename-parameters-to-match-properties-v3/get-assignment-property-name.js +0 -33
- package/dist/transforms/rename-parameters-to-match-properties-v3/manifest.json +0 -13
- package/dist/transforms/rename-parameters-to-match-properties-v3/nullish-default-expression.d.ts +0 -3
- package/dist/transforms/rename-parameters-to-match-properties-v3/nullish-default-expression.js +0 -67
- package/dist/transforms/rename-parameters-to-match-properties-v3/rename-parameters-to-match-properties-v3-transform.d.ts +0 -2
- package/dist/transforms/rename-parameters-to-match-properties-v3/rename-parameters-to-match-properties-v3-transform.js +0 -77
- package/dist/transforms/rename-queue-entry-variables/is-property-named.d.ts +0 -2
- package/dist/transforms/rename-queue-entry-variables/is-property-named.js +0 -13
- package/dist/transforms/rename-queue-entry-variables/manifest.json +0 -13
- package/dist/transforms/rename-queue-entry-variables/rename-queue-entry-variables-transform.d.ts +0 -2
- package/dist/transforms/rename-queue-entry-variables/rename-queue-entry-variables-transform.js +0 -128
- package/dist/transforms/rename-regex-exec-results/has-match-access.d.ts +0 -2
- package/dist/transforms/rename-regex-exec-results/has-match-access.js +0 -68
- package/dist/transforms/rename-regex-exec-results/is-regex-value.d.ts +0 -3
- package/dist/transforms/rename-regex-exec-results/is-regex-value.js +0 -92
- package/dist/transforms/rename-regex-exec-results/manifest.json +0 -12
- package/dist/transforms/rename-regex-exec-results/rename-regex-exec-results-transform.d.ts +0 -2
- package/dist/transforms/rename-regex-exec-results/rename-regex-exec-results-transform.js +0 -89
- package/dist/transforms/shared/node/is-node-require-in-scope.d.ts +0 -2
- package/dist/transforms/shared/url/is-require-from-url-module.js +0 -80
- package/dist/transforms/simplify-filter-boolean-coercion/manifest.json +0 -13
- package/dist/transforms/simplify-filter-boolean-coercion/simplify-filter-boolean-coercion-transform.d.ts +0 -2
- package/dist/transforms/simplify-filter-boolean-coercion/simplify-filter-boolean-coercion-transform.js +0 -124
- /package/dist/transforms/{shared/url/get-url-construction-kind.d.ts → get-url-construction-kind.d.ts} +0 -0
- /package/dist/transforms/{shared/url/get-url-construction-kind.js → get-url-construction-kind.js} +0 -0
- /package/dist/transforms/{shared/url/is-allowed-url-constructor-in-scope.d.ts → is-allowed-url-constructor-in-scope.d.ts} +0 -0
- /package/dist/transforms/{shared/url/is-allowed-url-module-import-binding.d.ts → is-allowed-url-module-import-binding.d.ts} +0 -0
- /package/dist/transforms/{shared/url/is-allowed-url-module-import-binding.js → is-allowed-url-module-import-binding.js} +0 -0
- /package/dist/transforms/{shared/url/is-allowed-url-namespace-binding-in-scope.d.ts → is-allowed-url-namespace-binding-in-scope.d.ts} +0 -0
- /package/dist/transforms/{shared → rename-safe-property-accessor-parameters}/unwrap-parentheses.d.ts +0 -0
- /package/dist/transforms/{rename-worker-handles → shared}/is-type-only-reference.d.ts +0 -0
- /package/dist/transforms/{shared/url/url-usage-heuristics.d.ts → url-usage-heuristics.d.ts} +0 -0
- /package/dist/transforms/{shared/url/url-usage-heuristics.js → url-usage-heuristics.js} +0 -0
- /package/dist/transforms/{shared → use-optional-chaining}/unwrap-parentheses.js +0 -0
package/README.md
CHANGED
|
@@ -17,19 +17,21 @@ miniread --list-transforms
|
|
|
17
17
|
miniread --input ./minified --output ./readable --transforms recommended
|
|
18
18
|
miniread --input ./minified --output ./readable --dry-run
|
|
19
19
|
miniread --input ./minified --output ./readable --workers 8
|
|
20
|
+
miniread --input ./minified --output ./readable --ignore-dirs dist,coverage
|
|
20
21
|
miniread --input ./minified --output ./readable --safe-stabilize-top-level-bindings
|
|
21
|
-
miniread --input ./repo --output ./readable --ignore-dirs none
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
When scanning
|
|
24
|
+
When scanning input directories, `miniread` ignores common heavy folders by
|
|
25
|
+
default: `.git`, `node_modules`, `coverage`, `.next`, `.nuxt`, `dist`, `build`,
|
|
26
|
+
`out`, and `.cache`.
|
|
27
|
+
|
|
28
|
+
Use `--ignore-dirs <comma-separated-names>` to add more directory names to the
|
|
29
|
+
ignore set (matching is case-insensitive).
|
|
25
30
|
|
|
26
31
|
## Output stability
|
|
27
32
|
|
|
28
33
|
The recommended preset includes `stabilize-top-level-bindings`, which renames program-scope bindings to stable hash-based names (`$h_<hash>`). This produces deterministic output across minifier versions, making diffs more useful.
|
|
29
34
|
|
|
30
|
-
The `recommended` preset prioritizes readability and may include documented heuristics where edge-case behavioral differences are possible.
|
|
31
|
-
One example is `simplify-filter-boolean-coercion`, which matches `.filter(...)` heuristically; strict-boolean custom filter implementations can behave differently.
|
|
32
|
-
|
|
33
35
|
By default, this transform runs even when it detects code patterns (like `eval`) that could make the output non-runnable. Use `--safe-stabilize-top-level-bindings` or set `MINIREAD_UNSAFE_STABILIZE_TOP_LEVEL_BINDINGS` to a falsy value (`0`, `false`, `no`, or empty string) to skip renaming in such cases.
|
|
34
36
|
|
|
35
37
|
## Examples
|
|
@@ -9,8 +9,7 @@ type FindInputFilesError = {
|
|
|
9
9
|
errors: string[];
|
|
10
10
|
};
|
|
11
11
|
type FindInputFilesResult = FindInputFilesOk | FindInputFilesError;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export declare const findInputFiles: (input: string, options?: FindInputFilesOptions) => Promise<FindInputFilesResult>;
|
|
12
|
+
export declare const findInputFiles: (input: string, options?: {
|
|
13
|
+
ignoredDirectoryNames?: string[];
|
|
14
|
+
}) => Promise<FindInputFilesResult>;
|
|
16
15
|
export {};
|
|
@@ -7,34 +7,31 @@ const isSourceFile = (fileName) => {
|
|
|
7
7
|
fileName.endsWith(".js") ||
|
|
8
8
|
fileName.endsWith(".jsx")));
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const DEFAULT_IGNORED_DIRECTORIES = new Set([
|
|
11
11
|
".git",
|
|
12
12
|
"node_modules",
|
|
13
13
|
"coverage",
|
|
14
|
-
".turbo",
|
|
15
14
|
".next",
|
|
15
|
+
".nuxt",
|
|
16
|
+
"dist",
|
|
17
|
+
"build",
|
|
18
|
+
"out",
|
|
19
|
+
".cache",
|
|
16
20
|
]);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
for (const directoryName of directoryNames) {
|
|
20
|
-
const normalizedDirectoryName = directoryName.trim().toLowerCase();
|
|
21
|
-
if (normalizedDirectoryName === "")
|
|
22
|
-
continue;
|
|
23
|
-
normalized.add(normalizedDirectoryName);
|
|
24
|
-
}
|
|
25
|
-
return normalized;
|
|
21
|
+
const normalizeDirectoryName = (directoryName) => {
|
|
22
|
+
return directoryName.trim().toLowerCase();
|
|
26
23
|
};
|
|
27
|
-
const findAllFiles = async (directory,
|
|
24
|
+
const findAllFiles = async (directory, ignoredDirectoryNames) => {
|
|
28
25
|
const sourceFiles = [];
|
|
29
26
|
const otherFiles = [];
|
|
30
27
|
const entries = await fs.readdir(directory, { withFileTypes: true });
|
|
31
28
|
for (const entry of entries) {
|
|
29
|
+
if (entry.isDirectory() &&
|
|
30
|
+
ignoredDirectoryNames.has(normalizeDirectoryName(entry.name)))
|
|
31
|
+
continue;
|
|
32
32
|
const fullPath = path.join(directory, entry.name);
|
|
33
33
|
if (entry.isDirectory()) {
|
|
34
|
-
|
|
35
|
-
if (ignoredDirectories.has(entry.name.toLowerCase()))
|
|
36
|
-
continue;
|
|
37
|
-
const subResult = await findAllFiles(fullPath, ignoredDirectories);
|
|
34
|
+
const subResult = await findAllFiles(fullPath, ignoredDirectoryNames);
|
|
38
35
|
sourceFiles.push(...subResult.sourceFiles);
|
|
39
36
|
otherFiles.push(...subResult.otherFiles);
|
|
40
37
|
continue;
|
|
@@ -49,7 +46,11 @@ const findAllFiles = async (directory, ignoredDirectories) => {
|
|
|
49
46
|
}
|
|
50
47
|
return { sourceFiles, otherFiles };
|
|
51
48
|
};
|
|
52
|
-
export const findInputFiles = async (input, options
|
|
49
|
+
export const findInputFiles = async (input, options) => {
|
|
50
|
+
const ignoredDirectoryNames = new Set([...DEFAULT_IGNORED_DIRECTORIES].map((directoryName) => normalizeDirectoryName(directoryName)));
|
|
51
|
+
for (const directoryName of options?.ignoredDirectoryNames ?? []) {
|
|
52
|
+
ignoredDirectoryNames.add(normalizeDirectoryName(directoryName));
|
|
53
|
+
}
|
|
53
54
|
let inputStat;
|
|
54
55
|
try {
|
|
55
56
|
inputStat = await fs.stat(input);
|
|
@@ -60,10 +61,9 @@ export const findInputFiles = async (input, options = {}) => {
|
|
|
60
61
|
}
|
|
61
62
|
let sourceFilePaths;
|
|
62
63
|
let otherFilePaths;
|
|
63
|
-
const normalizedIgnoredDirectories = normalizeIgnoredDirectoryNames(options.ignoredDirectories ?? ignoredDirectoryNames);
|
|
64
64
|
try {
|
|
65
65
|
if (inputStat.isDirectory()) {
|
|
66
|
-
const allFiles = await findAllFiles(input,
|
|
66
|
+
const allFiles = await findAllFiles(input, ignoredDirectoryNames);
|
|
67
67
|
sourceFilePaths = allFiles.sourceFiles;
|
|
68
68
|
otherFilePaths = allFiles.otherFiles;
|
|
69
69
|
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
const isExpectedStdoutCloseError = (error) => {
|
|
2
|
-
if (!(error instanceof Error))
|
|
3
|
-
return false;
|
|
4
|
-
const code = "code" in error && typeof error.code === "string" ? error.code : "";
|
|
5
|
-
// Treat only broken-pipe as expected in shell pipelines (e.g. `... | head`).
|
|
6
|
-
// Other stdout errors should surface so real stream lifecycle bugs are visible.
|
|
7
|
-
return code === "EPIPE";
|
|
8
|
-
};
|
|
9
1
|
export const installStdoutErrorHandler = () => {
|
|
10
2
|
process.stdout.on("error", (error) => {
|
|
11
|
-
if (
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
process.
|
|
15
|
-
return;
|
|
3
|
+
if (error.code === "EPIPE") {
|
|
4
|
+
// Exiting immediately prevents repeated EPIPE writes in closed pipelines.
|
|
5
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
6
|
+
process.exit(0);
|
|
16
7
|
}
|
|
17
8
|
throw error;
|
|
18
9
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ListFormat = "text" | "tsv" | "json";
|
|
2
|
+
export declare const parseIgnoredDirectories: (value: string) => string[];
|
|
3
|
+
export declare const parseListFormat: (value: string) => ListFormat;
|
|
4
|
+
export declare const parsePositiveInt: (value: string) => number;
|
|
5
|
+
export declare const normalizeArgvForCommander: (argv: string[]) => string[];
|
|
6
|
+
export declare const shouldUnsafeStabilize: (safeFlag: boolean | undefined) => boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { InvalidArgumentError } from "@commander-js/extra-typings";
|
|
2
|
+
export const parseIgnoredDirectories = (value) => {
|
|
3
|
+
const items = value
|
|
4
|
+
.split(",")
|
|
5
|
+
.map((item) => item.trim())
|
|
6
|
+
.filter((item) => item.length > 0);
|
|
7
|
+
if (items.length === 0) {
|
|
8
|
+
throw new InvalidArgumentError("must contain at least one directory name");
|
|
9
|
+
}
|
|
10
|
+
return items;
|
|
11
|
+
};
|
|
12
|
+
export const parseListFormat = (value) => {
|
|
13
|
+
if (value === "text" || value === "tsv" || value === "json")
|
|
14
|
+
return value;
|
|
15
|
+
throw new InvalidArgumentError(`invalid value '${value}' (expected: text, tsv, json)`);
|
|
16
|
+
};
|
|
17
|
+
export const parsePositiveInt = (value) => {
|
|
18
|
+
const parsed = Number(value);
|
|
19
|
+
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
20
|
+
throw new InvalidArgumentError("must be a positive integer");
|
|
21
|
+
}
|
|
22
|
+
return parsed;
|
|
23
|
+
};
|
|
24
|
+
export const normalizeArgvForCommander = (argv) => {
|
|
25
|
+
// Package managers forward args as: [..., "--", "--flag"].
|
|
26
|
+
// Strip only that forwarded sentinel at argv[2], preserving legitimate values
|
|
27
|
+
// like `--input --`.
|
|
28
|
+
if (argv[2] !== "--")
|
|
29
|
+
return argv;
|
|
30
|
+
const executablePath = argv[0];
|
|
31
|
+
const scriptPath = argv[1];
|
|
32
|
+
if (executablePath === undefined || scriptPath === undefined)
|
|
33
|
+
return argv;
|
|
34
|
+
return [executablePath, scriptPath, ...argv.slice(3)];
|
|
35
|
+
};
|
|
36
|
+
const isEnvironmentFalsy = (value) => {
|
|
37
|
+
if (value === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
const trimmed = value.trim().toLowerCase();
|
|
40
|
+
return trimmed === "" || ["0", "false", "no"].includes(trimmed);
|
|
41
|
+
};
|
|
42
|
+
export const shouldUnsafeStabilize = (safeFlag) => {
|
|
43
|
+
if (safeFlag === true)
|
|
44
|
+
return false;
|
|
45
|
+
if (isEnvironmentFalsy(process.env.MINIREAD_UNSAFE_STABILIZE_TOP_LEVEL_BINDINGS))
|
|
46
|
+
return false;
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
@@ -3,11 +3,11 @@ export type RunnerOptions = {
|
|
|
3
3
|
input: string;
|
|
4
4
|
output: string;
|
|
5
5
|
transforms: Transform[];
|
|
6
|
-
ignoredDirectories?: ReadonlySet<string>;
|
|
7
6
|
transformOptions?: Record<string, unknown>;
|
|
8
7
|
dryRun: boolean;
|
|
9
8
|
workers: number;
|
|
10
9
|
overwrite: boolean;
|
|
10
|
+
ignoreDirectories?: string[];
|
|
11
11
|
verbose: boolean;
|
|
12
12
|
};
|
|
13
13
|
export type RunnerResult = {
|
|
@@ -11,8 +11,10 @@ const logVerbose = (verbose, message) => {
|
|
|
11
11
|
console.error(message);
|
|
12
12
|
};
|
|
13
13
|
export const runTransforms = async (options) => {
|
|
14
|
-
const { input, output, transforms,
|
|
15
|
-
const inputFilesResult = await findInputFiles(input, {
|
|
14
|
+
const { input, output, transforms, transformOptions = {}, dryRun, workers, overwrite, ignoreDirectories, verbose, } = options;
|
|
15
|
+
const inputFilesResult = await findInputFiles(input, {
|
|
16
|
+
ignoredDirectoryNames: ignoreDirectories,
|
|
17
|
+
});
|
|
16
18
|
if (!inputFilesResult.ok) {
|
|
17
19
|
return {
|
|
18
20
|
filesProcessed: 0,
|
|
@@ -27,13 +29,25 @@ export const runTransforms = async (options) => {
|
|
|
27
29
|
}
|
|
28
30
|
// Read all files in parallel
|
|
29
31
|
logVerbose(verbose, "Reading files...");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
let projectGraph;
|
|
33
|
+
try {
|
|
34
|
+
const readQueue = new PQueue({ concurrency: workers });
|
|
35
|
+
const parsedFiles = await Promise.all(sourceFilePaths.map((filePath) => readQueue.add(async () => {
|
|
36
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
37
|
+
return { path: filePath, content };
|
|
38
|
+
})));
|
|
39
|
+
// Build project graph (includes parsing)
|
|
40
|
+
logVerbose(verbose, "Parsing files with Babel...");
|
|
41
|
+
projectGraph = buildProjectGraph(parsedFiles);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
45
|
+
return {
|
|
46
|
+
filesProcessed: 0,
|
|
47
|
+
totalTransformations: 0,
|
|
48
|
+
errors: [message],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
37
51
|
logVerbose(verbose, `Running ${transforms.length} transform(s) with ${workers} worker(s)...`);
|
|
38
52
|
// Create a queue for parallel processing
|
|
39
53
|
const queue = new PQueue({ concurrency: workers });
|
package/dist/cli.js
CHANGED
|
@@ -1,44 +1,121 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "@commander-js/extra-typings";
|
|
2
3
|
import packageJson from "../package.json" with { type: "json" };
|
|
3
|
-
import {
|
|
4
|
+
import { getTransformsToRun, getTransformSummaries } from "./cli/config.js";
|
|
5
|
+
import { runTransforms, transformStdin } from "./cli/runner.js";
|
|
6
|
+
import { getDefaultTransformOptions } from "./core/default-transform-options.js";
|
|
4
7
|
import { installStdoutErrorHandler } from "./cli/install-stdout-error-handler.js";
|
|
5
|
-
import {
|
|
6
|
-
import { runStdinMode } from "./cli/run-stdin-mode.js";
|
|
7
|
-
import { writeTransformSummaries } from "./cli/write-transform-summaries.js";
|
|
8
|
-
const program = createProgram({
|
|
9
|
-
name: packageJson.name,
|
|
10
|
-
description: packageJson.description,
|
|
11
|
-
version: packageJson.version,
|
|
12
|
-
});
|
|
8
|
+
import { normalizeArgvForCommander, parseIgnoredDirectories, parseListFormat, parsePositiveInt, shouldUnsafeStabilize, } from "./cli/parse-cli-options.js";
|
|
13
9
|
installStdoutErrorHandler();
|
|
14
|
-
const
|
|
10
|
+
const program = new Command()
|
|
11
|
+
.name(packageJson.name)
|
|
12
|
+
.description(packageJson.description)
|
|
13
|
+
.version(packageJson.version)
|
|
14
|
+
.showHelpAfterError("(add --help for additional information)")
|
|
15
|
+
.showSuggestionAfterError()
|
|
16
|
+
.option("-v, --verbose", "Enable verbose output")
|
|
17
|
+
.option("-i, --input <path>", "Input file or directory (default: stdin)")
|
|
18
|
+
.option("-o, --output <path>", "Output directory (required when using --input)")
|
|
19
|
+
.option("-t, --transforms <list>", "Comma-separated list of transforms to run (or preset: recommended, all, none)")
|
|
20
|
+
.option("--list-transforms", "List available transforms")
|
|
21
|
+
.option("--format <format>", "Output format for --list-transforms: text, tsv, json", parseListFormat, "text")
|
|
22
|
+
.option("--dry-run", "Show what would be changed without writing files")
|
|
23
|
+
.option("-w, --workers <n>", "Number of parallel workers", parsePositiveInt, 4)
|
|
24
|
+
.option("-f, --overwrite", "Overwrite existing files in output directory")
|
|
25
|
+
.option("--ignore-dirs <list>", "Comma-separated directory names to ignore while scanning --input directories", parseIgnoredDirectories)
|
|
26
|
+
.option("--safe-stabilize-top-level-bindings", "Make stabilize-top-level-bindings bail out on dynamic-name hazards (safer; output more likely runnable)");
|
|
27
|
+
program.addHelpText("after", `
|
|
28
|
+
Examples:
|
|
29
|
+
# Read from stdin, write to stdout (filter mode)
|
|
30
|
+
cat bundle.min.js | miniread > bundle.js
|
|
31
|
+
|
|
32
|
+
# Process a directory into an output directory
|
|
33
|
+
miniread --input ./minified --output ./readable
|
|
34
|
+
|
|
35
|
+
# Use the recommended preset explicitly
|
|
36
|
+
miniread --input ./minified --output ./readable --transforms recommended
|
|
37
|
+
|
|
38
|
+
# Run all transforms (including non-recommended ones)
|
|
39
|
+
miniread --input ./minified --output ./readable --transforms all
|
|
40
|
+
|
|
41
|
+
# List available transforms (one per line)
|
|
42
|
+
miniread --list-transforms
|
|
43
|
+
|
|
44
|
+
# Pipeline example: find frequent identifiers after transforming
|
|
45
|
+
cat bundle.min.js | miniread | grep -oE '[A-Za-z_][A-Za-z0-9_]+' | sort | uniq -c | sort -rn | head -20
|
|
46
|
+
`);
|
|
47
|
+
program.parse(normalizeArgvForCommander(process.argv));
|
|
48
|
+
const options = program.opts();
|
|
15
49
|
if (options.listTransforms) {
|
|
16
|
-
|
|
50
|
+
const summaries = getTransformSummaries();
|
|
51
|
+
if (options.format === "json") {
|
|
52
|
+
process.stdout.write(JSON.stringify(summaries, undefined, 2) + "\n");
|
|
53
|
+
}
|
|
54
|
+
else if (options.format === "tsv") {
|
|
55
|
+
process.stdout.write("ID\tDESCRIPTION\tSCOPE\tPARALLELIZABLE\n");
|
|
56
|
+
for (const summary of summaries) {
|
|
57
|
+
process.stdout.write(`${summary.id}\t${summary.description}\t${summary.scope}\t${summary.parallelizable}\n`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
for (const summary of summaries) {
|
|
62
|
+
process.stdout.write(`${summary.id}\n`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
17
65
|
}
|
|
18
66
|
else if (options.input) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
process.exit(
|
|
67
|
+
if (!options.output) {
|
|
68
|
+
program.error("--output is required when using --input");
|
|
69
|
+
process.exit(1);
|
|
22
70
|
}
|
|
23
|
-
|
|
71
|
+
const transformsResult = getTransformsToRun(options.transforms);
|
|
72
|
+
if (!transformsResult.ok) {
|
|
73
|
+
program.error(transformsResult.error);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
const result = await runTransforms({
|
|
77
|
+
input: options.input,
|
|
78
|
+
output: options.output,
|
|
79
|
+
transforms: transformsResult.transforms,
|
|
80
|
+
transformOptions: {
|
|
81
|
+
...getDefaultTransformOptions(),
|
|
82
|
+
unsafeStabilizeTopLevelBindings: shouldUnsafeStabilize(options.safeStabilizeTopLevelBindings),
|
|
83
|
+
},
|
|
84
|
+
dryRun: options.dryRun ?? false,
|
|
85
|
+
workers: options.workers,
|
|
86
|
+
overwrite: options.overwrite ?? false,
|
|
87
|
+
ignoreDirectories: options.ignoreDirs,
|
|
88
|
+
verbose: options.verbose ?? false,
|
|
89
|
+
});
|
|
90
|
+
if (result.errors.length > 0) {
|
|
24
91
|
console.error("Errors:");
|
|
25
|
-
for (const error of result.
|
|
92
|
+
for (const error of result.errors) {
|
|
26
93
|
console.error(`- ${error}`);
|
|
27
94
|
}
|
|
28
95
|
console.error(`Try '${packageJson.name} --help' for details.`);
|
|
29
96
|
process.exit(1);
|
|
30
97
|
}
|
|
31
|
-
program.error(result.error);
|
|
32
|
-
}
|
|
33
|
-
else if (options.output) {
|
|
34
|
-
program.error("--output cannot be used without --input");
|
|
35
98
|
}
|
|
36
99
|
else {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
process.stdout.write(result.output);
|
|
100
|
+
if (options.output) {
|
|
101
|
+
program.error("--output cannot be used without --input");
|
|
40
102
|
}
|
|
41
|
-
|
|
42
|
-
|
|
103
|
+
const transformsResult = getTransformsToRun(options.transforms);
|
|
104
|
+
if (!transformsResult.ok) {
|
|
105
|
+
program.error(transformsResult.error);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
const result = await transformStdin({
|
|
109
|
+
transforms: transformsResult.transforms,
|
|
110
|
+
transformOptions: {
|
|
111
|
+
...getDefaultTransformOptions(),
|
|
112
|
+
unsafeStabilizeTopLevelBindings: shouldUnsafeStabilize(options.safeStabilizeTopLevelBindings),
|
|
113
|
+
},
|
|
114
|
+
verbose: options.verbose ?? false,
|
|
115
|
+
});
|
|
116
|
+
if (!result.ok) {
|
|
117
|
+
console.error(`Error: ${result.error}`);
|
|
118
|
+
process.exit(1);
|
|
43
119
|
}
|
|
120
|
+
process.stdout.write(result.output);
|
|
44
121
|
}
|
|
@@ -84,8 +84,8 @@ const manifestData = {
|
|
|
84
84
|
},
|
|
85
85
|
"rename-charcode-variables-v2": {
|
|
86
86
|
recommended: true,
|
|
87
|
-
notes: "Derives names from charCodeAt
|
|
88
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-
|
|
87
|
+
notes: "Derives names from charCodeAt argument for better stability (e.g., $charCodeAtIndex, $charCodeAtIndexPlus1).",
|
|
88
|
+
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-01-25T23:09:28.154Z", "changedLines": 238, "durationSeconds": 65.10692229200001, "stableNames": 1367 } },
|
|
89
89
|
},
|
|
90
90
|
"rename-client-aliases": {
|
|
91
91
|
recommended: true,
|
|
@@ -133,11 +133,6 @@ const manifestData = {
|
|
|
133
133
|
notes: "Auto-added by evaluation script. Measured with baseline none: 0.09%.",
|
|
134
134
|
evaluations: { "legacy:evaluation": { "evaluatedAt": "2026-01-25T19:59:48.188Z", "changedLines": 38927, "durationSeconds": 0, "stableNames": 0, "diffSizePercent": 97.80020410477378 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 97.80020410477378, "evaluatedAt": "2026-01-25T23:15:44.243Z", "changedLines": 38927, "durationSeconds": 76.61873741599999, "stableNames": 4505 } },
|
|
135
135
|
},
|
|
136
|
-
"rename-dirent-parameters": {
|
|
137
|
-
recommended: true,
|
|
138
|
-
notes: "stableNames counts unique `$...` identifiers in transformed output for this transform run, so this value can differ across transforms.",
|
|
139
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-06T21:03:02.730Z", "changedLines": 518, "durationSeconds": 177.77177340999998, "stableNames": 1360 } },
|
|
140
|
-
},
|
|
141
136
|
"rename-document-fragment-variables": {
|
|
142
137
|
recommended: true,
|
|
143
138
|
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-02T22:12:52.993Z", "changedLines": 20, "durationSeconds": 207.34089557, "stableNames": 1358 } },
|
|
@@ -223,10 +218,6 @@ const manifestData = {
|
|
|
223
218
|
notes: "Measured with baseline none: 0.00%.",
|
|
224
219
|
evaluations: { "legacy:evaluation": { "evaluatedAt": "2026-01-25T20:05:17.827Z", "changedLines": 208, "durationSeconds": 0, "stableNames": 0, "diffSizePercent": 100 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-01-25T23:22:33.139Z", "changedLines": 208, "durationSeconds": 54.654894917, "stableNames": 1358 } },
|
|
225
220
|
},
|
|
226
|
-
"rename-memoized-instance-variables": {
|
|
227
|
-
recommended: true,
|
|
228
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99246065403827, "evaluatedAt": "2026-02-06T21:01:58.503Z", "changedLines": 80, "durationSeconds": 168.58266914, "stableNames": 1359 } },
|
|
229
|
-
},
|
|
230
221
|
"rename-object-entries-parameters": {
|
|
231
222
|
recommended: true,
|
|
232
223
|
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-06T17:39:17.299Z", "changedLines": 248, "durationSeconds": 215.530500649, "stableNames": 1358 } },
|
|
@@ -244,6 +235,11 @@ const manifestData = {
|
|
|
244
235
|
notes: "Measured with baseline none: 0.01%. Added to recommended for readability.",
|
|
245
236
|
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99244056393393, "evaluatedAt": "2026-01-27T06:42:06.193Z", "changedLines": 602, "durationSeconds": 165.514278459, "stableNames": 1358 } },
|
|
246
237
|
},
|
|
238
|
+
"rename-object-property-value-variables": {
|
|
239
|
+
recommended: true,
|
|
240
|
+
notes: "Measured with baseline none: 2.11%. Added to recommended for readability.",
|
|
241
|
+
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 97.88709829422298, "evaluatedAt": "2026-02-05T19:24:46.607Z", "changedLines": 12500, "durationSeconds": 2175.358991208, "stableNames": 2608 } },
|
|
242
|
+
},
|
|
247
243
|
"rename-parameters-to-match-properties": {
|
|
248
244
|
recommended: false,
|
|
249
245
|
notes: "Superseded by rename-parameters-to-match-properties-v2.",
|
|
@@ -251,16 +247,10 @@ const manifestData = {
|
|
|
251
247
|
evaluations: { "legacy:evaluation": { "evaluatedAt": "2026-01-25T20:06:13.642Z", "changedLines": 15823, "durationSeconds": 0, "stableNames": 0, "diffSizePercent": 99.99622028196697 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99622028196697, "evaluatedAt": "2026-01-25T23:23:32.785Z", "changedLines": 15823, "durationSeconds": 56.566717458, "stableNames": 1357 } },
|
|
252
248
|
},
|
|
253
249
|
"rename-parameters-to-match-properties-v2": {
|
|
254
|
-
recommended:
|
|
250
|
+
recommended: true,
|
|
255
251
|
notes: "Extends v1 to also handle this.property = param assignments.",
|
|
256
|
-
supersededBy: "rename-parameters-to-match-properties-v3",
|
|
257
252
|
evaluations: { "legacy:evaluation": { "evaluatedAt": "2026-01-25T20:07:10.063Z", "changedLines": 20493, "durationSeconds": 0, "stableNames": 0, "diffSizePercent": 99.99244056393393 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99244056393393, "evaluatedAt": "2026-01-25T23:24:32.608Z", "changedLines": 20493, "durationSeconds": 56.743425875, "stableNames": 1357 } },
|
|
258
253
|
},
|
|
259
|
-
"rename-parameters-to-match-properties-v3": {
|
|
260
|
-
recommended: true,
|
|
261
|
-
notes: "Extends v2 to rename parameters assigned with nullish defaulting patterns.",
|
|
262
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99244056393393, "evaluatedAt": "2026-02-07T08:43:16.376Z", "changedLines": 20493, "durationSeconds": 39.466395625, "stableNames": 1357 } },
|
|
263
|
-
},
|
|
264
254
|
"rename-platform-win32-flags": {
|
|
265
255
|
recommended: true,
|
|
266
256
|
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99623032701913, "evaluatedAt": "2026-02-06T14:58:00.533Z", "changedLines": 42, "durationSeconds": 224.696743585, "stableNames": 1358 } },
|
|
@@ -285,11 +275,6 @@ const manifestData = {
|
|
|
285
275
|
notes: "Supersedes rename-promise-executor-parameters with improved error-handler detection. Intentionally self-contained (helpers duplicated) per docs/workflow.md §3.6.",
|
|
286
276
|
evaluations: { "legacy:evaluation": { "diffSizePercent": 100, "evaluatedAt": "2026-01-25T21:22:01.643Z", "changedLines": 1086, "durationSeconds": 0, "stableNames": 0 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99622028196697, "evaluatedAt": "2026-01-29T14:37:20.798Z", "changedLines": 1102, "durationSeconds": 50.116025500000006, "stableNames": 1359 } },
|
|
287
277
|
},
|
|
288
|
-
"rename-queue-entry-variables": {
|
|
289
|
-
recommended: true,
|
|
290
|
-
notes: "Measured with baseline none: 100.00%. Added to recommended for readability. Targets variables assigned from *.queue.shift()/*._queue.shift() when used as Reflect.apply(entry[0], this, entry.slice(1)).",
|
|
291
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-06T21:08:25.267Z", "changedLines": 4, "durationSeconds": 201.97470723099997, "stableNames": 1358 } },
|
|
292
|
-
},
|
|
293
278
|
"rename-queue-traversal-variables": {
|
|
294
279
|
recommended: true,
|
|
295
280
|
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-06T21:04:31.256Z", "changedLines": 38, "durationSeconds": 223.94200929, "stableNames": 1359 } },
|
|
@@ -309,10 +294,6 @@ const manifestData = {
|
|
|
309
294
|
notes: "Measured with baseline none: 0.00%. Added to recommended for readability.",
|
|
310
295
|
evaluations: { "legacy:evaluation": { "evaluatedAt": "2026-01-25T20:09:26.721Z", "changedLines": 6, "durationSeconds": 0, "stableNames": 0, "diffSizePercent": 100 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-01-25T23:27:14.483Z", "changedLines": 6, "durationSeconds": 44.636690875, "stableNames": 1358 } },
|
|
311
296
|
},
|
|
312
|
-
"rename-regex-exec-results": {
|
|
313
|
-
recommended: true,
|
|
314
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 99.99057581754784, "evaluatedAt": "2026-02-06T21:07:13.698Z", "changedLines": 518, "durationSeconds": 165.95846238399997, "stableNames": 1359 } },
|
|
315
|
-
},
|
|
316
297
|
"rename-regex-source-parameters": {
|
|
317
298
|
recommended: true,
|
|
318
299
|
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-05T18:50:18.894Z", "changedLines": 312, "durationSeconds": 224.52329859600002, "stableNames": 1357 } },
|
|
@@ -436,11 +417,6 @@ const manifestData = {
|
|
|
436
417
|
notes: "Added manually; improves readability and cleans up `expand-boolean-literals` output.",
|
|
437
418
|
evaluations: { "legacy:evaluation": { "evaluatedAt": "2026-01-25T20:20:06.368Z", "changedLines": 144, "durationSeconds": 0, "stableNames": 0, "diffSizePercent": 100 }, "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-01-25T23:39:22.996Z", "changedLines": 144, "durationSeconds": 72.027506708, "stableNames": 1357 } },
|
|
438
419
|
},
|
|
439
|
-
"simplify-filter-boolean-coercion": {
|
|
440
|
-
recommended: true,
|
|
441
|
-
notes: "Simplifies redundant boolean coercion in truthiness-based array-like .filter predicates (heuristic; strict-boolean custom filters may change behavior). Isolated evaluation can still show diffSizePercent=100 when the sampled version pair has no matching patterns.",
|
|
442
|
-
evaluations: { "claude-code-2.1.10:claude-code-2.1.11": { "diffSizePercent": 100, "evaluatedAt": "2026-02-06T13:10:57.789Z", "changedLines": 26, "durationSeconds": 350.893236945, "stableNames": 1357 } },
|
|
443
|
-
},
|
|
444
420
|
"simplify-string-trim": {
|
|
445
421
|
recommended: true,
|
|
446
422
|
notes: "Improves readability for regex-based trims; expected to be diff-neutral.",
|
|
@@ -523,7 +499,6 @@ export const recommendedTransformIds = [
|
|
|
523
499
|
"rename-char-code-at",
|
|
524
500
|
"rename-charcode-variables-v2",
|
|
525
501
|
"rename-client-aliases",
|
|
526
|
-
"rename-memoized-instance-variables",
|
|
527
502
|
"rename-comparison-flags",
|
|
528
503
|
"rename-platform-win32-flags",
|
|
529
504
|
"rename-date-now-start-times",
|
|
@@ -542,7 +517,6 @@ export const recommendedTransformIds = [
|
|
|
542
517
|
"rename-add-event-listener-parameters",
|
|
543
518
|
"rename-http-server-parameters",
|
|
544
519
|
"rename-fs-sync-variables",
|
|
545
|
-
"rename-dirent-parameters",
|
|
546
520
|
"rename-http-method-parameters",
|
|
547
521
|
"rename-interval-ids",
|
|
548
522
|
"rename-indexeddb-request-variables",
|
|
@@ -552,21 +526,20 @@ export const recommendedTransformIds = [
|
|
|
552
526
|
"rename-document-fragment-variables",
|
|
553
527
|
"rename-object-keys-variables",
|
|
554
528
|
"rename-object-keys-iterator-variables",
|
|
529
|
+
"rename-object-property-value-variables",
|
|
555
530
|
"rename-object-keys-reducer-parameters",
|
|
556
531
|
"rename-object-entries-parameters",
|
|
557
|
-
"rename-parameters-to-match-properties-
|
|
532
|
+
"rename-parameters-to-match-properties-v2",
|
|
558
533
|
"rename-invalid-parameter-arguments",
|
|
559
534
|
"rename-promise-executor-parameters-v2",
|
|
560
535
|
"rename-range-parameters",
|
|
561
536
|
"rename-read-file-lines",
|
|
562
537
|
"rename-regex-builders",
|
|
563
|
-
"rename-regex-exec-results",
|
|
564
538
|
"rename-regex-source-parameters",
|
|
565
539
|
"rename-search-parameters-variables",
|
|
566
540
|
"rename-setstate-updater-parameters",
|
|
567
541
|
"rename-file-extension-variables",
|
|
568
542
|
"rename-string-split-variables-v2",
|
|
569
|
-
"rename-queue-entry-variables",
|
|
570
543
|
"rename-this-aliases",
|
|
571
544
|
"rename-timeout-promises",
|
|
572
545
|
"rename-timeout-ids",
|
|
@@ -579,7 +552,6 @@ export const recommendedTransformIds = [
|
|
|
579
552
|
"rename-use-reference-sets",
|
|
580
553
|
"rename-worker-handles",
|
|
581
554
|
"rename-zod-check-parameters",
|
|
582
|
-
"simplify-filter-boolean-coercion",
|
|
583
555
|
"simplify-boolean-negations",
|
|
584
556
|
"simplify-string-trim",
|
|
585
557
|
"split-variable-declarations",
|
|
@@ -26,7 +26,6 @@ import { renameDefaultOptionsParametersV3Transform } from "../rename-default-opt
|
|
|
26
26
|
import { renameDeferredResolveParametersTransform } from "../rename-deferred-resolve-parameters/rename-deferred-resolve-parameters-transform.js";
|
|
27
27
|
import { renameDeferredResolveParametersV2Transform } from "../rename-deferred-resolve-parameters-v2/rename-deferred-resolve-parameters-v2-transform.js";
|
|
28
28
|
import { renameDestructuredAliasesTransform } from "../rename-destructured-aliases/rename-destructured-aliases-transform.js";
|
|
29
|
-
import { renameDirentParametersTransform } from "../rename-dirent-parameters/rename-dirent-parameters-transform.js";
|
|
30
29
|
import { renameDocumentFragmentVariablesTransform } from "../rename-document-fragment-variables/rename-document-fragment-variables-transform.js";
|
|
31
30
|
import { renameErrorFirstCallbackParametersTransform } from "../rename-error-first-callback-parameters/rename-error-first-callback-parameters-transform.js";
|
|
32
31
|
import { renameErrorFirstCallbackParametersV2Transform } from "../rename-error-first-callback-parameters-v2/rename-error-first-callback-parameters-v2-transform.js";
|
|
@@ -45,25 +44,22 @@ import { renameLoopIndexVariablesTransform } from "../rename-loop-index-variable
|
|
|
45
44
|
import { renameLoopIndexVariablesV2Transform } from "../rename-loop-index-variables-v2/rename-loop-index-variables-v2-transform.js";
|
|
46
45
|
import { renameLoopIndexVariablesV3Transform } from "../rename-loop-index-variables-v3/rename-loop-index-variables-v3-transform.js";
|
|
47
46
|
import { renameLoopLengthVariablesTransform } from "../rename-loop-length-variables/rename-loop-length-variables-transform.js";
|
|
48
|
-
import { renameMemoizedInstanceVariablesTransform } from "../rename-memoized-instance-variables/rename-memoized-instance-variables-transform.js";
|
|
49
47
|
import { renameObjectEntriesParametersTransform } from "../rename-object-entries-parameters/rename-object-entries-parameters-transform.js";
|
|
50
48
|
import { renameObjectKeysIteratorVariablesTransform } from "../rename-object-keys-iterator-variables/rename-object-keys-iterator-variables-transform.js";
|
|
51
49
|
import { renameObjectKeysReducerParametersTransform } from "../rename-object-keys-reducer-parameters/rename-object-keys-reducer-parameters-transform.js";
|
|
52
50
|
import { renameObjectKeysVariablesTransform } from "../rename-object-keys-variables/rename-object-keys-variables-transform.js";
|
|
51
|
+
import { renameObjectPropertyValueVariablesTransform } from "../rename-object-property-value-variables/rename-object-property-value-variables-transform.js";
|
|
53
52
|
import { renameParametersToMatchPropertiesTransform } from "../rename-parameters-to-match-properties/rename-parameters-to-match-properties-transform.js";
|
|
54
53
|
import { renameParametersToMatchPropertiesV2Transform } from "../rename-parameters-to-match-properties-v2/rename-parameters-to-match-properties-v2-transform.js";
|
|
55
|
-
import { renameParametersToMatchPropertiesV3Transform } from "../rename-parameters-to-match-properties-v3/rename-parameters-to-match-properties-v3-transform.js";
|
|
56
54
|
import { renamePlatformWin32FlagsTransform } from "../rename-platform-win32-flags/rename-platform-win32-flags-transform.js";
|
|
57
55
|
import { renameProcessStdoutHandlersTransform } from "../rename-process-stdout-handlers/rename-process-stdout-handlers-transform.js";
|
|
58
56
|
import { renamePromiseCatchParametersTransform } from "../rename-promise-catch-parameters/rename-promise-catch-parameters-transform.js";
|
|
59
57
|
import { renamePromiseExecutorParametersTransform } from "../rename-promise-executor-parameters/rename-promise-executor-parameters-transform.js";
|
|
60
58
|
import { renamePromiseExecutorParametersV2Transform } from "../rename-promise-executor-parameters-v2/rename-promise-executor-parameters-v2-transform.js";
|
|
61
|
-
import { renameQueueEntryVariablesTransform } from "../rename-queue-entry-variables/rename-queue-entry-variables-transform.js";
|
|
62
59
|
import { renameQueueTraversalVariablesTransform } from "../rename-queue-traversal-variables/rename-queue-traversal-variables-transform.js";
|
|
63
60
|
import { renameRangeParametersTransform } from "../rename-range-parameters/rename-range-parameters-transform.js";
|
|
64
61
|
import { renameReadFileLinesTransform } from "../rename-read-file-lines/rename-read-file-lines-transform.js";
|
|
65
62
|
import { renameRegexBuildersTransform } from "../rename-regex-builders/rename-regex-builders-transform.js";
|
|
66
|
-
import { renameRegexExecResultsTransform } from "../rename-regex-exec-results/rename-regex-exec-results-transform.js";
|
|
67
63
|
import { renameRegexSourceParametersTransform } from "../rename-regex-source-parameters/rename-regex-source-parameters-transform.js";
|
|
68
64
|
import { renameReplaceChildParametersTransform } from "../rename-replace-child-parameters/rename-replace-child-parameters-transform.js";
|
|
69
65
|
import { renameRestParametersTransform } from "../rename-rest-parameters/rename-rest-parameters-transform.js";
|
|
@@ -90,7 +86,6 @@ import { renameWorkerHandlesTransform } from "../rename-worker-handles/rename-wo
|
|
|
90
86
|
import { renameZodCheckParametersTransform } from "../rename-zod-check-parameters/rename-zod-check-parameters-transform.js";
|
|
91
87
|
import { replaceDynamicRequireEvalTransform } from "../replace-dynamic-require-eval/replace-dynamic-require-eval-transform.js";
|
|
92
88
|
import { simplifyBooleanNegationsTransform } from "../simplify-boolean-negations/simplify-boolean-negations-transform.js";
|
|
93
|
-
import { simplifyFilterBooleanCoercionTransform } from "../simplify-filter-boolean-coercion/simplify-filter-boolean-coercion-transform.js";
|
|
94
89
|
import { simplifyStringTrimTransform } from "../simplify-string-trim/simplify-string-trim-transform.js";
|
|
95
90
|
import { splitVariableDeclarationsTransform } from "../split-variable-declarations/split-variable-declarations-transform.js";
|
|
96
91
|
import { stabilizeDeferredStableRhsTransform } from "../stabilize-deferred-stable-rhs/stabilize-deferred-stable-rhs-transform.js";
|
|
@@ -127,7 +122,6 @@ export const transformRegistry = {
|
|
|
127
122
|
[renameDeferredResolveParametersTransform.id]: renameDeferredResolveParametersTransform,
|
|
128
123
|
[renameDeferredResolveParametersV2Transform.id]: renameDeferredResolveParametersV2Transform,
|
|
129
124
|
[renameDestructuredAliasesTransform.id]: renameDestructuredAliasesTransform,
|
|
130
|
-
[renameDirentParametersTransform.id]: renameDirentParametersTransform,
|
|
131
125
|
[renameDocumentFragmentVariablesTransform.id]: renameDocumentFragmentVariablesTransform,
|
|
132
126
|
[renameErrorFirstCallbackParametersTransform.id]: renameErrorFirstCallbackParametersTransform,
|
|
133
127
|
[renameErrorFirstCallbackParametersV2Transform.id]: renameErrorFirstCallbackParametersV2Transform,
|
|
@@ -146,25 +140,22 @@ export const transformRegistry = {
|
|
|
146
140
|
[renameLoopIndexVariablesV2Transform.id]: renameLoopIndexVariablesV2Transform,
|
|
147
141
|
[renameLoopIndexVariablesV3Transform.id]: renameLoopIndexVariablesV3Transform,
|
|
148
142
|
[renameLoopLengthVariablesTransform.id]: renameLoopLengthVariablesTransform,
|
|
149
|
-
[renameMemoizedInstanceVariablesTransform.id]: renameMemoizedInstanceVariablesTransform,
|
|
150
143
|
[renameObjectEntriesParametersTransform.id]: renameObjectEntriesParametersTransform,
|
|
151
144
|
[renameObjectKeysIteratorVariablesTransform.id]: renameObjectKeysIteratorVariablesTransform,
|
|
152
145
|
[renameObjectKeysReducerParametersTransform.id]: renameObjectKeysReducerParametersTransform,
|
|
153
146
|
[renameObjectKeysVariablesTransform.id]: renameObjectKeysVariablesTransform,
|
|
147
|
+
[renameObjectPropertyValueVariablesTransform.id]: renameObjectPropertyValueVariablesTransform,
|
|
154
148
|
[renameParametersToMatchPropertiesTransform.id]: renameParametersToMatchPropertiesTransform,
|
|
155
149
|
[renameParametersToMatchPropertiesV2Transform.id]: renameParametersToMatchPropertiesV2Transform,
|
|
156
|
-
[renameParametersToMatchPropertiesV3Transform.id]: renameParametersToMatchPropertiesV3Transform,
|
|
157
150
|
[renamePlatformWin32FlagsTransform.id]: renamePlatformWin32FlagsTransform,
|
|
158
151
|
[renameProcessStdoutHandlersTransform.id]: renameProcessStdoutHandlersTransform,
|
|
159
152
|
[renamePromiseCatchParametersTransform.id]: renamePromiseCatchParametersTransform,
|
|
160
153
|
[renamePromiseExecutorParametersTransform.id]: renamePromiseExecutorParametersTransform,
|
|
161
154
|
[renamePromiseExecutorParametersV2Transform.id]: renamePromiseExecutorParametersV2Transform,
|
|
162
|
-
[renameQueueEntryVariablesTransform.id]: renameQueueEntryVariablesTransform,
|
|
163
155
|
[renameQueueTraversalVariablesTransform.id]: renameQueueTraversalVariablesTransform,
|
|
164
156
|
[renameRangeParametersTransform.id]: renameRangeParametersTransform,
|
|
165
157
|
[renameReadFileLinesTransform.id]: renameReadFileLinesTransform,
|
|
166
158
|
[renameRegexBuildersTransform.id]: renameRegexBuildersTransform,
|
|
167
|
-
[renameRegexExecResultsTransform.id]: renameRegexExecResultsTransform,
|
|
168
159
|
[renameRegexSourceParametersTransform.id]: renameRegexSourceParametersTransform,
|
|
169
160
|
[renameReplaceChildParametersTransform.id]: renameReplaceChildParametersTransform,
|
|
170
161
|
[renameRestParametersTransform.id]: renameRestParametersTransform,
|
|
@@ -191,7 +182,6 @@ export const transformRegistry = {
|
|
|
191
182
|
[renameZodCheckParametersTransform.id]: renameZodCheckParametersTransform,
|
|
192
183
|
[replaceDynamicRequireEvalTransform.id]: replaceDynamicRequireEvalTransform,
|
|
193
184
|
[simplifyBooleanNegationsTransform.id]: simplifyBooleanNegationsTransform,
|
|
194
|
-
[simplifyFilterBooleanCoercionTransform.id]: simplifyFilterBooleanCoercionTransform,
|
|
195
185
|
[simplifyStringTrimTransform.id]: simplifyStringTrimTransform,
|
|
196
186
|
[splitVariableDeclarationsTransform.id]: splitVariableDeclarationsTransform,
|
|
197
187
|
[stabilizeDeferredStableRhsTransform.id]: stabilizeDeferredStableRhsTransform,
|