migrate to "export default"

also, set no-use-before-define in linter
This commit is contained in:
Girish Ramakrishnan
2026-02-14 15:43:24 +01:00
parent ddb46646fa
commit 36aa641cb9
231 changed files with 2846 additions and 2728 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
/* global it:false */
import * as acme2 from '../acme2.js';
import * as common from './common.js';
import acme2 from '../acme2.js';
import common from './common.js';
import expect from 'expect.js';
/* global describe:false */
+2 -2
View File
@@ -1,7 +1,7 @@
/* global it:false */
import * as addonConfigs from '../addonconfigs.js';
import * as common from './common.js';
import addonConfigs from '../addonconfigs.js';
import common from './common.js';
import expect from 'expect.js';
/* global describe:false */
+2 -2
View File
@@ -1,8 +1,8 @@
/* global it:false */
import * as applinks from '../applinks.js';
import applinks from '../applinks.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
+3 -3
View File
@@ -1,11 +1,11 @@
/* jslint node:true */
import * as appPasswords from '../apppasswords.js';
import appPasswords from '../apppasswords.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
import * as users from '../users.js';
import users from '../users.js';
/* global it:false */
/* global describe:false */
+2 -2
View File
@@ -3,11 +3,11 @@
import apps from '../apps.js';
import AuditSource from '../auditsource.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import Location from '../location.js';
import safe from 'safetydance';
import * as users from '../users.js';
import users from '../users.js';
const { proxyApp } = common;
+2 -2
View File
@@ -1,7 +1,7 @@
/* global it:false */
import * as apptask from '../apptask.js';
import * as common from './common.js';
import apptask from '../apptask.js';
import common from './common.js';
import expect from 'expect.js';
import fs from 'node:fs';
import paths from '../paths.js';
+2 -2
View File
@@ -1,9 +1,9 @@
/* global it:false */
import * as archives from '../archives.js';
import archives from '../archives.js';
import backups from '../backups.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
+4 -4
View File
@@ -1,10 +1,10 @@
/* jslint node:true */
import * as archives from '../archives.js';
import * as backupCleaner from '../backupcleaner.js';
import archives from '../archives.js';
import backupCleaner from '../backupcleaner.js';
import backups from '../backups.js';
import * as backupSites from '../backupsites.js';
import * as common from './common.js';
import backupSites from '../backupsites.js';
import common from './common.js';
import expect from 'expect.js';
import moment from 'moment';
import tasks from '../tasks.js';
+3 -3
View File
@@ -1,14 +1,14 @@
/* jslint node:true */
import * as common from './common.js';
import common from './common.js';
import DataLayout from '../datalayout.js';
import * as tgz from '../backupformat/tgz.js';
import tgz from '../backupformat/tgz.js';
const EnsureFileSizeStream = tgz._EnsureFileSizeStream;
import expect from 'expect.js';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import * as rsync from '../backupformat/rsync.js';
import rsync from '../backupformat/rsync.js';
import safe from 'safetydance';
import stream from 'node:stream/promises';
+1 -1
View File
@@ -2,7 +2,7 @@
import backups from '../backups.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
+3 -3
View File
@@ -1,10 +1,10 @@
/* jslint node:true */
import * as archives from '../archives.js';
import archives from '../archives.js';
import backups from '../backups.js';
import * as backupSites from '../backupsites.js';
import backupSites from '../backupsites.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import constants from '../constants.js';
import expect from 'expect.js';
import safe from 'safetydance';
+2 -2
View File
@@ -1,9 +1,9 @@
/* jslint node:true */
import backups from '../backups.js';
import * as backupSites from '../backupsites.js';
import backupSites from '../backupsites.js';
import child_process from 'node:child_process';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import fs from 'node:fs';
import os from 'node:os';
+1 -1
View File
@@ -1,7 +1,7 @@
/* global it:false */
import blobs from '../blobs.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
/* global describe:false */
+2 -2
View File
@@ -1,8 +1,8 @@
/* global it:false */
import BoxError from '../boxerror.js';
import * as branding from '../branding.js';
import * as common from './common.js';
import branding from '../branding.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
+2 -2
View File
@@ -1,8 +1,8 @@
/* global it:false */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import * as cloudron from '../cloudron.js';
import common from './common.js';
import cloudron from '../cloudron.js';
import expect from 'expect.js';
import safe from 'safetydance';
+33 -32
View File
@@ -1,22 +1,22 @@
import apps from '../apps.js';
import * as appstore from '../appstore.js';
import * as backupSites from '../backupsites.js';
import appstore from '../appstore.js';
import backupSites from '../backupsites.js';
import constants from '../constants.js';
import * as cron from '../cron.js';
import * as dashboard from '../dashboard.js';
import * as database from '../database.js';
import * as domains from '../domains.js';
import cron from '../cron.js';
import dashboard from '../dashboard.js';
import database from '../database.js';
import domains from '../domains.js';
import expect from 'expect.js';
import fs from 'node:fs';
import locks from '../locks.js';
import * as mailer from '../mailer.js';
import * as mailServer from '../mailserver.js';
import mailer from '../mailer.js';
import mailServer from '../mailserver.js';
import nock from 'nock';
import path from 'node:path';
import * as settings from '../settings.js';
import settings from '../settings.js';
import tasks from '../tasks.js';
import timers from 'timers/promises';
import * as users from '../users.js';
import users from '../users.js';
const manifest = {
'id': 'io.cloudron.test',
@@ -168,28 +168,6 @@ const dashboardFqdn = `my.${domain.domain}`;
const appstoreToken = 'atoken';
const serverUrl = `http://localhost:${constants.PORT}`;
export {
createTree,
domainSetup,
databaseSetup,
setup,
cleanup,
checkMails,
clearMailQueue,
getDefaultBackupSite,
mockApiServerOrigin,
dashboardDomain,
dashboardFqdn,
app,
proxyApp,
admin,
auditSource,
domain, // the domain object,
manifest,
user,
appstoreToken,
serverUrl,
};
function createTree(root, obj) {
fs.rmSync(root, { recursive: true, force: true });
@@ -272,3 +250,26 @@ async function getDefaultBackupSite() {
const result = await backupSites.list();
return result[0];
}
export default {
createTree,
domainSetup,
databaseSetup,
setup,
cleanup,
checkMails,
clearMailQueue,
getDefaultBackupSite,
mockApiServerOrigin,
dashboardDomain,
dashboardFqdn,
app,
proxyApp,
admin,
auditSource,
domain, // the domain object,
manifest,
user,
appstoreToken,
serverUrl,
};
+1 -1
View File
@@ -1,7 +1,7 @@
/* global it, describe, before, after */
import BoxError from '../boxerror.js';
import * as database from '../database.js';
import database from '../database.js';
import expect from 'expect.js';
import safe from 'safetydance';
+2 -2
View File
@@ -1,8 +1,8 @@
/* jslint node:true */
import child_process from 'node:child_process';
import * as common from './common.js';
import * as df from '../df.js';
import common from './common.js';
import df from '../df.js';
import expect from 'expect.js';
/* global it:false */
+4 -4
View File
@@ -1,15 +1,15 @@
/* jslint node:true */
import async from 'async';
import * as common from './common.js';
import common from './common.js';
import constants from '../constants.js';
import * as directoryServer from '../directoryserver.js';
import directoryServer from '../directoryserver.js';
import expect from 'expect.js';
import * as groups from '../groups.js';
import groups from '../groups.js';
import ldap from 'ldapjs';
import safe from 'safetydance';
import speakeasy from 'speakeasy';
import * as users from '../users.js';
import users from '../users.js';
/* global it:false */
/* global describe:false */
+4 -4
View File
@@ -1,12 +1,12 @@
/* jslint node:true */
import * as common from './common.js';
import * as dns from '../dns.js';
import * as domains from '../domains.js';
import common from './common.js';
import dns from '../dns.js';
import domains from '../domains.js';
import expect from 'expect.js';
import { DNS as GCDNS } from '@google-cloud/dns';
import nock from 'nock';
import * as _ from '../underscore.js';
import _ from '../underscore.js';
/* global it:false */
/* global describe:false */
+2 -2
View File
@@ -1,7 +1,7 @@
/* global it:false */
import * as common from './common.js';
import * as dns from '../dns.js';
import common from './common.js';
import dns from '../dns.js';
import expect from 'expect.js';
/* global describe:false */
+2 -2
View File
@@ -1,7 +1,7 @@
/* jslint node:true */
import * as common from './common.js';
import * as docker from '../docker.js';
import common from './common.js';
import docker from '../docker.js';
import expect from 'expect.js';
import nock from 'nock';
+3 -3
View File
@@ -1,12 +1,12 @@
/* jslint node:true */
import child_process from 'node:child_process';
import * as common from './common.js';
import common from './common.js';
import constants from '../constants.js';
import * as dockerProxy from '../dockerproxy.js';
import dockerProxy from '../dockerproxy.js';
import expect from 'expect.js';
import nock from 'nock';
import * as syslogServer from '../../syslog.js';
import syslogServer from '../../syslog.js';
/* global it:false */
/* global xit:false */
+2 -2
View File
@@ -1,8 +1,8 @@
/* jslint node:true */
import * as dockerRegistries from '../dockerregistries.js';
import dockerRegistries from '../dockerregistries.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
+2 -2
View File
@@ -2,8 +2,8 @@
import apps from '../apps.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import * as domains from '../domains.js';
import common from './common.js';
import domains from '../domains.js';
import expect from 'expect.js';
import safe from 'safetydance';
+3 -3
View File
@@ -1,10 +1,10 @@
/* jslint node:true */
import * as common from './common.js';
import * as database from '../database.js';
import common from './common.js';
import database from '../database.js';
import eventlog from '../eventlog.js';
import expect from 'expect.js';
import * as notifications from '../notifications.js';
import notifications from '../notifications.js';
import timers from 'timers/promises';
/* global it:false */
+4 -4
View File
@@ -2,13 +2,13 @@
import async from 'async';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import * as externalLdap from '../externalldap.js';
import * as groups from '../groups.js';
import externalLdap from '../externalldap.js';
import groups from '../groups.js';
import ldap from 'ldapjs';
import safe from 'safetydance';
import * as users from '../users.js';
import users from '../users.js';
/* global describe:false */
/* global before:false */
+2 -2
View File
@@ -1,9 +1,9 @@
/* jslint node:true */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import * as groups from '../groups.js';
import groups from '../groups.js';
import safe from 'safetydance';
/* global it:false */
+1 -1
View File
@@ -1,7 +1,7 @@
/* global it, describe */
import expect from 'expect.js';
import * as ipaddr from '../ipaddr.js';
import ipaddr from '../ipaddr.js';
describe('ipaddr', function () {
describe('IPv4', function () {
+3 -3
View File
@@ -1,9 +1,9 @@
/* jslint node:true */
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import * as janitor from '../janitor.js';
import * as tokens from '../tokens.js';
import janitor from '../janitor.js';
import tokens from '../tokens.js';
/* global it:false */
/* global describe:false */
+5 -5
View File
@@ -1,14 +1,14 @@
/* jslint node:true */
import * as addonConfigs from '../addonconfigs.js';
import addonConfigs from '../addonconfigs.js';
import async from 'async';
import * as common from './common.js';
import common from './common.js';
import constants from '../constants.js';
import expect from 'expect.js';
import * as groups from '../groups.js';
import groups from '../groups.js';
import ldap from 'ldapjs';
import * as ldapServer from '../ldapserver.js';
import * as mail from '../mail.js';
import ldapServer from '../ldapserver.js';
import mail from '../mail.js';
import safe from 'safetydance';
/* global it:false */
+1 -1
View File
@@ -1,7 +1,7 @@
/* global it, describe, before, after */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
import locks from '../locks.js';
+1 -1
View File
@@ -2,7 +2,7 @@
import expect from 'expect.js';
import fs from 'node:fs';
import * as logs from '../logs.js';
import logs from '../logs.js';
import stream from 'node:stream';
/* global describe:false */
+2 -2
View File
@@ -1,9 +1,9 @@
/* global it:false */
import * as common from './common.js';
import common from './common.js';
import BoxError from '../boxerror.js';
import expect from 'expect.js';
import * as mail from '../mail.js';
import mail from '../mail.js';
import safe from 'safetydance';
/* global describe:false */
+2 -2
View File
@@ -1,10 +1,10 @@
/* global it:false */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import fs from 'node:fs';
import * as network from '../network.js';
import network from '../network.js';
import paths from '../paths.js';
import safe from 'safetydance';
+2 -2
View File
@@ -1,9 +1,9 @@
/* jslint node:true */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import * as notifications from '../notifications.js';
import notifications from '../notifications.js';
import safe from 'safetydance';
import timers from 'timers/promises';
+1 -1
View File
@@ -1,7 +1,7 @@
/* global describe, before, it, after */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import oidcClients from '../oidcclients.js';
import safe from 'safetydance';
+1 -1
View File
@@ -2,7 +2,7 @@
import BoxError from '../boxerror.js';
import expect from 'expect.js';
import * as openssl from '../openssl.js';
import openssl from '../openssl.js';
import safe from 'safetydance';
/* global describe:false */
+3 -3
View File
@@ -1,11 +1,11 @@
/* global it:false */
import * as appstore from '../appstore.js';
import appstore from '../appstore.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import nock from 'nock';
import * as provision from '../provision.js';
import provision from '../provision.js';
import safe from 'safetydance';
/* global describe:false */
+3 -3
View File
@@ -1,11 +1,11 @@
/* global it:false */
import * as common from './common.js';
import * as domains from '../domains.js';
import common from './common.js';
import domains from '../domains.js';
import expect from 'expect.js';
import fs from 'node:fs';
import paths from '../paths.js';
import * as reverseProxy from '../reverseproxy.js';
import reverseProxy from '../reverseproxy.js';
/* global describe:false */
/* global before:false */
+1 -1
View File
@@ -3,7 +3,7 @@
import constants from '../constants.js';
import expect from 'expect.js';
import safe from 'safetydance';
import * as server from '../server.js';
import server from '../server.js';
import superagent from '@cloudron/superagent';
/* global it:false */
+5 -5
View File
@@ -1,17 +1,17 @@
/* global it:false */
import * as backupSites from '../backupsites.js';
import backupSites from '../backupsites.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import consumers from 'node:stream/consumers';
import { execSync } from 'node:child_process';
import expect from 'expect.js';
import * as filesystem from '../storage/filesystem.js';
import filesystem from '../storage/filesystem.js';
import fs from 'node:fs';
import * as gcs from '../storage/gcs.js';
import gcs from '../storage/gcs.js';
import os from 'node:os';
import path from 'node:path';
import * as s3 from '../storage/s3.js';
import s3 from '../storage/s3.js';
import safe from 'safetydance';
import stream from 'stream/promises';
+2 -2
View File
@@ -1,6 +1,6 @@
/* global it:false */
import * as common from './common.js';
import common from './common.js';
const { createTree } = common;
import DataLayout from '../datalayout.js';
import { execSync } from 'node:child_process';
@@ -10,7 +10,7 @@ import os from 'node:os';
import path from 'node:path';
import paths from '../paths.js';
import safe from 'safetydance';
import * as syncer from '../syncer.js';
import syncer from '../syncer.js';
/* global describe:false */
/* global before:false */
+1 -1
View File
@@ -7,7 +7,7 @@ import net from 'node:net';
import path from 'node:path';
import paths from '../paths.js';
import safe from 'safetydance';
import * as syslogServer from '../../syslog.js';
import syslogServer from '../../syslog.js';
import timers from 'timers/promises';
/* global describe:false */
+2 -2
View File
@@ -1,10 +1,10 @@
/* jslint node:true */
import child_process from 'node:child_process';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import nock from 'nock';
import * as system from '../system.js';
import system from '../system.js';
/* global it:false */
/* global describe:false */
+2 -2
View File
@@ -1,13 +1,13 @@
/* jslint node:true */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import fs from 'node:fs';
import paths from '../paths.js';
import safe from 'safetydance';
import tasks from '../tasks.js';
import * as _ from '../underscore.js';
import _ from '../underscore.js';
/* global it:false */
/* global before:false */
+2 -2
View File
@@ -1,11 +1,11 @@
/* jslint node:true */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import oidcClients from '../oidcclients.js';
import safe from 'safetydance';
import * as tokens from '../tokens.js';
import tokens from '../tokens.js';
/* global it:false */
/* global describe:false */
+1 -1
View File
@@ -1,7 +1,7 @@
/* jslint node:true */
import expect from 'expect.js';
import * as translations from '../translations.js';
import translations from '../translations.js';
/* global it:false */
/* global describe:false */
+1 -1
View File
@@ -1,7 +1,7 @@
/* global it, describe, before, after */
import expect from 'expect.js';
import * as _ from '../underscore.js';
import _ from '../underscore.js';
describe('Underscore', function () {
it('pick', function () {
+2 -2
View File
@@ -2,14 +2,14 @@
import apps from '../apps.js';
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import constants from '../constants.js';
import expect from 'expect.js';
import nock from 'nock';
import paths from '../paths.js';
import safe from 'safetydance';
import semver from 'semver';
import * as updater from '../updater.js';
import updater from '../updater.js';
/* global describe:false */
/* global before:false */
+3 -3
View File
@@ -1,10 +1,10 @@
/* global it:false */
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import oidcClients from '../oidcclients.js';
import * as tokens from '../tokens.js';
import * as userDirectory from '../user-directory.js';
import tokens from '../tokens.js';
import userDirectory from '../user-directory.js';
/* global describe:false */
/* global before:false */
+3 -3
View File
@@ -1,12 +1,12 @@
/* global it:false */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import safe from 'safetydance';
import speakeasy from 'speakeasy';
import * as users from '../users.js';
import * as _ from '../underscore.js';
import users from '../users.js';
import _ from '../underscore.js';
/* global describe:false */
/* global before:false */
+1 -1
View File
@@ -1,7 +1,7 @@
/* global it, describe, before, after */
import expect from 'expect.js';
import * as validator from '../validator.js';
import validator from '../validator.js';
describe('Validator', function () {
const goodEmails = [
+2 -2
View File
@@ -1,11 +1,11 @@
/* jslint node:true */
import BoxError from '../boxerror.js';
import * as common from './common.js';
import common from './common.js';
import expect from 'expect.js';
import paths from '../paths.js';
import safe from 'safetydance';
import * as volumes from '../volumes.js';
import volumes from '../volumes.js';
/* global it:false */
/* global describe:false */