typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

JSON file includes do not change lowest common ancestor for outDir

Open Sainan opened this issue 9 months ago • 5 comments

Example project to reproduce the issue: repro.zip

Result when running tsgo here:

build\
  index.js

Expected result / what tsc outputs:

build\
  static\
    data.json
  src\
    index.js

Sainan avatar Mar 18 '25 11:03 Sainan

I also faced this same issue. I manually copied all json files using following command rsync -a --include="*/" --include="*.json" --exclude="*" src/ lib/

Other than this issue, typescript-go was able to complete a medium sized TS project very quickly.

harish2704 avatar Mar 24 '25 15:03 harish2704

Possibly an issue with the porting of JSON includes (#565)

Sainan avatar Mar 24 '25 15:03 Sainan

I think this just comes down to sourceFileMayBeEmitted having a TODO for adding JSON support.

jakebailey avatar Mar 25 '25 22:03 jakebailey

I don't see the TODO you speak of. 🤔

Edit: Oh, you might mean the one in emitter.go with the !!! comment.

Sainan avatar Mar 25 '25 22:03 Sainan

Yes, the !!! comments are "this isn't ported yet" markers.

jakebailey avatar Mar 25 '25 22:03 jakebailey

Can you try again in the next nightly? It's possible this was fixed in #1234.

jakebailey avatar Jun 20 '25 00:06 jakebailey

Compiled tsgo @ 652b18c4bd74ecd4bb9d18c44fbaf39d69aa4cc6; seems to still exibit the same broken behaviour. Repro is still valid.

Sainan avatar Jun 20 '25 00:06 Sainan

Thanks for checking.

jakebailey avatar Jun 20 '25 01:06 jakebailey