@wessberg/di-compiler
Advanced tools
Comparing version 1.0.32 to 1.0.33
@@ -0,1 +1,10 @@ | ||
<a name="1.0.33"></a> | ||
## 1.0.33 (2017-07-19) | ||
* 1.0.33 ([2a6b369](https://github.com/wessberg/di-compiler/commit/2a6b369)) | ||
* Bumped version ([2c6307b](https://github.com/wessberg/di-compiler/commit/2c6307b)) | ||
* Stopped validating if constructor arguments could be found for an implementation for a service. It m ([59573f6](https://github.com/wessberg/di-compiler/commit/59573f6)) | ||
<a name="1.0.32"></a> | ||
@@ -2,0 +11,0 @@ ## 1.0.32 (2017-07-19) |
@@ -5,3 +5,2 @@ import { IClassConstructorArgumentsStringifier } from "./Interface/IClassConstructorArgumentsStringifier"; | ||
import { IClassIndexer } from "@wessberg/codeanalyzer"; | ||
import { IIdentifierValidator } from "@wessberg/compiler-common"; | ||
/** | ||
@@ -13,4 +12,3 @@ * This class generates a stringified map between classes and the services that their constructors depend on. | ||
private config; | ||
private identifierValidator; | ||
constructor(config: IDIConfig, identifierValidator: IIdentifierValidator); | ||
constructor(config: IDIConfig); | ||
/** | ||
@@ -17,0 +15,0 @@ * This method will generate a stringified map between service interfaces and the (ordered) identifiers for services that should be dependency injected upon their |
@@ -7,5 +7,4 @@ import { shimGlobalObjectStringified } from "@wessberg/globalobject"; | ||
export class ClassConstructorArgumentsStringifier { | ||
constructor(config, identifierValidator) { | ||
constructor(config) { | ||
this.config = config; | ||
this.identifierValidator = identifierValidator; | ||
} | ||
@@ -28,4 +27,2 @@ /** | ||
const classDeclaration = classes[className]; | ||
if (classDeclaration == null && !this.identifierValidator.isBuiltIn(className)) | ||
throw new ReferenceError(`${this.constructor.name} could not get class constructor arguments: The interface "${key}" had no matching class implementation. Have you registered it as a service?`); | ||
if (classDeclaration != null) | ||
@@ -32,0 +29,0 @@ classDeclaration.mergeWithParent(); |
@@ -11,6 +11,4 @@ import { CodeAnalyzer } from "@wessberg/codeanalyzer"; | ||
import { ServiceExpressionUpdater } from "./ServiceExpressionUpdater/ServiceExpressionUpdater"; | ||
import { IdentifierValidator } from "@wessberg/compiler-common"; | ||
const typeDetector = new TypeDetector(); | ||
const identifierValidator = new IdentifierValidator(); | ||
const compiler = new Compiler(new CodeAnalyzer(), new ContainerReferenceFinder(diConfig), new ServiceExpressionFinder(), new ServiceExpressionUpdater(diConfig, typeDetector), new ClassConstructorArgumentsValidator(), new ClassConstructorArgumentsStringifier(diConfig, identifierValidator)); | ||
const compiler = new Compiler(new CodeAnalyzer(), new ContainerReferenceFinder(diConfig), new ServiceExpressionFinder(), new ServiceExpressionUpdater(diConfig, typeDetector), new ClassConstructorArgumentsValidator(), new ClassConstructorArgumentsStringifier(diConfig)); | ||
/** | ||
@@ -17,0 +15,0 @@ * The public method of DI. This is build-tool agnostic and only cares about getting an id and some code. |
@@ -5,3 +5,2 @@ import { IClassConstructorArgumentsStringifier } from "./Interface/IClassConstructorArgumentsStringifier"; | ||
import { IClassIndexer } from "@wessberg/codeanalyzer"; | ||
import { IIdentifierValidator } from "@wessberg/compiler-common"; | ||
/** | ||
@@ -13,4 +12,3 @@ * This class generates a stringified map between classes and the services that their constructors depend on. | ||
private config; | ||
private identifierValidator; | ||
constructor(config: IDIConfig, identifierValidator: IIdentifierValidator); | ||
constructor(config: IDIConfig); | ||
/** | ||
@@ -17,0 +15,0 @@ * This method will generate a stringified map between service interfaces and the (ordered) identifiers for services that should be dependency injected upon their |
@@ -18,5 +18,4 @@ (function (factory) { | ||
class ClassConstructorArgumentsStringifier { | ||
constructor(config, identifierValidator) { | ||
constructor(config) { | ||
this.config = config; | ||
this.identifierValidator = identifierValidator; | ||
} | ||
@@ -39,4 +38,2 @@ /** | ||
const classDeclaration = classes[className]; | ||
if (classDeclaration == null && !this.identifierValidator.isBuiltIn(className)) | ||
throw new ReferenceError(`${this.constructor.name} could not get class constructor arguments: The interface "${key}" had no matching class implementation. Have you registered it as a service?`); | ||
if (classDeclaration != null) | ||
@@ -43,0 +40,0 @@ classDeclaration.mergeWithParent(); |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "@wessberg/codeanalyzer", "@wessberg/typedetector", "magic-string", "./ClassConstructorArgumentsStringifier/ClassConstructorArgumentsStringifier", "./ClassConstructorArgumentsValidator/ClassConstructorArgumentsValidator", "./Compiler/Compiler", "./ContainerReferenceFinder/ContainerReferenceFinder", "./DIConfig/DIConfig", "./ServiceExpressionFinder/ServiceExpressionFinder", "./ServiceExpressionUpdater/ServiceExpressionUpdater", "@wessberg/compiler-common"], factory); | ||
define(["require", "exports", "@wessberg/codeanalyzer", "@wessberg/typedetector", "magic-string", "./ClassConstructorArgumentsStringifier/ClassConstructorArgumentsStringifier", "./ClassConstructorArgumentsValidator/ClassConstructorArgumentsValidator", "./Compiler/Compiler", "./ContainerReferenceFinder/ContainerReferenceFinder", "./DIConfig/DIConfig", "./ServiceExpressionFinder/ServiceExpressionFinder", "./ServiceExpressionUpdater/ServiceExpressionUpdater"], factory); | ||
} | ||
@@ -23,6 +23,4 @@ })(function (require, exports) { | ||
const ServiceExpressionUpdater_1 = require("./ServiceExpressionUpdater/ServiceExpressionUpdater"); | ||
const compiler_common_1 = require("@wessberg/compiler-common"); | ||
const typeDetector = new typedetector_1.TypeDetector(); | ||
const identifierValidator = new compiler_common_1.IdentifierValidator(); | ||
const compiler = new Compiler_1.Compiler(new codeanalyzer_1.CodeAnalyzer(), new ContainerReferenceFinder_1.ContainerReferenceFinder(DIConfig_1.diConfig), new ServiceExpressionFinder_1.ServiceExpressionFinder(), new ServiceExpressionUpdater_1.ServiceExpressionUpdater(DIConfig_1.diConfig, typeDetector), new ClassConstructorArgumentsValidator_1.ClassConstructorArgumentsValidator(), new ClassConstructorArgumentsStringifier_1.ClassConstructorArgumentsStringifier(DIConfig_1.diConfig, identifierValidator)); | ||
const compiler = new Compiler_1.Compiler(new codeanalyzer_1.CodeAnalyzer(), new ContainerReferenceFinder_1.ContainerReferenceFinder(DIConfig_1.diConfig), new ServiceExpressionFinder_1.ServiceExpressionFinder(), new ServiceExpressionUpdater_1.ServiceExpressionUpdater(DIConfig_1.diConfig, typeDetector), new ClassConstructorArgumentsValidator_1.ClassConstructorArgumentsValidator(), new ClassConstructorArgumentsStringifier_1.ClassConstructorArgumentsStringifier(DIConfig_1.diConfig)); | ||
/** | ||
@@ -29,0 +27,0 @@ * The public method of DI. This is build-tool agnostic and only cares about getting an id and some code. |
{ | ||
"name": "@wessberg/di-compiler", | ||
"version": "1.0.32", | ||
"version": "1.0.33", | ||
"description": "The compiler for https://www.npmjs.com/package/@wessberg/di", | ||
@@ -5,0 +5,0 @@ "scripts": { |
273
README.md
@@ -48,2 +48,11 @@ # DI-Compiler (The compiler for [DI](https://www.npmjs.com/package/@wessberg/di)) | ||
<a name="1.0.33"></a> | ||
## 1.0.33 (2017-07-19) | ||
* 1.0.33 ([2a6b369](https://github.com/wessberg/di-compiler/commit/2a6b369)) | ||
* Bumped version ([2c6307b](https://github.com/wessberg/di-compiler/commit/2c6307b)) | ||
* Stopped validating if constructor arguments could be found for an implementation for a service. It m ([59573f6](https://github.com/wessberg/di-compiler/commit/59573f6)) | ||
<a name="1.0.32"></a> | ||
@@ -314,2 +323,11 @@ ## 1.0.32 (2017-07-19) | ||
## 1.0.32 (2017-07-19) | ||
* 1.0.32 ([3f05bca](https://github.com/wessberg/di-compiler/commit/3f05bca)) | ||
* Bumped dependency on DI ([1ae2966](https://github.com/wessberg/di-compiler/commit/1ae2966)) | ||
* Bumped version ([3a2c97c](https://github.com/wessberg/di-compiler/commit/3a2c97c)) | ||
<a name="1.0.31"></a> | ||
## 1.0.31 (2017-07-19) | ||
@@ -570,2 +588,11 @@ | ||
## 1.0.31 (2017-07-19) | ||
* 1.0.31 ([75af389](https://github.com/wessberg/di-compiler/commit/75af389)) | ||
* Bumped version ([1b72ade](https://github.com/wessberg/di-compiler/commit/1b72ade)) | ||
* Stopped validating if a class exists before allowing a service to be registered. The type may not be ([663a097](https://github.com/wessberg/di-compiler/commit/663a097)) | ||
<a name="1.0.30"></a> | ||
## 1.0.30 (2017-07-19) | ||
@@ -817,2 +844,11 @@ | ||
## 1.0.30 (2017-07-19) | ||
* 1.0.30 ([17c4de9](https://github.com/wessberg/di-compiler/commit/17c4de9)) | ||
* Bumped dependency on DI ([cc76f7a](https://github.com/wessberg/di-compiler/commit/cc76f7a)) | ||
* Bumped version ([9aa8056](https://github.com/wessberg/di-compiler/commit/9aa8056)) | ||
<a name="1.0.29"></a> | ||
## 1.0.29 (2017-07-19) | ||
@@ -1055,2 +1091,11 @@ | ||
## 1.0.29 (2017-07-19) | ||
* 1.0.29 ([93adaf9](https://github.com/wessberg/di-compiler/commit/93adaf9)) | ||
* Bumped version ([4c9f658](https://github.com/wessberg/di-compiler/commit/4c9f658)) | ||
* Fixed an issue in the README ([ad567f7](https://github.com/wessberg/di-compiler/commit/ad567f7)) | ||
<a name="1.0.28"></a> | ||
## 1.0.28 (2017-07-19) | ||
@@ -1284,1 +1329,229 @@ | ||
## 1.0.28 (2017-07-19) | ||
* 1.0.28 ([b0b2f06](https://github.com/wessberg/di-compiler/commit/b0b2f06)) | ||
* Updated compiler to correctly understand new features of DI ([4d574f2](https://github.com/wessberg/di-compiler/commit/4d574f2)) | ||
<a name="1.0.27"></a> | ||
## 1.0.27 (2017-07-18) | ||
* 1.0.27 ([47eb559](https://github.com/wessberg/di-compiler/commit/47eb559)) | ||
* Updated README ([0747968](https://github.com/wessberg/di-compiler/commit/0747968)) | ||
<a name="1.0.26"></a> | ||
## 1.0.26 (2017-07-18) | ||
* 1.0.26 ([a397e1c](https://github.com/wessberg/di-compiler/commit/a397e1c)) | ||
* Added untracked files ([6dd0237](https://github.com/wessberg/di-compiler/commit/6dd0237)) | ||
* Bumped CodeAnalyzer dependency. Fixed an issue where super class constructor arguments wouldn't be d ([f36ef10](https://github.com/wessberg/di-compiler/commit/f36ef10)) | ||
* Update package.json ([69e74e0](https://github.com/wessberg/di-compiler/commit/69e74e0)) | ||
* Update README.md ([e782215](https://github.com/wessberg/di-compiler/commit/e782215)) | ||
<a name="1.0.25"></a> | ||
## 1.0.25 (2017-07-06) | ||
* 1.0.25 ([3e52902](https://github.com/wessberg/di-compiler/commit/3e52902)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.38. Added an 'excludeFiles' third (optional) argument to the ([6ab0983](https://github.com/wessberg/di-compiler/commit/6ab0983)) | ||
<a name="1.0.24"></a> | ||
## 1.0.24 (2017-07-06) | ||
* 1.0.24 ([399369a](https://github.com/wessberg/di-compiler/commit/399369a)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.36. ([653dbb2](https://github.com/wessberg/di-compiler/commit/653dbb2)) | ||
<a name="1.0.23"></a> | ||
## 1.0.23 (2017-07-05) | ||
* 1.0.23 ([eef0051](https://github.com/wessberg/di-compiler/commit/eef0051)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.34. ([f13c9b6](https://github.com/wessberg/di-compiler/commit/f13c9b6)) | ||
<a name="1.0.22"></a> | ||
## 1.0.22 (2017-07-05) | ||
* 1.0.22 ([353d52f](https://github.com/wessberg/di-compiler/commit/353d52f)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.33. ([b2d1ca5](https://github.com/wessberg/di-compiler/commit/b2d1ca5)) | ||
<a name="1.0.21"></a> | ||
## 1.0.21 (2017-07-05) | ||
* 1.0.21 ([5a254ac](https://github.com/wessberg/di-compiler/commit/5a254ac)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.32. ([5eefbfc](https://github.com/wessberg/di-compiler/commit/5eefbfc)) | ||
<a name="1.0.20"></a> | ||
## 1.0.20 (2017-07-05) | ||
* 1.0.20 ([c42fc59](https://github.com/wessberg/di-compiler/commit/c42fc59)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.31. ([38163f0](https://github.com/wessberg/di-compiler/commit/38163f0)) | ||
<a name="1.0.19"></a> | ||
## 1.0.19 (2017-07-05) | ||
* 1.0.19 ([4db402f](https://github.com/wessberg/di-compiler/commit/4db402f)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.30. ([f47f424](https://github.com/wessberg/di-compiler/commit/f47f424)) | ||
<a name="1.0.18"></a> | ||
## 1.0.18 (2017-05-31) | ||
* 1.0.18 ([e16343e](https://github.com/wessberg/di-compiler/commit/e16343e)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.25. ([211203a](https://github.com/wessberg/di-compiler/commit/211203a)) | ||
<a name="1.0.17"></a> | ||
## 1.0.17 (2017-05-31) | ||
* 1.0.17 ([73145f8](https://github.com/wessberg/di-compiler/commit/73145f8)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.24. ([2acffa9](https://github.com/wessberg/di-compiler/commit/2acffa9)) | ||
<a name="1.0.16"></a> | ||
## 1.0.16 (2017-05-31) | ||
* 1.0.16 ([450a117](https://github.com/wessberg/di-compiler/commit/450a117)) | ||
* The DI-compiler will now skip classes that has a 'noInject' decorator. ([b20189a](https://github.com/wessberg/di-compiler/commit/b20189a)) | ||
<a name="1.0.15"></a> | ||
## 1.0.15 (2017-05-31) | ||
* 1.0.15 ([9d7ea5d](https://github.com/wessberg/di-compiler/commit/9d7ea5d)) | ||
* A shim for the global object will now be added before the class constructor arguments map so that 'g ([60ac279](https://github.com/wessberg/di-compiler/commit/60ac279)) | ||
<a name="1.0.14"></a> | ||
## 1.0.14 (2017-05-31) | ||
* 1.0.14 ([52c0881](https://github.com/wessberg/di-compiler/commit/52c0881)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.22. ([bf4c089](https://github.com/wessberg/di-compiler/commit/bf4c089)) | ||
<a name="1.0.13"></a> | ||
## 1.0.13 (2017-05-31) | ||
* 1.0.13 ([b181554](https://github.com/wessberg/di-compiler/commit/b181554)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.21. ([9bf836b](https://github.com/wessberg/di-compiler/commit/9bf836b)) | ||
<a name="1.0.12"></a> | ||
## 1.0.12 (2017-05-31) | ||
* 1.0.12 ([8ec9e54](https://github.com/wessberg/di-compiler/commit/8ec9e54)) | ||
* Fixed a bug. ([064874f](https://github.com/wessberg/di-compiler/commit/064874f)) | ||
<a name="1.0.11"></a> | ||
## 1.0.11 (2017-05-31) | ||
* 1.0.11 ([80d433d](https://github.com/wessberg/di-compiler/commit/80d433d)) | ||
* Built-in constructors (for example Proxy or anything that is a native part of the environment) can n ([faaccad](https://github.com/wessberg/di-compiler/commit/faaccad)) | ||
<a name="1.0.10"></a> | ||
## 1.0.10 (2017-05-31) | ||
* 1.0.10 ([dd507f7](https://github.com/wessberg/di-compiler/commit/dd507f7)) | ||
* The package began depending on 'compiler-common' rather than setting up its own blacklist filter. ([6108201](https://github.com/wessberg/di-compiler/commit/6108201)) | ||
<a name="1.0.9"></a> | ||
## 1.0.9 (2017-05-31) | ||
* - Bumped CodeAnalyzer dependency to ^v1.0.18 ([32e39cf](https://github.com/wessberg/di-compiler/commit/32e39cf)) | ||
* 1.0.9 ([d811d25](https://github.com/wessberg/di-compiler/commit/d811d25)) | ||
<a name="1.0.8"></a> | ||
## 1.0.8 (2017-05-30) | ||
* 1.0.8 ([d5d2677](https://github.com/wessberg/di-compiler/commit/d5d2677)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.18 ([5b3a7b0](https://github.com/wessberg/di-compiler/commit/5b3a7b0)) | ||
<a name="1.0.7"></a> | ||
## 1.0.7 (2017-05-30) | ||
* - The Compiler will now recursively parse all imports, rather than just one step up. ([9ef95e9](https://github.com/wessberg/di-compiler/commit/9ef95e9)) | ||
* 1.0.7 ([6188a99](https://github.com/wessberg/di-compiler/commit/6188a99)) | ||
<a name="1.0.6"></a> | ||
## 1.0.6 (2017-05-30) | ||
* - The Compiler will now parse all imports for classes before proceeding. ([ab87556](https://github.com/wessberg/di-compiler/commit/ab87556)) | ||
* 1.0.6 ([43ee330](https://github.com/wessberg/di-compiler/commit/43ee330)) | ||
<a name="1.0.5"></a> | ||
## 1.0.5 (2017-05-30) | ||
* - Bumped CodeAnalyzer dependency to ^v1.0.17 ([fd046e7](https://github.com/wessberg/di-compiler/commit/fd046e7)) | ||
* 1.0.5 ([13e0373](https://github.com/wessberg/di-compiler/commit/13e0373)) | ||
<a name="1.0.4"></a> | ||
## 1.0.4 (2017-05-25) | ||
* 1.0.4 ([6ae12d8](https://github.com/wessberg/di-compiler/commit/6ae12d8)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.11 ([ccc5d33](https://github.com/wessberg/di-compiler/commit/ccc5d33)) | ||
<a name="1.0.3"></a> | ||
## 1.0.3 (2017-05-25) | ||
* 1.0.3 ([bbd7e77](https://github.com/wessberg/di-compiler/commit/bbd7e77)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.10 ([05cf98d](https://github.com/wessberg/di-compiler/commit/05cf98d)) | ||
<a name="1.0.2"></a> | ||
## 1.0.2 (2017-05-24) | ||
* 1.0.2 ([a4d4722](https://github.com/wessberg/di-compiler/commit/a4d4722)) | ||
* Bumped CodeAnalyzer dependency to ^v1.0.9 ([df814c2](https://github.com/wessberg/di-compiler/commit/df814c2)) | ||
<a name="1.0.1"></a> | ||
## 1.0.1 (2017-05-24) | ||
* 1.0.1 ([716937e](https://github.com/wessberg/di-compiler/commit/716937e)) | ||
* First commit ([385cd8d](https://github.com/wessberg/di-compiler/commit/385cd8d)) | ||
* Fixed an issue where the found class declarations would be reset for each new file. ([4d5966e](https://github.com/wessberg/di-compiler/commit/4d5966e)) | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
182986
1552
1814