-
Notifications
You must be signed in to change notification settings - Fork 105
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
Some characters are missing in generated output #37
Comments
I've also seen this before.. and it's frustrating. So far I believe the issue is either with the |
Thx for your quick answer and for the clue. |
No problem. I've seen it happening for one day [1] but I'm unable to reproduce it now for some reason. |
Removed a potential culprit with #38 . |
Thanks ! |
I will probably have to look into typescript-formatter then.. |
@xiamx how good are your tests? You don't really know that without code coverage. Check out - all my modules have it, you can use them as an example ;) Setting up code coverage is easy, and if you get stuck - just ask ;) |
@vitaly-t tests are admittedly not comprehensive at the moment 😂 . We only have end to end tests as of now. I should start adding some unit tests |
I'm experiencing the same problem with |
I will take another look at this over the weekend |
Anything? It's a killer bug, you know, very critical 😉 |
@vitaly-t 😂 I can't reproduce it, neither locally nor on CI.. even though code coverage report by Istanbul is at 100% line covered |
Bumping the version of typescript-formatter to 4.1.0. @abenhamdine @Jujunol can you guys please paste the content of your tsconfig.json and tslintrc (if any)? It should help me reproduce this bug locally. |
Bug still present in 1.1.0 for me, unfortunately. Here's the dump of the db : And the output file : /**
* AUTO-GENERATED FILE @ 2017-02-08 16:14:07 - DO NOT EDIT!
*
* This file was generated with schemats node package:
* $ schemats generate -c postgres://username:password@localhost:5432/test_schemats_2 -o schema.ts -t cta_situationcompte_sco
*
* Re-run the command above.
*
*/
export namespace cta_situationcompte_scoFields {
export type sco_id = number;
export type sco_t_debit = number;
export type sco_total_credit = number;
export type sco_nb_ecritures = number;
export type pst_id = number;
export type cpt_id = number;
}
export interface cta_situationcompte_sco {
sco_id: cta_situationcompte_scoFields.sco_id;
sco_total_debit: cta_situationcompte_scoFields.sco_total_debit;
sco_total_credit: cta_situationcompte_scoFields.sco_total_credit;
sco_nb_ecritures: cta_situationcompte_scoFields.sco_nb_ecritures;
pst_id: cta_situationcompte_scoFields.pst_id;
cpt_id: cta_situationcompte_scoFields.cpt_id;
} |
@abenhamdine Thanks. This is very helpful in reproducing it. I can confirm If I disable typescript-formatter, by replacing index.ts
with simply The generated file will have |
Maybe we can receive some help of its author @vvakame I've created an issue there vvakame/typescript-formatter#74 |
Interestingly, by removing the comment header from the input, the issue disappeared. So maybe the temporal solution is to feed only the output without the comment header to typescript-formatter, and then add the header afterward. |
After some lengthy debug on typescript-formatter, I proposed a fix here vvakame/typescript-formatter#75. I'll release a fix for schemats quickly by pointing the typescript-fromatter version to our fork. |
@abenhamdine awesome, glad to know it fixed it ! Let's keep this tracking issue open until patches are merged in the upstream typescript-formatter project. |
Thank you everyone, the patch is merged to typescript-formatter. Closing this issue with the release v1.1.2 |
Nodejs : 7.4.0
Postgres : 9.6.1
schemats : 1.0.1
While using last version 1.0.1 of this module, I run into a strange bug : in the generated file, some characters are missing, always in the third line of first interface declaration.
Eg, in the following example, the file contains
export type sal_matriculetring;
instead ofexport type sal_matricule = string;
4 characters
= s
are missingExcerpt of output :
With another table, the missing characters are in nearly the same place :
Of course, expected :
export type tex_id
instead ofexporte tex_id
4 characters
typ
are missingIt's the only issue in the output file : all other lines are correct.
I don't reproduce the issue with osm artifact test file, which is weird.
The text was updated successfully, but these errors were encountered: