@grafana/plugin-meta-extractor 0.0.2-canary.902.900cb7c.0 → 0.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v0.0.2 (Wed May 08 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - PME: Removed dependency on tsquery [#902](https://github.com/grafana/plugin-tools/pull/902) ([@mckn](https://github.com/mckn))
6
+
7
+ #### Authors: 1
8
+
9
+ - Marcus Andersson ([@mckn](https://github.com/mckn))
10
+
11
+ ---
12
+
1
13
  # v0.0.1 (Fri May 03 2024)
2
14
 
3
15
  #### 🐛 Bug Fix
package/dist/utils.js CHANGED
@@ -44,8 +44,7 @@ function getComponentExtensionConfigs(ast, checker) {
44
44
  }
45
45
  exports.getComponentExtensionConfigs = getComponentExtensionConfigs;
46
46
  function getExtensionConfigs(functionName, ast, checker) {
47
- const matcher = createExtensionMatcher(functionName);
48
- const identifiers = query(ast, matcher);
47
+ const identifiers = query(ast, createIdentifierMatcher(functionName));
49
48
  const extensionConfigs = [];
50
49
  for (const identifier of identifiers) {
51
50
  const callExpression = identifier.parent.parent;
@@ -63,7 +62,7 @@ function getExtensionConfigs(functionName, ast, checker) {
63
62
  return extensionConfigs;
64
63
  }
65
64
  exports.getExtensionConfigs = getExtensionConfigs;
66
- function createExtensionMatcher(functionName) {
65
+ function createIdentifierMatcher(functionName) {
67
66
  return (node) => {
68
67
  if (!ts.isIdentifier(node)) {
69
68
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/plugin-meta-extractor",
3
- "version": "0.0.2-canary.902.900cb7c.0",
3
+ "version": "0.0.2",
4
4
  "description": "Extract meta information from a Grafana plugin source code.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "bin": "./dist/bin/run.js",
@@ -43,5 +43,5 @@
43
43
  "react": "^18.2.0",
44
44
  "ts-jest": "^29.1.2"
45
45
  },
46
- "gitHead": "900cb7cf4e93f418b3c9b4f094b91349d034e17e"
46
+ "gitHead": "648d1db7150d535f246ef972d010206d35b45cc1"
47
47
  }
package/src/utils.ts CHANGED
@@ -18,8 +18,7 @@ export function getComponentExtensionConfigs(ast: ts.Node, checker: ts.TypeCheck
18
18
  }
19
19
 
20
20
  export function getExtensionConfigs(functionName: string, ast: ts.Node, checker: ts.TypeChecker) {
21
- const matcher = createExtensionMatcher(functionName);
22
- const identifiers = query(ast, matcher);
21
+ const identifiers = query(ast, createIdentifierMatcher(functionName));
23
22
  const extensionConfigs = [];
24
23
 
25
24
  for (const identifier of identifiers) {
@@ -39,7 +38,7 @@ export function getExtensionConfigs(functionName: string, ast: ts.Node, checker:
39
38
  return extensionConfigs;
40
39
  }
41
40
 
42
- function createExtensionMatcher(functionName: string): (node: ts.Node) => boolean {
41
+ function createIdentifierMatcher(functionName: string): (node: ts.Node) => boolean {
43
42
  return (node) => {
44
43
  if (!ts.isIdentifier(node)) {
45
44
  return false;