dart-archive / js_facade_gen

Generates package:js Javascript interop facades for arbitrary TypeScript libraries
Apache License 2.0
161 stars 29 forks source link

Monaco's TSD causes generation error #91

Open domesticmouse opened 4 years ago

domesticmouse commented 4 years ago

Attempting to generate a wrapper for monaco-editor leads to the following error message:

$ dart_js_facade_gen monaco.d.ts
/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/index.js:28
  if (e.name !== 'DartFacadeError') throw e;
                                    ^

TypeError: Cannot read property 'getSourceFile' of undefined
    at Transpiler.reportError (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/main.js:407:22)
    at FacadeConverter.reportError (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/base.js:395:25)
    at FacadeConverter.getTypeDeclarationOfSymbol (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/facade_converter.js:615:18)
    at MergedType.merge (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/merge.js:39:42)
    at Array.forEach (<anonymous>)
    at MergedType.merge (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/merge.js:24:33)
    at FacadeConverter.generateDartTypeName (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/facade_converter.js:399:20)
    at TypeTranspiler.visitNode (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/type.js:13:31)
    at Transpiler.visit (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/main.js:446:37)
    at DeclarationTranspiler.visit (/Users/brettmorgan/homebrew/lib/node_modules/dart_js_facade_gen/build/lib/base.js:301:25)
dannnnthemannnn commented 3 years ago

Also @google-cloud/tasks

dart_js_facade_gen node_modules/@google-cloud/tasks/build/protos/protos.d.ts

KSoto commented 3 years ago

I'm also trying to translate monaco! After some digging, I found the underlying error code:

no type declarations for symbol KeyCode

I edited the script to print but ignore errors and got all the following errors:

no type declarations for symbol KeyCode
no type declarations for symbol SelectionDirection
no type declarations for symbol SelectionDirection
no type declarations for symbol MarkerSeverity
no type declarations for symbol MarkerSeverity
no type declarations for symbol MarkerTag
no type declarations for symbol MarkerTag
no type declarations for symbol MarkerSeverity
no type declarations for symbol MarkerTag
no type declarations for symbol MarkerSeverity
no type declarations for symbol MarkerSeverity
no type declarations for symbol MarkerTag
no type declarations for symbol MarkerTag
no type declarations for symbol MarkerSeverity
no type declarations for symbol MarkerTag
no type declarations for symbol OverviewRulerLane
no type declarations for symbol OverviewRulerLane
no type declarations for symbol OverviewRulerLane
no type declarations for symbol MinimapPosition
no type declarations for symbol MinimapPosition
no type declarations for symbol MinimapPosition
no type declarations for symbol TrackedRangeStickiness
no type declarations for symbol TrackedRangeStickiness
no type declarations for symbol TrackedRangeStickiness
no type declarations for symbol DefaultEndOfLine
no type declarations for symbol EndOfLinePreference
no type declarations for symbol EndOfLinePreference
no type declarations for symbol EndOfLinePreference
no type declarations for symbol EndOfLineSequence
no type declarations for symbol EndOfLineSequence
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol ScrollType
no type declarations for symbol CursorChangeReason
no type declarations for symbol CursorChangeReason
no type declarations for symbol CursorChangeReason
no type declarations for symbol CursorChangeReason
no type declarations for symbol EditorOption
no type declarations for symbol EditorOption
no type declarations for symbol EditorOption
no type declarations for symbol RenderMinimap
no type declarations for symbol RenderMinimap
no type declarations for symbol RenderLineNumbersType
no type declarations for symbol RenderLineNumbersType
no type declarations for symbol ScrollbarVisibility
no type declarations for symbol ScrollbarVisibility
no type declarations for symbol ScrollbarVisibility
no type declarations for symbol ScrollbarVisibility
no type declarations for symbol ContentWidgetPositionPreference
no type declarations for symbol ContentWidgetPositionPreference
no type declarations for symbol ContentWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol OverlayWidgetPositionPreference
no type declarations for symbol MouseTargetType
no type declarations for symbol MouseTargetType
no type declarations for symbol EditorOption
Warning: typeReference with arguements not supported yet:Thenable<TokensProvider | EncodedTokensProvider>
Warning: typeReference with arguements not supported yet:Thenable<IMonarchLanguage>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol IndentAction
no type declarations for symbol IndentAction
no type declarations for symbol IndentAction
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol CompletionItemKind
no type declarations for symbol CompletionItemKind
no type declarations for symbol CompletionItemTag
no type declarations for symbol CompletionItemTag
no type declarations for symbol CompletionItemTag
no type declarations for symbol CompletionItemTag
no type declarations for symbol CompletionItemInsertTextRule
no type declarations for symbol CompletionItemInsertTextRule
no type declarations for symbol CompletionItemKind
no type declarations for symbol CompletionItemTag
no type declarations for symbol CompletionItemTag
no type declarations for symbol CompletionItemInsertTextRule
no type declarations for symbol CompletionTriggerKind
no type declarations for symbol CompletionTriggerKind
no type declarations for symbol CompletionTriggerKind
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol SignatureHelpTriggerKind
no type declarations for symbol SignatureHelpTriggerKind
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol DocumentHighlightKind
no type declarations for symbol DocumentHighlightKind
no type declarations for symbol DocumentHighlightKind
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol SymbolKind
no type declarations for symbol SymbolKind
no type declarations for symbol SymbolTag
no type declarations for symbol SymbolTag
no type declarations for symbol SymbolTag
no type declarations for symbol SymbolTag
no type declarations for symbol SymbolKind
no type declarations for symbol SymbolTag
no type declarations for symbol SymbolTag
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol EndOfLineSequence
no type declarations for symbol EndOfLineSequence
no type declarations for symbol EndOfLineSequence
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
Warning: typeReference with arguements not supported yet:Thenable<T | undefined | null>
no type declarations for symbol JsxEmit
no type declarations for symbol JsxEmit
no type declarations for symbol ModuleKind
no type declarations for symbol ModuleKind
no type declarations for symbol ModuleResolutionKind
no type declarations for symbol ModuleResolutionKind
no type declarations for symbol NewLineKind
no type declarations for symbol NewLineKind
no type declarations for symbol ScriptTarget
no type declarations for symbol ScriptTarget