@dword-design/base 9.1.0 → 9.1.2
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 +13 -6
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import depcheckDetectorExeca from 'depcheck-detector-execa';
|
|
|
6
6
|
import depcheckDetectorPackageName from 'depcheck-detector-package-name';
|
|
7
7
|
import packageName from 'depcheck-package-name';
|
|
8
8
|
import depcheckParserBabel from 'depcheck-parser-babel';
|
|
9
|
-
import importCwd from 'import-cwd';
|
|
10
9
|
import jiti from 'jiti';
|
|
11
10
|
import loadPkg from 'load-pkg';
|
|
12
11
|
import { transform as pluginNameToPackageName } from 'plugin-name-to-package-name';
|
|
@@ -35,7 +34,10 @@ import getGeneratedFiles from "./get-generated-files/index.js";
|
|
|
35
34
|
import getGitInfo from "./get-git-info/index.js";
|
|
36
35
|
class Base {
|
|
37
36
|
constructor(config) {
|
|
38
|
-
const jitiInstance = jiti(process.cwd()
|
|
37
|
+
const jitiInstance = jiti(process.cwd(), {
|
|
38
|
+
esmResolve: true,
|
|
39
|
+
interopDefault: true
|
|
40
|
+
});
|
|
39
41
|
if (config === undefined) {
|
|
40
42
|
config = {
|
|
41
43
|
name: packageName`@dword-design/base-config-node`
|
|
@@ -85,14 +87,19 @@ class Base {
|
|
|
85
87
|
supportedNodeVersions: [14, 16, 18],
|
|
86
88
|
syncKeywords: true
|
|
87
89
|
};
|
|
88
|
-
let inheritedConfig = config.name ? importCwd.silent(config.name) || jitiInstance(config.name) : undefined;
|
|
89
90
|
const mergeOptions = {
|
|
90
91
|
customMerge: key => key === 'supportedNodeVersions' ? (a, b) => b : undefined
|
|
91
92
|
};
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
const configsToMerge = [defaultConfig];
|
|
94
|
+
if (config.name) {
|
|
95
|
+
let inheritedConfig = config.name ? jitiInstance(config.name) : undefined;
|
|
96
|
+
if (typeof inheritedConfig === 'function') {
|
|
97
|
+
inheritedConfig = inheritedConfig(deepmerge(defaultConfig, config, mergeOptions));
|
|
98
|
+
}
|
|
99
|
+
configsToMerge.push(inheritedConfig);
|
|
94
100
|
}
|
|
95
|
-
|
|
101
|
+
configsToMerge.push(config);
|
|
102
|
+
this.config = deepmerge.all(configsToMerge, mergeOptions);
|
|
96
103
|
this.packageConfig = this.getPackageConfig();
|
|
97
104
|
this.generatedFiles = this.getGeneratedFiles();
|
|
98
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "Base package for projects.",
|
|
5
5
|
"repository": "dword-design/base",
|
|
6
6
|
"funding": "https://github.com/sponsors/dword-design",
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"hosted-git-info": "^5.0.0",
|
|
62
62
|
"husky": "^7.0.0",
|
|
63
63
|
"ignore": "^5.1.4",
|
|
64
|
-
"import-cwd": "^3.0.0",
|
|
65
64
|
"is-ci": "^3.0.0",
|
|
66
65
|
"jiti": "^1.16.0",
|
|
67
66
|
"load-pkg": "^4.0.0",
|