@grafana/create-plugin 4.14.1-canary.990.ef60ecd.0 → 4.14.2-canary.971.cf99ca0.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
+ # v4.14.1 (Thu Jul 04 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Create Plugin: Fix backend dev env for arm64 hosts [#990](https://github.com/grafana/plugin-tools/pull/990) ([@jackw](https://github.com/jackw))
6
+
7
+ #### Authors: 1
8
+
9
+ - Jack Westbrook ([@jackw](https://github.com/jackw))
10
+
11
+ ---
12
+
1
13
  # v4.14.0 (Mon Jul 01 2024)
2
14
 
3
15
  #### 🚀 Enhancement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "4.14.1-canary.990.ef60ecd.0",
3
+ "version": "4.14.2-canary.971.cf99ca0.0",
4
4
  "repository": {
5
5
  "directory": "packages/create-plugin",
6
6
  "url": "https://github.com/grafana/plugin-tools"
@@ -87,5 +87,5 @@
87
87
  "engines": {
88
88
  "node": ">=20"
89
89
  },
90
- "gitHead": "ef60ecd978d451f49cf5cb06a4ea18901931b7f6"
90
+ "gitHead": "cf99ca04b5540b15e128ef015024f3e6083ed354"
91
91
  }
@@ -1,13 +1,14 @@
1
- ARG TARGETARCH
2
1
  ARG grafana_version=latest
3
2
  ARG grafana_image=grafana-enterprise
4
3
 
5
4
  FROM grafana/${grafana_image}:${grafana_version}
6
5
 
7
6
  ARG development=false
7
+ ARG TARGETARCH
8
8
 
9
9
  {{#if hasBackend}}
10
10
  ARG GO_VERSION=1.21.6
11
+ ARG GO_ARCH=${TARGETARCH:-amd64}
11
12
  {{/if}}
12
13
 
13
14
  ENV DEV "${development}"
@@ -49,11 +50,11 @@ COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
49
50
  {{#if hasBackend}}
50
51
  # Installing Go
51
52
  RUN if [ "${development}" = "true" ]; then \
52
- curl -O -L https://golang.org/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz && \
53
+ curl -O -L https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
53
54
  rm -rf /usr/local/go && \
54
- tar -C /usr/local -xzf go${GO_VERSION}.linux-${TARGETARCH}.tar.gz && \
55
+ tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
55
56
  echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bashrc && \
56
- rm -f go${GO_VERSION}.linux-${TARGETARCH}.tar.gz; \
57
+ rm -f go${GO_VERSION}.linux-${GO_ARCH}.tar.gz; \
57
58
  fi
58
59
 
59
60
  # Installing delve for debugging
@@ -0,0 +1,17 @@
1
+ /*
2
+ * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
3
+ *
4
+ * This file dynamically sets the public path at runtime based on the location of the plugin's AMD module.
5
+ * It relies on the magic `module` which is defined by the AMD loader.
6
+ * https://github.com/requirejs/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#module
7
+ *
8
+ * We fallback to the plugin root so that older versions of Grafana will continue to load the plugin correctly.
9
+ */
10
+
11
+ // @ts-nocheck
12
+ import amdMetaModule from 'amd-module';
13
+
14
+ __webpack_public_path__ =
15
+ amdMetaModule && amdMetaModule.uri
16
+ ? amdMetaModule.uri.slice(0, amdMetaModule.uri.lastIndexOf('/') + 1)
17
+ : 'public/plugins/{{ pluginId }}/';
@@ -36,6 +36,8 @@ const config = async (env): Promise<Configuration> => {
36
36
  entry: await getEntries(),
37
37
 
38
38
  externals: [
39
+ // Required for dynamic publicPath resolution
40
+ { 'amd-module': 'module' },
39
41
  'lodash',
40
42
  'jquery',
41
43
  'moment',
@@ -104,6 +106,17 @@ const config = async (env): Promise<Configuration> => {
104
106
  },
105
107
  },
106
108
  },
109
+ {
110
+ test: /src\/(?:.*\/)?module\.tsx?$/,
111
+ use: [
112
+ {
113
+ loader: 'imports-loader',
114
+ options: {
115
+ imports: `side-effects ${path.join(__dirname, 'publicPath.ts')}`,
116
+ },
117
+ },
118
+ ],
119
+ },
107
120
  {
108
121
  test: /\.css$/,
109
122
  use: ['style-loader', 'css-loader'],
@@ -116,9 +129,6 @@ const config = async (env): Promise<Configuration> => {
116
129
  test: /\.(png|jpe?g|gif|svg)$/,
117
130
  type: 'asset/resource',
118
131
  generator: {
119
- // Keep publicPath relative for host.com/grafana/ deployments
120
- publicPath: `public/plugins/${pluginJson.id}/img/`,
121
- outputPath: 'img/',
122
132
  filename: Boolean(env.production) ? '[hash][ext]' : '[file]',
123
133
  },
124
134
  },
@@ -126,10 +136,7 @@ const config = async (env): Promise<Configuration> => {
126
136
  test: /\.(woff|woff2|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
127
137
  type: 'asset/resource',
128
138
  generator: {
129
- // Keep publicPath relative for host.com/grafana/ deployments
130
- publicPath: `public/plugins/${pluginJson.id}/fonts/`,
131
- outputPath: 'fonts/',
132
- filename: Boolean(env.production) ? '[hash][ext]' : '[name][ext]',
139
+ filename: Boolean(env.production) ? '[hash][ext]' : '[file]',
133
140
  },
134
141
  },
135
142
  ],
@@ -20,10 +20,10 @@
20
20
  "license": "Apache-2.0",
21
21
  "devDependencies": {
22
22
  "@babel/core": "^7.21.4",{{#if useCypress}}
23
- "@grafana/e2e": "^10.4.0",
24
- "@grafana/e2e-selectors": "^10.4.0",{{/if}}
23
+ "@grafana/e2e": "^11.0.1",
24
+ "@grafana/e2e-selectors": "^11.1.0",{{/if}}
25
25
  "@grafana/eslint-config": "^7.0.0",{{#if usePlaywright}}
26
- "@grafana/plugin-e2e": "^1.2.0",{{/if}}
26
+ "@grafana/plugin-e2e": "^1.6.0",{{/if}}
27
27
  "@grafana/tsconfig": "^1.2.0-rc1",{{#if usePlaywright}}
28
28
  "@playwright/test": "^1.41.2",{{/if}}
29
29
  "@swc/core": "^1.3.90",
@@ -43,6 +43,7 @@
43
43
  "fork-ts-checker-webpack-plugin": "^8.0.0",
44
44
  "glob": "^10.2.7",
45
45
  "identity-obj-proxy": "3.0.0",
46
+ "imports-loader": "^5.0.0",
46
47
  "jest": "^29.5.0",
47
48
  "jest-environment-jsdom": "^29.5.0",
48
49
  "prettier": "^2.8.7",
@@ -63,11 +64,11 @@
63
64
  },
64
65
  "dependencies": {
65
66
  "@emotion/css": "11.10.6",
66
- "@grafana/data": "^10.4.0",
67
- "@grafana/runtime": "^10.4.0",
68
- "@grafana/ui": "^10.4.0",
67
+ "@grafana/data": "^11.1.0",
68
+ "@grafana/runtime": "^11.1.0",
69
+ "@grafana/ui": "^11.1.0",
69
70
  "@grafana/schema": "^10.4.0",{{#if_eq pluginType "scenesapp"}}
70
- "@grafana/scenes": "^3.6.0",{{/if_eq}}
71
+ "@grafana/scenes": "^5.3.7",{{/if_eq}}
71
72
  "react": "18.2.0",
72
73
  "react-dom": "18.2.0",{{#if isAppType}}
73
74
  "react-router-dom": "^{{ reactRouterVersion }}",
@@ -7,7 +7,7 @@ services:
7
7
  context: ./.config
8
8
  args:
9
9
  grafana_image: ${GRAFANA_IMAGE:-{{~grafanaImage~}} }
10
- grafana_version: ${GRAFANA_VERSION:-10.4.0}
10
+ grafana_version: ${GRAFANA_VERSION:-11.1.0}
11
11
  development: ${DEVELOPMENT:-false}
12
12
  ports:
13
13
  - 3000:3000/tcp