@grafana/create-plugin 1.12.2 → 2.0.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,21 @@
1
+ # v2.0.0 (Mon Oct 02 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Bugfix: Enable plugins to lazy load modules [#427](https://github.com/grafana/plugin-tools/pull/427) ([@mckn](https://github.com/mckn))
6
+ - webpack template: minor lint fixes [#414](https://github.com/grafana/plugin-tools/pull/414) ([@briangann](https://github.com/briangann))
7
+ - Increase required node engine to v18 [#405](https://github.com/grafana/plugin-tools/pull/405) ([@academo](https://github.com/academo))
8
+ - README typo fixes [#387](https://github.com/grafana/plugin-tools/pull/387) ([@aangelisc](https://github.com/aangelisc))
9
+
10
+ #### Authors: 4
11
+
12
+ - Andreas Christou ([@aangelisc](https://github.com/aangelisc))
13
+ - Brian Gann ([@briangann](https://github.com/briangann))
14
+ - Esteban Beltran ([@academo](https://github.com/academo))
15
+ - Marcus Andersson ([@mckn](https://github.com/mckn))
16
+
17
+ ---
18
+
1
19
  # v1.12.2 (Thu Sep 07 2023)
2
20
 
3
21
  #### 🐛 Bug Fix
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "1.12.2",
3
+ "version": "2.0.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/create-plugin",
@@ -64,7 +64,7 @@
64
64
  }
65
65
  },
66
66
  "engines": {
67
- "node": ">=16"
67
+ "node": ">=18"
68
68
  },
69
- "gitHead": "a9af24493908592b90c952c224bfc8c96d2b340d"
69
+ "gitHead": "d61bc5effe7e3c9bd444ebe05c6840c48f15ecef"
70
70
  }
@@ -56,7 +56,7 @@ set up the Jest DOM for the testing library and to apply some polyfills. ([link
56
56
 
57
57
  #### ESM errors with Jest
58
58
 
59
- A common issue found with the current jest config involves importing an npm package which only offers an ESM build. These packages cause jest to error with `SyntaxError: Cannot use import statement outside a module`. To work around this we provide a list of known packages to pass to the `[transformIgnorePatterns](https://jestjs.io/docs/configuration#transformignorepatterns-arraystring)` jest configuration property. If need be this can be extended in the following way:
59
+ A common issue with the current jest config involves importing an npm package that only offers an ESM build. These packages cause jest to error with `SyntaxError: Cannot use import statement outside a module`. To work around this, we provide a list of known packages to pass to the `[transformIgnorePatterns](https://jestjs.io/docs/configuration#transformignorepatterns-arraystring)` jest configuration property. If need be, this can be extended in the following way:
60
60
 
61
61
  ```javascript
62
62
  process.env.TZ = 'UTC';
@@ -142,7 +142,7 @@ We need to update the `scripts` in the `package.json` to use the extended Webpac
142
142
 
143
143
  ### Configure grafana image to use when running docker
144
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`.
145
+ By default, `grafana-enterprise` will be used as the docker image for all docker related commands. If you want to override this behavior, simply alter the `docker-compose.yaml` by adding the following build arg `grafana_image`.
146
146
 
147
147
  **Example:**
148
148
 
@@ -159,6 +159,6 @@ services:
159
159
  grafana_image: ${GRAFANA_IMAGE:-grafana}
160
160
  ```
161
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.
162
+ In this example, we assign the environment variable `GRAFANA_IMAGE` to the build arg `grafana_image` with a default value of `grafana`. This will allow you to set the value while running the docker-compose commands, which might be convenient in some scenarios.
163
163
 
164
164
  ---
@@ -135,7 +135,7 @@ const config = async (env): Promise<Configuration> => {
135
135
  type: 'amd',
136
136
  },
137
137
  path: path.resolve(process.cwd(), DIST_DIR),
138
- publicPath: '/',
138
+ publicPath: `public/plugins/${pluginJson.id}/`,
139
139
  },
140
140
 
141
141
  plugins: [
@@ -197,14 +197,14 @@ const config = async (env): Promise<Configuration> => {
197
197
  modules: [path.resolve(process.cwd(), 'src'), 'node_modules'],
198
198
  unsafeCache: true,
199
199
  },
200
- }
200
+ };
201
201
 
202
- if(isWSL()) {
202
+ if (isWSL()) {
203
203
  baseConfig.watchOptions = {
204
204
  poll: 3000,
205
205
  ignored: /node_modules/,
206
- }}
207
-
206
+ };
207
+ }
208
208
 
209
209
  return baseConfig;
210
210
 
@@ -54,7 +54,7 @@
54
54
  "webpack-livereload-plugin": "^3.0.2"
55
55
  },
56
56
  "engines": {
57
- "node": ">=16"
57
+ "node": ">=18"
58
58
  },
59
59
  "dependencies": {
60
60
  "@emotion/css": "^11.1.3",
@@ -24,7 +24,7 @@ jobs:
24
24
  - name: Setup Node.js environment
25
25
  uses: actions/setup-node@v3
26
26
  with:
27
- node-version: '16'
27
+ node-version: '18'
28
28
  cache: '{{ packageManagerName }}'
29
29
 
30
30
  - name: Install dependencies
@@ -23,7 +23,7 @@ jobs:
23
23
  - name: Setup Node.js environment
24
24
  uses: actions/setup-node@v3
25
25
  with:
26
- node-version: '16'
26
+ node-version: '18'
27
27
  cache: '{{ packageManagerName }}'
28
28
 
29
29
  - name: Setup Go environment
@@ -14,7 +14,7 @@ jobs:
14
14
  - name: Setup Node.js environment
15
15
  uses: actions/setup-node@v3
16
16
  with:
17
- node-version: '16'
17
+ node-version: '18'
18
18
  cache: '{{ packageManagerName }}'
19
19
  - name: Install dependencies
20
20
  run: {{ packageManagerInstallCmd }}