-
Notifications
You must be signed in to change notification settings - Fork 235
Fix: prune unreachable definitions when --type "*" is used with multiple exports
#2284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arthurfiorette
merged 10 commits into
vega:next
from
alexchexes:fix/star-emits-unreachable
Jun 22, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4e92bbf
add non-working reproduction attempt
alexchexes 0624a9e
rename test case, remove unneccessary files
alexchexes de9bacc
reduce test to absolute minimum
alexchexes 78ded94
add BUGGY schema, just for my reference
alexchexes 787e866
fix the issue and re-generate schema
alexchexes 8f22842
preserve pruning unreachable definitions when entry file re-exports t…
alexchexes 6956138
accidentally commited `export { DepType2 }` instead of `export *`
alexchexes 694ba6d
fix: include local export clauses
alexchexes 114b90f
Update src/SchemaGenerator.ts
arthurfiorette e72b2fc
add non-exported helper type to verify it's inlined in schema
alexchexes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export interface SomeInterface { | ||
| foo?: string; | ||
| } | ||
|
|
||
| export type DepType = string; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export type DepType2 = string; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import type { SomeInterface } from "./dep"; | ||
| export { DepType } from "./dep"; | ||
| export * from "./dep2"; | ||
|
|
||
| export type MyType = string; | ||
|
|
||
| export interface MyObject extends SomeInterface { | ||
| bar?: number; | ||
| baz?: Internal; | ||
| } | ||
|
|
||
| interface Internal { | ||
|
arthurfiorette marked this conversation as resolved.
|
||
| nested?: boolean; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "definitions": { | ||
| "DepType": { | ||
| "type": "string" | ||
| }, | ||
| "DepType2": { | ||
| "type": "string" | ||
| }, | ||
| "MyObject": { | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "bar": { | ||
| "type": "number" | ||
| }, | ||
| "baz": { | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "nested": { | ||
| "type": "boolean" | ||
| } | ||
| }, | ||
| "type": "object" | ||
| }, | ||
| "foo": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "type": "object" | ||
| }, | ||
| "MyType": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.