dependency-injection-cat
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "dependency-injection-cat", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
@@ -9,3 +9,3 @@ "use strict"; | ||
default_1.prototype.apply = function (compiler) { | ||
compiler.hooks.afterCompile.tap('Report DI Errors', function (compilation) { | ||
compiler.hooks.thisCompilation.tap('Report DI Errors', function (compilation) { | ||
var message = CompilationContext_1.CompilationContext.getErrorMessage(); | ||
@@ -15,3 +15,3 @@ if (message === null) { | ||
} | ||
compilation.errors.push(new CompilationError_1.CompilationError(message)); | ||
throw new CompilationError_1.CompilationError(message); | ||
}); | ||
@@ -18,0 +18,0 @@ }; |
170
README.md
@@ -56,3 +56,4 @@ # Dependency Injection Cat | ||
```json | ||
```json5 | ||
//tsconfig.json | ||
{ | ||
@@ -74,34 +75,36 @@ "compilerOptions": { | ||
module.exports = { | ||
... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(t|j)sx?$/, | ||
loader: 'babel-loader', | ||
options: { | ||
plugins: [ | ||
[ | ||
require('dependency-injection-cat/transformers/babel'), | ||
{ | ||
//Here is configuration options, see below | ||
} | ||
//... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(t|j)sx?$/, | ||
loader: 'babel-loader', | ||
options: { | ||
plugins: [ | ||
[ | ||
require('dependency-injection-cat/transformers/babel'), | ||
{ | ||
//Here is configuration options, see below | ||
} | ||
] | ||
] | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
//Without this plugin, a compilation with DI errors will be successful | ||
new ReportDiErrorsPlugin(), | ||
] | ||
}, | ||
plugins: [ | ||
//Without this plugin, a compilation with DI errors will be successful | ||
new ReportDiErrorsPlugin(), | ||
] | ||
} | ||
``` | ||
```json5 | ||
//tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
//Should be specified | ||
"baseUrl": "your base url" | ||
//Should be specified | ||
"baseUrl": "your base url" | ||
} | ||
} | ||
} | ||
``` | ||
@@ -118,33 +121,35 @@ | ||
module.exports = { | ||
... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(t|j)sx?$/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: { | ||
getCustomTransformers: (program) => ({ | ||
before: [diCatTransformer(program, { | ||
//Here is configuration options, see below | ||
})], | ||
}), | ||
//... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(t|j)sx?$/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: { | ||
getCustomTransformers: (program) => ({ | ||
before: [diCatTransformer(program, { | ||
//Here is configuration options, see below | ||
})], | ||
}), | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
//Without this plugin, a compilation with DI errors will be successful | ||
new ReportDiErrorsPlugin(), | ||
] | ||
}, | ||
plugins: [ | ||
//Without this plugin, a compilation with DI errors will be successful | ||
new ReportDiErrorsPlugin(), | ||
] | ||
} | ||
``` | ||
```json5 | ||
//tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
//Should be specified | ||
"baseUrl": "your base url" | ||
//Should be specified | ||
"baseUrl": "your base url" | ||
} | ||
} | ||
} | ||
``` | ||
@@ -160,34 +165,59 @@ | ||
module.exports = { | ||
... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(t|j)sx?$/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: { | ||
compiler: 'ttypescript' | ||
//... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(t|j)sx?$/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: { | ||
compiler: 'ttypescript' | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
//Without this plugin, a compilation with DI errors will be successful | ||
new ReportDiErrorsPlugin(), | ||
] | ||
}, | ||
plugins: [ | ||
//Without this plugin, a compilation with DI errors will be successful | ||
new ReportDiErrorsPlugin(), | ||
] | ||
} | ||
``` | ||
```json5 | ||
//tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
//Should be specified | ||
"baseUrl": "your base url", | ||
"plugins": [ | ||
{ | ||
"transform": "dependency-injection-cat/transformers/typescript", | ||
//Here is configuration options, see below | ||
} | ||
] | ||
//Should be specified | ||
"baseUrl": "your base url", | ||
"plugins": [ | ||
{ | ||
"transform": "dependency-injection-cat/transformers/typescript", | ||
//Here is configuration options, see below | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
#### TTypescript | ||
```json5 | ||
//tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
//Should be specified | ||
"baseUrl": "your base url", | ||
"plugins": [ | ||
{ | ||
"transform": "dependency-injection-cat/transformers/typescript", | ||
//Here is configuration options, see below | ||
}, | ||
{ | ||
"transform": "dependency-injection-cat/plugins/typescript/ReportErrorsTypescriptPlugin" | ||
} | ||
] | ||
} | ||
} | ||
@@ -215,3 +245,3 @@ ``` | ||
```typescript | ||
class CatContext<TBeans, TConfig = null> | ||
class CatContext<TBeans, TConfig = null> {} | ||
``` | ||
@@ -218,0 +248,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
206220
117
3894
594