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
Is your feature request related to a problem? Please describe.
Hey @dsherret! Awesome project, thank you 馃檱!
I'm working on a small package that would help rename specifiers on-the-fly when using multiple TS compilation targets.
To create the TS Program I need to support project references, but currently the TsConfigResolver class does not expose those.
Hence, to recreate the tsProgram correctly I have to write this code that uses the private method tsConfigResolver._parseJsonConfigFileContent():
consttfsHost=newTransactionalFileSystem({fileSystem: fsHost,skipLoadingLibFiles: true,libFolderPath: undefined,});conststandardizedTsConfigPath=tfsHost.getStandardizedAbsolutePath(tsConfigFilePath);constencoding="utf-8";consttsConfigResolver=newTsConfigResolver(tfsHost,standardizedTsConfigPath,encoding,)asunknownasPrivateTsConfigResolver;// ^^ need to cast this to include the private methodconsttsConfigContent=tsConfigResolver._parseJsonConfigFileContent();consttsProgram=ts.createProgram({options: tsConfigContent.options,configFileParsingDiagnostics: tsConfigContent.errors,projectReferences: tsConfigContent.projectReferences,// ^^ hererootNames: [],});
Describe the solution you'd like
Ideally, the TsConfigResolver would expose the full config contents. Currently it only exposes these two (getCompilerOptions, getErrors):
Either adding a public method like getParsedCommandLine() or exposing parseJsonConfigFileContent() as public would solve my problem.
Describe alternatives you've considered
Alternative I've considered is to copy and paste a bunch of code from ts-morph and including that in my project. Not ideal, since I'd need to sync that every time the upstream changes.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Hey @dsherret! Awesome project, thank you 馃檱!
I'm working on a small package that would help rename specifiers on-the-fly when using multiple TS compilation targets.
To create the TS Program I need to support project references, but currently the
TsConfigResolver
class does not expose those.Hence, to recreate the tsProgram correctly I have to write this code that uses the private method
tsConfigResolver._parseJsonConfigFileContent()
:Describe the solution you'd like
Ideally, the TsConfigResolver would expose the full config contents. Currently it only exposes these two (
getCompilerOptions
,getErrors
):ts-morph/packages/common/src/tsconfig/TsConfigResolver.ts
Lines 21 to 27 in 930779a
Either adding a public method like
getParsedCommandLine()
or exposingparseJsonConfigFileContent()
as public would solve my problem.Describe alternatives you've considered
Alternative I've considered is to copy and paste a bunch of code from ts-morph and including that in my project. Not ideal, since I'd need to sync that every time the upstream changes.
The text was updated successfully, but these errors were encountered: