Skip to content

build(bazel): entry point file couldn't be resolved [ts-api-guardian] #25052

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed

Conversation

devversion
Copy link
Member

@devversion devversion commented Jul 23, 2018

  • When using ts-api-guardian on Windows, the input file can't be found due to wrong normalized path delimiters.

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

cc. @alexeagle. Wasn't sure how to indicate that this affects ts-api-guardian, so I've added it as a suffix.

* When using `ts-api-guardian` on Windows, the input file can't be found due to wrong normalized path delimiters.
const entrypoint = path.normalize(fileName);
// Since the entry point will be compared with the source files from the TypeScript program,
// the path needs to be normalized with forward slashes in order to work within Windows.
const entrypoint = path.normalize(fileName).replace(/\\/g, '/');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or use canonical-path 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to introduce another dependency for something simple. Also I'd have preferred using ts.normalizePath but that's apparently internal 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use path.posix.normaize

Copy link
Member Author

@devversion devversion Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought that too, but unfortunately it doesn't work that way :/ (nodejs/node#12298)

@jelbourn jelbourn added hotlist: components team Related to Angular CDK or Angular Material hotlist: angular-core-team labels Jul 24, 2018
Copy link
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@alexeagle alexeagle added the target: patch This PR is targeted for the next patch release label Jul 25, 2018
@alexeagle alexeagle added the action: merge The PR is ready for merge by the caretaker label Aug 1, 2018
@IgorMinar IgorMinar closed this in fa70a2a Aug 1, 2018
IgorMinar pushed a commit that referenced this pull request Aug 1, 2018
…#25052)

* When using `ts-api-guardian` on Windows, the input file can't be found due to wrong normalized path delimiters.

PR Close #25052
@devversion devversion deleted the fix/ts-api-guardian-entry-point branch August 1, 2018 20:33
FrederikSchlemmer pushed a commit to FrederikSchlemmer/angular that referenced this pull request Jan 3, 2019
…angular#25052)

* When using `ts-api-guardian` on Windows, the input file can't be found due to wrong normalized path delimiters.

PR Close angular#25052
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes hotlist: components team Related to Angular CDK or Angular Material target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants