@grafana/create-plugin 0.9.1 → 0.10.0-canary.197.f95c2c8.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,15 +1,3 @@
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
-
13
1
  # v0.9.0 (Thu Jan 26 2023)
14
2
 
15
3
  #### 🚀 Enhancement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "0.9.1",
3
+ "version": "0.10.0-canary.197.f95c2c8.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": "cf5b9a9afc6bd925f47c95a9a155137301c0f9d4"
63
+ "gitHead": "f95c2c83cdb8953565ab7e0e1ac2fa2002894f1c"
64
64
  }
@@ -1,6 +1,7 @@
1
1
  ARG grafana_version=latest
2
+ ARG grafana_image=grafana-enterprise
2
3
 
3
- FROM grafana/grafana:${grafana_version}
4
+ FROM grafana/${grafana_image}:${grafana_version}
4
5
 
5
6
  # Make it as simple as possible to access the grafana instance for development purposes
6
7
  # Do NOT enable these settings in a public facing / production grafana instance
@@ -139,3 +139,26 @@ We need to update the `scripts` in the `package.json` to use the extended Webpac
139
139
  -"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
140
140
  +"dev": "webpack -w -c ./webpack.config.ts --env development",
141
141
  ```
142
+
143
+ ### Configure grafana image to use when running docker
144
+
145
+ By default `grafana-enterprise` will be used as the docker image for all docker related commands. If you want to override this behaviour simply alter the `docker-compose.yaml` by adding the following build arg `grafana_image`.
146
+
147
+ **Example:**
148
+
149
+ ```yaml
150
+ version: '3.7'
151
+
152
+ services:
153
+ grafana:
154
+ container_name: 'myorg-basic-app'
155
+ build:
156
+ context: ./.config
157
+ args:
158
+ grafana_version: ${GRAFANA_VERSION:-9.1.2}
159
+ grafana_image: ${GRAFANA_IMAGE:-grafana}
160
+ ```
161
+
162
+ In this example we are assigning the environment variable `GRAFANA_IMAGE` to the build arg `grafana_image` with a default value of `grafana`. This will give you the possibility to set the value while running the docker-compose commands which might be convinent in some scenarios.
163
+
164
+ ---
@@ -20,25 +20,24 @@ 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.
25
23
  export async function getEntries(): Promise<Record<string, string>> {
26
24
  const pluginsJson = await globAsync('**/src/**/plugin.json', { absolute: true });
27
25
 
28
26
  const plugins = await Promise.all(pluginsJson.map((pluginJson) => {
29
27
  const folder = path.dirname(pluginJson);
30
- return globAsync(`${folder}/module.{ts,tsx,js,jsx}`, { absolute: true });
28
+ return globAsync(`${folder}/module.{ts,tsx,js}`, { absolute: true });
31
29
  })
32
30
  );
33
31
 
34
32
  return plugins.reduce((result, modules) => {
35
33
  return modules.reduce((result, module) => {
36
34
  const pluginPath = path.dirname(module);
37
- const pluginName = path.relative(process.cwd(), pluginPath).replace(/src\/?/i, '');
38
- const entryName = pluginName === '' ? 'module' : `${pluginName}/module`;
35
+ const pluginName = path.basename(pluginPath);
36
+ // support bundling nested plugins
37
+ const entryName = pluginName === 'src' ? 'module' : `${pluginName}/module`;
39
38
 
40
39
  result[entryName] = module;
41
40
  return result;
42
41
  }, result);
43
42
  }, {});
44
- }
43
+ }
@@ -96,6 +96,7 @@ const config = async (env): Promise<Configuration> => ({
96
96
  use: ["style-loader", "css-loader"]
97
97
  },
98
98
  {
99
+ exclude: /(node_modules)/,
99
100
  test: /\.s[ac]ss$/,
100
101
  use: ['style-loader', 'css-loader', 'sass-loader'],
101
102
  },