Build files and npm package information

This commit is contained in:
Ben Carter
2023-09-10 02:58:04 -04:00
parent b95e7e074e
commit b9b85ca934
6 changed files with 5631 additions and 0 deletions

5365
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

43
package.json Normal file
View File

@@ -0,0 +1,43 @@
{
"name": "wow-eluna-ts-module",
"version": "1.0.3",
"description": "Stripped down base repo for enabling custom WoW Eluna development using TypeScript",
"contributors": [
"ben-of-codecraft",
"Yehonal"
],
"license": "AGPL-3.0-or-later",
"files": [
"types",
".bin",
"tsconfig.build.json",
"common/**/*",
"ets.env"
],
"types": "types/index.d.ts",
"bin": {
"ets": ".bin/ets.js"
},
"scripts": {
"build": "tstl -p tsconfig.build.json",
"test": "npx jest"
},
"main": "index.ts",
"devDependencies": {
"@golevelup/ts-jest": "^0.3.1",
"@types/jest": "^29.5.4",
"jest": "^29.6.4",
"ts-node": "^10.9.1",
"tslint": "^6.1.3",
"typescript": "^5.2.2"
},
"dependencies": {
"@typescript-to-lua/language-extensions": "^1.19.0",
"commander": "^7.2.0",
"dotenv": "^9.0.2",
"fs-extra": "^11.1.1",
"lodash": "^4.17.21",
"lua-types": "^2.10.1",
"typescript-to-lua": "^1.19.0"
}
}

42
tsconfig.build.json Normal file
View File

@@ -0,0 +1,42 @@
{
"$schema": "https://raw.githubusercontent.com/TypeScriptToLua/TypeScriptToLua/master/tsconfig-schema.json",
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"target": "esnext",
"declaration": true,
"declarationDir": "./common/src/declarations",
"lib": [
"esnext","DOM"
],
"moduleResolution": "node",
"types": [
"lua-types/5.2",
"@typescript-to-lua/language-extensions"
],
"typeRoots": [
"./node_modules/@types",
"./node_modules",
"../../node_modules" // This is for reference when package is installed as a dependency
],
"rootDir": "common/src"
},
"include": [
"common/src/**/*.ts"
],
"exclude": [
"common/src/declarations",
"node_modules",
"**/node_modules",
"**/*spec.ts",
"**/__tests__",
],
"tstl": {
"luaTarget": "5.2",
"noHeader": true,
"luaLibImport": "require",
"tstlVerbose": true,
"luaBundle": "./dist/common/libs.lua",
"luaBundleEntry": "./common/src/index.ts"
}
}

28
tsconfig.json Normal file
View File

@@ -0,0 +1,28 @@
{
"compilerOptions": {
"strict": true,
"target": "esnext",
"noImplicitAny": true,
"preserveConstEnums": true,
"moduleResolution": "node",
"outDir": "dist",
"skipDefaultLibCheck": true,
"lib": [
"esnext","DOM"
],
"types": [
"lua-types/5.2",
"jest"
],
"typeRoots": [
"./types",
"./node_modules/@types",
"./node_modules"
],
"rootDir": "modules"
},
"include": [
"modules/**/*.ts",
"types/**/*.d.ts"
]
}

42
tsconfig.module.json Normal file
View File

@@ -0,0 +1,42 @@
{
"$schema": "./tstl.schema.json",
"compilerOptions": {
"strict": true,
"target": "esnext",
"outDir": "[[module_output]]",
"skipLibCheck": true,
"lib": [
"esnext","DOM"
],
"moduleResolution": "node",
"types": [
"lua-types/5.2",
"@typescript-to-lua/language-extensions",
"eluna-ts-base"
],
"typeRoots": [
"./node_modules/eluna-ts-base/types",
"./node_modules",
"./node_modules/@types",
],
"rootDir": "modules"
},
"include": [
"modules/**/*.ts"
],
"exclude": [
"node_modules",
"**/node_modules",
"test",
"**/*spec.ts",
"**/__tests__",
"**/__mocks__",
],
"tstl": {
"luaTarget": "5.2",
"noHeader": true,
"luaLibImport": "require",
"luaBundle": "./dist/module.lua",
"luaBundleEntry": "./modules/index.ts"
}
}

111
tstl.schema.json Normal file
View File

@@ -0,0 +1,111 @@
{
"title": "tsconfig.json with TSTL",
"description": "JSON schema for the TypeScript compiler's configuration file with TSTL",
"$schema": "http://json-schema.org/draft-07/schema",
"allOf": [
{
"$ref": "https://json.schemastore.org/tsconfig"
}
],
"properties": {
"tstl": {
"description": "TypeScriptToLua compiler options.",
"type": "object",
"definitions": {
"//": {
"reference": "https://typescripttolua.github.io/docs/configuration#custom-options"
}
},
"properties": {
"buildMode": {
"description": "Use buildMode: \"library\" to build publishable library packages.",
"type": "string",
"default": "library",
"enum": ["default", "library"]
},
"extension": {
"description": "File extension for the resulting Lua files. Defaults to \".lua\"",
"type": "string"
},
"lua51AllowTryCatchInAsyncAwait": {
"description": "Disable the warning that try/catch is not allowed in async functions in Lua 5.1, in case you are using a patched 5.1 lua version that supports this.",
"type": "boolean",
"default": false
},
"luaBundle": {
"description": "The name of the lua file to bundle output lua to. Requires luaBundleEntry.",
"type": "string",
"default": ""
},
"luaBundleEntry": {
"description": "The entry *.ts file that will be executed when entering the luaBundle. Requires luaBundle.",
"type": "string"
},
"luaLibImport": {
"description": "Specifies how js standard features missing in lua are imported.",
"type": "string",
"default": "require",
"enum": ["none", "inline", "require", "require-minimal"]
},
"luaTarget": {
"description": "Specifies the Lua version you want to generate code for.",
"type": "string",
"default": "universal",
"enum": ["5.0", "universal", "5.1", "5.2", "5.3", "5.4", "JIT"]
},
"noImplicitGlobalVariables": {
"description": "Always declare all root-level variables as local, even if the file is not a module and they would be global in TypeScript.",
"type": "boolean",
"default": false
},
"noImplicitSelf": {
"description": "If true, treats all project files as if they were prefixed with\n/** @noSelfInFile **/.",
"type": "boolean",
"default": false
},
"noHeader": {
"description": "Specify if a header will be added to compiled files.",
"type": "boolean",
"default": false
},
"noResolvePaths": {
"description": "An array of import paths that should not be resolved but copied verbatim to output lua.",
"type": "array"
},
"sourceMapTraceback": {
"description": "Applies the source map to show source TS files and lines in error tracebacks.",
"default": false,
"type": "boolean"
},
"tstlVerbose": {
"description": "Give verbose tstl output, helpful when diagnosing tstl issues.",
"type": "boolean",
"default": false
},
"luaPlugins": {
"description": "List of TypeScriptToLua plugins.",
"type": "array",
"items": {
"description": "Describes TypeScriptToLua plugin",
"type": "object",
"required": ["name"],
"properties": {
"name": {
"description": "Path to the JS file, that contains the plugin code",
"type": "string"
},
"import": {
"type": "string"
}
}
}
},
"measurePerformance": {
"description": "Measure and report performance of the tstl compiler.",
"type": "boolean"
}
}
}
},
"allowTrailingCommas": true
}