@grafana/create-plugin 0.8.4 → 0.9.1-canary.195.309a77f.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v0.9.0 (Thu Jan 26 2023)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Create Plugin: Update jest config to support Grafana 9.4 packages [#188](https://github.com/grafana/plugin-tools/pull/188) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v0.8.4 (Fri Jan 13 2023)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1-canary.195.309a77f.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/create-plugin",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=16"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "309a77f22020ef5506605d75c13ec5cd0197952b"
|
|
64
64
|
}
|
|
@@ -11,7 +11,16 @@
|
|
|
11
11
|
const nodeModulesToTransform = (moduleNames) => `node_modules\/(?!(${moduleNames.join('|')})\/)`;
|
|
12
12
|
|
|
13
13
|
// Array of known nested grafana package dependencies that only bundle an ESM version
|
|
14
|
-
const grafanaESModules = [
|
|
14
|
+
const grafanaESModules = [
|
|
15
|
+
'd3',
|
|
16
|
+
'd3-color',
|
|
17
|
+
'd3-force',
|
|
18
|
+
'd3-interpolate',
|
|
19
|
+
'd3-scale-chromatic',
|
|
20
|
+
'ol',
|
|
21
|
+
'react-colorful',
|
|
22
|
+
'uuid',
|
|
23
|
+
];
|
|
15
24
|
|
|
16
25
|
module.exports = {
|
|
17
26
|
nodeModulesToTransform,
|
|
@@ -20,24 +20,25 @@ export function hasReadme() {
|
|
|
20
20
|
return fs.existsSync(path.resolve(process.cwd(), SOURCE_DIR, 'README.md'));
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// Support bundling nested plugins by finding all plugin.json files in src directory
|
|
24
|
+
// then checking for a sibling module.[jt]sx? file.
|
|
23
25
|
export async function getEntries(): Promise<Record<string, string>> {
|
|
24
26
|
const pluginsJson = await globAsync('**/src/**/plugin.json', { absolute: true });
|
|
25
27
|
|
|
26
28
|
const plugins = await Promise.all(pluginsJson.map((pluginJson) => {
|
|
27
29
|
const folder = path.dirname(pluginJson);
|
|
28
|
-
return globAsync(`${folder}/module.{ts,tsx,js}`, { absolute: true });
|
|
30
|
+
return globAsync(`${folder}/module.{ts,tsx,js,jsx}`, { absolute: true });
|
|
29
31
|
})
|
|
30
32
|
);
|
|
31
33
|
|
|
32
34
|
return plugins.reduce((result, modules) => {
|
|
33
35
|
return modules.reduce((result, module) => {
|
|
34
36
|
const pluginPath = path.dirname(module);
|
|
35
|
-
const pluginName = path.
|
|
36
|
-
|
|
37
|
-
const entryName = pluginName === 'src' ? 'module' : `${pluginName}/module`;
|
|
37
|
+
const pluginName = path.relative(process.cwd(), pluginPath).replace(/src\/?/i, '');
|
|
38
|
+
const entryName = pluginName === '' ? 'module' : `${pluginName}/module`;
|
|
38
39
|
|
|
39
40
|
result[entryName] = module;
|
|
40
41
|
return result;
|
|
41
42
|
}, result);
|
|
42
43
|
}, {});
|
|
43
|
-
}
|
|
44
|
+
}
|