Repository navigation
Feature/tsdefinition short names - #3
Merged
Merged
Conversation
…s auto-emission v3.1.4 lands the "Monaco hovers show the short name instead of the 80-char namespace path" story, with one config that works for .d.ts AND NewObject: - New IJsTsDefinitionContributor extension point; AddLinq auto-registers a contributor so linq.d.ts surfaces in GetTsDefinitions() output — closes the "linq.* is invisible in Monaco" gap from the FR - AddTypeAlias<T>() / MapNamespace(prefix, target) on JsEvalBuilder — aliases emit at root scope in the .d.ts AND resolve via NewObject(...); single source of truth lives on JsEngineOptions so the two layers cannot drift apart - DefinitionBuilder.AddType(type, alias) / MapNamespace(source, target) for standalone (non-DI) consumers - Collision detection fires only when a user rule is involved; natural same-name collisions (Span.Enumerator vs ReadOnlySpan.Enumerator) keep the v3.1.3 interface-merging behavior so unconfigured consumers don't regress - System.* excluded from namespace mapping by default - 8 new regression tests, 314/314 suite green Pure additive release. No breaking changes to any existing API. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tening and updated documentation
… more hand-written files
AddLinq()'s TypeScript surface had drifted from reality: linq.d.ts referenced
undeclared types (Guid, Decimal, Long), cocoar-jseval-linq.d.ts was a hand-
maintained mirror of the translator's method-map. Both are now derived from
real C# metadata by LinqTsContributor:
- LinqGlobal: POCO bound to Jint as the `linq` runtime object. Its public
instance methods become the JS API (linq.guid('...'), linq.today(), ...)
AND the reflection source for generating linq.d.ts with matching return
types (System.Guid, number, Date).
- IJsStringAliases / IJsArrayAliases<T>: metadata-only interfaces describing
the PascalCase aliases (Contains, StartsWith, Any, All, Where, ...). Not
registered at runtime — pure reflection targets so LinqTsContributor can
emit `interface String { ... }` / `interface Array<T> { ... }` / `ReadonlyArray<T>`
augmentations that TypeScript merges with the built-in lib.es5 declarations.
LinqTypeScriptDefinition.Read/WriteTo helpers are removed (TsDefinitionService
surfaces the content automatically via the contributor). Both embedded .d.ts
resources are gone — single source of truth lives in C# code. Adding a new
alias = adding a method on the C# class, no second edit needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.