Make Git a native feature with an off switch

- Add the native feature runtime in src/lib/features/: the catalog, the switches, the first-start migration, the loader, and the feature sessions.
- Add Settings → Features and the features settings section.
- Add features_legacy. It reads the old plugin packages and changes nothing.
- Move Git from the plugin into src/lib/features/git/, on host internals.
- Remove api.git, the git contribution key, and the SDK Git types.
- Add pnpm check:features. It fails when a feature module loads at start.
- Update the tests, the menu inventory, the docs, and UI-055.
This commit is contained in:
Knotty Wyvern
2026-10-29 15:51:21 -07:00
parent 58f77b2e9f
commit d3218b2501
68 changed files with 2068 additions and 324 deletions
+5 -1
View File
@@ -195,7 +195,7 @@ function installMock(options, commands) {
if (target !== pageId) channel.postMessage({ event, payload, target });
};
const SETTINGS_FILE = "runestone.smoke.settings-file", TRANSFERS = "runestone.smoke.tab-transfers";
const SECTIONS = ["general", "appearance", "customThemes", "customThemesLegacy", "language"];
const SECTIONS = ["general", "appearance", "customThemes", "customThemesLegacy", "language", "features"];
const readJson = (key, fallback) => { try { return JSON.parse(localStorage.getItem(key)) ?? fallback; } catch { return fallback; } };
const settingsFile = () => readJson(SETTINGS_FILE, null);
const snapshot = () => {
@@ -223,6 +223,10 @@ function installMock(options, commands) {
// src-tauri/src/browser_engine.rs. Tests of the engine setup replace it.
browser_engine_status: () => ({ state: "installed", version: "0.1.8", bytes: 160612374, received: 0, error: null }),
settings_read: () => snapshot(),
// src-tauri/src/features.rs: no old plugin package of a native feature is installed.
features_legacy: () => [],
// The editor asks for the Git line of the cursor while the Git feature is on. Tests of Git replace it.
git_blame: () => null,
settings_migrate: ({ sections }) => {
if (!settingsFile()) localStorage.setItem(SETTINGS_FILE, JSON.stringify({ schema: 1, revision: 1, ...sections }));
return snapshot();