Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .devcontainer/development/Containerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM registry.opensuse.org/opensuse/tumbleweed:latest

RUN zypper -n install sudo man vim gawk git openssh-clients bash-completion \
RUN zypper addrepo --refresh --no-gpgcheck "https://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_Tumbleweed/" nodejs-repo && \
zypper -n install sudo man vim gawk git openssh-clients bash-completion \
npm22 nodejs22 glib2-tools gettext-tools jq yq rsync zip

RUN npm install --global yarn

RUN useradd --create-home --shell /bin/bash developer
RUN echo "developer ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER developer
USER developer
4 changes: 2 additions & 2 deletions .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ jobs:
- name: Install translation tools
run: sudo apt-get install -y make gettext

- name: Install NodeJS 18
- name: Install NodeJS 22
uses: actions/setup-node@v5
with:
node-version: 18
node-version: 22
cache: 'yarn'

- name: Install the dependencies
Expand Down
17 changes: 2 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,7 @@
"typescript": "^4.8.4"
},
"dependencies": {
"@girs/gjs": "4.0.0-beta.37",
"@girs/gnome-shell": "49.0.1",
"@girs/gnomedesktop-4.0": "^4.0.0-4.0.0-beta.37",
"@girs/soup-3.0": "3.6.5-4.0.0-beta.37"
},
"resolutions": {
"@girs/adw-1": "1.8.0-4.0.0-beta.37",
"@girs/clutter-17": "17.0.0-4.0.0-beta.37",
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.37",
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.37",
"@girs/gio-2.0": "2.86.0-4.0.0-beta.37",
"@girs/glib-2.0": "2.86.0-4.0.0-beta.37",
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.37",
"@girs/gtk-4.0": "4.20.1-4.0.0-beta.37",
"@girs/st-17": "17.0.0-4.0.0-beta.37"
"@girs/gnome-shell": "^50.0.0-alpha.1",
"@girs/soup-3.0": "3.6.6-4.0.0-rc.3"
}
}
4 changes: 2 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const metadata: ExtensionMetadata = JSON.parse(data) as ExtensionMetadata;
const explicitMappings = new Map<string, string>(
Object.entries({
'@girs/adw-1': 'gi://Adw',
'@girs/clutter-17': 'gi://Clutter',
'@girs/clutter-18': 'gi://Clutter',
'@girs/gdk-4.0': 'gi://Gdk',
'@girs/gdkpixbuf-2.0': 'gi://GdkPixbuf',
'@girs/gio-2.0': 'gi://Gio',
Expand All @@ -33,7 +33,7 @@ const explicitMappings = new Map<string, string>(
'@girs/gnomedesktop-4.0': 'gi://GnomeDesktop?version=4.0',
'@girs/gtk-4.0': 'gi://Gtk',
'@girs/soup-3.0': 'gi://Soup?version=3.0',
'@girs/st-17': 'gi://St',
'@girs/st-18': 'gi://St',
})
);

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"46",
"47",
"48",
"49"
"49",
"50"
],
"gettext-domain": "github-manager@mackdk-on-github",
"version": 1
Expand Down
7 changes: 4 additions & 3 deletions src/main/typescript/extension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Extension, ExtensionMetadata } from '@girs/gnome-shell/dist/extensions/extension';
import { Extension } from '@girs/gnome-shell/dist/extensions/extension';
import { MetadataJson } from '@girs/gnome-shell/dist/types';

import { GitHubManager } from '@github-manager/core';
import { Logger, lazy } from '@github-manager/utils';
Expand All @@ -12,7 +13,7 @@ export default class GitHubManagerExtension extends Extension {

private gitHubManager?: GitHubManager;

public constructor(metadata: ExtensionMetadata) {
public constructor(metadata: MetadataJson) {
super(metadata);

Logger.initialize(metadata.name);
Expand All @@ -25,7 +26,7 @@ export default class GitHubManagerExtension extends Extension {
}

try {
GitHubManagerExtension.LOGGER.debug('Inizializing extension at {0}', new Date().toISOString());
GitHubManagerExtension.LOGGER.debug('Initializing extension at {0}', new Date().toISOString());
this.gitHubManager = new GitHubManager(this.metadata.name, this.path, this.getSettings());
this.gitHubManager.start();
} catch (err) {
Expand Down
29 changes: 18 additions & 11 deletions src/main/typescript/preferences/PreferencesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Adw from '@girs/adw-1';
import Gdk from '@girs/gdk-4.0';
import Gio from '@girs/gio-2.0';
import { gettext as _ } from '@girs/gnome-shell/dist/extensions/prefs';
import { ExtensionMetadata } from '@girs/gnome-shell/dist/types';
import { MetadataJson } from '@girs/gnome-shell/dist/types';
import GnomeDesktop from '@girs/gnomedesktop-4.0';
import Gtk from '@girs/gtk-4.0';

Expand Down Expand Up @@ -74,12 +74,12 @@ export function createAndBindWidget(

export function buildActionGroupFor(
dialog: Gtk.Window,
metadata: ExtensionMetadata,
metadata: MetadataJson,
settings: Gio.Settings
): Gio.ActionGroup {
const actionGroup = new Gio.SimpleActionGroup();
const baseUrl = metadata.url;
if (baseUrl === undefined) {
const baseUrl: unknown = metadata.url;
if (baseUrl === undefined || typeof baseUrl !== 'string') {
throw new Error('Unable to identify the extension url');
}

Expand Down Expand Up @@ -145,20 +145,18 @@ function resetToDefault(dialog: Gtk.Window, settings: Gio.Settings): void {
confirmation.present();
}

function about(dialog: Gtk.Window, metadata: ExtensionMetadata): void {
function about(dialog: Gtk.Window, metadata: MetadataJson): void {
try {
const baseUrl = metadata.url;
if (baseUrl === undefined) {
throw new Error('Unable to identify the extension url');
}
const baseUrl = requireStringMetadata(metadata, 'url');
const path = requireStringMetadata(metadata, 'path');

const extensionInfo = getAdditionalExtensionInfo(`${metadata.path}/extension-info.json`);
const extensionInfo = getAdditionalExtensionInfo(`${path}/extension-info.json`);

const iconTheme = Gtk.IconTheme.get_for_display(dialog.get_display());
const originalSearchPath = iconTheme.get_search_path();

// Adding the extension path to the icon theme directory, so that icons can be retrieved by name
iconTheme.add_search_path(metadata.path);
iconTheme.add_search_path(path);

const aboutDialog = new Adw.AboutWindow({
transientFor: dialog,
Expand Down Expand Up @@ -247,3 +245,12 @@ function getLocaleDisplayName(localeCode: string): string {
// Remove the encoding part if present
return result.replace(/\[[^[\]]*\]$/, '').trim();
}

function requireStringMetadata(metadata: MetadataJson, name: string): string {
const value: unknown = metadata[name];
if (value === undefined || typeof value !== 'string') {
throw new Error(`Unable to identify the extension ${name} in the extension metadata`);
}

return value;
}
4 changes: 2 additions & 2 deletions src/main/typescript/prefs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Adw from '@girs/adw-1';
import { ExtensionPreferences } from '@girs/gnome-shell/dist/extensions/prefs';
import { ExtensionMetadata } from '@girs/gnome-shell/dist/types';
import { MetadataJson } from '@girs/gnome-shell/dist/types';
import GObject from '@girs/gobject-2.0';
import Gtk from '@girs/gtk-4.0';

Expand All @@ -11,7 +11,7 @@ export default class GithubManagerPreferences extends ExtensionPreferences {
@lazy
private static readonly LOGGER: Logger = new Logger('GitHubManagerPreferences');

public constructor(metadata: ExtensionMetadata) {
public constructor(metadata: MetadataJson) {
super(metadata);

Logger.initialize(metadata.name);
Expand Down
4 changes: 2 additions & 2 deletions src/main/typescript/widget/GitHubWidget.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Clutter from '@girs/clutter-17';
import Clutter from '@girs/clutter-18';
import Gio from '@girs/gio-2.0';
import { Button } from '@girs/gnome-shell/dist/ui/panelMenu';
import GObject from '@girs/gobject-2.0';
import St from '@girs/st-17';
import St from '@girs/st-18';

import { GObjectMetaInfo, registerGObject } from '@github-manager/utils/gnome';

Expand Down
2 changes: 1 addition & 1 deletion src/main/typescript/widget/WidgetController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Clutter from '@girs/clutter-17';
import Clutter from '@girs/clutter-18';
import Gdk from '@girs/gdk-4.0';
import Gio from '@girs/gio-2.0';
import { Extension } from '@girs/gnome-shell/dist/extensions/extension';
Expand Down
Loading
Loading