miniread 1.0.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/LICENSE +21 -0
- package/README.md +86 -0
- package/bin/miniread +17 -0
- package/bin/miniread-evaluate +17 -0
- package/bin/miniread-sample +17 -0
- package/dist/cli/config.d.ts +17 -0
- package/dist/cli/config.js +85 -0
- package/dist/cli/generate-code.d.ts +2 -0
- package/dist/cli/generate-code.js +7 -0
- package/dist/cli/output.d.ts +7 -0
- package/dist/cli/output.js +119 -0
- package/dist/cli/run-transforms.d.ts +16 -0
- package/dist/cli/run-transforms.js +145 -0
- package/dist/cli/runner.d.ts +3 -0
- package/dist/cli/runner.js +2 -0
- package/dist/cli/transform-stdin.d.ts +14 -0
- package/dist/cli/transform-stdin.js +58 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +121 -0
- package/dist/core/paths.d.ts +8 -0
- package/dist/core/paths.js +9 -0
- package/dist/core/project-graph.d.ts +6 -0
- package/dist/core/project-graph.js +40 -0
- package/dist/core/types.d.ts +30 -0
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/scripts/evaluate/create-evaluate-command.d.ts +5 -0
- package/dist/scripts/evaluate/create-evaluate-command.js +47 -0
- package/dist/scripts/evaluate/diff-utilities.d.ts +17 -0
- package/dist/scripts/evaluate/diff-utilities.js +114 -0
- package/dist/scripts/evaluate/evaluation-report.d.ts +22 -0
- package/dist/scripts/evaluate/evaluation-report.js +1 -0
- package/dist/scripts/evaluate/evaluation-types.d.ts +16 -0
- package/dist/scripts/evaluate/evaluation-types.js +1 -0
- package/dist/scripts/evaluate/metrics.d.ts +3 -0
- package/dist/scripts/evaluate/metrics.js +11 -0
- package/dist/scripts/evaluate/pair-evaluator.d.ts +21 -0
- package/dist/scripts/evaluate/pair-evaluator.js +104 -0
- package/dist/scripts/evaluate/parse-evaluate-cli-options.d.ts +40 -0
- package/dist/scripts/evaluate/parse-evaluate-cli-options.js +97 -0
- package/dist/scripts/evaluate/parse-transform-manifest.d.ts +22 -0
- package/dist/scripts/evaluate/parse-transform-manifest.js +29 -0
- package/dist/scripts/evaluate/resolve-evaluate-dependencies.d.ts +9 -0
- package/dist/scripts/evaluate/resolve-evaluate-dependencies.js +66 -0
- package/dist/scripts/evaluate/run-evaluate-cli.d.ts +1 -0
- package/dist/scripts/evaluate/run-evaluate-cli.js +112 -0
- package/dist/scripts/evaluate/run-evaluations.d.ts +25 -0
- package/dist/scripts/evaluate/run-evaluations.js +50 -0
- package/dist/scripts/evaluate/run-pair-transformations.d.ts +21 -0
- package/dist/scripts/evaluate/run-pair-transformations.js +57 -0
- package/dist/scripts/evaluate/sanitize.d.ts +2 -0
- package/dist/scripts/evaluate/sanitize.js +6 -0
- package/dist/scripts/evaluate/shell-utilities.d.ts +15 -0
- package/dist/scripts/evaluate/shell-utilities.js +68 -0
- package/dist/scripts/evaluate/transform-id-set.d.ts +3 -0
- package/dist/scripts/evaluate/transform-id-set.js +29 -0
- package/dist/scripts/evaluate/transform-manifest.d.ts +13 -0
- package/dist/scripts/evaluate/transform-manifest.js +102 -0
- package/dist/scripts/evaluate/write-evaluation-stdout.d.ts +7 -0
- package/dist/scripts/evaluate/write-evaluation-stdout.js +20 -0
- package/dist/scripts/evaluate/write-text-file-atomic.d.ts +5 -0
- package/dist/scripts/evaluate/write-text-file-atomic.js +47 -0
- package/dist/scripts/evaluate.d.ts +2 -0
- package/dist/scripts/evaluate.js +13 -0
- package/dist/scripts/sample/choose-line-window.d.ts +11 -0
- package/dist/scripts/sample/choose-line-window.js +19 -0
- package/dist/scripts/sample/clip-text-around-core.d.ts +12 -0
- package/dist/scripts/sample/clip-text-around-core.js +61 -0
- package/dist/scripts/sample/collect-function-candidates.d.ts +20 -0
- package/dist/scripts/sample/collect-function-candidates.js +82 -0
- package/dist/scripts/sample/create-function-excerpt.d.ts +20 -0
- package/dist/scripts/sample/create-function-excerpt.js +37 -0
- package/dist/scripts/sample/create-sample-command.d.ts +17 -0
- package/dist/scripts/sample/create-sample-command.js +50 -0
- package/dist/scripts/sample/extract-function-samples.d.ts +31 -0
- package/dist/scripts/sample/extract-function-samples.js +105 -0
- package/dist/scripts/sample/find-source-files.d.ts +1 -0
- package/dist/scripts/sample/find-source-files.js +49 -0
- package/dist/scripts/sample/format-sample-output.d.ts +22 -0
- package/dist/scripts/sample/format-sample-output.js +29 -0
- package/dist/scripts/sample/line-offsets.d.ts +4 -0
- package/dist/scripts/sample/line-offsets.js +40 -0
- package/dist/scripts/sample/parse-sample-cli-options.d.ts +18 -0
- package/dist/scripts/sample/parse-sample-cli-options.js +36 -0
- package/dist/scripts/sample/random.d.ts +10 -0
- package/dist/scripts/sample/random.js +60 -0
- package/dist/scripts/sample/run-sample-cli.d.ts +1 -0
- package/dist/scripts/sample/run-sample-cli.js +79 -0
- package/dist/scripts/sample.d.ts +2 -0
- package/dist/scripts/sample.js +13 -0
- package/dist/transforms/add-prefix/add-prefix-transform.d.ts +2 -0
- package/dist/transforms/add-prefix/add-prefix-transform.js +40 -0
- package/dist/transforms/add-suffix/add-suffix-transform.d.ts +2 -0
- package/dist/transforms/add-suffix/add-suffix-transform.js +40 -0
- package/dist/transforms/expand-boolean-literals/expand-boolean-literals-transform.d.ts +2 -0
- package/dist/transforms/expand-boolean-literals/expand-boolean-literals-transform.js +39 -0
- package/dist/transforms/expand-undefined-literals/expand-undefined-literals-transform.d.ts +2 -0
- package/dist/transforms/expand-undefined-literals/expand-undefined-literals-transform.js +40 -0
- package/dist/transforms/rename-catch-parameters/rename-catch-parameters-transform.d.ts +2 -0
- package/dist/transforms/rename-catch-parameters/rename-catch-parameters-transform.js +67 -0
- package/dist/transforms/rename-loop-index-variables/rename-loop-index-variables-transform.d.ts +2 -0
- package/dist/transforms/rename-loop-index-variables/rename-loop-index-variables-transform.js +125 -0
- package/dist/transforms/transform-presets.d.ts +3 -0
- package/dist/transforms/transform-presets.js +19 -0
- package/dist/transforms/transform-registry.d.ts +3 -0
- package/dist/transforms/transform-registry.js +15 -0
- package/package.json +84 -0
- package/transform-manifest.json +70 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
4
|
+
const traverse = require("@babel/traverse").default;
|
|
5
|
+
const BASE_NAME = "caughtError";
|
|
6
|
+
const getRenamedAncestorCatchCount = (path, renamedCatches) => {
|
|
7
|
+
let count = 0;
|
|
8
|
+
for (const ancestor of path.getAncestry()) {
|
|
9
|
+
if (ancestor === path)
|
|
10
|
+
continue;
|
|
11
|
+
if (!ancestor.isCatchClause())
|
|
12
|
+
continue;
|
|
13
|
+
if (renamedCatches.has(ancestor.node))
|
|
14
|
+
count++;
|
|
15
|
+
}
|
|
16
|
+
return count;
|
|
17
|
+
};
|
|
18
|
+
const getTargetCaughtErrorName = (renamedAncestorCatchCount) => {
|
|
19
|
+
if (renamedAncestorCatchCount === 0)
|
|
20
|
+
return BASE_NAME;
|
|
21
|
+
return `${BASE_NAME}${renamedAncestorCatchCount + 1}`;
|
|
22
|
+
};
|
|
23
|
+
const getCatchParameterNameIfEligible = (path) => {
|
|
24
|
+
const parameter = path.node.param;
|
|
25
|
+
if (!parameter)
|
|
26
|
+
return;
|
|
27
|
+
if (parameter.type !== "Identifier")
|
|
28
|
+
return;
|
|
29
|
+
if (parameter.name.length > 2)
|
|
30
|
+
return;
|
|
31
|
+
return parameter.name;
|
|
32
|
+
};
|
|
33
|
+
export const renameCatchParametersTransform = {
|
|
34
|
+
id: "rename-catch-parameters",
|
|
35
|
+
description: "Renames minified catch clause parameters to caughtError/caughtError2/...",
|
|
36
|
+
scope: "file",
|
|
37
|
+
parallelizable: true,
|
|
38
|
+
transform(context) {
|
|
39
|
+
const { projectGraph } = context;
|
|
40
|
+
let nodesVisited = 0;
|
|
41
|
+
let transformationsApplied = 0;
|
|
42
|
+
for (const [, fileInfo] of projectGraph.files) {
|
|
43
|
+
const renamedCatches = new WeakMap();
|
|
44
|
+
traverse(fileInfo.ast, {
|
|
45
|
+
CatchClause(path) {
|
|
46
|
+
nodesVisited++;
|
|
47
|
+
const currentName = getCatchParameterNameIfEligible(path);
|
|
48
|
+
if (!currentName)
|
|
49
|
+
return;
|
|
50
|
+
const renamedAncestorCatchCount = getRenamedAncestorCatchCount(path, renamedCatches);
|
|
51
|
+
const targetName = getTargetCaughtErrorName(renamedAncestorCatchCount);
|
|
52
|
+
if (currentName === targetName)
|
|
53
|
+
return;
|
|
54
|
+
if (path.scope.hasBinding(targetName))
|
|
55
|
+
return;
|
|
56
|
+
path.scope.rename(currentName, targetName);
|
|
57
|
+
renamedCatches.set(path.node, targetName);
|
|
58
|
+
transformationsApplied++;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return Promise.resolve({
|
|
63
|
+
nodesVisited,
|
|
64
|
+
transformationsApplied,
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
4
|
+
const traverse = require("@babel/traverse").default;
|
|
5
|
+
const getRenamedAncestorLoopCount = (path, renamedLoops) => {
|
|
6
|
+
let count = 0;
|
|
7
|
+
for (const ancestor of path.getAncestry()) {
|
|
8
|
+
if (ancestor === path)
|
|
9
|
+
continue;
|
|
10
|
+
if (!ancestor.isForStatement())
|
|
11
|
+
continue;
|
|
12
|
+
if (renamedLoops.has(ancestor.node))
|
|
13
|
+
count++;
|
|
14
|
+
}
|
|
15
|
+
return count;
|
|
16
|
+
};
|
|
17
|
+
const getTargetIndexName = (renamedAncestorLoopCount) => {
|
|
18
|
+
if (renamedAncestorLoopCount === 0)
|
|
19
|
+
return "index";
|
|
20
|
+
return `index${renamedAncestorLoopCount + 1}`;
|
|
21
|
+
};
|
|
22
|
+
const getLoopCounterNameIfEligible = (path) => {
|
|
23
|
+
const init = path.node.init;
|
|
24
|
+
if (!init)
|
|
25
|
+
return;
|
|
26
|
+
if (init.type !== "VariableDeclaration")
|
|
27
|
+
return;
|
|
28
|
+
if (init.kind !== "let")
|
|
29
|
+
return;
|
|
30
|
+
if (init.declarations.length !== 1)
|
|
31
|
+
return;
|
|
32
|
+
const declarator = init.declarations[0];
|
|
33
|
+
if (!declarator)
|
|
34
|
+
return;
|
|
35
|
+
if (declarator.id.type !== "Identifier")
|
|
36
|
+
return;
|
|
37
|
+
if (!declarator.init)
|
|
38
|
+
return;
|
|
39
|
+
if (declarator.init.type !== "NumericLiteral")
|
|
40
|
+
return;
|
|
41
|
+
if (declarator.init.value !== 0)
|
|
42
|
+
return;
|
|
43
|
+
const loopCounterName = declarator.id.name;
|
|
44
|
+
const test = path.node.test;
|
|
45
|
+
if (!test)
|
|
46
|
+
return;
|
|
47
|
+
if (test.type !== "BinaryExpression")
|
|
48
|
+
return;
|
|
49
|
+
if (test.operator !== "<" && test.operator !== "<=")
|
|
50
|
+
return;
|
|
51
|
+
if (test.left.type !== "Identifier")
|
|
52
|
+
return;
|
|
53
|
+
if (test.left.name !== loopCounterName)
|
|
54
|
+
return;
|
|
55
|
+
if (test.right.type !== "MemberExpression")
|
|
56
|
+
return;
|
|
57
|
+
if (test.right.computed)
|
|
58
|
+
return;
|
|
59
|
+
if (test.right.property.type !== "Identifier")
|
|
60
|
+
return;
|
|
61
|
+
if (test.right.property.name !== "length")
|
|
62
|
+
return;
|
|
63
|
+
const update = path.node.update;
|
|
64
|
+
if (!update)
|
|
65
|
+
return;
|
|
66
|
+
if (update.type === "UpdateExpression") {
|
|
67
|
+
if (update.operator !== "++")
|
|
68
|
+
return;
|
|
69
|
+
if (update.argument.type !== "Identifier")
|
|
70
|
+
return;
|
|
71
|
+
if (update.argument.name !== loopCounterName)
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
else if (update.type === "AssignmentExpression") {
|
|
75
|
+
if (update.operator !== "+=")
|
|
76
|
+
return;
|
|
77
|
+
if (update.left.type !== "Identifier")
|
|
78
|
+
return;
|
|
79
|
+
if (update.left.name !== loopCounterName)
|
|
80
|
+
return;
|
|
81
|
+
if (update.right.type !== "NumericLiteral")
|
|
82
|
+
return;
|
|
83
|
+
if (update.right.value <= 0)
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
return loopCounterName;
|
|
90
|
+
};
|
|
91
|
+
export const renameLoopIndexVariablesTransform = {
|
|
92
|
+
id: "rename-loop-index-variables",
|
|
93
|
+
description: "Renames numeric for-loop counters to index/index2/... based on nesting depth",
|
|
94
|
+
scope: "file",
|
|
95
|
+
parallelizable: true,
|
|
96
|
+
transform(context) {
|
|
97
|
+
const { projectGraph } = context;
|
|
98
|
+
let nodesVisited = 0;
|
|
99
|
+
let transformationsApplied = 0;
|
|
100
|
+
for (const [, fileInfo] of projectGraph.files) {
|
|
101
|
+
const renamedLoops = new WeakMap();
|
|
102
|
+
traverse(fileInfo.ast, {
|
|
103
|
+
ForStatement(path) {
|
|
104
|
+
nodesVisited++;
|
|
105
|
+
const loopCounterName = getLoopCounterNameIfEligible(path);
|
|
106
|
+
if (!loopCounterName)
|
|
107
|
+
return;
|
|
108
|
+
const renamedAncestorLoopCount = getRenamedAncestorLoopCount(path, renamedLoops);
|
|
109
|
+
const targetName = getTargetIndexName(renamedAncestorLoopCount);
|
|
110
|
+
if (loopCounterName === targetName)
|
|
111
|
+
return;
|
|
112
|
+
if (path.scope.hasBinding(targetName))
|
|
113
|
+
return;
|
|
114
|
+
path.scope.rename(loopCounterName, targetName);
|
|
115
|
+
renamedLoops.set(path.node, targetName);
|
|
116
|
+
transformationsApplied++;
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return Promise.resolve({
|
|
121
|
+
nodesVisited,
|
|
122
|
+
transformationsApplied,
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import transformManifestJson from "../../transform-manifest.json" with { type: "json" };
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
const TransformManifestEntry = z
|
|
4
|
+
.object({
|
|
5
|
+
id: z.string().min(1),
|
|
6
|
+
enabledByDefault: z.boolean(),
|
|
7
|
+
})
|
|
8
|
+
.loose();
|
|
9
|
+
const TransformManifest = z
|
|
10
|
+
.object({
|
|
11
|
+
transforms: z.array(TransformManifestEntry),
|
|
12
|
+
})
|
|
13
|
+
.loose();
|
|
14
|
+
const transformManifest = TransformManifest.parse(transformManifestJson);
|
|
15
|
+
export const transformPresets = {
|
|
16
|
+
recommended: transformManifest.transforms
|
|
17
|
+
.filter((transform) => transform.enabledByDefault)
|
|
18
|
+
.map((transform) => transform.id),
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { addPrefixTransform } from "./add-prefix/add-prefix-transform.js";
|
|
2
|
+
import { addSuffixTransform } from "./add-suffix/add-suffix-transform.js";
|
|
3
|
+
import { expandBooleanLiteralsTransform } from "./expand-boolean-literals/expand-boolean-literals-transform.js";
|
|
4
|
+
import { expandUndefinedLiteralsTransform } from "./expand-undefined-literals/expand-undefined-literals-transform.js";
|
|
5
|
+
import { renameCatchParametersTransform } from "./rename-catch-parameters/rename-catch-parameters-transform.js";
|
|
6
|
+
import { renameLoopIndexVariablesTransform } from "./rename-loop-index-variables/rename-loop-index-variables-transform.js";
|
|
7
|
+
export const transformRegistry = {
|
|
8
|
+
[addPrefixTransform.id]: addPrefixTransform,
|
|
9
|
+
[addSuffixTransform.id]: addSuffixTransform,
|
|
10
|
+
[expandBooleanLiteralsTransform.id]: expandBooleanLiteralsTransform,
|
|
11
|
+
[expandUndefinedLiteralsTransform.id]: expandUndefinedLiteralsTransform,
|
|
12
|
+
[renameCatchParametersTransform.id]: renameCatchParametersTransform,
|
|
13
|
+
[renameLoopIndexVariablesTransform.id]: renameLoopIndexVariablesTransform,
|
|
14
|
+
};
|
|
15
|
+
export const allTransformIds = Object.keys(transformRegistry);
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "miniread",
|
|
3
|
+
"author": "Łukasz Jerciński",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Transform minified JavaScript/TypeScript into a more readable form using deterministic AST-based transforms.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Jercik/miniread.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Jercik/miniread#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Jercik/miniread/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"miniread": "bin/miniread",
|
|
26
|
+
"miniread-evaluate": "bin/miniread-evaluate",
|
|
27
|
+
"miniread-sample": "bin/miniread-sample"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin/",
|
|
31
|
+
"dist/",
|
|
32
|
+
"transform-manifest.json",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"keywords": [],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22.14.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@babel/generator": "^7.28.6",
|
|
42
|
+
"@babel/parser": "^7.28.6",
|
|
43
|
+
"@babel/traverse": "^7.28.6",
|
|
44
|
+
"@babel/types": "^7.28.6",
|
|
45
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
46
|
+
"commander": "^14.0.2",
|
|
47
|
+
"env-paths": "^3.0.0",
|
|
48
|
+
"p-queue": "^9.1.0",
|
|
49
|
+
"zod": "^4.3.5"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
53
|
+
"@types/babel__generator": "^7.27.0",
|
|
54
|
+
"@types/babel__traverse": "^7.28.0",
|
|
55
|
+
"@types/node": "^25.0.9",
|
|
56
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
57
|
+
"eslint": "^9.39.2",
|
|
58
|
+
"eslint-config-axkit": "^1.1.0",
|
|
59
|
+
"fta-check": "^1.5.1",
|
|
60
|
+
"fta-cli": "^3.0.0",
|
|
61
|
+
"knip": "^5.82.1",
|
|
62
|
+
"prettier": "3.8.0",
|
|
63
|
+
"semantic-release": "^25.0.2",
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"vitest": "^4.0.17"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc -p tsconfig.app.json",
|
|
69
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
70
|
+
"format": "prettier --write .",
|
|
71
|
+
"format:check": "prettier --check .",
|
|
72
|
+
"fta": "fta-check",
|
|
73
|
+
"knip": "knip",
|
|
74
|
+
"lint": "eslint",
|
|
75
|
+
"rebuild": "pnpm run clean && pnpm run build",
|
|
76
|
+
"miniread": "pnpm -s run rebuild && node bin/miniread",
|
|
77
|
+
"test": "vitest run",
|
|
78
|
+
"test:coverage": "vitest run --coverage",
|
|
79
|
+
"test:watch": "vitest",
|
|
80
|
+
"miniread-evaluate": "pnpm -s run rebuild && node bin/miniread-evaluate",
|
|
81
|
+
"miniread-sample": "pnpm -s run rebuild && node bin/miniread-sample",
|
|
82
|
+
"typecheck": "tsc -b --noEmit"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"transforms": [
|
|
3
|
+
{
|
|
4
|
+
"id": "add-prefix",
|
|
5
|
+
"description": "Adds 'renamed_' prefix to variable and function declarations",
|
|
6
|
+
"iteration": 0,
|
|
7
|
+
"scope": "file",
|
|
8
|
+
"parallelizable": true,
|
|
9
|
+
"diffReductionImpact": 0,
|
|
10
|
+
"enabledByDefault": false,
|
|
11
|
+
"notes": "Example transform for testing infrastructure"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "add-suffix",
|
|
15
|
+
"description": "Adds '_end' suffix to variable and function declarations",
|
|
16
|
+
"iteration": 0,
|
|
17
|
+
"scope": "file",
|
|
18
|
+
"parallelizable": true,
|
|
19
|
+
"diffReductionImpact": 0,
|
|
20
|
+
"enabledByDefault": false,
|
|
21
|
+
"notes": "Example transform for testing infrastructure"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "expand-boolean-literals",
|
|
25
|
+
"description": "Expands !0 to true and !1 to false",
|
|
26
|
+
"iteration": 1,
|
|
27
|
+
"scope": "file",
|
|
28
|
+
"parallelizable": true,
|
|
29
|
+
"diffReductionImpact": 0,
|
|
30
|
+
"enabledByDefault": true,
|
|
31
|
+
"notes": "Improves readability but does not reduce diffs (boolean literals are already deterministic)"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "expand-undefined-literals",
|
|
35
|
+
"description": "Expands void 0 to undefined (when undefined is not shadowed)",
|
|
36
|
+
"iteration": 2,
|
|
37
|
+
"scope": "file",
|
|
38
|
+
"parallelizable": true,
|
|
39
|
+
"diffReductionImpact": 0,
|
|
40
|
+
"enabledByDefault": true,
|
|
41
|
+
"notes": "Auto-added by evaluation script."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "rename-loop-index-variables",
|
|
45
|
+
"description": "Renames numeric for-loop counters to index/index2/... based on nesting depth",
|
|
46
|
+
"iteration": 3,
|
|
47
|
+
"scope": "file",
|
|
48
|
+
"parallelizable": true,
|
|
49
|
+
"diffReductionImpact": 0,
|
|
50
|
+
"enabledByDefault": true,
|
|
51
|
+
"notes": "Auto-added by evaluation script."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "rename-catch-parameters",
|
|
55
|
+
"description": "Renames minified catch clause parameters to caughtError/caughtError2/...",
|
|
56
|
+
"iteration": 4,
|
|
57
|
+
"scope": "file",
|
|
58
|
+
"parallelizable": true,
|
|
59
|
+
"diffReductionImpact": 0,
|
|
60
|
+
"enabledByDefault": true,
|
|
61
|
+
"notes": "Auto-added by evaluation script."
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"presetStats": {
|
|
65
|
+
"recommended": {
|
|
66
|
+
"diffReductionImpact": 0,
|
|
67
|
+
"notes": "Auto-updated by evaluation when running with baseline none and the recommended preset."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|