Support implementations that extend DIContainer: Adds a new environment variable DI_COMPILER_CLASS_NAME (and associated di.diClassName option) to specify one or more names of classes that inherit from DIContainer. This allows one to extend DI with custom functionality without needing to request changes to the repo (and allowed me to rip out some likely wanted junk from a prior pull request and implement it in my own class).
Bugs fixed:
Options with transformers: Unlike loaders, transformers use the di() call which did not allow any of the environment variable / di.xxx options to be used. This adds functionality to the di() call to get and apply options from resolveOptions.
Adust DIProgramOptions type to be consistent with use: The DiProgramOptions interface specified program: TS.Program, which is lacking the extensions added for options. Adjusted to match implementation by changing to program: TS.Program & DiIsolatedModulesOptions.
Retain identifier options: The identifier option was being dropped in the getBaseVistorContext function with identifer: []. Retained the options by changing to identifier: rest.identifier ?? [].
This passes all test cases, but no new test cases added as I didn't see any test code that tested options.
New feature:
DIContainer
: Adds a new environment variableDI_COMPILER_CLASS_NAME
(and associateddi.diClassName
option) to specify one or more names of classes that inherit fromDIContainer
. This allows one to extend DI with custom functionality without needing to request changes to the repo (and allowed me to rip out some likely wanted junk from a prior pull request and implement it in my own class).Bugs fixed:
Options with transformers: Unlike loaders, transformers use the
di()
call which did not allow any of the environment variable / di.xxx options to be used. This adds functionality to thedi()
call to get and apply options fromresolveOptions
.Adust
DIProgramOptions
type to be consistent with use: TheDiProgramOptions
interface specifiedprogram: TS.Program
, which is lacking the extensions added for options. Adjusted to match implementation by changing toprogram: TS.Program & DiIsolatedModulesOptions
.Retain
identifier
options: Theidentifier
option was being dropped in thegetBaseVistorContext
function withidentifer: []
. Retained the options by changing toidentifier: rest.identifier ?? []
.This passes all test cases, but no new test cases added as I didn't see any test code that tested options.