From ea1b0970df36a042b842f8ff38b83c658ee54e00 Mon Sep 17 00:00:00 2001 From: Toliak Date: Tue, 17 Aug 2021 22:14:12 +0300 Subject: [PATCH 1/3] Fixes #4 - Added reference link - Added `buildMode` property - Added default value into `luaLibImport`, `luaTarget`, `noImplicitSelf`, `noHeader` and `sourceMapTraceback` property - Modified description of `luaPlugins` property - Prettified --- tsconfig-schema.json | 72 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/tsconfig-schema.json b/tsconfig-schema.json index 61dd35f..19c747c 100644 --- a/tsconfig-schema.json +++ b/tsconfig-schema.json @@ -6,17 +6,35 @@ "plugins": { "items": { "properties": { - "transform": { "type": "string" }, - "import": { "type": "string" }, - "after": { "type": "boolean" }, - "afterDeclarations": { "type": "boolean" }, + "transform": { + "type": "string" + }, + "import": { + "type": "string" + }, + "after": { + "type": "boolean" + }, + "afterDeclarations": { + "type": "boolean" + }, "type": { "oneOf": [ - { "const": "program" }, - { "const": "config" }, - { "const": "checker" }, - { "const": "raw" }, - { "const": "compilerOptions" } + { + "const": "program" + }, + { + "const": "config" + }, + { + "const": "checker" + }, + { + "const": "raw" + }, + { + "const": "compilerOptions" + } ] } } @@ -25,9 +43,20 @@ } }, "tstl": { - "description": "TypeScriptToLua options.", + "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"] + }, "luaBundle": { "description": "The name of the lua file to bundle output lua to. Requires luaBundleEntry.", "type": "string" @@ -39,34 +68,45 @@ "luaLibImport": { "description": "Specifies how js standard features missing in lua are imported.", "type": "string", + "default": "require", "enum": ["none", "always", "inline", "require"] }, "luaTarget": { - "description": "Specify Lua target version.", + "description": "Specifies the Lua version you want to generate code for.", "type": "string", + "default": "universal", "enum": ["5.1", "5.2", "5.3", "JIT"] }, "noImplicitSelf": { - "description": "If \"this\" is implicitly considered an any type, do not generate a self parameter.", - "type": "boolean" + "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" + "type": "boolean", + "default": false }, "sourceMapTraceback": { "description": "Applies the source map to show source TS files and lines in error tracebacks.", + "default": false, "type": "boolean" }, "luaPlugins": { "description": "List of TypeScriptToLua plugins.", "type": "array", "items": { + "description": "Describes TypeScriptToLua plugin", "type": "object", "required": ["name"], "properties": { - "name": { "type": "string" }, - "import": { "type": "string" } + "name": { + "description": "Path to the JS file, that contains the plugin code", + "type": "string" + }, + "import": { + "type": "string" + } } } } From a9440e48f55d517a77861be300a36aa7a95a2257 Mon Sep 17 00:00:00 2001 From: Toliak Date: Wed, 18 Aug 2021 10:20:45 +0300 Subject: [PATCH 2/3] In progress #5 - Added title and description for the schema - Added (mixined) the default tsconfig.json schema - Removed default properties (they are already described in the default tsconfig.json schema) --- tsconfig-schema.json | 48 +++++++------------------------------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/tsconfig-schema.json b/tsconfig-schema.json index 19c747c..67b5012 100644 --- a/tsconfig-schema.json +++ b/tsconfig-schema.json @@ -1,47 +1,13 @@ { + "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": { - "compilerOptions": { - "properties": { - "plugins": { - "items": { - "properties": { - "transform": { - "type": "string" - }, - "import": { - "type": "string" - }, - "after": { - "type": "boolean" - }, - "afterDeclarations": { - "type": "boolean" - }, - "type": { - "oneOf": [ - { - "const": "program" - }, - { - "const": "config" - }, - { - "const": "checker" - }, - { - "const": "raw" - }, - { - "const": "compilerOptions" - } - ] - } - } - } - } - } - }, "tstl": { "description": "TypeScriptToLua compiler options.", "type": "object", From 140fdd45f374bc0377426d2f732f88b9acdc244d Mon Sep 17 00:00:00 2001 From: Toliak Date: Wed, 18 Aug 2021 10:21:42 +0300 Subject: [PATCH 3/3] Fixed comma --- tsconfig-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig-schema.json b/tsconfig-schema.json index 67b5012..927f012 100644 --- a/tsconfig-schema.json +++ b/tsconfig-schema.json @@ -1,5 +1,5 @@ { - "title": "tsconfig.json with TSTL" + "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": [