js: Port Config to ESM

The Config module is shared between the main process, D-Bus
services and tests, which previously prevented it from being
ported to ESM.

The previous commit removed the last outstanding blocker, so
we can now port the last remaining module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2880>
This commit is contained in:
Florian Müllner 2023-08-07 17:30:22 +02:00 committed by Marge Bot
parent 9546860d05
commit 8a8539ee67
14 changed files with 22 additions and 23 deletions

View File

@ -4,7 +4,7 @@ import GObject from 'gi://GObject';
import {bindtextdomain} from 'gettext';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
export class ExtensionBase {
#gettextDomain;

View File

@ -2,20 +2,20 @@
const pkg = imports.package;
/* The name of this package (not localized) */
var PACKAGE_NAME = '@PACKAGE_NAME@';
export const PACKAGE_NAME = '@PACKAGE_NAME@';
/* The version of this package */
var PACKAGE_VERSION = '@PACKAGE_VERSION@';
export const PACKAGE_VERSION = '@PACKAGE_VERSION@';
/* 1 if networkmanager is available, 0 otherwise */
var HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
export const HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
/* gettext package */
var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
export const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
/* locale dir */
var LOCALEDIR = '@datadir@/locale';
export const LOCALEDIR = '@datadir@/locale';
/* other standard directories */
var LIBEXECDIR = '@libexecdir@';
var PKGDATADIR = '@datadir@/@PACKAGE_NAME@';
export const LIBEXECDIR = '@libexecdir@';
export const PKGDATADIR = '@datadir@/@PACKAGE_NAME@';
/* g-i package versions */
var LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@';
export const LIBMUTTER_API_VERSION = '@LIBMUTTER_API_VERSION@';
var HAVE_BLUETOOTH = pkg.checkSymbol('GnomeBluetooth', '3.0',
export const HAVE_BLUETOOTH = pkg.checkSymbol('GnomeBluetooth', '3.0',
'Client.default_adapter_state')

View File

@ -1,7 +1,7 @@
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
const Config = imports.misc.config;
import * as Config from './config.js';
let _ifaceResource = null;

View File

@ -26,7 +26,7 @@ import 'gi://Rsvg?version=2.0';
import 'gi://Soup?version=3.0';
import 'gi://UPowerGlib?version=1.0';
const Config = imports.misc.config;
import * as Config from './config.js';
// Meta-related dependencies use a shared version
// from the compile-time config.

View File

@ -10,7 +10,7 @@ import {programInvocationName, programArgs} from 'system';
const _ = Gettext.gettext;
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import {loadInterfaceXML} from '../misc/fileUtils.js';
const PortalHelperResult = {

View File

@ -6,7 +6,7 @@ import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Soup from 'gi://Soup';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import * as Dialog from './dialog.js';
import * as ExtensionUtils from '../misc/extensionUtils.js';
import * as FileUtils from '../misc/fileUtils.js';

View File

@ -7,14 +7,13 @@ import St from 'gi://St';
import Shell from 'gi://Shell';
import * as Signals from '../misc/signals.js';
import * as Config from '../misc/config.js';
import * as ExtensionDownloader from './extensionDownloader.js';
import {ExtensionState, ExtensionType} from '../misc/extensionUtils.js';
import * as FileUtils from '../misc/fileUtils.js';
import * as Main from './main.js';
import * as MessageTray from './messageTray.js';
const Config = imports.misc.config;
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
const DISABLED_EXTENSIONS_KEY = 'disabled-extensions';
const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions';

View File

@ -10,6 +10,7 @@ import St from 'gi://St';
import * as AccessDialog from './accessDialog.js';
import * as AudioDeviceSelection from './audioDeviceSelection.js';
import * as Config from '../misc/config.js';
import * as Components from './components.js';
import * as CtrlAltTab from './ctrlAltTab.js';
import * as EndSessionDialog from './endSessionDialog.js';
@ -45,7 +46,6 @@ import * as KbdA11yDialog from './kbdA11yDialog.js';
import * as LocatePointer from './locatePointer.js';
import * as PointerA11yTimeout from './pointerA11yTimeout.js';
import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
const Config = imports.misc.config;
import * as Util from '../misc/util.js';
const WELCOME_DIALOG_LAST_SHOWN_VERSION = 'welcome-dialog-last-shown-version';

View File

@ -7,7 +7,7 @@ import GObject from 'gi://GObject';
import Shell from 'gi://Shell';
import St from 'gi://St';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import * as Main from './main.js';
import * as MessageTray from './messageTray.js';
import * as Params from '../misc/params.js';

View File

@ -10,7 +10,7 @@ import St from 'gi://St';
import * as Animation from './animation.js';
import {AppMenu} from './appMenu.js';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import * as CtrlAltTab from './ctrlAltTab.js';
import * as DND from './dnd.js';
import * as Overview from './overview.js';

View File

@ -5,7 +5,7 @@ import GLib from 'gi://GLib';
import Meta from 'gi://Meta';
import Shell from 'gi://Shell';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import * as Main from './main.js';
import * as Params from '../misc/params.js';
import * as Util from '../misc/util.js';

View File

@ -9,7 +9,7 @@ import * as Params from '../misc/params.js';
import {LoginDialog} from '../gdm/loginDialog.js';
import {UnlockDialog} from '../ui/unlockDialog.js';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
const DEFAULT_MODE = 'restrictive';

View File

@ -5,7 +5,7 @@ import GLib from 'gi://GLib';
import Meta from 'gi://Meta';
import Shell from 'gi://Shell';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import * as ExtensionDownloader from './extensionDownloader.js';
import * as ExtensionUtils from '../misc/extensionUtils.js';
import * as Main from './main.js';

View File

@ -5,7 +5,7 @@ import GObject from 'gi://GObject';
import Shell from 'gi://Shell';
import St from 'gi://St';
const Config = imports.misc.config;
import * as Config from '../misc/config.js';
import * as Main from './main.js';
import * as Dialog from './dialog.js';
import * as ModalDialog from './modalDialog.js';