forked from dagger/dagger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: typescript SDK resolve value by reference.
Fixes dagger#8676. Refactor typedef resolution to be resolve by reference. The introspection starts from the entrypoint (which is the class named the same as the module) and recursively resolve every references. Refactor the TS compiler API to be abstract with a AST that handle lookups, typedef resolutions and default value resolution. Use `imports` to resolve default value that refers to an exported variable. Add custom introspection error. Improve error handling to point to the line that couldn't be introspected. Add supports for native `enum` keyword and `type` native keyword. Simplify overall code abstractions too minimal. Avoid long abstractions functions. Signed-off-by: Tom Chauveau <[email protected]>
- Loading branch information
Showing
58 changed files
with
2,419 additions
and
1,628 deletions.
There are no files selected for viewing
This file contains 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 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,11 @@ | ||
import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.js" | ||
import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.js" | ||
|
||
export class IntrospectionError extends DaggerSDKError { | ||
name = ERROR_NAMES.IntrospectionError | ||
code = ERROR_CODES.IntrospectionError | ||
|
||
constructor(message: string, options?: DaggerSDKErrorOptions) { | ||
super(message, options) | ||
} | ||
} |
This file contains 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 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 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 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 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
Oops, something went wrong.