Skip to content

Convert to TypeScript - #51

Merged
joeferner merged 1 commit into
masterfrom
typescript-conversion
Sep 5, 2026
Merged

Convert to TypeScript#51
joeferner merged 1 commit into
masterfrom
typescript-conversion

Conversation

@joeferner

Copy link
Copy Markdown
Owner

Summary

  • bplistParser.js/test/parse.test.js.ts. Hand-written bplistParser.d.ts is replaced by declarations generated by tsc (build.js now runs tsc -p tsconfig.build.json after the esbuild bundling step and copies the emitted .d.ts to both dist/index.d.ts/dist/index.d.cts, same as before).
  • strict: true. Parsed plist values stay any (matches the existing public T = any generics — parsing arbitrary plist data is inherently dynamic), but internals get real types: a proper UID class, bigint-aware integer helpers.
  • Added a typecheck script (tsc --noEmit) and CI step.
  • Bumped to 0.5.0 (no public API change, tooling only).

Test plan

  • npm run typecheck
  • npm run build (inspected dist/index.d.ts/dist/index.d.cts, match the previous hand-written shape)
  • npm test (11/11 pass)
  • npm run lint (only pre-existing eqeqeq warnings remain)
  • npm run smoke

bplistParser.js/test/parse.test.js become .ts, with the hand-written
bplistParser.d.ts replaced by declarations generated by tsc (build.js
now runs tsc -p tsconfig.build.json after the esbuild bundling step and
copies the emitted .d.ts to both dist/index.d.ts and dist/index.d.cts,
same as before). Hand-maintained .d.ts files drift from the
implementation over time; generating them from the source makes the
types the actual source of truth.

strict: true, with the parser's genuinely dynamic parts (parsed plist
values are arbitrary nested data) typed as `any` to match, same as the
public API's existing `T = any` generics. Internals get real types
(bigint-aware integer helpers, a proper UID class).

Added a typecheck script (tsc --noEmit) and CI step so a future type
regression fails CI the same way a broken test does.

typescript-eslint pinned to typescript 6.0.x rather than the new 7.x
line, since typescript-eslint@8.69's peer range doesn't support it yet.
@joeferner
joeferner merged commit be75a59 into master Sep 5, 2026
2 checks passed
@joeferner
joeferner deleted the typescript-conversion branch September 5, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant