mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Use externally built core plugins (#76682)
This commit is contained in:
committed by
GitHub
parent
da4e9c73f6
commit
d83142c513
11
package.json
11
package.json
@@ -6,9 +6,10 @@
|
||||
"version": "10.3.0-pre",
|
||||
"repository": "github:grafana/grafana",
|
||||
"scripts": {
|
||||
"build": "yarn i18n:compile && NODE_ENV=production webpack --progress --config scripts/webpack/webpack.prod.js",
|
||||
"prebuild": "yarn i18n:compile && yarn plugin:build",
|
||||
"build": "yarn prebuild & NODE_ENV=production webpack --progress --config scripts/webpack/webpack.prod.js",
|
||||
"build:nominify": "yarn run build --env noMinify=1",
|
||||
"dev": "yarn i18n:compile && NODE_ENV=dev webpack --progress --color --config scripts/webpack/webpack.dev.js",
|
||||
"dev": "yarn prebuild & NODE_ENV=dev webpack --progress --color --config scripts/webpack/webpack.dev.js",
|
||||
"e2e": "./e2e/start-and-run-suite",
|
||||
"e2e:debug": "./e2e/start-and-run-suite debug",
|
||||
"e2e:dev": "./e2e/start-and-run-suite dev",
|
||||
@@ -55,9 +56,9 @@
|
||||
"betterer:stats": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/reportBettererStats.ts",
|
||||
"betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts",
|
||||
"generate-icons-bundle-cache-file": "node ./scripts/generate-icon-bundle.js",
|
||||
"plugin:build": "lerna run build --ignore=\"@grafana/*\"",
|
||||
"plugin:build:commit": "lerna run build:commit --ignore=\"@grafana/*\"",
|
||||
"plugin:build:dev": "lerna run dev --ignore=\"@grafana/*\""
|
||||
"plugin:build": "lerna run build --ignore=\"@grafana/*\" --ignore=\"@grafana-plugins/input-datasource\"",
|
||||
"plugin:build:commit": "lerna run build:commit --ignore=\"@grafana/*\" --ignore=\"@grafana-plugins/input-datasource\"",
|
||||
"plugin:build:dev": "lerna run dev --ignore=\"@grafana/*\" --ignore=\"@grafana-plugins/input-datasource\""
|
||||
},
|
||||
"grafana": {
|
||||
"whatsNewUrl": "https://grafana.com/docs/grafana/next/whatsnew/whats-new-in-v10-1/",
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/config"
|
||||
"github.com/grafana/grafana/pkg/plugins/pluginscdn"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
)
|
||||
|
||||
// Service provides methods for constructing asset paths for plugins.
|
||||
@@ -57,8 +58,14 @@ func (s *Service) Base(n PluginInfo) (string, error) {
|
||||
// Module returns the module.js path for the specified plugin.
|
||||
func (s *Service) Module(n PluginInfo) (string, error) {
|
||||
if n.class == plugins.ClassCore {
|
||||
baseDir := getBaseDir(n.dir)
|
||||
return path.Join("core:plugin", baseDir), nil
|
||||
if s.cfg.Features != nil &&
|
||||
s.cfg.Features.IsEnabled(featuremgmt.FlagExternalCorePlugins) &&
|
||||
filepath.Base(n.dir) == "dist" {
|
||||
// The core plugin has been built externally, use the module from the dist folder
|
||||
} else {
|
||||
baseDir := getBaseDir(n.dir)
|
||||
return path.Join("core:plugin", baseDir), nil
|
||||
}
|
||||
}
|
||||
if s.cdn.PluginSupported(n.pluginJSON.ID) {
|
||||
return s.cdn.AssetURL(n.pluginJSON.ID, n.pluginJSON.Info.Version, "module.js")
|
||||
|
||||
Reference in New Issue
Block a user