Find the Terminal plugin the same way as the runner, and wait for formula results
pluginMocks.mjs now finds the compiled Terminal plugin through RUNESTONE_PLUGIN_REPOS, like the "@requires plugin:terminal" check. Before, it used a path relative to the file, which fails in a worktree. tables/formulas waits for the cycle results after Ctrl+Enter. Under load, the check ran before the table rendered again.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { pluginRepo } from "./index.mjs";
|
||||
|
||||
/** An installed package of the old Table Formulas plugin. RuneStone now includes the feature and must not load this code. */
|
||||
export const oldTableFormulasRow = {
|
||||
@@ -13,7 +14,8 @@ export const oldTableFormulasRow = {
|
||||
* `extraRows` adds installed rows without code, for example `oldTableFormulasRow`.
|
||||
*/
|
||||
export async function mockFeaturePlugins(surface, extraRows = []) {
|
||||
const root = process.env.RUNESTONE_TERMINAL_DIST ? pathToFileURL(resolve(process.env.RUNESTONE_TERMINAL_DIST) + "/") : new URL("../../../../RuneStone_Terminal/dist/", import.meta.url);
|
||||
// The runner checks the same folder for "@requires plugin:terminal".
|
||||
const root = pathToFileURL(resolve(process.env.RUNESTONE_TERMINAL_DIST || pluginRepo("RuneStone_Terminal/dist")) + "/");
|
||||
const packages = [{
|
||||
manifest: JSON.parse(await readFile(new URL("plugin.json", root), "utf8")),
|
||||
code: await readFile(new URL("main.js", root), "utf8"),
|
||||
|
||||
Reference in New Issue
Block a user