DI-Compiler (The compiler for DI)



Installation
Simply do: npm install @wessberg/di-compiler
.
Usage
import {compile, getIntro} from "@wessberg/di-compiler";
const compiled = compile(
"a_file.ts", `
class Foo implements IFoo {}
DIContainer.registerSingleton<IFoo, Foo>();
`);
const intro = getIntro();
If you are using Rollup, then use rollup-plugin-di to compile your code automatically as part of your bundle, rather than using this compiler.
Changelog
1.0.40 (2017-08-17)
1.0.39 (2017-08-03)
1.0.38 (2017-07-28)
1.0.37 (2017-07-28)
1.0.36 (2017-07-28)
1.0.34 (2017-07-20)
1.0.33 (2017-07-19)
- 1.0.33 (2a6b369)
- Bumped version (2c6307b)
- Stopped validating if constructor arguments could be found for an implementation for a service. It m (59573f6)
1.0.32 (2017-07-19)
1.0.31 (2017-07-19)
- 1.0.31 (75af389)
- Bumped version (1b72ade)
- Stopped validating if a class exists before allowing a service to be registered. The type may not be (663a097)
1.0.30 (2017-07-19)
1.0.29 (2017-07-19)
1.0.28 (2017-07-19)
- 1.0.28 (b0b2f06)
- Updated compiler to correctly understand new features of DI (4d574f2)
1.0.27 (2017-07-18)
1.0.26 (2017-07-18)
- 1.0.26 (a397e1c)
- Added untracked files (6dd0237)
- Bumped CodeAnalyzer dependency. Fixed an issue where super class constructor arguments wouldn't be d (f36ef10)
- Update package.json (69e74e0)
- Update README.md (e782215)
1.0.25 (2017-07-06)
- 1.0.25 (3e52902)
- Bumped CodeAnalyzer dependency to ^v1.0.38. Added an 'excludeFiles' third (optional) argument to the (6ab0983)
1.0.24 (2017-07-06)
1.0.23 (2017-07-05)
1.0.22 (2017-07-05)
1.0.21 (2017-07-05)
1.0.20 (2017-07-05)
1.0.19 (2017-07-05)
1.0.18 (2017-05-31)
1.0.17 (2017-05-31)
1.0.16 (2017-05-31)
- 1.0.16 (450a117)
- The DI-compiler will now skip classes that has a 'noInject' decorator. (b20189a)
1.0.15 (2017-05-31)
- 1.0.15 (9d7ea5d)
- A shim for the global object will now be added before the class constructor arguments map so that 'g (60ac279)
1.0.14 (2017-05-31)
1.0.13 (2017-05-31)
1.0.12 (2017-05-31)
1.0.11 (2017-05-31)
- 1.0.11 (80d433d)
- Built-in constructors (for example Proxy or anything that is a native part of the environment) can n (faaccad)
1.0.10 (2017-05-31)
- 1.0.10 (dd507f7)
- The package began depending on 'compiler-common' rather than setting up its own blacklist filter. (6108201)
1.0.9 (2017-05-31)
1.0.8 (2017-05-30)
1.0.7 (2017-05-30)
-
- The Compiler will now recursively parse all imports, rather than just one step up. (9ef95e9)
- 1.0.7 (6188a99)
1.0.6 (2017-05-30)
-
- The Compiler will now parse all imports for classes before proceeding. (ab87556)
- 1.0.6 (43ee330)
1.0.5 (2017-05-30)
1.0.4 (2017-05-25)
1.0.3 (2017-05-25)
1.0.2 (2017-05-24)
1.0.1 (2017-05-24)
- 1.0.1 (716937e)
- First commit (385cd8d)
- Fixed an issue where the found class declarations would be reset for each new file. (4d5966e)