@rym-lib/inversify-bundler-express 1.4.7 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -1
- package/build/index.mjs.map +1 -1
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
container: () => container
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
|
|
27
27
|
// src/express.ts
|
|
28
28
|
var import_inversify_bundler = require("@rym-lib/inversify-bundler");
|
|
@@ -34,7 +34,7 @@ var container = (...modules) => {
|
|
|
34
34
|
)
|
|
35
35
|
);
|
|
36
36
|
const container2 = new import_inversify_bundler.Container();
|
|
37
|
-
container2.
|
|
37
|
+
container2.loadSync(...bundler.resolve());
|
|
38
38
|
req.container = container2;
|
|
39
39
|
next();
|
|
40
40
|
};
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/express.ts"],"sourcesContent":["export * from './express'\n","import { Request, RequestHandler, Response } from 'express'\n\nimport {\n Bundler,\n Container,\n ContainerInterface,\n ModuleInput,\n} from '@rym-lib/inversify-bundler'\n\ndeclare module 'express-serve-static-core' {\n interface Request {\n container: ContainerInterface\n }\n}\n\nexport const container = (\n ...modules: (ModuleInput | ((req: Request, res: Response) => Bundler))[]\n) => {\n const handler: RequestHandler = (req, res, next) => {\n const bundler = new Bundler(\n ...modules.map((module) =>\n typeof module === 'function' ? module(req, res) : module,\n ),\n )\n\n const container = new Container()\n container.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/express.ts"],"sourcesContent":["export * from './express'\n","import { Request, RequestHandler, Response } from 'express'\n\nimport {\n Bundler,\n Container,\n ContainerInterface,\n ModuleInput,\n} from '@rym-lib/inversify-bundler'\n\ndeclare module 'express-serve-static-core' {\n interface Request {\n container: ContainerInterface\n }\n}\n\nexport const container = (\n ...modules: (ModuleInput | ((req: Request, res: Response) => Bundler))[]\n) => {\n const handler: RequestHandler = (req, res, next) => {\n const bundler = new Bundler(\n ...modules.map((module) =>\n typeof module === 'function' ? module(req, res) : module,\n ),\n )\n\n const container = new Container()\n container.loadSync(...bundler.resolve())\n\n req.container = container\n\n next()\n }\n\n return handler\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,+BAKO;AAQA,IAAM,YAAY,IACpB,YACA;AACH,QAAM,UAA0B,CAAC,KAAK,KAAK,SAAS;AAClD,UAAM,UAAU,IAAI;AAAA,MAClB,GAAG,QAAQ;AAAA,QAAI,CAACA,YACd,OAAOA,YAAW,aAAaA,QAAO,KAAK,GAAG,IAAIA;AAAA,MACpD;AAAA,IACF;AAEA,UAAMC,aAAY,IAAI,mCAAU;AAChC,IAAAA,WAAU,SAAS,GAAG,QAAQ,QAAQ,CAAC;AAEvC,QAAI,YAAYA;AAEhB,SAAK;AAAA,EACP;AAEA,SAAO;AACT;","names":["module","container"]}
|
package/build/index.mjs
CHANGED
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/express.ts"],"sourcesContent":["import { Request, RequestHandler, Response } from 'express'\n\nimport {\n Bundler,\n Container,\n ContainerInterface,\n ModuleInput,\n} from '@rym-lib/inversify-bundler'\n\ndeclare module 'express-serve-static-core' {\n interface Request {\n container: ContainerInterface\n }\n}\n\nexport const container = (\n ...modules: (ModuleInput | ((req: Request, res: Response) => Bundler))[]\n) => {\n const handler: RequestHandler = (req, res, next) => {\n const bundler = new Bundler(\n ...modules.map((module) =>\n typeof module === 'function' ? module(req, res) : module,\n ),\n )\n\n const container = new Container()\n container.
|
|
1
|
+
{"version":3,"sources":["../src/express.ts"],"sourcesContent":["import { Request, RequestHandler, Response } from 'express'\n\nimport {\n Bundler,\n Container,\n ContainerInterface,\n ModuleInput,\n} from '@rym-lib/inversify-bundler'\n\ndeclare module 'express-serve-static-core' {\n interface Request {\n container: ContainerInterface\n }\n}\n\nexport const container = (\n ...modules: (ModuleInput | ((req: Request, res: Response) => Bundler))[]\n) => {\n const handler: RequestHandler = (req, res, next) => {\n const bundler = new Bundler(\n ...modules.map((module) =>\n typeof module === 'function' ? module(req, res) : module,\n ),\n )\n\n const container = new Container()\n container.loadSync(...bundler.resolve())\n\n req.container = container\n\n next()\n }\n\n return handler\n}\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAQA,IAAM,YAAY,IACpB,YACA;AACH,QAAM,UAA0B,CAAC,KAAK,KAAK,SAAS;AAClD,UAAM,UAAU,IAAI;AAAA,MAClB,GAAG,QAAQ;AAAA,QAAI,CAAC,WACd,OAAO,WAAW,aAAa,OAAO,KAAK,GAAG,IAAI;AAAA,MACpD;AAAA,IACF;AAEA,UAAMA,aAAY,IAAI,UAAU;AAChC,IAAAA,WAAU,SAAS,GAAG,QAAQ,QAAQ,CAAC;AAEvC,QAAI,YAAYA;AAEhB,SAAK;AAAA,EACP;AAEA,SAAO;AACT;","names":["container"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rym-lib/inversify-bundler-express",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@rym-lib/dev-config": "*",
|
|
36
|
-
"@rym-lib/inversify-bundler": "1.
|
|
36
|
+
"@rym-lib/inversify-bundler": "1.6.0",
|
|
37
37
|
"@types/express": "^5.0.0",
|
|
38
38
|
"@types/node": "^22.9.0",
|
|
39
39
|
"express": "^4.21.1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"vitest": "^2.1.5"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@rym-lib/inversify-bundler": ">=1.
|
|
45
|
+
"@rym-lib/inversify-bundler": ">=1.6.0",
|
|
46
46
|
"express": ">=4.0.0"
|
|
47
47
|
}
|
|
48
48
|
}
|