Skip to content

Commit d1bea19

Browse files
webpack changes
1 parent 8dbef0c commit d1bea19

File tree

9 files changed

+46
-208
lines changed

9 files changed

+46
-208
lines changed

go.mod

+1-7
Original file line numberDiff line numberDiff line change
@@ -480,24 +480,18 @@ require (
480480
github.com/grafadruid/go-druid v0.0.7-0.20230607082331-983aa577d90a
481481
github.com/grafana/authlib v0.0.0-20240828122726-9edfcbea43e2
482482
github.com/grafana/authlib/claims v0.0.0-20240827210201-19d5347dd8dd
483-
github.com/grafana/thema v0.0.0-20240605110052-2016107581da
484483
)
485484

486485
require (
487486
cloud.google.com/go/longrunning v0.5.12 // indirect
488487
github.com/at-wat/mqtt-go v0.19.4 // indirect
489-
github.com/cockroachdb/errors v1.9.1 // indirect
490-
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect
491-
github.com/cockroachdb/redact v1.1.3 // indirect
492488
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
493-
github.com/getsentry/sentry-go v0.12.0 // indirect
494489
github.com/grafana/grafana/pkg/semconv v0.0.0-20240808213237-f4d2e064f435 // indirect
495490
github.com/hairyhenderson/go-which v0.2.0 // indirect
496491
github.com/iancoleman/orderedmap v0.3.0 // indirect
497-
github.com/kr/pretty v0.3.1 // indirect
498-
github.com/rogpeppe/go-internal v1.12.0 // indirect
499492
github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect
500493
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
494+
github.com/yudai/pp v2.0.1+incompatible // indirect
501495
)
502496

503497
// Use fork of crewjam/saml with fixes for some issues until changes get merged into upstream

go.sum

-98
Large diffs are not rendered by default.

go.work.sum

+7-7
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTY
654654
github.com/ClickHouse/clickhouse-go/v2 v2.17.1 h1:ZCmAYWpu75IyEi7+Yrs/uaAjiCGY5wfW5kXo64exkX4=
655655
github.com/ClickHouse/clickhouse-go/v2 v2.17.1/go.mod h1:rkGTvFDTLqLIm0ma+13xmcCfr/08Gvs7KmFt1tgiWHQ=
656656
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=
657+
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
657658
github.com/CloudyKit/jet/v3 v3.0.0 h1:1PwO5w5VCtlUUl+KTOBsTGZlhjWkcybsGaAau52tOy8=
658659
github.com/CloudyKit/jet/v6 v6.2.0 h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME=
659660
github.com/CloudyKit/jet/v6 v6.2.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4=
@@ -841,8 +842,6 @@ github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi
841842
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
842843
github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
843844
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
844-
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w=
845-
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q=
846845
github.com/drone/drone-runtime v1.1.0 h1:IsKbwiLY6+ViNBzX0F8PERJVZZcEJm9rgxEh3uZP5IE=
847846
github.com/drone/drone-runtime v1.1.0/go.mod h1:+osgwGADc/nyl40J0fdsf8Z09bgcBZXvXXnLOY48zYs=
848847
github.com/drone/drone-yaml v1.2.3 h1:SWzLmzr8ARhbtw1WsVDENa8WFY2Pi9l0FVMfafVUWz8=
@@ -871,6 +870,7 @@ github.com/expr-lang/expr v1.16.2 h1:JvMnzUs3LeVHBvGFcXYmXo+Q6DPDmzrlcSBO6Wy3w4s
871870
github.com/expr-lang/expr v1.16.2/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ=
872871
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=
873872
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
873+
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
874874
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
875875
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
876876
github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=
@@ -942,6 +942,7 @@ github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198/go.mod h1:DTh/Y2+Nbn
942942
github.com/goccy/go-yaml v1.11.0 h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54=
943943
github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4 h1:vF83LI8tAakwEwvWZtrIEx7pOySacl2TOxx6eXk4ePo=
944944
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
945+
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
945946
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
946947
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
947948
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
@@ -983,7 +984,6 @@ github.com/grafadruid/go-druid v0.0.6 h1:Nt9jQrhrtHi1BJICN9aDJgYDmBmc10pJYpQiuwA
983984
github.com/grafadruid/go-druid v0.0.6/go.mod h1:KY3a6MrVMKkXgMTwBS9Nrhm1E8OWyR4gd0WzUi8d/zM=
984985
github.com/grafana/authlib v0.0.0-20240730122259-a0d13672efb1/go.mod h1:YA9We4kTafu7mlMnUh3In6Q2wpg8fYN3ycgCKOK1TB8=
985986
github.com/grafana/authlib/claims v0.0.0-20240809101159-74eaccc31a06/go.mod h1:r+F8H6awwjNQt/KPZ2GNwjk8TvsJ7/gxzkXN26GlL/A=
986-
github.com/grafana/authlib/claims v0.0.0-20240827210201-19d5347dd8dd/go.mod h1:r+F8H6awwjNQt/KPZ2GNwjk8TvsJ7/gxzkXN26GlL/A=
987987
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
988988
github.com/grafana/grafana-plugin-sdk-go v0.235.0/go.mod h1:6n9LbrjGL3xAATntYVNcIi90G9BVHRJjzHKz5FXVfWw=
989989
github.com/grafana/prometheus-alertmanager v0.25.1-0.20240422145632-c33c6b5b6e6b h1:HCbWyVL6vi7gxyO76gQksSPH203oBJ1MJ3JcG1OQlsg=
@@ -1283,6 +1283,7 @@ github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/e
12831283
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU=
12841284
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
12851285
github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk=
1286+
github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g=
12861287
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e h1:uO75wNGioszjmIzcY/tvdDYKRLVvzggtAmmJkn9j4GQ=
12871288
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e/go.mod h1:tm/wZFQ8e24NYaBGIlnO2WGCAi67re4HHuOm0sftE/M=
12881289
github.com/sercand/kuberesolver/v5 v5.1.1 h1:CYH+d67G0sGBj7q5wLK61yzqJJ8gLLC8aeprPTHb6yY=
@@ -1292,8 +1293,6 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I
12921293
github.com/sony/gobreaker v0.4.1 h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ=
12931294
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
12941295
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
1295-
github.com/speakeasy-api/openapi-overlay v0.9.0 h1:Wrz6NO02cNlLzx1fB093lBlYxSI54VRhy1aSutx0PQg=
1296-
github.com/speakeasy-api/openapi-overlay v0.9.0/go.mod h1:f5FloQrHA7MsxYg9djzMD5h6dxrHjVVByWKh7an8TRc=
12971296
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
12981297
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad h1:fiWzISvDn0Csy5H0iwgAuJGQTUpVfEMJJd4nRFXogbc=
12991298
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
@@ -1337,8 +1336,6 @@ github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9
13371336
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
13381337
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
13391338
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
1340-
github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk=
1341-
github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ=
13421339
github.com/willf/bitset v1.1.11 h1:N7Z7E9UvjW+sGsEl7k/SJrvY2reP1A07MrGuCjIOjRE=
13431340
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
13441341
github.com/willf/bloom v2.0.3+incompatible h1:QDacWdqcAUI1MPOwIQZRy9kOR7yxfyEmxX8Wdm2/JPA=
@@ -1350,8 +1347,11 @@ github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6
13501347
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
13511348
github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0=
13521349
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
1350+
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
13531351
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
1352+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
13541353
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
1354+
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
13551355
github.com/xhit/go-str2duration v1.2.0 h1:BcV5u025cITWxEQKGWr1URRzrcXtu7uk8+luz3Yuhwc=
13561356
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
13571357
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow=

pkg/api/http_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {
602602
m.UseMiddleware(hs.Csrf.Middleware())
603603

604604
hs.mapStatic(m, hs.Cfg.StaticRootPath, "build", "public/build")
605-
hs.mapStatic(m, hs.Cfg.StaticRootPath, "", "public", "/public/views/swagger.html")
605+
hs.mapStatic(m, hs.Cfg.StaticRootPath, "", "public", "/public/views/swagger-template.html")
606606
hs.mapStatic(m, hs.Cfg.StaticRootPath, "robots.txt", "robots.txt")
607607

608608
if hs.Cfg.ImageUploadProvider == "local" {

pkg/plugins/pfs/corelist/corelist_load_gen.go

-90
This file was deleted.

public/microfrontends/fn_dashboard/index.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
</script>
1818

1919

20-
<script nonce="" src="../../../public/build/runtime~fn_dashboard.8c4efc41962ba1b3df3b.js" type="text/javascript"></script>
20+
<script nonce="" src="../../../public/build/runtime~fn_dashboard.c83a06ddbc89c9abfa28.js" type="text/javascript"></script>
2121

22-
<script nonce="" src="../../../public/build/fn_dashboard.4b3f77e3a182be7e3dd9.js" type="text/javascript"></script>
22+
<script nonce="" src="../../../public/build/fn_dashboard.64bed42e59e41ca4843a.js" type="text/javascript"></script>
23+
24+
<script nonce="" src="../../../public/build/runtime~swagger.bc7e13f08c957c6b1db6.js" type="text/javascript"></script>
25+
26+
<script nonce="" src="../../../public/build/swagger.f3d428838e3cf78b5d79.js" type="text/javascript"></script>
2327

2428
</body>
2529
</html>

public/views/swagger.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
</script>
4242
</body>
4343

44-
</html>
44+
</html>

scripts/webpack/webpack.dev.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
77
const HtmlWebpackPlugin = require('html-webpack-plugin');
88
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
99
const path = require('path');
10-
const { DefinePlugin } = require('webpack');
10+
const { DefinePlugin, EnvironmentPlugin } = require('webpack');
11+
const WebpackAssetsManifest = require('webpack-assets-manifest');
1112
const { merge } = require('webpack-merge');
13+
const WebpackBar = require('webpackbar');
1214

15+
const getEnvConfig = require('./env-util.js');
1316
const HTMLWebpackCSSChunks = require('./plugins/HTMLWebpackCSSChunks');
1417
const common = require('./webpack.common.js');
1518
const esbuildTargets = resolveToEsbuildTarget(browserslist(), { printUnknownTargets: false });
@@ -20,6 +23,8 @@ const esbuildOptions = {
2023
format: undefined,
2124
};
2225

26+
const envConfig = getEnvConfig();
27+
2328
module.exports = (env = {}) => {
2429
return merge(common, {
2530
devtool: 'eval-source-map',
@@ -30,6 +35,7 @@ module.exports = (env = {}) => {
3035
dark: './public/sass/grafana.dark.scss',
3136
light: './public/sass/grafana.light.scss',
3237
fn_dashboard: './public/app/fn_dashboard.ts',
38+
swagger: './public/swagger/index.tsx',
3339
},
3440

3541
// If we enabled watch option via CLI
@@ -128,6 +134,16 @@ module.exports = (env = {}) => {
128134
SHOULD_LOG: JSON.stringify('true'),
129135
},
130136
}),
137+
new WebpackAssetsManifest({
138+
entrypoints: true,
139+
integrity: true,
140+
publicPath: true,
141+
}),
142+
new WebpackBar({
143+
color: '#eb7b18',
144+
name: 'Grafana',
145+
}),
146+
new EnvironmentPlugin(envConfig),
131147
],
132148
});
133149
};

scripts/webpack/webpack.prod.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ const { resolveToEsbuildTarget } = require('esbuild-plugin-browserslist');
77
const HtmlWebpackPlugin = require('html-webpack-plugin');
88
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
99
const path = require('path');
10-
const { DefinePlugin } = require('webpack');
10+
const { DefinePlugin, EnvironmentPlugin } = require('webpack');
1111
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
1212
const { merge } = require('webpack-merge');
1313

14+
const getEnvConfig = require('./env-util.js');
1415
const HTMLWebpackCSSChunks = require('./plugins/HTMLWebpackCSSChunks');
1516
const common = require('./webpack.common.js');
1617
const esbuildTargets = resolveToEsbuildTarget(browserslist(), { printUnknownTargets: false });
@@ -22,6 +23,8 @@ const esbuildOptions = {
2223
format: undefined,
2324
};
2425

26+
const envConfig = getEnvConfig();
27+
2528
module.exports = (env = {}) =>
2629
merge(common, {
2730
mode: 'production',
@@ -32,6 +35,7 @@ module.exports = (env = {}) =>
3235
dark: './public/sass/grafana.dark.scss',
3336
light: './public/sass/grafana.light.scss',
3437
fn_dashboard: './public/app/fn_dashboard.ts',
38+
swagger: './public/swagger/index.tsx',
3539
},
3640

3741
module: {
@@ -84,6 +88,13 @@ module.exports = (env = {}) =>
8488
excludeChunks: ['manifest', 'dark', 'light', 'fn_dashboard'],
8589
chunksSortMode: 'none',
8690
}),
91+
new HtmlWebpackPlugin({
92+
filename: path.resolve(__dirname, '../../public/views/swagger.html'),
93+
template: path.resolve(__dirname, '../../public/views/swagger-template.html'),
94+
inject: false,
95+
chunksSortMode: 'none',
96+
excludeChunks: ['dark', 'light', 'fn_dashboard'],
97+
}),
8798
// Added fn_dashboard/index.html
8899
new HtmlWebpackPlugin({
89100
filename: path.resolve(__dirname, '../../public/microfrontends/fn_dashboard/index.html'),
@@ -111,5 +122,6 @@ module.exports = (env = {}) =>
111122
}
112123
});
113124
},
125+
new EnvironmentPlugin(envConfig),
114126
],
115127
});

0 commit comments

Comments
 (0)