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/dbusServices/**
- js/portalHelper/** - js/portalHelper/**
- subprojects/extensions-app/** - subprojects/extensions-app/**
- subprojects/extensions-tool/**
parserOptions: parserOptions:
sourceType: module sourceType: module

View File

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