dcs-git-utils 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ name: Pull Request Checks
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [ "main" ] # Or "master", depending on your default branch
6
+ # This triggers on new PRs, commits to existing PRs, and re-opened PRs
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ name: Run CI Tests
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ # 1. Checkout the repository code
18
+ - name: Checkout Code
19
+ uses: actions/checkout@v4
20
+
21
+ # 2. Setup Node.js environment
22
+ - name: Setup Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: '18' # Matches your pkg target
26
+ cache: 'npm' # Caches node_modules for faster runs
27
+
28
+ # 3. Install dependencies strictly from package-lock.json
29
+ - name: Install Dependencies
30
+ run: npm ci
31
+
32
+ # 4. Run the specific test command
33
+ - name: Run Tests
34
+ run: npm run test:ci
@@ -0,0 +1,65 @@
1
+ name: Build and Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Triggers only on version tags like v1.0.0, v2.1.5
7
+
8
+ permissions:
9
+ contents: write # Required to create releases and upload assets
10
+
11
+ jobs:
12
+ build-and-release:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ # 1. Checkout the code
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+
20
+ # 2. Setup Node.js
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '18'
25
+ cache: 'npm'
26
+
27
+ # 3. Install Dependencies
28
+ - name: Install Dependencies
29
+ run: npm ci
30
+
31
+ - name: Set Package Version from Git Tag
32
+ # The github.ref is the full tag path (refs/tags/v1.0.1).
33
+ # We use a shell command to trim "refs/tags/v" to get "1.0.1".
34
+ run: |
35
+ VERSION="${{ github.ref_name }}"
36
+ # The 'npm version' command updates package.json and package-lock.json
37
+ npm version "$VERSION" --no-git-tag-version --allow-same-version
38
+
39
+ - name: Verify Updated Version
40
+ run: cat package.json | grep version
41
+
42
+ # 4. Build (TypeScript -> JS + Copy Lua Assets)
43
+ - name: Build Project
44
+ run: npm run build
45
+
46
+ # 5. Package (Generate Binaries)
47
+ # This runs 'pkg .' and creates the 3 executables (win, linux, macos)
48
+ - name: Create Executables
49
+ run: npm run package
50
+
51
+ # 6. Create GitHub Release
52
+ - name: Create Release
53
+ id: create_release
54
+ uses: softprops/action-gh-release@v1
55
+ with:
56
+ tag_name: ${{ github.ref_name }}
57
+ name: Release ${{ github.ref_name }}
58
+ draft: false
59
+ prerelease: false
60
+ generate_release_notes: true
61
+ files: |
62
+ bin/DCS-Git-Utils-win.exe
63
+ bin/DCS-Git-Utils-linux
64
+ env:
65
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,23 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "DEbug",
9
+ "type": "node",
10
+ "request": "launch",
11
+ "preLaunchTask": "npm: prestart",
12
+ "autoAttachChildProcesses": true,
13
+ "skipFiles": [
14
+ "<node_internals>/**",
15
+ "**/node_modules/**"
16
+ ],
17
+ "program": "${workspaceRoot}/dist/main.js",
18
+ "cwd": "${workspaceRoot}",
19
+ "smartStep": true,
20
+ "console": "integratedTerminal"
21
+ }
22
+ ]
23
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Martin Backudd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # DCS git tool
2
+
3
+ DCS shuffles the keys in the configs when saving, to be able to version control, we need to sort the keys of config objects.
4
+
5
+ ## Flow
6
+
7
+ - If .miz is selected, extracts content into ./out and sorts all configs.
8
+ - If ./out exists, creates a .miz
9
+
10
+ - (When saving in editor) After writing the .miz completes, it unpacks the archive and sorts the content, THEN re-archives into the .miz again to keep everything consistent for version control.
11
+ - When editing anything in ./out, archive (.miz) is created from ./out.
12
+
13
+ ### Cmd args for debugging purposes
14
+
15
+ a single arg of a .miz filepath can be given to override file selection
package/config.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "lastMissionPath": "C:\\Users\\marti\\Saved Games\\DCS\\Missions\\cas\\cas.miz",
3
+ "backupEnabled": true
4
+ }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.unpackMiz = exports.handleArchive = exports.checkStable = void 0;
39
+ const node_fs_1 = __importStar(require("node:fs"));
40
+ const archiver_1 = __importDefault(require("archiver"));
41
+ const decompress_1 = __importDefault(require("decompress"));
42
+ function checkStable(filePath, stableChecks = 10, // how many *consecutive* stable reads required
43
+ interval = 250 // ms between checks
44
+ ) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ let lastSize = null;
47
+ let stableCount = 0;
48
+ while (stableCount < stableChecks) {
49
+ let stat;
50
+ try {
51
+ stat = yield node_fs_1.promises.stat(filePath);
52
+ }
53
+ catch (_a) {
54
+ // file might not exist yet – reset
55
+ lastSize = null;
56
+ stableCount = 0;
57
+ yield new Promise((res) => setTimeout(res, interval));
58
+ continue;
59
+ }
60
+ const size = stat.size;
61
+ if (lastSize !== null && size === lastSize) {
62
+ stableCount++;
63
+ }
64
+ else {
65
+ stableCount = 0; // reset if changed
66
+ }
67
+ lastSize = size;
68
+ yield new Promise((res) => setTimeout(res, interval));
69
+ }
70
+ return true; // stable!
71
+ });
72
+ }
73
+ exports.checkStable = checkStable;
74
+ const handleArchive = (dirPath, mizpath) => {
75
+ return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
76
+ const archive = (0, archiver_1.default)("zip", { zlib: { level: 9 } });
77
+ const output = node_fs_1.default.createWriteStream(mizpath);
78
+ // Handle events
79
+ output.on('close', function () {
80
+ console.log(`Archive created successfully at ${mizpath}, total bytes: ${archive.pointer()}`);
81
+ resolve();
82
+ });
83
+ archive.on('error', function (err) {
84
+ throw err;
85
+ });
86
+ // Pipe archive data to the file
87
+ archive.pipe(output);
88
+ // Append directory
89
+ archive.directory(dirPath, false); // false = no root folder in zip
90
+ // Finalize the archive
91
+ yield archive.finalize();
92
+ }));
93
+ };
94
+ exports.handleArchive = handleArchive;
95
+ const unpackMiz = (path, outPath) => __awaiter(void 0, void 0, void 0, function* () {
96
+ try {
97
+ console.log('decompressing');
98
+ const result = yield (0, decompress_1.default)(path, outPath);
99
+ if (!result.length) {
100
+ throw new Error('Decompression yielded no results, something is wrong with the .miz');
101
+ }
102
+ return result;
103
+ }
104
+ catch (err) {
105
+ console.error(err);
106
+ throw err;
107
+ }
108
+ });
109
+ exports.unpackMiz = unpackMiz;
110
+ //# sourceMappingURL=compression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compression.js","sourceRoot":"","sources":["../src/compression.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAuC;AACvC,wDAAgC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Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.initializeConfig = exports.readConfig = exports.saveConfig = void 0;
39
+ const fs = __importStar(require("fs"));
40
+ const path = __importStar(require("path"));
41
+ const inquirer_1 = __importDefault(require("inquirer"));
42
+ const miz_selector_1 = require("./files/miz-selector");
43
+ // 2. Define Defaults (Used if file is missing or partial)
44
+ const DEFAULT_CONFIG = {
45
+ lastMissionPath: null,
46
+ backupEnabled: true
47
+ };
48
+ function saveConfig(data) {
49
+ // 1. Determine the directory of the Executable
50
+ // Check if we are running inside a 'pkg' executable
51
+ const isPkg = process.pkg !== undefined;
52
+ const exeDir = isPkg
53
+ ? path.dirname(process.execPath) // PROD: The folder containing .exe
54
+ : process.cwd(); // DEV: The folder where you ran 'npm start'
55
+ // 2. Construct the full path
56
+ const configPath = path.join(exeDir, 'config.json');
57
+ try {
58
+ // 3. Write the file
59
+ fs.writeFileSync(configPath, JSON.stringify(data, null, 4), 'utf8');
60
+ console.log(`Config saved to: ${configPath}`);
61
+ }
62
+ catch (err) {
63
+ console.error(`Failed to write config`, err);
64
+ }
65
+ }
66
+ exports.saveConfig = saveConfig;
67
+ function readConfig() {
68
+ // A. Determine the directory (Compatible with 'pkg')
69
+ const isPkg = process.pkg !== undefined;
70
+ const exeDir = isPkg
71
+ ? path.dirname(process.execPath) // PROD: Next to the .exe
72
+ : process.cwd(); // DEV: Current working directory
73
+ const configPath = path.join(exeDir, 'config.json');
74
+ // B. Check if file exists
75
+ if (!fs.existsSync(configPath)) {
76
+ console.log("No config found. Using defaults.");
77
+ return DEFAULT_CONFIG;
78
+ }
79
+ try {
80
+ // C. Read and Parse
81
+ const rawData = fs.readFileSync(configPath, 'utf8');
82
+ const userConfig = JSON.parse(rawData);
83
+ // D. Merge with Defaults
84
+ // (Ensures your app doesn't crash if the user deletes a key from the JSON)
85
+ return Object.assign(Object.assign({}, DEFAULT_CONFIG), userConfig);
86
+ }
87
+ catch (err) {
88
+ console.error(`Error reading config (corrupt JSON?)`, err);
89
+ console.log("Reverting to default configuration.");
90
+ return DEFAULT_CONFIG;
91
+ }
92
+ }
93
+ exports.readConfig = readConfig;
94
+ const initializeConfig = (options) => __awaiter(void 0, void 0, void 0, function* () {
95
+ var _a;
96
+ const config = readConfig();
97
+ let missionPath = (_a = options === null || options === void 0 ? void 0 : options.file) !== null && _a !== void 0 ? _a : "";
98
+ let outDir = "";
99
+ if (missionPath) {
100
+ const mizDir = missionPath.replace(path.basename(missionPath), "");
101
+ outDir = path.join(mizDir, "out");
102
+ }
103
+ else if (config.lastMissionPath === null) {
104
+ const { mizPath, dir } = yield (0, miz_selector_1.getMizPath)();
105
+ missionPath = mizPath;
106
+ outDir = path.join(dir, "out");
107
+ }
108
+ else {
109
+ missionPath = config.lastMissionPath;
110
+ const { action } = yield inquirer_1.default.prompt([
111
+ {
112
+ type: 'rawlist',
113
+ name: 'action',
114
+ message: 'Target file already exists. What would you like to do?',
115
+ choices: [
116
+ {
117
+ name: `Reuse the existing path: ${config.lastMissionPath}`,
118
+ value: 'reusePath'
119
+ },
120
+ {
121
+ name: "Select new .miz",
122
+ value: 'selectMiz'
123
+ }
124
+ ]
125
+ }
126
+ ]);
127
+ const mizDir = missionPath.replace(path.basename(missionPath), "");
128
+ outDir = path.join(mizDir, "out");
129
+ if (action === "selectMiz") {
130
+ const { mizPath, dir } = yield (0, miz_selector_1.getMizPath)(mizDir);
131
+ missionPath = mizPath;
132
+ outDir = path.join(dir, "out");
133
+ ;
134
+ }
135
+ }
136
+ saveConfig(Object.assign(Object.assign({}, config), { lastMissionPath: missionPath }));
137
+ return { missionPath, outDir };
138
+ });
139
+ exports.initializeConfig = initializeConfig;
140
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,wDAAgC;AAChC,uDAAkD;AAOlD,0DAA0D;AAC1D,MAAM,cAAc,GAAc;IAC9B,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;CACtB,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAe;IACtC,+CAA+C;IAC/C,oDAAoD;IACpD,MAAM,KAAK,GAAI,OAAe,CAAC,GA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AAE;oBACL;wBACI,IAAI,EAAE,4BAA4B,MAAM,CAAC,eAAe,EAAE;wBAC1D,KAAK,EAAE,WAAW;qBACrB;oBACD;wBACI,IAAI,EAAE,iBAAiB;wBACvB,KAAK,EAAE,WAAW;qBACrB;iBACJ;aACJ;SACJ,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;QAEnE,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAElC,IAAI,MAAM,KAAK,WAAW,EAAE;YACxB,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,IAAA,yBAAU,EAAC,MAAM,CAAC,CAAC;YAClD,WAAW,GAAG,OAAO,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAAA,CAAC;SACnC;KAGJ;IAED,UAAU,iCAAM,MAAM,KAAE,eAAe,EAAE,WAAW,IAAG,CAAC;IAExD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACnC,CAAC,CAAA,CAAA;AAjDY,QAAA,gBAAgB,oBAiD5B"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.fengariSortFile = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ const fengari = __importStar(require("fengari"));
30
+ const lua = fengari.lua;
31
+ const lauxlib = fengari.lauxlib;
32
+ const lualib = fengari.lualib;
33
+ const to_luastring = fengari.to_luastring;
34
+ const scriptPath = path.join(__dirname, "../lua/sorter_lib.lua");
35
+ const runSorter = (dataFilePath, varName) => {
36
+ // 1. Read the Data File
37
+ const dataContent = fs.readFileSync(dataFilePath, 'utf8');
38
+ // --- DETECT LINE ENDINGS ---
39
+ // Check if the file contains Carriage Return + Line Feed
40
+ const useCRLF = dataContent.includes("\r\n");
41
+ const EOL = useCRLF ? "\r\n" : "\n";
42
+ // ---------------------------
43
+ const L = lauxlib.luaL_newstate();
44
+ lualib.luaL_openlibs(L);
45
+ // 2. Load Data into VM
46
+ // Strip shebang just in case, convert to Lua String
47
+ const cleanContent = dataContent.replace(/^#!\/.*\n/, "");
48
+ let status = lauxlib.luaL_dostring(L, to_luastring(cleanContent));
49
+ if (status !== lua.LUA_OK) {
50
+ throw new Error(`Lua Load Error: ${lua.lua_tojsstring(L, -1)}`);
51
+ }
52
+ // 3. Load Sorter Logic
53
+ const scriptContent = fs.readFileSync(scriptPath, 'utf8');
54
+ status = lauxlib.luaL_loadstring(L, to_luastring(scriptContent));
55
+ if (status !== lua.LUA_OK) {
56
+ throw new Error(`Script Load Error: ${lua.lua_tojsstring(L, -1)}`);
57
+ }
58
+ // 4. Run Sorter
59
+ lua.lua_pushstring(L, varName);
60
+ status = lua.lua_pcall(L, 1, 2, 0);
61
+ if (status !== lua.LUA_OK) {
62
+ throw new Error(`Runtime Error: ${lua.lua_tojsstring(L, -1)}`);
63
+ }
64
+ const errorMsg = lua.lua_tojsstring(L, -1);
65
+ let resultString = lua.lua_tojsstring(L, -2); // This will contain \n
66
+ if (!resultString && errorMsg) {
67
+ throw new Error(`Logic Error: ${errorMsg}`);
68
+ }
69
+ resultString = resultString.replace(/\r?\n/g, EOL);
70
+ // 5. Write back
71
+ fs.writeFileSync(dataFilePath, resultString);
72
+ console.log(`Success: Sorted ${varName}`);
73
+ };
74
+ const fengariSortFile = (filepath) => {
75
+ const targetVar = path.basename(filepath);
76
+ runSorter(filepath, targetVar);
77
+ };
78
+ exports.fengariSortFile = fengariSortFile;
79
+ //# sourceMappingURL=fengari-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fengari-wrapper.js","sourceRoot":"","sources":["../src/fengari-wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAmC;AAEnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACxB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC9B,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAE1C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AAEjE,MAAM,SAAS,GAAG,CAAC,YAAoB,EAAE,OAAe,EAAE,EAAE;IACxD,wBAAwB;IACxB,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAE1D,8BAA8B;IAC9B,yDAAyD;IACzD,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,OAAO,CAAC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,QAAQ,GAAG,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,YAAY,GAAG,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB;IAErE,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,gBAAgB,QAAQ,EAAE,CAAC,CAAC;KAC/C;IAED,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEnD,gBAAgB;IAChB,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEK,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,EAAE;IAChD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC1C,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEnC,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.pickMissionFileNative = void 0;
16
+ const node_child_process_1 = require("node:child_process");
17
+ const node_os_1 = __importDefault(require("node:os"));
18
+ function pickMissionFileNative() {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const platform = node_os_1.default.platform();
21
+ return new Promise((resolve, reject) => {
22
+ let cmd = '';
23
+ let args = [];
24
+ if (platform === 'win32') {
25
+ // WINDOWS: Use PowerShell with .NET Forms
26
+ cmd = 'powershell';
27
+ const psScript = `
28
+ Add-Type -AssemblyName System.Windows.Forms
29
+ $f = New-Object System.Windows.Forms.OpenFileDialog
30
+ $f.Filter = "Mission Files (*.miz)|*.miz"
31
+ $f.Title = "Select a DCS Mission File"
32
+ $f.ShowHelp = $true
33
+ $result = $f.ShowDialog()
34
+ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
35
+ Write-Host $f.FileName
36
+ }
37
+ `;
38
+ // Encode command to avoid escaping issues
39
+ args = ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', psScript];
40
+ }
41
+ else if (platform === 'linux') {
42
+ // LINUX: Use Zenity (Common on Ubuntu/Desktop Linux)
43
+ cmd = 'zenity';
44
+ args = ['--file-selection', '--file-filter=*.miz', '--title=Select a Mission File'];
45
+ }
46
+ else if (platform === 'darwin') {
47
+ // MAC: Use AppleScript
48
+ cmd = 'osascript';
49
+ const appleScript = `
50
+ set theFile to choose file with prompt "Select a Mission File" of type {"miz"}
51
+ POSIX path of theFile
52
+ `;
53
+ args = ['-e', appleScript];
54
+ }
55
+ const child = (0, node_child_process_1.spawn)(cmd, args);
56
+ let output = '';
57
+ let errorOutput = '';
58
+ child.stdout.on('data', (data) => { output += data.toString(); });
59
+ child.stderr.on('data', (data) => { errorOutput += data.toString(); });
60
+ child.on('close', (code) => {
61
+ const resultPath = output.trim();
62
+ if (code === 0 && resultPath) {
63
+ resolve(resultPath);
64
+ }
65
+ else {
66
+ // If user cancelled, usually code is 1 or path is empty
67
+ reject(new Error("Selection cancelled"));
68
+ }
69
+ });
70
+ child.on('error', (err) => {
71
+ reject(new Error(`Failed to launch dialog: ${err.message}`));
72
+ });
73
+ });
74
+ });
75
+ }
76
+ exports.pickMissionFileNative = pickMissionFileNative;
77
+ //# sourceMappingURL=file-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-picker.js","sourceRoot":"","sources":["../../src/files/file-picker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2DAA2C;AAC3C,sDAAwB;AAExB,SAAsB,qBAAqB;;QACvC,MAAM,QAAQ,GAAG,iBAAE,CAAC,QAAQ,EAAE,CAAC;QAE/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI,GAAG,GAAG,EAAE,CAAC;YACb,IAAI,IAAI,GAAa,EAAE,CAAC;YAExB,IAAI,QAAQ,KAAK,OAAO,EAAE;gBACtB,0CAA0C;gBAC1C,GAAG,GAAG,YAAY,CAAC;gBACnB,MAAM,QAAQ,GAAG;;;;;;;;;;aAUhB,CAAC;gBACF,0CAA0C;gBAC1C,IAAI,GAAG,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;aAC7E;iBACI,IAAI,QAAQ,KAAK,OAAO,EAAE;gBAC3B,qDAAqD;gBACrD,GAAG,GAAG,QAAQ,CAAC;gBACf,IAAI,GAAG,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,+BAA+B,CAAC,CAAC;aACvF;iBACI,IAAI,QAAQ,KAAK,QAAQ,EAAE;gBAC5B,uBAAuB;gBACvB,GAAG,GAAG,WAAW,CAAC;gBAClB,MAAM,WAAW,GAAG;;;cAGlB,CAAC;gBACH,IAAI,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;aAC9B;YAED,MAAM,KAAK,GAAG,IAAA,0BAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,IAAI,WAAW,GAAG,EAAE,CAAC;YAErB,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,WAAW,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAEvE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;gBACjC,IAAI,IAAI,KAAK,CAAC,IAAI,UAAU,EAAE;oBAC1B,OAAO,CAAC,UAAU,CAAC,CAAC;iBACvB;qBAAM;oBACH,wDAAwD;oBACxD,MAAM,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;iBAC5C;YACL,CAAC,CAAC,CAAC;YAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACtB,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACjE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CAAA;AA5DD,sDA4DC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.getMizPath = void 0;
16
+ const node_path_1 = __importDefault(require("node:path"));
17
+ const file_picker_1 = require("./file-picker");
18
+ const getMizPath = (root = ".") => __awaiter(void 0, void 0, void 0, function* () {
19
+ const mizPath = yield (0, file_picker_1.pickMissionFileNative)();
20
+ const dir = mizPath.replace(node_path_1.default.basename(mizPath), "");
21
+ return { mizPath, dir };
22
+ });
23
+ exports.getMizPath = getMizPath;
24
+ //# sourceMappingURL=miz-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"miz-selector.js","sourceRoot":"","sources":["../../src/files/miz-selector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAA4B;AAE5B,+CAAqD;AAE9C,MAAM,UAAU,GAAG,CAAO,OAAe,GAAG,EAAE,EAAE;IACnD,MAAM,OAAO,GAAG,MAAM,IAAA,mCAAqB,GAAE,CAAC;IAE9C,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACxD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;AAC5B,CAAC,CAAA,CAAA;AALY,QAAA,UAAU,cAKtB"}