schemats: Some characters are missing in generated output
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 of export type sal_matricule = string;
4 characters = s are missing
Excerpt of output :
/**
* AUTO-GENERATED FILE @ 2017-01-24 13:27:02 - DO NOT EDIT!
*
* This file was generated with schemats node package:
* $ schemats generate -c postgres://username:password@localhost:5432/testpayroll -t pay_salarie_sal -o schema.ts
*
* Re-run the command above.
*
*/
export namespace pay_salarie_salFields {
export type sal_id = number;
export type sal_matriculetring;
With another table, the missing characters are in nearly the same place :
/**
* AUTO-GENERATED FILE @ 2017-01-24 13:33:18 - DO NOT EDIT!
*
* This file was generated with schemats node package:
* $ schemats generate -c postgres://username:password@localhost:5432/testpayroll -t pay_contrat_cnt -o schema.ts
*
* Re-run the command above.
*
*/
export namespace pay_contrat_cntFields {
export type cnt_soldetc_mdp_id = number | null;
exporte tex_id = number | null;
Of course, expected : export type tex_id instead of exporte tex_id
4 characters typ are missing
It’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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (20 by maintainers)
Commits related to this issue
- hotfix for #37 — committed to SweetIQ/schemats by xiamx 7 years ago
- Merge pull request #40 from SweetIQ/tsfmtfix hotfix for #37 — committed to SweetIQ/schemats by xiamx 7 years ago
Thank you everyone, the patch is merged to typescript-formatter. Closing this issue with the release v1.1.2
Maybe we can receive some help of its author @vvakame I’ve created an issue there https://github.com/vvakame/typescript-formatter/issues/74
@abenhamdine Thanks. This is very helpful in reproducing it.
I can confirm If I disable typescript-formatter, by replacing index.ts
with simply
return outputThe generated file will have
export type sco_total_debit = number;generated correctly. This is a weird issue and certainly suggests a bug in typescript-formatter (or a misusage of it in my part.) We use typescript-formatter to (mainly) generate files with correct indentation levels specified by the project’s tslintrc or editorconfig.After some lengthy debug on typescript-formatter, I proposed a fix here https://github.com/vvakame/typescript-formatter/pull/75. I’ll release a fix for schemats quickly by pointing the typescript-fromatter version to our fork.