feat: isolated plugin system (#2742)

(cherry picked from commit f2ac2e5b84)
This commit is contained in:
Himself65
2023-06-09 16:43:46 +08:00
committed by Alex Yang
parent a0ee00a4b2
commit af205cde7c
51 changed files with 489 additions and 209 deletions
+6 -2
View File
@@ -1,12 +1,12 @@
/* eslint-disable no-async-promise-executor */
import { spawn } from 'node:child_process';
import { readFileSync } from 'node:fs';
import path from 'node:path';
import path, { resolve } from 'node:path';
import electronPath from 'electron';
import * as esbuild from 'esbuild';
import { config, electronDir } from './common.mjs';
import { config, electronDir, rootDir } from './common.mjs';
// this means we don't spawn electron windows, mainly for testing
const watchMode = process.argv.includes('--watch');
@@ -69,6 +69,10 @@ function spawnOrReloadElectron() {
const common = config();
async function watchPlugins() {
spawn('yarn', ['dev'], {
stdio: 'inherit',
cwd: resolve(rootDir, './packages/plugin-infra'),
});
await import('./plugins/dev-plugins.mjs');
}