@grafana/create-plugin 0.9.0 → 0.9.1
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.1 (Thu Feb 02 2023)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Create Plugin: Fix deeply nested plugins [#195](https://github.com/grafana/plugin-tools/pull/195) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v0.9.0 (Thu Jan 26 2023)
|
|
2
14
|
|
|
3
15
|
#### 🚀 Enhancement
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
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": "cf5b9a9afc6bd925f47c95a9a155137301c0f9d4"
|
|
64
64
|
}
|
|
@@ -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
|
+
}
|