awilix 13.0.3 → 13.0.4

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/README.md CHANGED
@@ -1494,6 +1494,7 @@ because they depend on Node-specific packages.
1494
1494
  - [`awilix-router-core`](https://github.com/jeffijoe/awilix-router-core): Library for building HTTP bindings for Awilix with routing.
1495
1495
  - [`fastify-awilix`](https://github.com/fastify/fastify-awilix): Bindings for the Fastify framework.
1496
1496
  - [`awilix-vite`](https://github.com/kvist-no/awilix-vite): Use Awilix in Vite projects.
1497
+ - [`awilix-modular`](https://github.com/wildstyles/awilix-modular): Modular DI library for Awilix that brings NestJS-like module architecture to any Node.js application.
1497
1498
 
1498
1499
  # Contributing
1499
1500
 
@@ -513,23 +513,6 @@ function isFunction(val) {
513
513
  return typeof val === 'function';
514
514
  }
515
515
 
516
- var loadModuleNative = {};
517
-
518
- var hasRequiredLoadModuleNative;
519
-
520
- function requireLoadModuleNative () {
521
- if (hasRequiredLoadModuleNative) return loadModuleNative;
522
- hasRequiredLoadModuleNative = 1;
523
- // This is kept in a separate .js file to prevent TypeScript re-writing the import() statement to a require() statement
524
- // This is the CJS version; the .mjs version is used by the ESM build.
525
- loadModuleNative.importModule = function importModule(path) {
526
- return import(path)
527
- };
528
- return loadModuleNative;
529
- }
530
-
531
- requireLoadModuleNative();
532
-
533
516
  /*
534
517
  * Parses the parameter list of a function string, including ES6 class constructors.
535
518
  *
@@ -1,7 +1,6 @@
1
1
  import * as util from 'util';
2
2
  import glob from 'fast-glob';
3
3
  import * as path from 'path';
4
- import { importModule } from './load-module-native.mjs';
5
4
  import { pathToFileURL } from 'url';
6
5
 
7
6
  /**
@@ -593,6 +592,12 @@ function listModules(globPatterns, opts) {
593
592
  return _listModules(globPatterns, opts);
594
593
  }
595
594
 
595
+ // Kept in a separate module so it can be excluded from test coverage;
596
+ // jest cannot execute a native dynamic import.
597
+ function importModule(path) {
598
+ return import(path);
599
+ }
600
+
596
601
  /**
597
602
  * Hyperoptimized camelCase conversion.
598
603
  *
package/lib/awilix.umd.js CHANGED
@@ -519,23 +519,6 @@
519
519
  return typeof val === 'function';
520
520
  }
521
521
 
522
- var loadModuleNative = {};
523
-
524
- var hasRequiredLoadModuleNative;
525
-
526
- function requireLoadModuleNative () {
527
- if (hasRequiredLoadModuleNative) return loadModuleNative;
528
- hasRequiredLoadModuleNative = 1;
529
- // This is kept in a separate .js file to prevent TypeScript re-writing the import() statement to a require() statement
530
- // This is the CJS version; the .mjs version is used by the ESM build.
531
- loadModuleNative.importModule = function importModule(path) {
532
- return import(path)
533
- };
534
- return loadModuleNative;
535
- }
536
-
537
- requireLoadModuleNative();
538
-
539
522
  /*
540
523
  * Parses the parameter list of a function string, including ES6 class constructors.
541
524
  *
@@ -1 +1 @@
1
- export function importModule(path: string): Promise<any>
1
+ export declare function importModule(path: string): Promise<any>;
@@ -1,5 +1,9 @@
1
- // This is kept in a separate .js file to prevent TypeScript re-writing the import() statement to a require() statement
2
- // This is the CJS version; the .mjs version is used by the ESM build.
3
- module.exports.importModule = function importModule(path) {
4
- return import(path)
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.importModule = importModule;
4
+ // Kept in a separate module so it can be excluded from test coverage;
5
+ // jest cannot execute a native dynamic import.
6
+ function importModule(path) {
7
+ return import(path);
5
8
  }
9
+ //# sourceMappingURL=load-module-native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-module-native.js","sourceRoot":"","sources":["../src/load-module-native.ts"],"names":[],"mappings":";;AAEA,oCAEC;AAJD,sEAAsE;AACtE,+CAA+C;AAC/C,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;AACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awilix",
3
- "version": "13.0.3",
3
+ "version": "13.0.4",
4
4
  "description": "Extremely powerful dependency injection container.",
5
5
  "main": "lib/awilix.js",
6
6
  "module": "lib/awilix.module.mjs",
@@ -76,31 +76,28 @@
76
76
  },
77
77
  "homepage": "https://github.com/jeffijoe/awilix#readme",
78
78
  "devDependencies": {
79
- "@babel/core": "^7.29.0",
80
- "@babel/plugin-transform-runtime": "^7.29.0",
81
- "@babel/preset-env": "^7.29.0",
82
- "@babel/runtime": "^7.28.6",
83
- "@rollup/plugin-commonjs": "^29.0.0",
84
- "@rollup/plugin-node-resolve": "^16.0.3",
79
+ "@babel/core": "^7.29.7",
80
+ "@babel/plugin-transform-runtime": "^7.29.7",
81
+ "@babel/preset-env": "^7.29.7",
82
+ "@babel/runtime": "^7.29.7",
85
83
  "@rollup/plugin-replace": "^6.0.3",
86
84
  "@types/jest": "^30.0.0",
87
- "@types/node": "^25.3.3",
88
- "babel-jest": "^30.2.0",
85
+ "@types/node": "^25.9.3",
86
+ "babel-jest": "^30.4.1",
89
87
  "eslint": "^9.22.0",
90
88
  "husky": "^9.1.7",
91
- "jest": "^30.2.0",
89
+ "jest": "^30.4.2",
92
90
  "lint-staged": "^16.3.1",
93
- "prettier": "^3.8.1",
91
+ "prettier": "^3.8.4",
94
92
  "rimraf": "^6.1.3",
95
- "rollup": "^4.59.0",
96
- "rollup-plugin-copy": "^3.5.0",
97
- "rollup-plugin-typescript2": "^0.36.0",
93
+ "rollup": "^4.61.1",
94
+ "rollup-plugin-typescript2": "^0.37.0",
98
95
  "smid": "^0.1.1",
99
- "tinybench": "^6.0.0",
100
- "ts-jest": "^29.4.6",
96
+ "tinybench": "^6.0.2",
97
+ "ts-jest": "^29.4.11",
101
98
  "tslib": "^2.8.1",
102
- "typescript": "^5.9.3",
103
- "typescript-eslint": "^8.56.1"
99
+ "typescript": "^6.0.3",
100
+ "typescript-eslint": "^8.61.0"
104
101
  },
105
102
  "dependencies": {
106
103
  "fast-glob": "^3.3.3"
@@ -147,8 +144,7 @@
147
144
  "/node_modules/",
148
145
  "__tests__",
149
146
  "lib",
150
- "src/load-module-native.mjs",
151
- "src/load-module-native.js",
147
+ "src/load-module-native.ts",
152
148
  "src/awilix.ts"
153
149
  ],
154
150
  "moduleFileExtensions": [
@@ -156,6 +152,9 @@
156
152
  "tsx",
157
153
  "js"
158
154
  ],
155
+ "moduleNameMapper": {
156
+ "^(\\.{1,2}/.*)\\.js$": "$1"
157
+ },
159
158
  "transform": {
160
159
  "^.+\\.tsx?$": [
161
160
  "ts-jest",
@@ -1 +0,0 @@
1
- export function importModule(path: string): Promise<any>
@@ -1,4 +0,0 @@
1
- // This is kept in a separate .js file to prevent TypeScript re-writing the import() statement to a require() statement
2
- export function importModule(path) {
3
- return import(path)
4
- }