mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Toolkit: Remove plugin:dev
and plugin:test
(#67125)
This commit is contained in:
parent
362936b002
commit
872e79f687
@ -5,9 +5,7 @@ import { nodeVersionCheckerTask } from './tasks/nodeVersionChecker';
|
|||||||
import { buildPackageTask } from './tasks/package.build';
|
import { buildPackageTask } from './tasks/package.build';
|
||||||
import { pluginBuildTask } from './tasks/plugin.build';
|
import { pluginBuildTask } from './tasks/plugin.build';
|
||||||
import { ciBuildPluginTask, ciPackagePluginTask, ciPluginReportTask } from './tasks/plugin.ci';
|
import { ciBuildPluginTask, ciPackagePluginTask, ciPluginReportTask } from './tasks/plugin.ci';
|
||||||
import { pluginDevTask } from './tasks/plugin.dev';
|
|
||||||
import { pluginSignTask } from './tasks/plugin.sign';
|
import { pluginSignTask } from './tasks/plugin.sign';
|
||||||
import { pluginTestTask } from './tasks/plugin.tests';
|
|
||||||
import { pluginUpdateTask } from './tasks/plugin.update';
|
import { pluginUpdateTask } from './tasks/plugin.update';
|
||||||
import { getToolkitVersion, githubPublishTask } from './tasks/plugin.utils';
|
import { getToolkitVersion, githubPublishTask } from './tasks/plugin.utils';
|
||||||
import { bundleManagedTask } from './tasks/plugin/bundle.managed';
|
import { bundleManagedTask } from './tasks/plugin/bundle.managed';
|
||||||
@ -121,48 +119,6 @@ export const run = (includeInternalScripts = false) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
program
|
|
||||||
.command('plugin:dev')
|
|
||||||
.option('-w, --watch', 'Run plugin development mode with watch enabled')
|
|
||||||
.description('[Deprecated] Starts plugin dev mode')
|
|
||||||
.action(async (cmd) => {
|
|
||||||
console.log(chalk.yellow('\n⚠️ DEPRECATED. This command is deprecated and will be removed in v10. ⚠️'));
|
|
||||||
console.log(
|
|
||||||
'Please migrate to grafana create-plugin https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin\n'
|
|
||||||
);
|
|
||||||
|
|
||||||
await execTask(pluginDevTask)({
|
|
||||||
watch: !!cmd.watch,
|
|
||||||
silent: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
program
|
|
||||||
.command('plugin:test')
|
|
||||||
.option('-u, --updateSnapshot', 'Run snapshots update')
|
|
||||||
.option('--coverage', 'Run code coverage')
|
|
||||||
.option('--watch', 'Run tests in interactive watch mode')
|
|
||||||
.option('--testPathPattern <regex>', 'Run only tests with a path that matches the regex')
|
|
||||||
.option('--testNamePattern <regex>', 'Run only tests with a name that matches the regex')
|
|
||||||
.option('--maxWorkers <num>|<string>', 'Limit number of workers spawned')
|
|
||||||
.description('[Deprecated] Executes plugin tests')
|
|
||||||
.action(async (cmd) => {
|
|
||||||
console.log(chalk.yellow('\n⚠️ DEPRECATED. This command is deprecated and will be removed in v10. ⚠️'));
|
|
||||||
console.log(
|
|
||||||
'Please migrate to grafana create-plugin https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin\n'
|
|
||||||
);
|
|
||||||
|
|
||||||
await execTask(pluginTestTask)({
|
|
||||||
updateSnapshot: !!cmd.updateSnapshot,
|
|
||||||
coverage: !!cmd.coverage,
|
|
||||||
watch: !!cmd.watch,
|
|
||||||
testPathPattern: cmd.testPathPattern,
|
|
||||||
testNamePattern: cmd.testNamePattern,
|
|
||||||
maxWorkers: cmd.maxWorkers,
|
|
||||||
silent: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('plugin:sign')
|
.command('plugin:sign')
|
||||||
.option('--signatureType <type>', 'Signature Type')
|
.option('--signatureType <type>', 'Signature Type')
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
import { useSpinner } from '../utils/useSpinner';
|
|
||||||
|
|
||||||
import { lintPlugin } from './plugin.build';
|
|
||||||
import { bundlePlugin as bundleFn, PluginBundleOptions } from './plugin/bundle';
|
|
||||||
import { Task, TaskRunner } from './task';
|
|
||||||
|
|
||||||
const bundlePlugin = (options: PluginBundleOptions) =>
|
|
||||||
useSpinner('Bundling plugin in dev mode', () => bundleFn(options));
|
|
||||||
|
|
||||||
const pluginDevRunner: TaskRunner<PluginBundleOptions> = async (options) => {
|
|
||||||
if (options.watch) {
|
|
||||||
await bundleFn(options);
|
|
||||||
} else {
|
|
||||||
// Always fix lint in dev mode
|
|
||||||
await lintPlugin({ fix: true });
|
|
||||||
|
|
||||||
const result = await bundlePlugin(options);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const pluginDevTask = new Task<PluginBundleOptions>('Dev plugin', pluginDevRunner);
|
|
@ -1,8 +0,0 @@
|
|||||||
import { testPlugin, PluginTestOptions } from './plugin/tests';
|
|
||||||
import { Task, TaskRunner } from './task';
|
|
||||||
|
|
||||||
const pluginTestRunner: TaskRunner<PluginTestOptions> = async (options) => {
|
|
||||||
await testPlugin(options);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const pluginTestTask = new Task<PluginTestOptions>('Test plugin', pluginTestRunner);
|
|
Loading…
Reference in New Issue
Block a user