extensions-tool: Adjust templates

Extensions are now loaded as modules, so adjust the templates
accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2795>
This commit is contained in:
Florian Müllner 2023-06-02 00:47:22 +02:00 committed by Marge Bot
parent c76861b3c1
commit 393d9df375
3 changed files with 7 additions and 18 deletions

View File

@ -7,5 +7,6 @@ overrides:
- js/dbusServices/**
- js/portalHelper/**
- subprojects/extensions-app/**
- subprojects/extensions-tool/**
parserOptions:
sourceType: module

View File

@ -16,12 +16,10 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* exported init */
const GETTEXT_DOMAIN = 'my-indicator-extension';
const GObject = imports.gi.GObject;
const St = imports.gi.St;
import GObject from 'gi://GObject';
import St from 'gi://St';
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
@ -48,9 +46,9 @@ class Indicator extends PanelMenu.Button {
}
});
class Extension {
constructor(uuid) {
this._uuid = uuid;
export default class Extension {
constructor(metadata) {
this._uuid = metadata.uuid;
ExtensionUtils.initTranslations(GETTEXT_DOMAIN);
}
@ -65,7 +63,3 @@ class Extension {
this._indicator = null;
}
}
function init(meta) {
return new Extension(meta.uuid);
}

View File

@ -16,9 +16,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* exported init */
class Extension {
export default class Extension {
constructor() {
}
@ -28,7 +26,3 @@ class Extension {
disable() {
}
}
function init() {
return new Extension();
}