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:
54
src/index.ts
54
src/index.ts
@@ -1,17 +1,19 @@
|
||||
/* tslint:disable:no-shadowed-variable */
|
||||
import dotenv from 'dotenv'
|
||||
import { writeFile } from 'fs-extra'
|
||||
import { writeFile } from 'fs/promises'
|
||||
import { resolve as resolvePath } from 'path'
|
||||
import { URL } from 'url'
|
||||
import { inspect } from 'util'
|
||||
import yargs from 'yargs'
|
||||
import { DistributionStructure } from './structure/spec_model/Distribution.struct'
|
||||
import { ServerStructure } from './structure/spec_model/Server.struct'
|
||||
import { VersionSegmentedRegistry } from './util/VersionSegmentedRegistry'
|
||||
import { VersionUtil } from './util/versionutil'
|
||||
import { MinecraftVersion } from './util/MinecraftVersion'
|
||||
import { LoggerUtil } from './util/LoggerUtil'
|
||||
import { generateSchemas } from './util/SchemaUtil'
|
||||
import yargs from 'yargs/yargs'
|
||||
import { Argv, CommandModule } from 'yargs'
|
||||
import { hideBin } from 'yargs/helpers'
|
||||
import { DistributionStructure } from './structure/spec_model/Distribution.struct.js'
|
||||
import { ServerStructure } from './structure/spec_model/Server.struct.js'
|
||||
import { VersionSegmentedRegistry } from './util/VersionSegmentedRegistry.js'
|
||||
import { VersionUtil } from './util/VersionUtil.js'
|
||||
import { MinecraftVersion } from './util/MinecraftVersion.js'
|
||||
import { LoggerUtil } from './util/LoggerUtil.js'
|
||||
import { generateSchemas } from './util/SchemaUtil.js'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
@@ -41,7 +43,7 @@ function getBaseURL(): string {
|
||||
return (new URL(baseUrl)).toString()
|
||||
}
|
||||
|
||||
function installLocalOption(yargs: yargs.Argv): yargs.Argv {
|
||||
function installLocalOption(yargs: Argv): Argv {
|
||||
return yargs.option('installLocal', {
|
||||
describe: 'Install the generated distribution to your local Helios data folder.',
|
||||
type: 'boolean',
|
||||
@@ -51,7 +53,7 @@ function installLocalOption(yargs: yargs.Argv): yargs.Argv {
|
||||
})
|
||||
}
|
||||
|
||||
function discardOutputOption(yargs: yargs.Argv): yargs.Argv {
|
||||
function discardOutputOption(yargs: Argv): Argv {
|
||||
return yargs.option('discardOutput', {
|
||||
describe: 'Delete cached output after it is no longer required. May be useful if disk space is limited.',
|
||||
type: 'boolean',
|
||||
@@ -61,7 +63,7 @@ function discardOutputOption(yargs: yargs.Argv): yargs.Argv {
|
||||
})
|
||||
}
|
||||
|
||||
function invalidateCacheOption(yargs: yargs.Argv): yargs.Argv {
|
||||
function invalidateCacheOption(yargs: Argv): Argv {
|
||||
return yargs.option('invalidateCache', {
|
||||
describe: 'Invalidate and delete existing caches as they are encountered. Requires fresh cache generation.',
|
||||
type: 'boolean',
|
||||
@@ -71,7 +73,7 @@ function invalidateCacheOption(yargs: yargs.Argv): yargs.Argv {
|
||||
})
|
||||
}
|
||||
|
||||
// function rootOption(yargs: yargs.Argv) {
|
||||
// function rootOption(yargs: Argv) {
|
||||
// return yargs.option('root', {
|
||||
// describe: 'File structure root.',
|
||||
// type: 'string',
|
||||
@@ -83,7 +85,7 @@ function invalidateCacheOption(yargs: yargs.Argv): yargs.Argv {
|
||||
// })
|
||||
// }
|
||||
|
||||
// function baseUrlOption(yargs: yargs.Argv) {
|
||||
// function baseUrlOption(yargs: Argv) {
|
||||
// return yargs.option('baseUrl', {
|
||||
// describe: 'Base url of your file host.',
|
||||
// type: 'string',
|
||||
@@ -106,7 +108,7 @@ function invalidateCacheOption(yargs: yargs.Argv): yargs.Argv {
|
||||
// }
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||
function namePositional(yargs: yargs.Argv) {
|
||||
function namePositional(yargs: Argv) {
|
||||
return yargs.option('name', {
|
||||
describe: 'Distribution index file name.',
|
||||
type: 'string',
|
||||
@@ -117,7 +119,7 @@ function namePositional(yargs: yargs.Argv) {
|
||||
// -------------
|
||||
// Init Commands
|
||||
|
||||
const initRootCommand: yargs.CommandModule = {
|
||||
const initRootCommand: CommandModule = {
|
||||
command: 'root',
|
||||
describe: 'Generate an empty standard file structure.',
|
||||
builder: (yargs) => {
|
||||
@@ -139,7 +141,7 @@ const initRootCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const initCommand: yargs.CommandModule = {
|
||||
const initCommand: CommandModule = {
|
||||
command: 'init',
|
||||
aliases: ['i'],
|
||||
describe: 'Base init command.',
|
||||
@@ -155,7 +157,7 @@ const initCommand: yargs.CommandModule = {
|
||||
// -----------------
|
||||
// Generate Commands
|
||||
|
||||
const generateServerCommand: yargs.CommandModule = {
|
||||
const generateServerCommand: CommandModule = {
|
||||
command: 'server <id> <version>',
|
||||
describe: 'Generate a new server configuration.',
|
||||
builder: (yargs) => {
|
||||
@@ -205,7 +207,7 @@ const generateServerCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const generateDistroCommand: yargs.CommandModule = {
|
||||
const generateDistroCommand: CommandModule = {
|
||||
command: 'distro [name]',
|
||||
describe: 'Generate a distribution index from the root file structure.',
|
||||
builder: (yargs) => {
|
||||
@@ -259,7 +261,7 @@ const generateDistroCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const generateSchemasCommand: yargs.CommandModule = {
|
||||
const generateSchemasCommand: CommandModule = {
|
||||
command: 'schemas',
|
||||
describe: 'Generate json schemas.',
|
||||
handler: async (argv) => {
|
||||
@@ -278,7 +280,7 @@ const generateSchemasCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const generateCommand: yargs.CommandModule = {
|
||||
const generateCommand: CommandModule = {
|
||||
command: 'generate',
|
||||
aliases: ['g'],
|
||||
describe: 'Base generate command.',
|
||||
@@ -293,7 +295,7 @@ const generateCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const validateCommand: yargs.CommandModule = {
|
||||
const validateCommand: CommandModule = {
|
||||
command: 'validate [name]',
|
||||
describe: 'Validate a distribution.json against the spec.',
|
||||
builder: (yargs) => {
|
||||
@@ -304,7 +306,7 @@ const validateCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const latestForgeCommand: yargs.CommandModule = {
|
||||
const latestForgeCommand: CommandModule = {
|
||||
command: 'latest-forge <version>',
|
||||
describe: 'Get the latest version of forge.',
|
||||
handler: async (argv) => {
|
||||
@@ -316,7 +318,7 @@ const latestForgeCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const recommendedForgeCommand: yargs.CommandModule = {
|
||||
const recommendedForgeCommand: CommandModule = {
|
||||
command: 'recommended-forge <version>',
|
||||
describe: 'Get the recommended version of forge. Returns latest if there is no recommended build.',
|
||||
handler: async (argv) => {
|
||||
@@ -341,7 +343,7 @@ const recommendedForgeCommand: yargs.CommandModule = {
|
||||
}
|
||||
}
|
||||
|
||||
const testCommand: yargs.CommandModule = {
|
||||
const testCommand: CommandModule = {
|
||||
command: 'test <mcVer> <forgeVer>',
|
||||
describe: 'Validate a distribution.json against the spec.',
|
||||
builder: (yargs) => {
|
||||
@@ -362,7 +364,7 @@ const testCommand: yargs.CommandModule = {
|
||||
|
||||
// Registering yargs configuration.
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
yargs
|
||||
yargs(hideBin(process.argv))
|
||||
.version(false)
|
||||
.scriptName('')
|
||||
.command(initCommand)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { McModInfo } from './mcmodinfo'
|
||||
import { McModInfo } from './McModInfo.js'
|
||||
|
||||
export interface McModInfoList {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Module } from 'helios-distribution-types'
|
||||
import { VersionSegmented } from '../util/VersionSegmented'
|
||||
import { Resolver } from './resolver'
|
||||
import { MinecraftVersion } from '../util/MinecraftVersion'
|
||||
import { VersionSegmented } from '../util/VersionSegmented.js'
|
||||
import { Resolver } from './Resolver.js'
|
||||
import { MinecraftVersion } from '../util/MinecraftVersion.js'
|
||||
|
||||
export abstract class BaseResolver implements Resolver, VersionSegmented {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import StreamZip from 'node-stream-zip'
|
||||
import { createHash } from 'crypto'
|
||||
import { Stats } from 'fs-extra'
|
||||
import { Stats } from 'fs'
|
||||
import { Artifact } from 'helios-distribution-types'
|
||||
import { RepoStructure } from '../../structure/repo/Repo.struct'
|
||||
import { BaseResolver } from '../baseresolver'
|
||||
import { MinecraftVersion } from '../../util/MinecraftVersion'
|
||||
import { VersionUtil } from '../../util/versionutil'
|
||||
import { LoggerUtil } from '../../util/LoggerUtil'
|
||||
import { RepoStructure } from '../../structure/repo/Repo.struct.js'
|
||||
import { BaseResolver } from '../BaseResolver.js'
|
||||
import { MinecraftVersion } from '../../util/MinecraftVersion.js'
|
||||
import { VersionUtil } from '../../util/VersionUtil.js'
|
||||
import { LoggerUtil } from '../../util/LoggerUtil.js'
|
||||
|
||||
export abstract class ForgeResolver extends BaseResolver {
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { createHash } from 'crypto'
|
||||
import { copy, lstat, mkdirs, pathExists, readFile, remove } from 'fs-extra'
|
||||
import { copy, mkdirs, pathExists, remove } from 'fs-extra/esm'
|
||||
import { lstat, readFile } from 'fs/promises'
|
||||
import { Module, Type } from 'helios-distribution-types'
|
||||
import { basename, join } from 'path'
|
||||
import { VersionManifestFG2 } from '../../../model/forge/VersionManifestFG2'
|
||||
import { LibRepoStructure } from '../../../structure/repo/LibRepo.struct'
|
||||
import { MavenUtil } from '../../../util/maven'
|
||||
import { PackXZExtractWrapper } from '../../../util/java/PackXZExtractWrapper'
|
||||
import { VersionUtil } from '../../../util/versionutil'
|
||||
import { ForgeResolver } from '../forge.resolver'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { LoggerUtil } from '../../../util/LoggerUtil'
|
||||
import { VersionManifestFG2 } from '../../../model/forge/VersionManifestFG2.js'
|
||||
import { LibRepoStructure } from '../../../structure/repo/LibRepo.struct.js'
|
||||
import { MavenUtil } from '../../../util/MavenUtil.js'
|
||||
import { PackXZExtractWrapper } from '../../../util/java/PackXZExtractWrapper.js'
|
||||
import { VersionUtil } from '../../../util/VersionUtil.js'
|
||||
import { ForgeResolver } from '../Forge.resolver.js'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { LoggerUtil } from '../../../util/LoggerUtil.js'
|
||||
|
||||
type ArrayElement<A> = A extends readonly (infer T)[] ? T : never
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { ForgeResolver } from '../forge.resolver'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { LoggerUtil } from '../../../util/LoggerUtil'
|
||||
import { VersionUtil } from '../../../util/versionutil'
|
||||
import { ForgeResolver } from '../Forge.resolver.js'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { LoggerUtil } from '../../../util/LoggerUtil.js'
|
||||
import { VersionUtil } from '../../../util/VersionUtil.js'
|
||||
import { Module, Type } from 'helios-distribution-types'
|
||||
import { LibRepoStructure } from '../../../structure/repo/LibRepo.struct'
|
||||
import { pathExists, remove, mkdirs, copy, writeFile, readFile, lstat, writeJson, exists } from 'fs-extra'
|
||||
import { LibRepoStructure } from '../../../structure/repo/LibRepo.struct.js'
|
||||
import { pathExists, remove, mkdirs, copy, writeJson } from 'fs-extra/esm'
|
||||
import { lstat, readFile, writeFile } from 'fs/promises'
|
||||
import { join, basename, dirname } from 'path'
|
||||
import { spawn } from 'child_process'
|
||||
import { JavaUtil } from '../../../util/java/javautil'
|
||||
import { VersionManifestFG3 } from '../../../model/forge/VersionManifestFG3'
|
||||
import { MavenUtil } from '../../../util/maven'
|
||||
import { JavaUtil } from '../../../util/java/JavaUtil.js'
|
||||
import { VersionManifestFG3 } from '../../../model/forge/VersionManifestFG3.js'
|
||||
import { MavenUtil } from '../../../util/MavenUtil.js'
|
||||
import { createHash } from 'crypto'
|
||||
|
||||
interface GeneratedFile {
|
||||
@@ -339,7 +340,7 @@ export class ForgeGradle3Adapter extends ForgeResolver {
|
||||
private async verifyInstallerRan(installerOutputDir: string): Promise<void> {
|
||||
const versionManifestPath = this.getVersionManifestPath(installerOutputDir)
|
||||
|
||||
if(!await exists(versionManifestPath)) {
|
||||
if(!await pathExists(versionManifestPath)) {
|
||||
await remove(installerOutputDir)
|
||||
throw new Error(`Forge was either not installed or installed to the wrong location. When the forge installer opens, you MUST set the installation directory to ${installerOutputDir}`)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { mkdirs } from 'fs-extra'
|
||||
import { mkdirs } from 'fs-extra/esm'
|
||||
import { join, resolve } from 'path'
|
||||
import { FileStructure } from './FileStructure'
|
||||
import { FileStructure } from './FileStructure.js'
|
||||
import { Logger } from 'winston'
|
||||
import { LoggerUtil } from '../util/LoggerUtil'
|
||||
import { LoggerUtil } from '../util/LoggerUtil.js'
|
||||
|
||||
export abstract class BaseFileStructure implements FileStructure {
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import got from 'got'
|
||||
import { createWriteStream, mkdirs, pathExists } from 'fs-extra'
|
||||
import { mkdirs, pathExists } from 'fs-extra/esm'
|
||||
import { createWriteStream } from 'fs'
|
||||
import { dirname, join, resolve } from 'path'
|
||||
import { URL } from 'url'
|
||||
import { MavenUtil } from '../../util/maven'
|
||||
import { BaseFileStructure } from '../BaseFileStructure'
|
||||
import { LoggerUtil } from '../../util/LoggerUtil'
|
||||
import { MavenUtil } from '../../util/MavenUtil.js'
|
||||
import { BaseFileStructure } from '../BaseFileStructure.js'
|
||||
import { LoggerUtil } from '../../util/LoggerUtil.js'
|
||||
|
||||
export abstract class BaseMavenRepo extends BaseFileStructure {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BaseMavenRepo } from './BaseMavenRepo'
|
||||
import { BaseMavenRepo } from './BaseMavenRepo.js'
|
||||
|
||||
export class LibRepoStructure extends BaseMavenRepo {
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { mkdirs } from 'fs-extra'
|
||||
import { mkdirs } from 'fs-extra/esm'
|
||||
import { join } from 'path'
|
||||
import { BaseFileStructure } from '../BaseFileStructure'
|
||||
import { LibRepoStructure } from './LibRepo.struct'
|
||||
import { VersionRepoStructure } from './VersionRepo.struct'
|
||||
import { BaseFileStructure } from '../BaseFileStructure.js'
|
||||
import { LibRepoStructure } from './LibRepo.struct.js'
|
||||
import { VersionRepoStructure } from './VersionRepo.struct.js'
|
||||
|
||||
export class RepoStructure extends BaseFileStructure {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { join } from 'path'
|
||||
import { URL } from 'url'
|
||||
import { BaseFileStructure } from '../BaseFileStructure'
|
||||
import { MinecraftVersion } from '../../util/MinecraftVersion'
|
||||
import { BaseFileStructure } from '../BaseFileStructure.js'
|
||||
import { MinecraftVersion } from '../../util/MinecraftVersion.js'
|
||||
|
||||
export class VersionRepoStructure extends BaseFileStructure {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BaseFileStructure } from '../BaseFileStructure'
|
||||
import { SpecModelStructure } from './SpecModelStructure'
|
||||
import { BaseFileStructure } from '../BaseFileStructure.js'
|
||||
import { SpecModelStructure } from './SpecModelStructure.js'
|
||||
|
||||
export abstract class BaseModelStructure<T> extends BaseFileStructure implements SpecModelStructure<T[]> {
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { mkdirs, writeFile, readFile, pathExists } from 'fs-extra'
|
||||
import { mkdirs, pathExists } from 'fs-extra/esm'
|
||||
import { readFile, writeFile } from 'fs/promises'
|
||||
import { Distribution } from 'helios-distribution-types'
|
||||
import { SpecModelStructure } from './SpecModelStructure'
|
||||
import { ServerStructure } from './Server.struct'
|
||||
import { SpecModelStructure } from './SpecModelStructure.js'
|
||||
import { ServerStructure } from './Server.struct.js'
|
||||
import { join, resolve } from 'path'
|
||||
import { DistroMeta, getDefaultDistroMeta } from '../../model/nebula/distrometa'
|
||||
import { addSchemaToObject, SchemaTypes } from '../../util/SchemaUtil'
|
||||
import { LoggerUtil } from '../../util/LoggerUtil'
|
||||
import { DistroMeta, getDefaultDistroMeta } from '../../model/nebula/DistroMeta.js'
|
||||
import { addSchemaToObject, SchemaTypes } from '../../util/SchemaUtil.js'
|
||||
import { LoggerUtil } from '../../util/LoggerUtil.js'
|
||||
|
||||
const logger = LoggerUtil.getLogger('DistributionStructure')
|
||||
|
||||
|
||||
@@ -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> {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FileStructure } from '../FileStructure'
|
||||
import { FileStructure } from '../FileStructure.js'
|
||||
|
||||
export interface SpecModelStructure<T> extends FileStructure {
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import { Stats } from 'fs'
|
||||
import { Type, Module } from 'helios-distribution-types'
|
||||
import { URL } from 'url'
|
||||
import { ModuleStructure } from './Module.struct'
|
||||
import { readdir, stat } from 'fs-extra'
|
||||
import { ModuleStructure } from './Module.struct.js'
|
||||
import { readdir, stat } from 'fs/promises'
|
||||
import { join, resolve, sep } from 'path'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/servermeta'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export class MiscFileStructure extends ModuleStructure {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Stats } from 'fs-extra'
|
||||
import { Stats } from 'fs'
|
||||
import { Type, Module } from 'helios-distribution-types'
|
||||
import { join } from 'path'
|
||||
import { URL } from 'url'
|
||||
import { VersionSegmented } from '../../../util/VersionSegmented'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { ToggleableModuleStructure } from './ToggleableModule.struct'
|
||||
import { LibraryType } from '../../../model/claritas/ClaritasLibraryType'
|
||||
import { ClaritasException } from './Module.struct'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/servermeta'
|
||||
import { VersionSegmented } from '../../../util/VersionSegmented.js'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { ToggleableModuleStructure } from './ToggleableModule.struct.js'
|
||||
import { LibraryType } from '../../../model/claritas/ClaritasLibraryType.js'
|
||||
import { ClaritasException } from './Module.struct.js'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export abstract class BaseForgeModStructure extends ToggleableModuleStructure implements VersionSegmented {
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ModuleStructure } from './Module.struct'
|
||||
import { ModuleStructure } from './Module.struct.js'
|
||||
import { Type, TypeMetadata } from 'helios-distribution-types'
|
||||
import { Stats } from 'fs-extra'
|
||||
import { Stats } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { URL } from 'url'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/servermeta'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export class LibraryStructure extends ModuleStructure {
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import minimatch from 'minimatch'
|
||||
import { minimatch } from 'minimatch'
|
||||
import { createHash } from 'crypto'
|
||||
import { lstat, pathExists, readdir, readFile, Stats } from 'fs-extra'
|
||||
import { pathExists } from 'fs-extra/esm'
|
||||
import { Stats } from 'fs'
|
||||
import { lstat, readdir, readFile } from 'fs/promises'
|
||||
import { Artifact, Module, Type, TypeMetadata } from 'helios-distribution-types'
|
||||
import { resolve } from 'path'
|
||||
import { BaseModelStructure } from '../BaseModel.struct'
|
||||
import { LibraryType } from '../../../model/claritas/ClaritasLibraryType'
|
||||
import { ClaritasResult, ClaritasModuleMetadata } from '../../../model/claritas/ClaritasResult'
|
||||
import { ClaritasWrapper } from '../../../util/java/ClaritasWrapper'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/servermeta'
|
||||
import { BaseModelStructure } from '../BaseModel.struct.js'
|
||||
import { LibraryType } from '../../../model/claritas/ClaritasLibraryType.js'
|
||||
import { ClaritasResult, ClaritasModuleMetadata } from '../../../model/claritas/ClaritasResult.js'
|
||||
import { ClaritasWrapper } from '../../../util/java/ClaritasWrapper.js'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export interface ModuleCandidate {
|
||||
file: string
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { ModuleStructure, ModuleCandidate } from './Module.struct'
|
||||
import { ModuleStructure, ModuleCandidate } from './Module.struct.js'
|
||||
import { Type, Module } from 'helios-distribution-types'
|
||||
import { Stats, mkdirs } from 'fs-extra'
|
||||
import { mkdirs } from 'fs-extra/esm'
|
||||
import { Stats } from 'fs'
|
||||
import { resolve } from 'path'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/servermeta'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion.js'
|
||||
import { UntrackedFilesOption } from '../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export enum ToggleableNamespace {
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import StreamZip from 'node-stream-zip'
|
||||
import toml from 'toml'
|
||||
import { capitalize } from '../../../../util/stringutils'
|
||||
import { VersionUtil } from '../../../../util/versionutil'
|
||||
import { ModsToml } from '../../../../model/forge/modstoml'
|
||||
import { BaseForgeModStructure } from '../ForgeMod.struct'
|
||||
import { MinecraftVersion } from '../../../../util/MinecraftVersion'
|
||||
import { UntrackedFilesOption } from '../../../../model/nebula/servermeta'
|
||||
import { capitalize } from '../../../../util/StringUtils.js'
|
||||
import { VersionUtil } from '../../../../util/VersionUtil.js'
|
||||
import { ModsToml } from '../../../../model/forge/ModsToml.js'
|
||||
import { BaseForgeModStructure } from '../ForgeMod.struct.js'
|
||||
import { MinecraftVersion } from '../../../../util/MinecraftVersion.js'
|
||||
import { UntrackedFilesOption } from '../../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export class ForgeModStructure113 extends BaseForgeModStructure {
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import StreamZip from 'node-stream-zip'
|
||||
import { capitalize } from '../../../../util/stringutils'
|
||||
import { VersionUtil } from '../../../../util/versionutil'
|
||||
import { McModInfo } from '../../../../model/forge/mcmodinfo'
|
||||
import { McModInfoList } from '../../../../model/forge/mcmodinfolist'
|
||||
import { BaseForgeModStructure } from '../ForgeMod.struct'
|
||||
import { MinecraftVersion } from '../../../../util/MinecraftVersion'
|
||||
import { ForgeModType_1_7 } from '../../../../model/claritas/ClaritasResult'
|
||||
import { UntrackedFilesOption } from '../../../../model/nebula/servermeta'
|
||||
import { capitalize } from '../../../../util/StringUtils.js'
|
||||
import { VersionUtil } from '../../../../util/VersionUtil.js'
|
||||
import { McModInfo } from '../../../../model/forge/McModInfo.js'
|
||||
import { McModInfoList } from '../../../../model/forge/McModInfoList.js'
|
||||
import { BaseForgeModStructure } from '../ForgeMod.struct.js'
|
||||
import { MinecraftVersion } from '../../../../util/MinecraftVersion.js'
|
||||
import { ForgeModType_1_7 } from '../../../../model/claritas/ClaritasResult.js'
|
||||
import { UntrackedFilesOption } from '../../../../model/nebula/ServerMeta.js'
|
||||
|
||||
export class ForgeModStructure17 extends BaseForgeModStructure {
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { createLogger, format, transports, Logger } from 'winston'
|
||||
import { SPLAT as SPLAT_Symbol } from 'triple-beam'
|
||||
import { SPLAT } from 'triple-beam'
|
||||
import { DateTime } from 'luxon'
|
||||
import { inspect } from 'util'
|
||||
|
||||
// Workaround until fixed.
|
||||
// https://github.com/winstonjs/logform/issues/111
|
||||
const SPLAT = SPLAT_Symbol as unknown as string
|
||||
|
||||
export class LoggerUtil {
|
||||
|
||||
public static getLogger(label: string): Logger {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { mkdirs, pathExists, remove, writeFile } from 'fs-extra'
|
||||
import { mkdirs, pathExists, remove } from 'fs-extra/esm'
|
||||
import { writeFile } from 'fs/promises'
|
||||
import { join, resolve } from 'path'
|
||||
import { createGenerator } from 'ts-json-schema-generator'
|
||||
import { URL } from 'url'
|
||||
import { DistroMeta } from '../model/nebula/distrometa'
|
||||
import { ServerMeta } from '../model/nebula/servermeta'
|
||||
import { LoggerUtil } from './LoggerUtil'
|
||||
import { DistroMeta } from '../model/nebula/DistroMeta.js'
|
||||
import { ServerMeta } from '../model/nebula/ServerMeta.js'
|
||||
import { LoggerUtil } from './LoggerUtil.js'
|
||||
|
||||
const logger = LoggerUtil.getLogger('SchemaUtil')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MinecraftVersion } from './MinecraftVersion'
|
||||
import { MinecraftVersion } from './MinecraftVersion.js'
|
||||
|
||||
export interface VersionSegmented {
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ForgeModStructure113 } from '../structure/spec_model/module/forgemod/ForgeMod113.struct'
|
||||
import { ForgeModStructure17 } from '../structure/spec_model/module/forgemod/ForgeMod17.struct'
|
||||
import { ForgeGradle3Adapter } from '../resolver/forge/adapter/ForgeGradle3.resolver'
|
||||
import { ForgeGradle2Adapter } from '../resolver/forge/adapter/ForgeGradle2.resolver'
|
||||
import { ForgeResolver } from '../resolver/forge/forge.resolver'
|
||||
import { BaseForgeModStructure } from '../structure/spec_model/module/ForgeMod.struct'
|
||||
import { MinecraftVersion } from './MinecraftVersion'
|
||||
import { UntrackedFilesOption } from '../model/nebula/servermeta'
|
||||
import { ForgeModStructure113 } from '../structure/spec_model/module/forgemod/ForgeMod113.struct.js'
|
||||
import { ForgeModStructure17 } from '../structure/spec_model/module/forgemod/ForgeMod17.struct.js'
|
||||
import { ForgeGradle3Adapter } from '../resolver/forge/adapter/ForgeGradle3.resolver.js'
|
||||
import { ForgeGradle2Adapter } from '../resolver/forge/adapter/ForgeGradle2.resolver.js'
|
||||
import { ForgeResolver } from '../resolver/forge/Forge.resolver.js'
|
||||
import { BaseForgeModStructure } from '../structure/spec_model/module/ForgeMod.struct.js'
|
||||
import { MinecraftVersion } from './MinecraftVersion.js'
|
||||
import { UntrackedFilesOption } from '../model/nebula/ServerMeta.js'
|
||||
|
||||
export class VersionSegmentedRegistry {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import got from 'got'
|
||||
import { PromotionsSlim } from '../model/forge/promotionsslim'
|
||||
import { MinecraftVersion } from './MinecraftVersion'
|
||||
import { LoggerUtil } from './LoggerUtil'
|
||||
import { PromotionsSlim } from '../model/forge/PromotionsSlim.js'
|
||||
import { MinecraftVersion } from './MinecraftVersion.js'
|
||||
import { LoggerUtil } from './LoggerUtil.js'
|
||||
|
||||
export class VersionUtil {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { JarExecutor } from './JarExecutor'
|
||||
import { JarExecutor } from './JarExecutor.js'
|
||||
import { join, resolve } from 'path'
|
||||
import { ClaritasResult } from '../../model/claritas/ClaritasResult'
|
||||
import { MinecraftVersion } from '../MinecraftVersion'
|
||||
import { LibraryType } from '../../model/claritas/ClaritasLibraryType'
|
||||
import { pathExists, remove, readFile, writeFile, mkdirs } from 'fs-extra'
|
||||
import { ClaritasResult } from '../../model/claritas/ClaritasResult.js'
|
||||
import { MinecraftVersion } from '../MinecraftVersion.js'
|
||||
import { LibraryType } from '../../model/claritas/ClaritasLibraryType.js'
|
||||
import { pathExists, remove, mkdirs } from 'fs-extra/esm'
|
||||
import { readFile, writeFile } from 'fs/promises'
|
||||
|
||||
export class ClaritasWrapper extends JarExecutor<ClaritasResult> {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { JavaUtil } from './javautil'
|
||||
import { JavaUtil } from './JavaUtil.js'
|
||||
import { Logger } from 'winston'
|
||||
import { spawn } from 'child_process'
|
||||
import { LoggerUtil } from '../LoggerUtil'
|
||||
import { LoggerUtil } from '../LoggerUtil.js'
|
||||
|
||||
export abstract class JarExecutor<T> {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { join } from 'path'
|
||||
import { JarExecutor } from './JarExecutor'
|
||||
import { JarExecutor } from './JarExecutor.js'
|
||||
|
||||
export class PackXZExtractWrapper extends JarExecutor<void> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user