Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Correctly compare paths to files in the current directory. #152

Merged
merged 1 commit into from
Jun 8, 2016

Conversation

jjudd
Copy link
Contributor

@jjudd jjudd commented Jun 8, 2016

If the tsickle main function is run against files in the same directory,
then closure type comments are not added to the outputted JavaScript. For
example, if you run tsickle against './hello.ts' then the outputted
hello.js will not have type comments.

This occurs because the sourceReplacingCompilerHost compares fileNames to
determine whether we ran tsickle on the source file. 'hello.ts' is compared
to './hello.ts' and we incorrectly skip the file.

This is fixed by comparing the path to the files using the TypeScript
sys utilities.

If the tsickle main function is run against files in the same directory,
then closure type comments are not added to the outputted JavaScript. For
example, if you run tsickle against './hello.ts' then the outputted
hello.js will not have type comments.

This occurs because the sourceReplacingCompilerHost compares fileNames to
determine whether we ran tsickle on the source file. 'hello.ts' is compared
to './hello.ts' and we incorrectly skip the file.

This is fixed by comparing the path to the files using the TypeScript
sys utilities.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@jjudd
Copy link
Contributor Author

jjudd commented Jun 8, 2016

I signed the CLA. Also, I hope this is a decent way to fix this. I downloaded tsickle and was considering using it for a large closure codebase. When I couldn't get it to work on a small example program, I was a bit concerned :)

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Jun 8, 2016
@evmar
Copy link
Contributor

evmar commented Jun 8, 2016

Thanks for looking! We are successfully using tsickle within Google, and this main.ts is an attempt at open-sourcing the general gist of how it works. (Our internal code is full of Google-specific hacks for our weird source code layout.) So as you have observed, it doesn't quite work yet, but I am pretty confident that it can be made to work because the bulk of the tsickle library is in successful use.

@evmar evmar merged commit dd0f489 into angular:master Jun 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants