Support for classes that extend DIContainer with new option #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.