expose-kit 0.2.5 → 0.2.6
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/dist/index.js +5 -6
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -132,10 +132,9 @@ import traverse from "@babel/traverse";
|
|
|
132
132
|
import generate from "@babel/generator";
|
|
133
133
|
import loading2 from "loading-cli";
|
|
134
134
|
|
|
135
|
-
// utils/babel/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return traverse2.default;
|
|
135
|
+
// utils/babel/patchDefault.ts
|
|
136
|
+
var patchDefault = (babelFn) => {
|
|
137
|
+
return babelFn.default;
|
|
139
138
|
};
|
|
140
139
|
|
|
141
140
|
// commands/scope-safe/index.ts
|
|
@@ -150,7 +149,7 @@ var createDefaultOutputPath = (inputPath) => {
|
|
|
150
149
|
var renameBindingsByScope = (code, filename) => {
|
|
151
150
|
const ast = parse2(code, createParseOptions(filename));
|
|
152
151
|
const renamedBindings = /* @__PURE__ */ new Set();
|
|
153
|
-
|
|
152
|
+
patchDefault(traverse)(ast, {
|
|
154
153
|
Scopable(path) {
|
|
155
154
|
for (const [name, binding] of Object.entries(path.scope.bindings)) {
|
|
156
155
|
if (renamedBindings.has(binding)) {
|
|
@@ -169,7 +168,7 @@ var renameBindingsByScope = (code, filename) => {
|
|
|
169
168
|
}
|
|
170
169
|
}
|
|
171
170
|
});
|
|
172
|
-
return generate(ast).code;
|
|
171
|
+
return patchDefault(generate)(ast).code;
|
|
173
172
|
};
|
|
174
173
|
var scope_safe_default = createCommand((program2) => {
|
|
175
174
|
program2.command("scope-safe").description("Rename bindings per scope for safer transforms").argument("[file]", "The file to transform").option("--input, --file <file>", "The file to transform").option("--o, --output <file>", "Output file path").option("--unlimited", "Unlimited timeout").action(
|
package/dist/package.json
CHANGED