You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RUN sed -i 's/<\/body><\/html>/<script src=\"http:\/\/localhost:35729\/livereload.js\"><\/script><\/body><\/html>/g' /usr/share/grafana/public/views/index.html
Copy file name to clipboardExpand all lines: .config/README.md
+48-4Lines changed: 48 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,12 @@ to issues around working with the project.
16
16
Edit the `.eslintrc` file in the project root in order to extend the ESLint configuration.
17
17
18
18
**Example:**
19
+
19
20
```json
20
21
{
21
22
"extends": "./.config/.eslintrc",
22
23
"rules": {
23
-
"react/prop-types": "off"
24
+
"react/prop-types": "off"
24
25
}
25
26
}
26
27
```
@@ -32,10 +33,11 @@ Edit the `.eslintrc` file in the project root in order to extend the ESLint conf
32
33
Edit the `.prettierrc.js` file in the project root in order to extend the Prettier configuration.
33
34
34
35
**Example:**
36
+
35
37
```javascript
36
38
module.exports= {
37
39
// Prettier configuration provided by Grafana scaffolding
38
-
...require("./.config/.prettierrc.js"),
40
+
...require('./.config/.prettierrc.js'),
39
41
40
42
semi:false,
41
43
};
@@ -50,7 +52,23 @@ There are two configuration in the project root that belong to Jest: `jest-setup
50
52
**`jest-setup.js`:** A file that is run before each test file in the suite is executed. We are using it to
51
53
set up the Jest DOM for the testing library and to apply some polyfills. ([link to Jest docs](https://jestjs.io/docs/configuration#setupfilesafterenv-array))
52
54
53
-
**`jest.config.js`:** The main Jest configuration file that is extending our basic Grafana-tailored setup. ([link to Jest docs](https://jestjs.io/docs/configuration))
55
+
**`jest.config.js`:** The main Jest configuration file that extends the Grafana recommended setup. ([link to Jest docs](https://jestjs.io/docs/configuration))
56
+
57
+
#### ESM errors with Jest
58
+
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:
### 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 behavior, 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 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.
0 commit comments