Make Table Formulas a built-in feature

The formula engine, the rendered results, and the formula help now
come from src/lib/formulas/. The editor and the renderer call this
module directly. The tableFormulas contribution type is removed.

- Add the tableFormulas general setting (default on) and a switch in
  Settings > General. When it is off, formulas show as source text.
- Do not load an installed runestone.table-formulas package. Settings
  > Plug-ins marks it as included with RuneStone and tells the user
  that it can be removed. The user's files stay in place.
- Translate the formula help and the error descriptions into French,
  Japanese, and Simplified Chinese.
- Port the plugin unit tests. Test the setting and use a test-only
  contribution for the generic plugin lifecycle tests.
- Smoke tests load only Terminal. The formula and lifecycle tests use
  the built-in feature and its setting.
- Remove scripts/buildPlugins.mjs, the build:plugins script, and the
  plugin-packages requirement of the smoke runner.
- Remove RuneStone_Table_Formulas from the menu audit scope. It had no
  menu surfaces.
- Update the README, the user guides, and the developer references.
This commit is contained in:
Knotty Wyvern
2026-10-28 01:05:43 -07:00
parent 72671e5d01
commit 5e1533c371
43 changed files with 580 additions and 198 deletions
+3 -4
View File
@@ -81,6 +81,7 @@ A new command needs an entry in `generate_handler!` in `lib.rs`, in the command
| --- | --- |
| `layout/` | The app shell (`Workbench.svelte`), the file tree, tabs, panes, Settings, and dialogs |
| `editor/` | The Writer view (`LiveWriter.svelte`), the source editor (`EditorHost.svelte`), tables, links, images, and editor menus |
| `formulas/` | Table formulas: the parser and evaluator (`engine.ts`), the rendered results, the formula help, and the `tableFormulas` setting (`index.ts`) |
| `workspace/` | Tauri wrappers, document buffers, the note index and backlinks, paths, templates, and tab transfer (`tabTransfer.ts`) |
| `settings/` | The settings store (`store.ts`), and the code that moves the old browser values to the settings file (`migration.ts`) |
| `plugins/` | The plugin runtime, the SDK types (`sdk.ts`), and Settings → Plug-ins |
@@ -123,7 +124,7 @@ On macOS, it is `~/Library/Application Support/<identifier>/`. On Linux, it is `
{
"schema": 1,
"revision": 12,
"general": { "autosaveEnabled": true, "autosaveSeconds": 5, "showInternalFolder": false },
"general": { "autosaveEnabled": true, "autosaveSeconds": 5, "showInternalFolder": false, "tableFormulas": true },
"appearance": { "theme": "default", "mode": "dark" },
"customThemes": [],
"customThemesLegacy": [],
@@ -146,7 +147,7 @@ After that, `src/lib/settings/store.ts` reads the sections from memory and tells
## Product boundaries
- Workspace documents stay ordinary local files. Users keep access to them when plugins are disabled.
- The core includes basic Markdown table editing and rendering.
- The core includes Markdown table editing, rendering, and table formulas.
- Native file access, file watching, search, Git, and terminals belong in Rust.
- Optional features ship as plugins. The [plugin development reference](plugin-development.md) defines the package format and the API.
- For sync, prefer a local Git clone. Do not use a live network share as the sync path.
@@ -179,7 +180,6 @@ For type errors while you edit, run `pnpm check:watch`.
Some tests need files from outside this repository. Without those files, the tests skip and state the reason:
- `tests/unit/plugins/plugins.spec.ts` and `tests/unit/tables/formulas.spec.ts` import the compiled Table Formulas package. To run them, run `pnpm build:plugins` first. See [Build examples](plugin-development.md#build-examples).
- `tests/unit/release/installerVersion.spec.ts` needs the NSIS compiler that the Tauri CLI downloads on Windows.
- The Rust terminal tests start the real shells on the computer.
@@ -206,7 +206,6 @@ A test states what it needs near its top. The runner skips the test, with the re
| Line | Requirement |
| --- | --- |
| `// @requires plugin:table-formulas` | `plugin-packages/table-formulas/`. Run `pnpm build:plugins`. |
| `// @requires plugin:terminal` | The compiled Terminal plugin |
| `// @requires repo:RuneStone_Git/dist` | A file or folder in a sibling plugin checkout |
| `// @requires electron` | The browser engine dependencies. Run `npm ci --prefix browser-runtime`. |