Skip to content
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

[heft-typescript] Bound current directory in sys.watchFile and sys.watchDirectory #4600

Open
dmichon-msft opened this issue Mar 22, 2024 · 0 comments
Milestone

Comments

@dmichon-msft
Copy link
Contributor

Summary

The built-in ts.sys watchFile and watchDirectory methods bind process.cwd() at the moment of instantiation. This inhibits the ability of heft-typescript-plugin to change working directories between compilations (mostly relevant if running as a service).

Repro steps

Not reproducible via CLI. Happens when attempting to leverage Heft as an API to conserve system resources.

Details

See comment here:
https://github.com/microsoft/rushstack/blob/8fe0ea8f861a1cecd8b964bcdabc610f2a5574e3/heft-plugins/heft-typescript-plugin/src/TypeScriptBuilder.ts#L313C1-L313C58

The watchFile and watchDirectory methods need to be rebound to reflect the custom getCurrentDirectory() call. Might be worth reaching out to TypeScript to make the method that creates ts.sys publicly callable.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@rushstack/heft-typescript-plugin version? 0.4.0
Operating system? Linux
Would you consider contributing a PR? Yes
Node.js version (node -v)? v18.19.1
@dmichon-msft dmichon-msft added this to the Heft 1.0 milestone Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: High priority
Development

No branches or pull requests

1 participant