@grafana/plugin-meta-extractor 0.0.5 → 0.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v0.0.6 (Thu Aug 29 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Chore: Bump lerna to latest [#1082](https://github.com/grafana/plugin-tools/pull/1082) ([@jackw](https://github.com/jackw))
6
+
7
+ #### Authors: 1
8
+
9
+ - Jack Westbrook ([@jackw](https://github.com/jackw))
10
+
11
+ ---
12
+
1
13
  # v0.0.5 (Fri Aug 09 2024)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -23,14 +23,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.extractPluginExtensions = exports.extractPluginMeta = void 0;
26
+ exports.extractPluginMeta = extractPluginMeta;
27
+ exports.extractPluginExtensions = extractPluginExtensions;
27
28
  const ts = __importStar(require("typescript"));
28
29
  const utils_1 = require("./utils");
29
30
  function extractPluginMeta(entry) {
30
31
  const extensionPoints = extractPluginExtensions(entry);
31
32
  return { extensions: extensionPoints };
32
33
  }
33
- exports.extractPluginMeta = extractPluginMeta;
34
34
  function extractPluginExtensions(entry) {
35
35
  const program = ts.createProgram([entry], {
36
36
  allowSyntheticDefaultImports: true,
@@ -51,7 +51,6 @@ function extractPluginExtensions(entry) {
51
51
  const componentExtensionConfigs = (0, utils_1.getComponentExtensionConfigs)(appNode, checker);
52
52
  return [...linkExtensionConfigs, ...componentExtensionConfigs];
53
53
  }
54
- exports.extractPluginExtensions = extractPluginExtensions;
55
54
  function findAppPluginDeclarationNode(entry, checker) {
56
55
  let appNode;
57
56
  const rootNodes = [];
package/dist/utils.js CHANGED
@@ -26,7 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.debug = exports.parseExtensionPointOptions = exports.parseExtensionPointId = exports.parseString = exports.getExtensionConfigs = exports.getComponentExtensionConfigs = exports.getLinkExtensionsConfigs = void 0;
29
+ exports.getLinkExtensionsConfigs = getLinkExtensionsConfigs;
30
+ exports.getComponentExtensionConfigs = getComponentExtensionConfigs;
31
+ exports.getExtensionConfigs = getExtensionConfigs;
32
+ exports.parseString = parseString;
33
+ exports.parseExtensionPointId = parseExtensionPointId;
34
+ exports.parseExtensionPointOptions = parseExtensionPointOptions;
35
+ exports.debug = debug;
30
36
  const ts = __importStar(require("typescript"));
31
37
  const debug_1 = __importDefault(require("debug"));
32
38
  const types_1 = require("./types");
@@ -38,11 +44,9 @@ const CONFIGURE_FN_NAME_TO_TYPE = {
38
44
  function getLinkExtensionsConfigs(ast, checker) {
39
45
  return getExtensionConfigs('configureExtensionLink', ast, checker);
40
46
  }
41
- exports.getLinkExtensionsConfigs = getLinkExtensionsConfigs;
42
47
  function getComponentExtensionConfigs(ast, checker) {
43
48
  return getExtensionConfigs('configureExtensionComponent', ast, checker);
44
49
  }
45
- exports.getComponentExtensionConfigs = getComponentExtensionConfigs;
46
50
  function getExtensionConfigs(functionName, ast, checker) {
47
51
  const identifiers = query(ast, createIdentifierMatcher(functionName));
48
52
  const extensionConfigs = [];
@@ -61,7 +65,6 @@ function getExtensionConfigs(functionName, ast, checker) {
61
65
  }
62
66
  return extensionConfigs;
63
67
  }
64
- exports.getExtensionConfigs = getExtensionConfigs;
65
68
  function createIdentifierMatcher(functionName) {
66
69
  return (node) => {
67
70
  if (!ts.isIdentifier(node)) {
@@ -103,7 +106,6 @@ function parseString(node) {
103
106
  }
104
107
  return node.getText();
105
108
  }
106
- exports.parseString = parseString;
107
109
  // This needs to be rewritten as well
108
110
  function parseExtensionPointId(node, checker) {
109
111
  // If value is simple string
@@ -123,7 +125,6 @@ function parseExtensionPointId(node, checker) {
123
125
  }
124
126
  return node.getText();
125
127
  }
126
- exports.parseExtensionPointId = parseExtensionPointId;
127
128
  function parseExtensionPointOptions(options, checker) {
128
129
  // Need to rewrite this part to something more elegant that works when you add more
129
130
  // fields to the meta and configuration
@@ -151,8 +152,6 @@ function parseExtensionPointOptions(options, checker) {
151
152
  description: '',
152
153
  });
153
154
  }
154
- exports.parseExtensionPointOptions = parseExtensionPointOptions;
155
155
  function debug(...args) {
156
156
  _debug(...args);
157
157
  }
158
- exports.debug = debug;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/plugin-meta-extractor",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
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",
@@ -40,5 +40,5 @@
40
40
  "@types/node": "^20.11.25",
41
41
  "react": "^18.2.0"
42
42
  },
43
- "gitHead": "083e48deb1b6be862f40d87f6d5ce35071c63a84"
43
+ "gitHead": "87527bed3d7ded59bdc80f32da3c6c2aed773a3e"
44
44
  }
package/src/utils.ts CHANGED
@@ -68,7 +68,7 @@ function traverse(
68
68
  ancestors.unshift(node.parent);
69
69
  }
70
70
  iterator(node, ancestors);
71
- let children: ts.Node[] = [];
71
+ let children: readonly ts.Node[] = [];
72
72
  try {
73
73
  // We need to use `getChildren()` to traverse JSDoc nodes
74
74
  children = node.getChildren();