-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Api for tsc --build and --incremental #31432
Conversation
…gSet and graph queue
…t anyways is tested with the --watch mode
…nd simplify to use configFileMap
…aths Turn projectPendingBuild to config file map
…l or invalidated use single path)
…r options Also fix return type of readBuilderProgram
@sheetalkamat could this API be used from a Language Service |
@manucorporat Sorry I missed your question earlier. I am not sure what you mean by |
It looks like these APIs either allow fine-granular acccess with In order to trigger the watching behaviour one needs to call However, not all is lost. It is possible to sneak transformers in by using Here is a simple example on Stack Overflow: |
This PR provides api for tooling to use build and incremental options:
TypeStrong/ts-loader#935 shows use of --build api
Solution Builder
Two functions
createSolutionBuilder
andcreateSolutionBuilderWithWatch
provide a way to createSolutionBuilder
for given root projects, and build options. The only difference in later is that it also watches the projects for changes to be able to build.build
andclean
provide a compact way of building/cleaning all root projects provided or project mentioned (including their references).getNextInvalidatedProject
is the API for more granular level operations on each project. This function will give you a project that needs to be either built or needs to update output because prepend changed or just needs update timestamps. Whendone
method of the returned project is called, it ensures all actions are taken place and its ready to move to next project so that next call togetNextInvalidatedProject
will return you next project that's invalid or undefined if the build is complete.Incremental Builder Program
createIncrementalProgram
andcreateIncrementalCompilerHost
are methods similar tocreateProgram
andcreateCompilerHost
to build the incremental builder program.This also exposes
readBuilderProgram
provides a way to be able to create theEmitAndSemanticDiagnosticsBuilder
from the.tsbuildinfo
for the compiler options. Note that this is special program that is readonly version and it can only be used asoldProgram
to create new builder program.