vue-hook-optimizer 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -39,8 +39,8 @@ So I want to build a tool to help us analyze the code, and find the relations be
|
|
39
39
|
|
40
40
|
- [ ] add node type and more info
|
41
41
|
- [ ] provide some suggestions for optimization
|
42
|
-
- [
|
43
|
-
- [x] vscode extension
|
42
|
+
- [x] support `options api`
|
43
|
+
- [x] [vscode extension](./packages/vscode)
|
44
44
|
|
45
45
|
## Contribution
|
46
46
|
|
package/dist/index.js
CHANGED
@@ -86321,9 +86321,10 @@ function analyze2(content) {
|
|
86321
86321
|
const name = path2.node.id?.name;
|
86322
86322
|
if (name && graph.nodes.has(name)) {
|
86323
86323
|
path2.traverse({
|
86324
|
-
Identifier(
|
86325
|
-
|
86326
|
-
|
86324
|
+
Identifier(path1) {
|
86325
|
+
const binding2 = path1.scope.getBinding(path1.node.name);
|
86326
|
+
if (graph.nodes.has(path1.node.name) && path1.node.name !== name && binding2?.scope.block.type === "Program") {
|
86327
|
+
graph.edges.get(name)?.add(path1.node.name);
|
86327
86328
|
}
|
86328
86329
|
}
|
86329
86330
|
});
|
@@ -86339,9 +86340,10 @@ function analyze2(content) {
|
|
86339
86340
|
const name = path2.node.id?.name;
|
86340
86341
|
if (name && graph.nodes.has(name)) {
|
86341
86342
|
path2.traverse({
|
86342
|
-
Identifier(
|
86343
|
-
|
86344
|
-
|
86343
|
+
Identifier(path1) {
|
86344
|
+
const binding2 = path1.scope.getBinding(path1.node.name);
|
86345
|
+
if (graph.nodes.has(path1.node.name) && path1.node.name !== name && binding2?.scope.block.type === "Program") {
|
86346
|
+
graph.edges.get(name)?.add(path1.node.name);
|
86345
86347
|
}
|
86346
86348
|
}
|
86347
86349
|
});
|
@@ -86589,7 +86591,6 @@ function analyze3(content) {
|
|
86589
86591
|
process2(path2.node.declaration, path2);
|
86590
86592
|
} else if (path2.node.declaration.type === "CallExpression" && path2.node.declaration.callee.type === "Identifier" && path2.node.declaration.callee.name === "defineComponent" && path2.node.declaration.arguments[0].type === "ObjectExpression") {
|
86591
86593
|
process2(path2.node.declaration.arguments[0], path2);
|
86592
|
-
console.log(graph);
|
86593
86594
|
}
|
86594
86595
|
}
|
86595
86596
|
});
|