You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario As a developer, I would like to use a very high level project compiler API for build purposes. It would be somehow symmetric to what tsc allows but in a programmatic way.
Although the compiler API is public, the project logic for file resolution isn't (i.e. : how the rootFileNames are resolved before passed to createProgram).
I would like something simpler that would allow me to intercept a serialized tsconfig and alter its properties (that would somehow provide a workaround for #20110). I could also chose to merge default excludes by importing a symbol (would fix #20108 )
Suggestion Perhaps abstracting the tsc logic would allow two interfaces to be implemented: API and CLI. This new layer could be labeled "build".
exporttypeTsConfigInterceptor=(tsconfig: any)=>anyexportconstDEFAULT_EXCLUDE=Symbol('DEFAULT_EXCLUDE')/*** @param tsconfigPath Root dir where tsconfig.json exists or tsconfig file name* @param [interceptor] A callback that received the object deserialized from tsconfig * file and returns a new one*/exportfunctioncreateProject(tsconfigPath: string,interceptor?: TsConfigInterceptor): Project{// ...}/*** @param project The project from which a program shall be created*/exportfunctioncreateProgramFromProject(project: Project): Program{// ...}
The text was updated successfully, but these errors were encountered:
Although the compiler API is public, the project logic for file resolution isn't (i.e. : how the rootFileNames are resolved before passed to createProgram).
All the tsconfig.json parsing function are public.. please see:
findConfigFile to locate an applicable tsconfig.json file
parseJsonText to parse the text into a JsonSourceFile
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
Scenario As a developer, I would like to use a very high level project compiler API for build purposes. It would be somehow symmetric to what
tsc
allows but in a programmatic way.Although the compiler API is public, the project logic for file resolution isn't (i.e. : how the
rootFileNames
are resolved before passed tocreateProgram
).I would like something simpler that would allow me to intercept a serialized
tsconfig
and alter its properties (that would somehow provide a workaround for #20110). I could also chose to merge default excludes by importing a symbol (would fix #20108 )Suggestion Perhaps abstracting the
tsc
logic would allow two interfaces to be implemented: API and CLI. This new layer could be labeled "build".Speculative API sample
New definitions
The text was updated successfully, but these errors were encountered: