-
-
Notifications
You must be signed in to change notification settings - Fork 868
test: add integration test for TypeScript declarations #4853
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I've left a bunch of comments inline
When you are ready for a review please un-draft this PR and tag me for a review. Thank you!
.PHONY: build | ||
test: | ||
cargo run --quiet -- build | ||
tsc ./build/dev/javascript/typescript_declarations/typescript_declarations.d.mts --noEmit --lib es2015 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write this in a way where they don't need to install tsc globally? Perhaps deno can be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use it and it seems that tsc and deno process files in different way so this doesn't work, sadly.
$ deno check ./main.ts
Check file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/main.ts
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'BitArray'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'CustomType'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'Empty'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'Error'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'List'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'NonEmpty'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'Ok'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'Result'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'UtfCodepoint'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'codepointBits'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'divideFloat'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'divideInt'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'isEqual'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'prepend'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'remainderInt'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'sizedFloat'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'sizedInt'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'stringBits'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'toBitArray'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
TS2308 [ERROR]: Module "../prelude.mjs" has already exported a member named 'toList'. Consider explicitly re-exporting to resolve the ambiguity.
export type * from "../prelude.d.mts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///data/data/com.termux/files/home/gleam/test/typescript_declarations/build/dev/javascript/typescript_declarations/gleam.d.mts:2:1
Found 20 errors.
error: Type checking failed.
@lpil I fixed all things you mentioned. Niw test includes more code and there is TS file which imports generated code and type-checking works. One thing that I don't know what to do with is tsc requirement. I tried to use Deno and found following:
|
Signed-off-by: Andrey <[email protected]>
Signed-off-by: Andrey <[email protected]>
Signed-off-by: Andrey <[email protected]>
Signed-off-by: Andrey <[email protected]>
Signed-off-by: Andrey <[email protected]>
Signed-off-by: Andrey <[email protected]>
Signed-off-by: Andrey <[email protected]>
Closes #2003
Description
Add integration test for TS type declarations. It compiles project and then runs
tsc
with--noEmit
flag, so it won't generate JS files.