Plugins: renames snake cased plugin files (#107862)
* Plugins: renames plugin_loader * test(pluginloader): fix mock paths to pluginLoader * chore: rename sandbox files * Trigger build * Trigger build --------- Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
co-authored by
Jack Westbrook
parent
d786316766
commit
0f3edd3b5f
+2
-2
@@ -2538,10 +2538,10 @@ exports[`better eslint`] = {
|
||||
"public/app/features/plugins/loader/sharedDependencies.ts:5381": [
|
||||
[0, 0, 0, "* import is invalid because \'Layout,HorizontalGroup,VerticalGroup\' from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"]
|
||||
],
|
||||
"public/app/features/plugins/sandbox/distortion_map.ts:5381": [
|
||||
"public/app/features/plugins/sandbox/distortions.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/plugins/sandbox/sandbox_plugin_loader.ts:5381": [
|
||||
"public/app/features/plugins/sandbox/sandboxPluginLoader.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||
|
||||
@@ -45,7 +45,7 @@ jest.mock('../services/PreferencesService', () => ({
|
||||
}));
|
||||
|
||||
// FIXME: Tests break unless plugin loader is mocked. This is likely due to a circular dependency
|
||||
jest.mock('app/features/plugins/plugin_loader', () => ({}));
|
||||
jest.mock('app/features/plugins/pluginLoader', () => ({}));
|
||||
|
||||
describe('RichHistoryRemoteStorage', () => {
|
||||
let storage: RichHistoryRemoteStorage;
|
||||
|
||||
@@ -23,8 +23,8 @@ import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { DatasourceAPIVersions } from 'app/features/apiserver/client';
|
||||
import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants';
|
||||
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||
import { importDataSourcePlugin } from 'app/features/plugins/pluginLoader';
|
||||
import { getPluginSettings } from 'app/features/plugins/pluginSettings';
|
||||
import { importDataSourcePlugin } from 'app/features/plugins/plugin_loader';
|
||||
import { AccessControlAction } from 'app/types/accessControl';
|
||||
import { DataSourcePluginCategory } from 'app/types/datasources';
|
||||
import { ThunkDispatch, ThunkResult } from 'app/types/store';
|
||||
|
||||
@@ -15,15 +15,15 @@ import { AddedComponentsRegistry } from '../extensions/registry/AddedComponentsR
|
||||
import { AddedFunctionsRegistry } from '../extensions/registry/AddedFunctionsRegistry';
|
||||
import { AddedLinksRegistry } from '../extensions/registry/AddedLinksRegistry';
|
||||
import { ExposedComponentsRegistry } from '../extensions/registry/ExposedComponentsRegistry';
|
||||
import { importAppPlugin } from '../pluginLoader';
|
||||
import { getPluginSettings } from '../pluginSettings';
|
||||
import { importAppPlugin } from '../plugin_loader';
|
||||
|
||||
import AppRootPage from './AppRootPage';
|
||||
|
||||
jest.mock('../pluginSettings', () => ({
|
||||
getPluginSettings: jest.fn(),
|
||||
}));
|
||||
jest.mock('../plugin_loader', () => ({
|
||||
jest.mock('../pluginLoader', () => ({
|
||||
importAppPlugin: jest.fn(),
|
||||
}));
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ import {
|
||||
useExposedComponentsRegistry,
|
||||
useAddedFunctionsRegistry,
|
||||
} from '../extensions/ExtensionRegistriesContext';
|
||||
import { importAppPlugin } from '../pluginLoader';
|
||||
import { getPluginSettings } from '../pluginSettings';
|
||||
import { importAppPlugin } from '../plugin_loader';
|
||||
import { buildPluginSectionNav, pluginsLogger } from '../utils';
|
||||
|
||||
import { PluginErrorBoundary } from './PluginErrorBoundary';
|
||||
|
||||
@@ -61,7 +61,7 @@ class TestRuntimeDataSource extends RuntimeDataSource {
|
||||
}
|
||||
}
|
||||
|
||||
jest.mock('./plugin_loader', () => ({
|
||||
jest.mock('./pluginLoader', () => ({
|
||||
importDataSourcePlugin: (meta: DataSourcePluginMeta) => {
|
||||
return Promise.resolve(new DataSourcePlugin(TestDataSource as any));
|
||||
},
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
} from 'app/features/expressions/ExpressionDatasource';
|
||||
import { ExpressionDatasourceUID } from 'app/features/expressions/types';
|
||||
|
||||
import { importDataSourcePlugin } from './plugin_loader';
|
||||
import { importDataSourcePlugin } from './pluginLoader';
|
||||
|
||||
export class DatasourceSrv implements DataSourceService {
|
||||
private datasources: Record<string, DataSourceApi> = {}; // UID
|
||||
|
||||
@@ -3,7 +3,7 @@ import config from 'app/core/config';
|
||||
|
||||
import { getPanelPluginLoadError } from '../panel/components/PanelPluginError';
|
||||
|
||||
import { importPluginModule } from './plugin_loader';
|
||||
import { importPluginModule } from './pluginLoader';
|
||||
|
||||
const promiseCache: Record<string, Promise<PanelPlugin>> = {};
|
||||
const panelPluginCache: Record<string, PanelPlugin> = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
import { sandboxPluginDependencies } from '../sandbox/plugin_dependencies';
|
||||
import { sandboxPluginDependencies } from '../sandbox/pluginDependencies';
|
||||
|
||||
import { SHARED_DEPENDENCY_PREFIX } from './constants';
|
||||
import { SystemJS } from './systemjs';
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ import * as i18nModule from '@grafana/i18n/internal';
|
||||
import { server } from './loader/pluginLoader.mock';
|
||||
import { SystemJS } from './loader/systemjs';
|
||||
import { SystemJSWithLoaderHooks } from './loader/types';
|
||||
import { addTranslationsToI18n } from './plugin_loader';
|
||||
import { addTranslationsToI18n } from './pluginLoader';
|
||||
|
||||
describe('plugin_loader', () => {
|
||||
describe('pluginLoader', () => {
|
||||
describe('addTranslationsToI18n', () => {
|
||||
const systemJSPrototype: SystemJSWithLoaderHooks = SystemJS.constructor.prototype;
|
||||
const originalFetch = systemJSPrototype.fetch;
|
||||
+2
-2
@@ -30,8 +30,8 @@ import { sharedDependenciesMap } from './loader/sharedDependencies';
|
||||
import { decorateSystemJSFetch, decorateSystemJSResolve, decorateSystemJsOnload } from './loader/systemjsHooks';
|
||||
import { SystemJSWithLoaderHooks } from './loader/types';
|
||||
import { buildImportMap, resolveModulePath } from './loader/utils';
|
||||
import { importPluginModuleInSandbox } from './sandbox/sandbox_plugin_loader';
|
||||
import { shouldLoadPluginInFrontendSandbox } from './sandbox/sandbox_plugin_loader_registry';
|
||||
import { importPluginModuleInSandbox } from './sandbox/sandboxPluginLoader';
|
||||
import { shouldLoadPluginInFrontendSandbox } from './sandbox/sandboxPluginLoaderRegistry';
|
||||
import { pluginsLogger } from './utils';
|
||||
|
||||
const imports = buildImportMap(sharedDependenciesMap);
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
import type { AppPluginConfig } from '@grafana/runtime';
|
||||
import { getPluginSettings } from 'app/features/plugins/pluginSettings';
|
||||
|
||||
import { importAppPlugin } from './pluginLoader';
|
||||
import { clearPreloadedPluginsCache, preloadPlugins } from './pluginPreloader';
|
||||
import { importAppPlugin } from './plugin_loader';
|
||||
|
||||
jest.mock('app/core/services/context_srv', () => ({
|
||||
contextSrv: {
|
||||
@@ -26,7 +26,7 @@ jest.mock('app/features/plugins/pluginSettings', () => ({
|
||||
getPluginSettings: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('./plugin_loader', () => ({
|
||||
jest.mock('./pluginLoader', () => ({
|
||||
importAppPlugin: jest.fn(),
|
||||
}));
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { AppPluginConfig } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { getPluginSettings } from 'app/features/plugins/pluginSettings';
|
||||
|
||||
import { importAppPlugin } from './plugin_loader';
|
||||
import { importAppPlugin } from './pluginLoader';
|
||||
|
||||
export type PluginPreloadResult = {
|
||||
pluginId: string;
|
||||
|
||||
+2
-2
@@ -4,9 +4,9 @@ import { cloneDeep, isFunction } from 'lodash';
|
||||
|
||||
import { Monaco } from '@grafana/ui';
|
||||
|
||||
import { loadScriptIntoSandbox } from './code_loader';
|
||||
import { loadScriptIntoSandbox } from './codeLoader';
|
||||
import { forbiddenElements } from './constants';
|
||||
import { recursivePatchObjectAsLiveTarget } from './document_sandbox';
|
||||
import { recursivePatchObjectAsLiveTarget } from './documentSandbox';
|
||||
import { SandboxEnvironment, SandboxPluginMeta } from './types';
|
||||
import { logWarning, unboxRegexesFromMembraneProxy } from './utils';
|
||||
|
||||
+5
-5
@@ -5,8 +5,8 @@ import { BootData } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { defaultTrustedTypesPolicy } from 'app/core/trustedTypePolicies';
|
||||
|
||||
import { getPluginCode, getPluginLoadData, patchSandboxEnvironmentPrototype } from './code_loader';
|
||||
import { getGeneralSandboxDistortionMap, distortLiveApis } from './distortion_map';
|
||||
import { getPluginCode, getPluginLoadData, patchSandboxEnvironmentPrototype } from './codeLoader';
|
||||
import { getGeneralSandboxDistortionMap, distortLiveApis } from './distortions';
|
||||
import {
|
||||
getSafeSandboxDomElement,
|
||||
isDomElement,
|
||||
@@ -14,9 +14,9 @@ import {
|
||||
markDomElementStyleAsALiveTarget,
|
||||
patchObjectAsLiveTarget,
|
||||
patchWebAPIs,
|
||||
} from './document_sandbox';
|
||||
import { sandboxPluginDependencies } from './plugin_dependencies';
|
||||
import { sandboxPluginComponents } from './sandbox_components';
|
||||
} from './documentSandbox';
|
||||
import { sandboxPluginDependencies } from './pluginDependencies';
|
||||
import { sandboxPluginComponents } from './sandboxComponents';
|
||||
import { CompartmentDependencyModule, PluginFactoryFunction, SandboxEnvironment, SandboxPluginMeta } from './types';
|
||||
import { logError, logInfo } from './utils';
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import {
|
||||
setSandboxEnabledCheck,
|
||||
isPluginFrontendSandboxEnabled,
|
||||
isPluginFrontendSandboxEligible,
|
||||
} from './sandbox_plugin_loader_registry';
|
||||
} from './sandboxPluginLoaderRegistry';
|
||||
|
||||
jest.mock('@grafana/runtime', () => ({
|
||||
config: {
|
||||
@@ -11,7 +11,7 @@ import { AppPluginMeta, PluginMetaInfo, PluginType, AppPlugin } from '@grafana/d
|
||||
// Loaded after the `unmock` above
|
||||
import { addedComponentsRegistry, addedLinksRegistry, exposedComponentsRegistry } from '../extensions/registry/setup';
|
||||
import { SystemJS } from '../loader/systemjs';
|
||||
import { importAppPlugin } from '../plugin_loader';
|
||||
import { importAppPlugin } from '../pluginLoader';
|
||||
|
||||
jest.mock('../extensions/registry/setup');
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { GrafanaPlugin, NavModel, NavModelItem, PanelPluginMeta, PluginType } fr
|
||||
import { createMonitoringLogger } from '@grafana/runtime';
|
||||
|
||||
import { importPanelPluginFromMeta } from './importPanelPlugin';
|
||||
import { importAppPlugin, importDataSourcePlugin } from './pluginLoader';
|
||||
import { getPluginSettings } from './pluginSettings';
|
||||
import { importAppPlugin, importDataSourcePlugin } from './plugin_loader';
|
||||
|
||||
export async function loadPlugin(pluginId: string): Promise<GrafanaPlugin> {
|
||||
const info = await getPluginSettings(pluginId);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useCallback } from 'react';
|
||||
import { DataQuery, DataSourceApi, DataSourceJsonData, QueryEditorProps, StandardVariableQuery } from '@grafana/data';
|
||||
import { getTemplateSrv } from '@grafana/runtime';
|
||||
|
||||
import { importDataSourcePlugin } from '../../plugins/plugin_loader';
|
||||
import { importDataSourcePlugin } from '../../plugins/pluginLoader';
|
||||
import {
|
||||
hasCustomVariableSupport,
|
||||
hasDatasourceVariableSupport,
|
||||
|
||||
@@ -69,7 +69,7 @@ const mocks: Record<string, any> = {
|
||||
|
||||
setDataSourceSrv(mocks.dataSourceSrv as DataSourceSrv);
|
||||
|
||||
jest.mock('../../plugins/plugin_loader', () => ({
|
||||
jest.mock('../../plugins/pluginLoader', () => ({
|
||||
importDataSourcePlugin: () => mocks.pluginLoader.importDataSourcePlugin(),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user