From ef3489e55064677c386b69469124eefb44fd6869 Mon Sep 17 00:00:00 2001 From: tsa96 Date: Sat, 7 Oct 2023 18:45:14 +0100 Subject: [PATCH] chore: move TS compilation to script_dist --- .eslintrc.js | 2 +- .gitignore | 2 +- .prettierignore | 2 +- README.md | 2 +- panorama.cfg | 2 +- tsconfig.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 8e669e11..d2fffbed 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,7 +3,7 @@ module.exports = { extends: ['eslint:recommended', 'plugin:unicorn/recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], root: true, parserOptions: { project: 'tsconfig.json' }, - ignorePatterns: ['.eslintrc.js', 'node_modules', '__types_momentum.js', 'tools', 'scripts_dist'], + ignorePatterns: ['.eslintrc.js', 'node_modules', '__types_momentum.js', 'tools', 'script_dist'], rules: { // We don't use modules or really any kind of import system. '@typescript-eslint/explicit-module-boundary-types': 'off', diff --git a/.gitignore b/.gitignore index c403174f..5e282513 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ node_modules # Specific files learn.vdf __types_momentum.js -scripts_dist/ +script_dist/ diff --git a/.prettierignore b/.prettierignore index dab5bbeb..2e803f6b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,2 @@ scripts/types/ -scripts_dist/ +script_dist/ diff --git a/README.md b/README.md index 0333b7d4..3c9f49d0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The Sass module structure, found in `styles/`, is quite conventional, with all t Panorama uses the [V8 JavaScript engine](https://v8.dev) to interpret and run the JavaScript files, found in `scripts/`, at runtime, which are included in XML files within `` tags (similar to regular web development). -We also support TypeScript - any `.ts` file `scripts/` are compiled to corresponding JavaScript files in `scripts_dist/`, whilst `.js` are just copied over. Note that we don't use any kind of import/module/bundling system as it's not supported in engine code. Instead we just declare the same XML `` tags and scripts get the same scope (yeah, old school). Use `/// ` to keep TypeScript happy. +We also support TypeScript - any `.ts` file `scripts/` are compiled to corresponding JavaScript files in `script_dist/`, whilst `.js` are just copied over. Note that we don't use any kind of import/module/bundling system as it's not supported in engine code. Instead we just declare the same XML `` tags and scripts get the same scope (yeah, old school). Use `/// ` to keep TypeScript happy. JavaScript communicates with the game via events and APIs exposed by the game. The [pano-typed](https://github.com/StrataSource/pano-typed) package (submoduled in `scripts/types/`) which provides types and documentation for the exposed APIs and events. These are updated manually, and some things may be missing. A full list of which can be found by running `dump_panorama_events markdown` and `dump_panorama_js_scopes markdown` in-game (best to the game in `-condebug` and read `momentum/console.log`). Feel free to add any APIs/events to the `pano-typed` package! If anything is missing completely, please contact us in Discord and we can check in engine code for you. diff --git a/panorama.cfg b/panorama.cfg index 7b6ef863..9a323890 100644 --- a/panorama.cfg +++ b/panorama.cfg @@ -4,7 +4,7 @@ "NamedPaths" { "resources" "panorama" - "scripts" "panorama/scripts_dist" + "scripts" "panorama/script_dist" "config" "panorama/config" "materials" "materials" "images" "panorama/images" diff --git a/tsconfig.json b/tsconfig.json index 38897af4..45c69cbc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "lib": ["ESNext"], "module": "None", "rootDir": "scripts/", - "outDir": "scripts_dist/", + "outDir": "script_dist/", "alwaysStrict": true, "isolatedModules": true, "allowJs": true,