Convert project to ESM (#58)

* Convert to ESM, enforce file single naming convention.

* Update fs-extra esm usage.

* Fix minimatch import.

* fixes

* triple-beam issue is finally fixed.
This commit is contained in:
Daniel Scalzi
2023-03-17 19:53:27 -04:00
committed by GitHub
parent 82967469e9
commit b55b7af689
34 changed files with 491 additions and 518 deletions

View File

@@ -1,14 +1,15 @@
import { lstat, mkdirs, pathExists, readdir, readFile, writeFile } from 'fs-extra'
import { mkdirs, pathExists } from 'fs-extra/esm'
import { lstat, readdir, readFile, writeFile } from 'fs/promises'
import { Server, Module } from 'helios-distribution-types'
import { dirname, join, resolve as resolvePath } from 'path'
import { URL } from 'url'
import { VersionSegmentedRegistry } from '../../util/VersionSegmentedRegistry'
import { ServerMeta, getDefaultServerMeta, ServerMetaOptions, UntrackedFilesOption } from '../../model/nebula/servermeta'
import { BaseModelStructure } from './BaseModel.struct'
import { MiscFileStructure } from './module/File.struct'
import { LibraryStructure } from './module/Library.struct'
import { MinecraftVersion } from '../../util/MinecraftVersion'
import { addSchemaToObject, SchemaTypes } from '../../util/SchemaUtil'
import { VersionSegmentedRegistry } from '../../util/VersionSegmentedRegistry.js'
import { ServerMeta, getDefaultServerMeta, ServerMetaOptions, UntrackedFilesOption } from '../../model/nebula/ServerMeta.js'
import { BaseModelStructure } from './BaseModel.struct.js'
import { MiscFileStructure } from './module/File.struct.js'
import { LibraryStructure } from './module/Library.struct.js'
import { MinecraftVersion } from '../../util/MinecraftVersion.js'
import { addSchemaToObject, SchemaTypes } from '../../util/SchemaUtil.js'
export class ServerStructure extends BaseModelStructure<Server> {