Release RuneStone 0.1.7 with plugin documents and shared menus

This commit is contained in:
Knotty Wyvern
2026-10-06 09:29:09 -07:00
parent 6b7af0d527
commit 5d0a4a24f9
75 changed files with 2286 additions and 1665 deletions
+40 -7
View File
@@ -5,7 +5,7 @@ import { readFileSync } from "node:fs";
const require = createRequire(import.meta.url);
const { chromium } = require(process.env.PLAYWRIGHT_MODULE || "playwright");
const browser = await chromium.launch({ headless: true, ...(process.env.CHROME_PATH ? { executablePath: process.env.CHROME_PATH } : {}) });
const context = await browser.newContext({ viewport: { width: 1440, height: 1000 } });
const context = await browser.newContext({ viewport: { width: 1440, height: 1000 }, locale: 'en-US', timezoneId: 'America/Vancouver' });
const page = await context.newPage();
page.setDefaultTimeout(10000);
const errors = [];
@@ -42,10 +42,14 @@ await page.context().addInitScript(({ manifest, pluginCode }) => {
if (command === "plugin:window|is_maximized") return false;
if (command.startsWith("plugin:window|")) return null;
if (command === "plugins_snapshot") return snapshot();
if (command === "plugins_choose") return [{ token: 'candidate', source: 'C:/Downloads/overview.runestone-plugin', manifest, error: null }];
if (command === "plugins_choose") return [{ token: 'candidate', source: 'C:/Downloads/overview.zip', manifest, error: null }];
if (command === "plugins_from_git") {
if (args.tag === 'missing') throw new Error('Release not found. Publish a release with one plugin ZIP.');
return [{ token: 'git-candidate', source: args.url + ' @ ' + (args.tag || 'v1.0.0'), manifest, error: null }];
}
if (command === "plugins_cancel") { removalPrepared = false; return; }
if (command === "plugins_install") {
installed = [{ manifest, hash: 'reviewed-hash', enabled: args.enabled, path, error: null, removal: false }];
installed = [{ manifest, hash: 'reviewed-hash', enabled: args.enabled, installedAt: Date.parse('2026-10-05T18:24:36Z'), path, error: null, removal: false }];
emit('plugins-changed', null); return [{ name: manifest.name, error: null }];
}
if (command === "plugins_set_enabled") {
@@ -119,19 +123,39 @@ async function settings() {
await page.getByRole('button', { name: 'Settings (Ctrl+,)', exact: true }).click();
await settingsDialog.getByRole('button', { name: 'Plug-ins', exact: true }).click();
}
async function uninstall() { await settingsDialog.getByRole('button', { name: 'Uninstall Workspace overview', exact: true }).click(); }
async function uninstall() { await settingsDialog.locator('.card').filter({ hasText: 'Workspace overview' }).getByRole('button', { name: 'Uninstall', exact: true }).click(); }
try {
await page.goto(process.env.SMOKE_URL || 'http://127.0.0.1:1420');
await page.getByText('smoke-workspace', { exact: true }).waitFor();
await settings();
await settingsDialog.getByRole('button', { name: 'Install from file', exact: true }).click();
assert.equal(await settingsDialog.getByRole('button', { name: 'Install from folder', exact: true }).count(), 0);
assert.equal(await settingsDialog.getByRole('button', { name: 'Install from file', exact: true }).count(), 0);
await settingsDialog.getByRole('button', { name: 'Install plugin ZIP', exact: true }).click();
let review = page.getByRole('dialog', { name: 'Review plugin installation', exact: true });
await review.getByText('Source: C:/Downloads/overview.zip', { exact: true }).waitFor();
await review.getByRole('button', { name: 'Cancel', exact: true }).click();
assert.equal(await count('plugins_install'), 0);
await settingsDialog.getByRole('button', { name: 'Install from folder', exact: true }).click();
const gitButton = settingsDialog.getByRole('button', { name: 'Install from Git link', exact: true });
await gitButton.click();
const gitDialog = page.getByRole('dialog', { name: 'Install from Git link', exact: true });
await gitDialog.getByLabel('Repository link', { exact: true }).fill('https://git.example/owner/plugin.git');
await gitDialog.getByLabel('Release tag (optional)', { exact: true }).fill('missing');
await gitDialog.getByLabel('Access token (optional)', { exact: true }).fill('test-token');
await gitDialog.getByRole('button', { name: 'Review release', exact: true }).click();
await gitDialog.getByRole('alert').getByText(/Release not found/).waitFor();
assert.equal(await gitDialog.getByLabel('Access token (optional)', { exact: true }).inputValue(), '');
await gitDialog.getByLabel('Release tag (optional)', { exact: true }).fill('v1.0.0');
await gitDialog.getByRole('button', { name: 'Review release', exact: true }).click();
await review.getByText('Source: https://git.example/owner/plugin.git @ v1.0.0', { exact: true }).waitFor();
await review.getByRole('button', { name: 'Cancel', exact: true }).click();
assert.equal(await count('plugins_install'), 0);
assert(await gitButton.evaluate(element => element === document.activeElement));
await settingsDialog.getByRole('button', { name: 'Install plugin ZIP', exact: true }).click();
await review.getByRole('button', { name: 'Install and enable', exact: true }).click();
await settingsDialog.getByRole('switch', { name: 'Workspace overview', exact: true }).waitFor();
assert(await settingsDialog.getByRole('switch', { name: 'Workspace overview', exact: true }).isChecked());
assert.equal(await settingsDialog.locator('time').getAttribute('datetime'), '2026-10-05T18:24:36.000Z');
assert.match(await settingsDialog.locator('time').innerText(), /Oct 5, 2026.*11:24:36 AM PDT/);
await page.screenshot({ path: '.audit/plugin-manager-installed.png' });
await page.keyboard.press('Escape');
await page.getByRole('button', { name: 'Plugin commands and views', exact: true }).click();
@@ -167,6 +191,15 @@ try {
await settings();
await page.screenshot({ path: '.audit/plugin-manager-narrow.png' });
assert.equal(await settingsDialog.evaluate(element => element.scrollWidth > element.clientWidth), false);
await gitButton.click();
await gitDialog.getByLabel('Repository link', { exact: true }).fill('https://git.example/owner/plugin.git');
await page.screenshot({ path: '.audit/plugin-git-narrow.png' });
assert.equal(await gitDialog.evaluate(element => element.scrollWidth > element.clientWidth), false);
await gitDialog.getByRole('button', { name: 'Review release', exact: true }).click();
await review.getByRole('button', { name: 'Install', exact: true }).click();
await settingsDialog.getByRole('switch', { name: 'Workspace overview', exact: true }).waitFor();
assert.equal(await settingsDialog.getByRole('switch', { name: 'Workspace overview', exact: true }).isChecked(), false);
assert.equal(await count('plugins_from_git'), 3);
assert.deepEqual(errors, []);
console.log('External plugin smoke passed: file/folder review, code loading, command/view, one confirmation, cancellation, focus, cleanup, and uninstall.');
console.log('External plugin smoke passed: ZIP and Git-link review, download errors, token clearing, disabled installation, code loading, cancellation, focus, cleanup, and uninstall.');
} finally { await browser.close(); }