43 lines
2.5 KiB
Markdown
43 lines
2.5 KiB
Markdown
# Spearhead
|
|
|
|
Hello and welcome to Spearhead!
|
|
|
|
If you're a developer that wants to contribute, look at the code or understand what we're doing, feel free to read on.
|
|
|
|
If you're a mission maker that wants to see the documentation and build you mission with this framework. <br>
|
|
It's best to go to our fully fledged documentation website:
|
|
- Stable/Main: https://spearhead.rocks
|
|
- Beta/Develop: https://beta.spearhead.rocks
|
|
|
|
## Project Structure
|
|
|
|
The Spearhead project is structured in a lot of separate files. <br>
|
|
While Lua isn't specifically created for it, most of it has been written with the standards of OOP in mind. <br>
|
|
Classes, Objects and helper methods.
|
|
|
|
You're find in the `/src` folder all the files. <br>
|
|
They are separated in a somewhat logical order, but some things might feel out of place. <br>
|
|
|
|
### Bundling, Intellisense, Linting
|
|
|
|
In DCS the easiest way to import a script is with 1 single file, however, that's not as "maintainable".
|
|
In order to keep it maintainable we're using a self-built tool to bundle, validate and rewrite some of the lua in order to get it into a single file.
|
|
The tool is open-source here: https://git.dutchie031.com/dutchie031/DcsMissionScriptingTools. <br>
|
|
It has a `VSCode` extensions and two `Github Action` steps. <br>
|
|
If your favorite IDE isn't `VSCode` (I respect that), it might be very easy to create an extension for it, if it does allow that.
|
|
|
|
The `VSCode` extensions comes with Intellisense as well, in the form of a full file of DCS lua type annotations. <br>
|
|
This gives the Lua Language Server by Sumneko (which can be used in `VSCode`) all the type definitions it needs.
|
|
When writing Spearhead code it is also important to keep our own LuaLS Annotations up to date and complete. <br>
|
|
Read all about those annotations here: https://luals.github.io/wiki/annotations/
|
|
|
|
When a pull-request to the `develop` or `main` branches is created, before it can be merged it requires to pass the linter checks.
|
|
The first linting check is done by the Lua Language Server. It checks for whitespace and formatting, but it also checks if all types, type-checking and casts are in order. It marks unused variables etc. `.luarc.json` has all the config for those checks. <br>
|
|
The second linter job is with `luacheck` which first "bundles" the script, and then runs a full linter check over the bundled script. <br>
|
|
This is to make sure that also the bundled script does not contain any errors.
|
|
|
|
## Contributing
|
|
|
|
### Setting up the project
|
|
|
|
If you've kept on reading I assume you either want to brwose |