@stryke/fs 0.20.1 → 0.20.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/tsconfig.cjs +10 -9
- package/dist/tsconfig.mjs +1 -1
- package/package.json +2 -2
package/dist/tsconfig.cjs
CHANGED
|
@@ -8,19 +8,20 @@ var _exists = require("@stryke/path/exists");
|
|
|
8
8
|
var _filePathFns = require("@stryke/path/file-path-fns");
|
|
9
9
|
var _joinPaths = require("@stryke/path/join-paths");
|
|
10
10
|
var _defu = _interopRequireDefault(require("defu"));
|
|
11
|
-
var
|
|
11
|
+
var _mlly = require("mlly");
|
|
12
12
|
var _readFile = require("./read-file.cjs");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
async function loadTsConfig(e = process.cwd()) {
|
|
15
|
+
let s = e.endsWith(".json") ? e : (0, _joinPaths.joinPaths)(e, "tsconfig.json");
|
|
16
|
+
if (!(0, _exists.existsSync)(s) && (s = await (0, _mlly.resolvePath)(e, {
|
|
17
|
+
url: require('url').pathToFileURL(__filename).toString()
|
|
18
|
+
}), !(0, _exists.existsSync)(s))) throw new Error(`tsconfig.json not found at ${s}. Please ensure the file exists.`);
|
|
19
|
+
let o = await (0, _readFile.readJsonFile)(s);
|
|
20
|
+
if (o?.compilerOptions?.baseUrl && (o.compilerOptions.baseUrl = (0, _joinPaths.joinPaths)((0, _filePathFns.findFilePath)(s), o.compilerOptions.baseUrl)), o?.extends) {
|
|
20
21
|
const f = Array.isArray(o.extends) ? o.extends : [o.extends];
|
|
21
22
|
for (const m of f) {
|
|
22
|
-
const
|
|
23
|
-
|
|
23
|
+
const n = await loadTsConfig((0, _joinPaths.joinPaths)((0, _filePathFns.findFilePath)(s), m));
|
|
24
|
+
n && (o = (0, _defu.default)(o, n ?? {}));
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
return o.extends = void 0, o;
|
package/dist/tsconfig.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as i}from"@stryke/path/exists";import{findFilePath as r}from"@stryke/path/file-path-fns";import{joinPaths as t}from"@stryke/path/join-paths";import a from"defu";import{resolvePath as p}from"mlly";import{readJsonFile as c}from"./read-file";export async function loadTsConfig(e=process.cwd()){let s=e.endsWith(".json")?e:t(e,"tsconfig.json");if(!i(s)&&(s=await p(e,{url:import.meta.url}),!i(s)))throw new Error(`tsconfig.json not found at ${s}. Please ensure the file exists.`);let o=await c(s);if(o?.compilerOptions?.baseUrl&&(o.compilerOptions.baseUrl=t(r(s),o.compilerOptions.baseUrl)),o?.extends){const f=Array.isArray(o.extends)?o.extends:[o.extends];for(const m of f){const n=await loadTsConfig(t(r(s),m));n&&(o=a(o,n??{}))}}return o.extends=void 0,o}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/fs",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"chalk": "^5.4.1",
|
|
21
21
|
"defu": "^6.1.4",
|
|
22
22
|
"glob": "^11.0.1",
|
|
23
|
-
"
|
|
23
|
+
"mlly": "1.7.4",
|
|
24
24
|
"nanotar": "^0.2.0",
|
|
25
25
|
"semver": "7.7.1",
|
|
26
26
|
"@stryke/json": "^0.9.0",
|