Skip to content

Commit d70dc79

Browse files
committed
Update changelog, bump version: 3.10.0
1 parent a11ab57 commit d70dc79

10 files changed

Lines changed: 45 additions & 20 deletions

File tree

binary/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22

33
Notable changes to `@bgforge/binary` (the library and the `fgbin` CLI). Binary-editor UI changes ship in the extension changelog, not here.
44

5-
## Unreleased
5+
## 0.3.0
66

77
### Changed
88

99
- Oversized JSON snapshots (crafted to inflate array lengths) are now rejected before allocation.
1010
- Registering two parsers or format adapters under the same id now throws instead of silently overwriting.
11+
- Proto-dir `.pro` reads (MAP subtype resolution) are now capped at the PRO size budget.
12+
13+
### Removed
14+
15+
- `findEditableField` is no longer exported; there is no replacement.
1116

1217
### Fixed
1318

1419
- Trailing-NUL trimming no longer leaves a literal NUL byte at the end of a trimmed value.
1520
- CRE: an empty section whose offset a shrinking edit pushed past end-of-file is now recomputed correctly on save.
21+
- The CLI's JSON-snapshot input-size cap can no longer be raced past by swapping the file mid-read.
1622

1723
## 0.2.0
1824

binary/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bgforge/binary",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Library and CLI for parsing and serialising Fallout PRO and MAP binary files (round-trip to canonical JSON snapshots).",
55
"keywords": [
66
"binary",

binary/src/pro-resolver-loader.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,23 @@ export function loadProDirResolver(protoBaseDir: string): ProResolverResult {
8686
try {
8787
// Same stat-before-allocate budget the CLI parse path applies (max-file-sizes.ts):
8888
// the parser's own 1 KB limit rejects oversized DATA, but only after the whole file
89-
// has already been read into memory - cap the read itself.
89+
// has already been read into memory - cap the read itself. fstat and read go through
90+
// ONE descriptor so the size check and the read see the same inode; a statSync ->
91+
// readFileSync pair on the path leaves a TOCTOU window (CodeQL js/file-system-race)
92+
// where a file swapped after the check could bypass the cap.
9093
const proCap = MAX_FILE_SIZES.pro;
91-
const size = fs.statSync(filePath).size;
92-
if (proCap !== undefined && size > proCap) {
93-
errors.push(`Skipped ${filePath}: ${size} bytes exceeds the ${proCap}-byte PRO cap`);
94-
continue;
94+
let data: Buffer;
95+
const fd = fs.openSync(filePath, "r");
96+
try {
97+
const size = fs.fstatSync(fd).size;
98+
if (proCap !== undefined && size > proCap) {
99+
errors.push(`Skipped ${filePath}: ${size} bytes exceeds the ${proCap}-byte PRO cap`);
100+
continue;
101+
}
102+
data = fs.readFileSync(fd);
103+
} finally {
104+
fs.closeSync(fd);
95105
}
96-
const data = fs.readFileSync(filePath);
97106
const parsed = proParser.parse(new Uint8Array(data));
98107
if (!parsed.document) {
99108
errors.push(`Failed to parse ${filePath}: no canonical document`);

docs/changelog.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
# Changelog
22

3-
## Unreleased
3+
## 3.10.0
44

55
### Dialog editor
66

77
- New interactive Dialog Editor for D, TD, SSL, TSSL dialogue.
8-
- The Dialog Editor now follows the active VS Code color theme, including light themes.
8+
9+
### Diagnostics
10+
11+
- New `bgforge.diagnostics` setting (on by default): instant syntax-error reporting for all parsed languages (Fallout SSL and MSG, WeiDU BAF, D, TP2, TRA), alongside compiler diagnostics.
12+
13+
### Binary editor
14+
15+
- Read-only fields are now enforced on save, not only disabled in the interface, and show a tooltip explaining why.
16+
- Fixed: a size-shrinking CRE edit could corrupt an empty section's offset, producing a file that failed to reopen.
917

1018
### Translations
1119

1220
- `.tra`/`.msg` files are now read as UTF-8 first, falling back to windows-1252 for older files that predate UTF-8 - accented and other special characters in `@N` text now display correctly instead of being mangled.
13-
- Saving `@N` edits now preserves a file's original encoding: a windows-1252 file round-trips its untouched text byte-for-byte instead of being silently rewritten as UTF-8. An edit that adds a character the file's encoding can't represent is refused with an error instead of corrupting the file.
14-
- Saving `@N` edits is now crash-safe: the file is written to a temporary file and swapped in, so an interruption mid-save can no longer leave a `.tra`/`.msg` truncated.
1521
- Editing an open `.tra`/`.msg` file now refreshes the `@N` inlay hint previews in other open files immediately, instead of waiting for their own next edit.
22+
- `.msg` comments must now be marked (`#`, `//`, or `/* */`); unmarked trailing text is a syntax error.
1623

1724
### Requirements
1825

1926
- Minimum supported VS Code is now 1.91 (was 1.73).
2027

2128
### WeiDU
2229

23-
- Added parsing and highlighting for more WeiDU constructs: TP2 `REQUIRE_FILE` / `FORBID_FILE` / `FORBID_PREDICATE` component flags, `EXTEND_TOP` / `EXTEND_BOTTOM ... USING`, and `REMOVE_CRE_ITEMS`; D `CHAIN3` and `%var%`-interpolated names.
30+
- Added parsing and highlighting for more WeiDU constructs: TP2 `REQUIRE_FILE` / `FORBID_FILE` / `FORBID_PREDICATE` component flags, `EXTEND_TOP` / `EXTEND_BOTTOM ... USING`, and `REMOVE_CRE_ITEMS`; D `CHAIN3`, `%var%`-interpolated names, hyphenated state labels, `ALTER_TRANS` bareword `ACTION`, and trailing `IF`/`UNLESS` after `ADD_TRANS_ACTION`.
2431
- Fixed: in TP2 hover tooltips, `buffString` and `ascString` parameter names were not highlighted because of an unreachable pattern branch.
2532
- Fixed: dropped several phantom TP2 keywords the grammar never matched, and corrected highlighting of the real ones.
2633
- Fixed: the WeiDU D formatter was not idempotent when a `~string~` immediately followed a keyword.
2734

2835
### Transpilers
2936

30-
- Fixed: transpiling a multi-file TSSL/TBAF/TD source (one that uses `import`) relied on the system `PATH` `node`, so it broke on editors that ship their own runtime instead of a `node` binary AND in environments with a broken `node` shim (stale nvm/mise/asdf). The bundler now always uses the editor's own runtime, the same way the built-in SSL compiler does, so a missing or broken `PATH` `node` no longer affects it.
37+
- Built-in transpiler no longer relies on system Node.
38+
- Fixed: the TD loop unroller silently dropped all but the first variable of a multi-variable `for` initializer; it now reports an error.
3139

3240
### Performance
3341

format/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Notable changes to `@bgforge/format` (the library and the `fgfmt` CLI).
44

5-
## Unreleased
5+
## 0.2.0
66

77
### Added
88

format/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bgforge/format",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Library for formatting Fallout SSL, WeiDU BAF/D/TP2/TRA, Fallout MSG, Infinity Engine 2DA, and Fallout scripts.lst files",
55
"keywords": [
66
"fallout",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bgforge-mls",
33
"displayName": "BGforge MLS",
4-
"version": "3.9.1",
4+
"version": "3.10.0",
55
"description": "BGforge multilanguage server",
66
"categories": [
77
"Programming Languages"

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bgforge/mls-server",
3-
"version": "3.9.1",
3+
"version": "3.10.0",
44
"description": "LSP server for Fallout SSL, WeiDU (BAF/D/TP2), and related modding languages",
55
"keywords": [
66
"fallout",

transpilers/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
Notable changes to `@bgforge/transpile` (the library and the `fgtp` CLI).
44

5-
## Unreleased
5+
## 0.1.2
66

77
### Fixed
88

99
- The TD transpiler now reports an error on a multi-variable `for` initializer during loop unrolling instead of silently keeping only the first variable.
10+
- Multi-file transpiles no longer rely on a `node` binary on `PATH`; the bundler's child always runs on the current runtime.
11+
- `quick-lru` is now a declared dependency, fixing standalone installs.
1012

1113
## 0.1.1
1214

transpilers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bgforge/transpile",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Library for transpiling TSSL, TBAF, and TD source files to Fallout SSL, WeiDU BAF, and WeiDU D",
55
"keywords": [
66
"fallout",

0 commit comments

Comments
 (0)