feat: upgrade to gnome 51

Adds GNOME Shell 51 to shell-version and moves the build onto the
GNOME 51 type packages.

- switch to @girs/gjs 5.5.0 and the -51 namespace packages (shell/st/meta
  plus gio/glib/gobject/gtk/adw)
- drop @girs/gnome-shell 49, the pinned @girs/gjs 4.0.0-beta.38 and the 16
  pnpm overrides it needed. The umbrella is still GNOME 50 and pulls St-18
  and Meta-18 types that clash with the -51 packages
- types/: hand-written declarations for the two Shell JS modules this
  extension imports (extension.js and prefs.js). Upstream has these for 51
  in 51.0.0-alpha.1, but that is not published to npm yet, so declaring the
  handful of symbols we use keeps installs registry-only
- TypeScript 6.0.3 rather than 7: typescript-eslint requires <6.1.0 and
  ts-jest requires <7. TS 6 also needs an explicit rootDir (TS5011)
- eslint 10.12, @eslint/js 10.0.1, eslint-plugin-jsdoc 65.3.4 and
  typescript-eslint 8.71.2
This commit is contained in:
Lucas Oskorep committed 2026-10-15 01:54:51 -04:00
1 parent 203b573168
commit 28f7e7ccc2
8 files changed
+906 -951

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
/**
* GNOME Shell runtime globals.
*
* The `global` object is created by the shell before an extension is loaded and
* has no `.gir`, so it is not covered by the generated `@girs/*-51` packages.
* Upstream ships these in `@girs/gnome-shell`, but its GNOME 51 build
* (51.0.0-alpha.1) is unpublished, and v50 pulls St-18/Meta-18 types that
* collide with the -51 packages. Declaring the few symbols we use keeps the
* project on GNOME 51 types and installable from the registry.
*
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/environment.js
*/
import type Shell from "@girs/shell-51";
declare global {
/** Global shell object created by GNOME Shell on startup. */
const global: Shell.Global;
}
export {};
+86
View File
@@ -0,0 +1,86 @@
/**
* Ambient declarations for the GNOME Shell JavaScript modules this extension
* imports.
*
* Shell's JavaScript API has no `.gir`, so generated `@girs/*` types do not
* cover it. Upstream maintains those types in `@girs/gnome-shell`, but its
* GNOME 51 support (51.0.0-alpha.1) is unpublished on npm, and v50 depends on
* St-18/Meta-18 types that conflict with the -51 packages this project uses.
* Only the symbols actually imported here are declared; extend as needed.
*
* Signatures follow GNOME Shell 51:
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/extensions/extension.js
* @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/extensions/prefs.js
*/
declare module "resource:///org/gnome/shell/extensions/extension.js" {
import type Gio from "@girs/gio-2.0";
/** Parsed contents of the extension's `metadata.json`. */
export interface ExtensionMetadata {
uuid: string;
name: string;
description: string;
"shell-version"?: string[];
"settings-schema"?: string;
"gettext-domain"?: string;
url?: string;
[key: string]: unknown;
}
/**
* Base class for an extension's `extension.js` default export.
*
* GNOME Shell 51 requires `disable()` to stay synchronous; returning a
* promise now throws.
*/
export class Extension {
constructor(metadata: ExtensionMetadata);
readonly metadata: ExtensionMetadata;
readonly uuid: string;
readonly path: string;
/** Returns a {@link Gio.Settings} for the extension's schema. */
getSettings(schema?: string | null, subdir?: string | null): Gio.Settings;
/** Marks the extension's settings as translatable. */
translateConfig(): void;
/** Opens the extension's preferences dialog, if it has one. */
openPreferences(): void;
enable(): void;
disable(): void;
}
}
declare module "resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js" {
import type Gio from "@girs/gio-2.0";
import type Adw from "@girs/adw-1";
/** Marks a string for translation and returns the translation. */
export function gettext(str: string): string;
/** Pluralised form of {@link gettext}. */
export function ngettext(fid: string, fidPlural: string, n: number): string;
/** Context-sensitive form of {@link gettext}. */
export function pgettext(context: string, str: string): string;
/** Base class for an extension's `prefs.js` default export. */
export class ExtensionPreferences {
readonly metadata: Record<string, unknown>;
readonly uuid: string;
readonly path: string;
/** Returns a {@link Gio.Settings} for the extension's schema. */
getSettings(schema?: string | null, subdir?: string | null): Gio.Settings;
/** Marks the extension's settings as translatable. */
translateConfig(): void;
/** Called by the shell to populate the preferences window. */
fillPreferencesWindow(window: Adw.PreferencesWindow): Promise<void> | void;
}
}