Skip to content

refactor(types): tighten up type safety#28

Merged
Fevol merged 8 commits intoFevol:mainfrom
rsp2k:fix/type-safety-improvements
Apr 6, 2026
Merged

refactor(types): tighten up type safety#28
Fevol merged 8 commits intoFevol:mainfrom
rsp2k:fix/type-safety-improvements

Conversation

@rsp2k
Copy link
Copy Markdown
Contributor

@rsp2k rsp2k commented Jan 21, 2026

Replaced a bunch of any types with proper typing:

  • deepMerge/deepDiff now use unknown + type guards
  • Virtual module generation references TS types instead of JSON.stringify
  • D3 force simulation has proper generics
  • Added DiffResult/DiffValue types

Makes the IDE happier and catches more bugs at compile time.

rsp2k and others added 6 commits March 29, 2026 22:04
- Replace `any` with `unknown` and proper type guards in deepMerge and deepDiff functions
- Add type predicate `isObject` for better type narrowing
- Fix virtual module type generation to reference TypeScript types instead of JSON.stringify
- Update virtual.d.ts to use FullStarlightSiteGraphConfig instead of StarlightSiteGraphConfig
- Improve D3 force simulation type safety with proper generic parameters
- Add type-safe narrowing in graph-component.ts for diff results
- Add DiffResult and DiffValue types for better type safety
refactor: use enums instead of literal unions for string literals
refactor: define all zod defaults values in default value config
feat: make object diffing typesafe
refactor: rename deepMerge to mergeDefaults
@Fevol Fevol force-pushed the fix/type-safety-improvements branch from 97f8c5a to bc43f49 Compare April 6, 2026 20:57
@Fevol
Copy link
Copy Markdown
Owner

Fevol commented Apr 6, 2026

Thanks for the PR! I have added some commits to the PR to make the functions more type-safe, and refactored the code to make it a bit cleaner.

@Fevol Fevol merged commit 1e5854e into Fevol:main Apr 6, 2026
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.

2 participants