mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Set up TypeScript for lib
Add a TypeScript build suitable for incremental migration to TypeScript to the lib package.
This commit is contained in:
1 parent
a1ee147c46
commit
90798205e0
16 files changed
+115
-151
No files matched your search
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Configuration System
|
||||
* @author Hornwitser
|
||||
* @module lib/config
|
||||
*/
|
||||
"use strict";
|
||||
const classes = require("./classes");
|
||||
const definitions = require("./definitions");
|
||||
|
||||
module.exports = {
|
||||
...classes,
|
||||
...definitions,
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Configuration System
|
||||
* @author Hornwitser
|
||||
* @module lib/config
|
||||
*/
|
||||
export * from "./classes";
|
||||
export * from "./definitions";
|
||||
@@ -21,11 +21,14 @@ function jsonPrimitive(type) {
|
||||
},
|
||||
};
|
||||
}
|
||||
const JsonBoolean = jsonPrimitive("boolean");
|
||||
const JsonNumber = jsonPrimitive("number");
|
||||
const JsonString = jsonPrimitive("string");
|
||||
|
||||
module.exports = {
|
||||
JsonBoolean: jsonPrimitive("boolean"),
|
||||
JsonNumber: jsonPrimitive("number"),
|
||||
JsonString: jsonPrimitive("string"),
|
||||
JsonBoolean,
|
||||
JsonNumber,
|
||||
JsonString,
|
||||
|
||||
jsonArray,
|
||||
jsonPrimitive,
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Shared data types used in Clusterio
|
||||
* @module lib/data
|
||||
* @author Hornwitser
|
||||
*/
|
||||
"use strict";
|
||||
const ExportManifest = require("./ExportManifest");
|
||||
const ModInfo = require("./ModInfo");
|
||||
const ModPack = require("./ModPack");
|
||||
const composites = require("./composites");
|
||||
const messagesCore = require("./messages_core");
|
||||
const messagesController = require("./messages_controller");
|
||||
const messagesHost = require("./messages_host");
|
||||
const messagesInstance = require("./messages_instance");
|
||||
const messagesMod = require("./messages_mod");
|
||||
const messagesUser = require("./messages_user");
|
||||
const version = require("./version");
|
||||
|
||||
module.exports = {
|
||||
ExportManifest,
|
||||
ModInfo,
|
||||
ModPack,
|
||||
...composites,
|
||||
...messagesCore,
|
||||
...messagesController,
|
||||
...messagesHost,
|
||||
...messagesInstance,
|
||||
...messagesMod,
|
||||
...messagesUser,
|
||||
...version,
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Shared data types used in Clusterio
|
||||
* @module lib/data
|
||||
* @author Hornwitser
|
||||
*/
|
||||
export { default as ExportManifest } from "./ExportManifest";
|
||||
export { default as ModInfo } from "./ModInfo";
|
||||
export { default as ModPack } from "./ModPack";
|
||||
export * from "./composites";
|
||||
export * from "./messages_core";
|
||||
export * from "./messages_controller";
|
||||
export * from "./messages_host";
|
||||
export * from "./messages_instance";
|
||||
export * from "./messages_mod";
|
||||
export * from "./messages_user";
|
||||
export * from "./version";
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import type { ValidateFunction } from "ajv"
|
||||
export default ValidateFunction
|
||||
@@ -3,9 +3,4 @@
|
||||
* @module lib/factorio
|
||||
* @author Hornwitser
|
||||
*/
|
||||
"use strict";
|
||||
const exchange_string = require("./exchange_string");
|
||||
|
||||
module.exports = {
|
||||
...exchange_string,
|
||||
};
|
||||
export * from "./exchange_string";
|
||||
@@ -1,17 +0,0 @@
|
||||
/**
|
||||
* Library for message based communication between nodes
|
||||
* @module lib/link
|
||||
* @author Hornwitser
|
||||
*/
|
||||
"use strict";
|
||||
const link = require("./link");
|
||||
const connectors = require("./connectors");
|
||||
|
||||
module.exports = {
|
||||
...link,
|
||||
...connectors,
|
||||
|
||||
// migrate: Allow info for plugins from before link refactor to load.
|
||||
Event: class Event {},
|
||||
Request: class Request {},
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Library for message based communication between nodes
|
||||
* @module lib/link
|
||||
* @author Hornwitser
|
||||
*/
|
||||
export * from "./link"
|
||||
export * from "./connectors"
|
||||
|
||||
// migrate: Allow info for plugins from before link refactor to load.
|
||||
export class Event {}
|
||||
export class Request {}
|
||||
@@ -416,7 +416,7 @@ function handleUnhandledErrors() {
|
||||
/* eslint-enable node/no-process-exit */
|
||||
}
|
||||
|
||||
|
||||
const _formatServerOutput = formatServerOutput;
|
||||
module.exports = {
|
||||
TerminalFormat,
|
||||
LinkTransport,
|
||||
@@ -425,5 +425,5 @@ module.exports = {
|
||||
queryLog,
|
||||
|
||||
// for testing only
|
||||
_formatServerOutput: formatServerOutput,
|
||||
_formatServerOutput,
|
||||
};
|
||||
Reference in new issue
Block a user