@dword-design/base 12.0.12 → 12.0.14
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/dist/index.js +10 -5
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -6,10 +6,11 @@ import depcheck from 'depcheck';
|
|
|
6
6
|
import depcheckDetectorBinName from 'depcheck-detector-bin-name';
|
|
7
7
|
import depcheckDetectorExeca from 'depcheck-detector-execa';
|
|
8
8
|
import depcheckDetectorPackageName from 'depcheck-detector-package-name';
|
|
9
|
+
import depcheckDetectorTinyexec from 'depcheck-detector-tinyexec';
|
|
9
10
|
import packageName from 'depcheck-package-name';
|
|
10
11
|
import depcheckParserBabel from 'depcheck-parser-babel';
|
|
11
12
|
import fs from 'fs-extra';
|
|
12
|
-
import
|
|
13
|
+
import { createJiti } from 'jiti';
|
|
13
14
|
import { transform as pluginNameToPackageName } from 'plugin-name-to-package-name';
|
|
14
15
|
import checkUnknownFiles from "./commands/check-unknown-files/index.js";
|
|
15
16
|
import commit from "./commands/commit/index.js";
|
|
@@ -45,9 +46,8 @@ const mergeConfigs = (...configs) => {
|
|
|
45
46
|
class Base {
|
|
46
47
|
constructor(config = null) {
|
|
47
48
|
var _this$config$commands;
|
|
48
|
-
const jitiInstance =
|
|
49
|
-
|
|
50
|
-
interopDefault: true,
|
|
49
|
+
const jitiInstance = createJiti(process.cwd(), {
|
|
50
|
+
moduleCache: false,
|
|
51
51
|
transform: jitiBabelTransform
|
|
52
52
|
});
|
|
53
53
|
if (config === null) {
|
|
@@ -66,7 +66,7 @@ class Base {
|
|
|
66
66
|
allowedMatches: [],
|
|
67
67
|
commands: {},
|
|
68
68
|
depcheckConfig: {
|
|
69
|
-
detectors: [depcheck.detector.importDeclaration, depcheck.detector.requireCallExpression, depcheck.detector.requireResolveCallExpression, depcheckDetectorExeca, depcheckDetectorPackageName, depcheckDetectorBinName],
|
|
69
|
+
detectors: [depcheck.detector.importDeclaration, depcheck.detector.requireCallExpression, depcheck.detector.requireResolveCallExpression, depcheckDetectorExeca, depcheckDetectorTinyexec, depcheckDetectorPackageName, depcheckDetectorBinName],
|
|
70
70
|
ignorePath: '.gitignore',
|
|
71
71
|
parsers: {
|
|
72
72
|
'**/*.js': depcheckParserBabel
|
|
@@ -106,6 +106,11 @@ class Base {
|
|
|
106
106
|
if (config.name) {
|
|
107
107
|
const inheritedConfigPath = config.name === this.packageConfig.name ? P.resolve('src', 'index.js') : config.name;
|
|
108
108
|
let inheritedConfig = inheritedConfigPath ? jitiInstance(inheritedConfigPath) : undefined;
|
|
109
|
+
|
|
110
|
+
// I don't know why Jiti doesn't interopDefault here
|
|
111
|
+
if (inheritedConfig?.default) {
|
|
112
|
+
inheritedConfig = inheritedConfig.default;
|
|
113
|
+
}
|
|
109
114
|
if (typeof inheritedConfig === 'function') {
|
|
110
115
|
inheritedConfig = inheritedConfig(mergeConfigs(defaultConfig, config));
|
|
111
116
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.14",
|
|
4
4
|
"description": "Base package for projects.",
|
|
5
5
|
"repository": "dword-design/base",
|
|
6
6
|
"funding": "https://github.com/sponsors/dword-design",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"depcheck-detector-bin-name": "^1.0.2",
|
|
51
51
|
"depcheck-detector-execa": "^4.0.0",
|
|
52
52
|
"depcheck-detector-package-name": "^3.0.4",
|
|
53
|
+
"depcheck-detector-tinyexec": "^1.0.0",
|
|
53
54
|
"depcheck-package-name": "^3.0.1",
|
|
54
55
|
"depcheck-parser-babel": "^3.0.57",
|
|
55
56
|
"eslint": "^9.27.0",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"husky": "^8.0.3",
|
|
63
64
|
"ignore": "^5.3.2",
|
|
64
65
|
"is-ci": "^3.0.1",
|
|
65
|
-
"jiti": "^
|
|
66
|
+
"jiti": "^2.4.2",
|
|
66
67
|
"make-cli": "^4.0.0",
|
|
67
68
|
"mocha": "^10.8.2",
|
|
68
69
|
"mocha-spec-reporter-with-file-names": "npm:@dword-design/mocha-spec-reporter-with-file-names@^0.0.1",
|