New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wessberg/di-compiler

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wessberg/di-compiler - npm Package Compare versions

Comparing version 1.0.47 to 1.0.49

dist/es2015/code-container/code-container.d.ts

3

dist/es2015/index.d.ts

@@ -1,1 +0,2 @@

export { compile, getIntro, ICompileFileResult } from "./DI";
export { DICompiler } from "./di-compiler/di-compiler";
export { IDICompiler } from "./di-compiler/i-di-compiler";

@@ -1,2 +0,2 @@

export { compile, getIntro } from "./DI";
export { DICompiler } from "./di-compiler/di-compiler";
//# sourceMappingURL=index.js.map

@@ -1,1 +0,2 @@

export { compile, getIntro, ICompileFileResult } from "./DI";
export { DICompiler } from "./di-compiler/di-compiler";
export { IDICompiler } from "./di-compiler/i-di-compiler";

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./DI"], factory);
define(["require", "exports", "./di-compiler/di-compiler"], factory);
}

@@ -13,6 +13,5 @@ })(function (require, exports) {

Object.defineProperty(exports, "__esModule", { value: true });
var DI_1 = require("./DI");
exports.compile = DI_1.compile;
exports.getIntro = DI_1.getIntro;
var di_compiler_1 = require("./di-compiler/di-compiler");
exports.DICompiler = di_compiler_1.DICompiler;
});
//# sourceMappingURL=index.js.map
{
"name": "@wessberg/di-compiler",
"version": "1.0.47",
"version": "1.0.49",
"description": "The compiler for https://www.npmjs.com/package/@wessberg/di",

@@ -46,17 +46,15 @@ "scripts": {

"devDependencies": {
"@types/node": "^8.0.25",
"@wessberg/di": "^1.0.22",
"@types/node": "^8.0.26",
"@wessberg/ts-config": "0.0.23",
"ava": "^0.22.0",
"conventional-changelog-cli": "latest",
"conventional-changelog-cli": "^1.3.3",
"husky": "latest",
"tslint": "^5.7.0",
"typescript": "^2.5.1"
"typescript": "^2.5.2"
},
"dependencies": {
"@wessberg/codeanalyzer": "^1.0.61",
"@wessberg/compiler-common": "^1.0.0",
"@wessberg/globalobject": "^1.0.7",
"@wessberg/type": "^0.0.81",
"@wessberg/typedetector": "^1.0.6",
"@types/chalk": "^0.4.31",
"@wessberg/codeanalyzer": "^1.0.63",
"@wessberg/type": "0.0.87",
"chalk": "^2.1.0",
"magic-string": "^0.22.4",

@@ -63,0 +61,0 @@ "tslib": "^1.7.1"

@@ -18,18 +18,19 @@ # DI-Compiler (The compiler for [DI](https://www.npmjs.com/package/@wessberg/di))

```typescript
import {compile, getIntro} from "@wessberg/di-compiler";
import {DICompiler} from "@wessberg/di-compiler";
// The 'compile' method will upgrade all service registrations and 'get' calls
// throughout the code
const compiled = compile(
"a_file.ts", `
class Foo implements IFoo {}
DIContainer.registerSingleton<IFoo, Foo>();
`);
// Instantiate the compiler
const compiler = new DICompiler();
// The intro is a map between interface names and the constructor arguments
// of their concrete implementations. Should only be injected once in your code
// and at best in top of your bundle.
const intro = getIntro();
// The 'compile' method will upgrade all 'registerSingleton', 'registerTransient', 'get' and 'has' calls throughout the code
// and resolve the constructor arguments of all classes that matches the provided services
const compiled = compiler.compile({
file: "a_file.ts",
code: `class Foo implements IFoo {}
DIContainer.registerSingleton<IFoo, Foo>();`
});
compiled.code; // The updated code
compiled.hasChanged; // is true if the source code was upgraded
compiled.map // Holds a SourceMap reflecting the changes
```
If you are using [Rollup](https://github.com/rollup/rollup), then use [rollup-plugin-di](https://github.com/wessberg/rollup-plugin-di) to compile your code automatically as part of your bundle, rather than using this compiler.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc