adapap / OWScript

Python-like scripting language which transpiles into Overwatch Workshop script rulesets.
MIT License
37 stars 2 forks source link

VSCode/OWScript configuration JSON #15

Open MatthewSH opened 4 years ago

MatthewSH commented 4 years ago

You were discussing the compiling of a script via VSCode extension earlier. Why don't we take this a step further and implement an auto-compiler into the language itself with a configuration file.

The file can be defined in the root of the project and be something like owscript.config.json or something of the sort (a standard filename, like package.json and have a setup like:

{
    "name": "My Gamemode",
    "version": "1.0.0",
    "author": "John Doe",
    "website": "https://mywebsite.com",
    "git": {
        "repo": "https://github.com/johndoe/ow-gamemode",
        "issues": "https://github.com/johndoe/ow-gamemode/issues"
    },
    "compiler": {
        "bin": "path/to/OWScript",
        "input": "src/myscript.owpy",
        "output": "dist/myscript.ows",
        "options": {
            "generateAdapapCredit": true,
            "generateVersionRule": true,
            "generateCreditRule": true
        }
    },
    "cli": {
        "git": {
            "useHTTPS": false
        },
        "locations": {
            "modules":  "src/modules"
        }
    }
}

This is definitely, inspired, by NPM package file for sure. But this can give us a lot of flexibility in managing multiple projects and we can start standardizing a lot of the common functionality and make it easier to integrate git, generate standard rules for crediting author, showing version, etc. This could also integrate into the VSCode extension and utilize a submodule or an external path for the compiler (if defined).

EDIT: Forgot to add. Maybe on top of "OWScript" compiler we can write a "watcher" that will give us the ability to compile on file change, or something. Like my powershell file in my upgrade shop: https://github.com/overwatchworkshop/upgrade-shop/blob/master/watch.ps1

This watcher will utilize this configuration file so it makes development process easier and less to remember. Configure it once, and boom.

MatthewSH commented 4 years ago

While adding this to node-OWScript I did find it pretty easy to do. I may break this out into it's own package however to allow us to use it in the extension branch as well as in my package. I'll generate any typings needed as well because, TypeScript.