Toolkit: Remove plugin:dev and plugin:test (#67125)

This commit is contained in:
Esteban Beltran 2023-04-24 17:18:42 +02:00 committed by GitHub
parent 362936b002
commit 872e79f687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 74 deletions

View File

@ -5,9 +5,7 @@ import { nodeVersionCheckerTask } from './tasks/nodeVersionChecker';
import { buildPackageTask } from './tasks/package.build';
import { pluginBuildTask } from './tasks/plugin.build';
import { ciBuildPluginTask, ciPackagePluginTask, ciPluginReportTask } from './tasks/plugin.ci';
import { pluginDevTask } from './tasks/plugin.dev';
import { pluginSignTask } from './tasks/plugin.sign';
import { pluginTestTask } from './tasks/plugin.tests';
import { pluginUpdateTask } from './tasks/plugin.update';
import { getToolkitVersion, githubPublishTask } from './tasks/plugin.utils';
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
.command('plugin:sign')
.option('--signatureType <type>', 'Signature Type')

View File

@ -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);

View File

@ -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);