diff --git a/dutchies-dcs-scripting-tools/.vscodeignore b/dutchies-dcs-scripting-tools/.vscodeignore deleted file mode 100644 index 159277f..0000000 --- a/dutchies-dcs-scripting-tools/.vscodeignore +++ /dev/null @@ -1,14 +0,0 @@ -.vscode/** -.vscode-test/** -out/** -node_modules/** -src/** -.gitignore -.yarnrc -esbuild.js -vsc-extension-quickstart.md -**/tsconfig.json -**/eslint.config.mjs -**/*.map -**/*.ts -**/.vscode-test.* diff --git a/dutchies-dcs-scripting-tools/LICENSE b/dutchies-dcs-scripting-tools/LICENSE new file mode 100644 index 0000000..2f3a7b3 --- /dev/null +++ b/dutchies-dcs-scripting-tools/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 dutchie031 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/dutchies-dcs-scripting-tools/README.md b/dutchies-dcs-scripting-tools/README.md index 67cd679..8509199 100644 --- a/dutchies-dcs-scripting-tools/README.md +++ b/dutchies-dcs-scripting-tools/README.md @@ -5,15 +5,68 @@ Direct DCS API checking and a Transpiler that can help keep huge complex scripts ## Features +- DCS API checking in VSCode + Automatic checking of your code for DCS API errors. +- Transpiler + A tool that can help you write more complex scripts in a more simple and overseeable way. + Transpiles multiple files into a single file that can be used in DCS, using standard Lua syntax and features. + + +## How To use + +### Intellisense and API checking in VSCode. + +1. Install the extension in VSCode. +2. Open your workspace with your DCS mission scripts. +3. Enable: `> Dutchies Scripting Tools: Enable` + +### Transpiler + +1. Make sure you have the code in `./src` folder by default, or change the `src` folder in the settings. + `settings.json`: + ```json + { + "dutchiesScriptingTools.src": "./src" + } + ``` + +2. Write your code in the `src` folder, with possible subfolders. You can use standard Lua syntax and features, and the transpiler will handle the rest. + +NOTE: +There's no implicit entry point. The whole code will be put into a single Lua file.
+The order of the files depends on dependencies via the `require` function. So if you have a file `main.lua` that requires `utils.lua`, the transpiler will first transpile `utils.lua` and then `main.lua`.
+This means that if you have code that executes on load, it will be executed.
+Best practice is to have 1 file that executes and the rest be modules.
+Eg. `main.lua`: +```lua +local utils = require("utils") + +utils.printHelloWorld() + +``` +And `utils.lua`: +```lua +local utils = {} +utils.printHelloWorld = function() + env.info("Hello World!") +end +return utils +``` + +## Possible Future Features + +- DCS Snippets + A collection of useful code snippets for DCS scripting in VSCode. + + ## Requirements `sumenko.lua` : The VSCode Lua Language Server ## Release Notes - ### 0.0.1 Initial. -Still very much in Test/Development +Still very much in Test/Development. Use at your own risk. diff --git a/dutchies-dcs-scripting-tools/dutchie2.png b/dutchies-dcs-scripting-tools/dutchie2.png new file mode 100644 index 0000000..b22286c Binary files /dev/null and b/dutchies-dcs-scripting-tools/dutchie2.png differ diff --git a/dutchies-dcs-scripting-tools/package.json b/dutchies-dcs-scripting-tools/package.json index c3baa5d..368c0dd 100644 --- a/dutchies-dcs-scripting-tools/package.json +++ b/dutchies-dcs-scripting-tools/package.json @@ -7,6 +7,11 @@ "name": "dutchie031", "email": "54616262+dutchie031@users.noreply.github.com" }, + "icon": "dutchie2.png", + "galleryBanner": { + "color": "#222430", + "theme": "dark" + }, "publisher": "dutchie031", "license": "MIT", "engines": { @@ -51,16 +56,15 @@ "sumneko.lua" ], "files": [ - "dist", + "dist/**", "README.md", "lua-addons/**/*", - "syntaxes/**/*" + "dutchie2.png", + "LICENSE" ], - "dependencies": { - "dcs-script-compiler" : "*" - }, + "dependencies": {}, "scripts": { - "vscode:prepublish": "npm run build -w compiler && npm run package", + "vscode:prepublish": "npm run package", "compile": "npm run check-types && npm run lint && node esbuild.js", "watch": "npm-run-all -p watch:*", "watch:esbuild": "node esbuild.js --watch", diff --git a/package-extension.sh b/package-extension.sh new file mode 100644 index 0000000..09a76f9 --- /dev/null +++ b/package-extension.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +npm install +cd dutchies-dcs-scripting-tools +npm install +npm run package +npx @vscode/vsce package --no-dependencies \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1203ade..255900b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "compiler": { "name": "dcs-script-compiler", "version": "1.0.0", + "extraneous": true, "devDependencies": { "@types/node": "^22.0.0", "typescript": "^5.9.3" @@ -21,9 +22,6 @@ "dutchies-dcs-scripting-tools": { "version": "0.0.1", "license": "MIT", - "dependencies": { - "dcs-script-compiler": "*" - }, "devDependencies": { "@types/mocha": "^10.0.10", "@types/node": "22.x", @@ -893,6 +891,7 @@ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.54.0", "@typescript-eslint/types": "8.54.0", @@ -1125,6 +1124,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1713,10 +1713,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/dcs-script-compiler": { - "resolved": "compiler", - "link": true - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -2065,6 +2061,7 @@ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -5154,6 +5151,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -5284,6 +5282,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver"