@stryke/fs 0.33.0 → 0.33.1
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 -10
- package/dist/tsconfig.mjs +1 -1
- package/package.json +2 -2
package/dist/tsconfig.cjs
CHANGED
|
@@ -8,21 +8,21 @@ var _cwd = require("@stryke/path/cwd");
|
|
|
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 _mlly = require("mlly");
|
|
12
11
|
var _exists = require("./exists.cjs");
|
|
13
12
|
var _json = require("./json.cjs");
|
|
13
|
+
var _resolve = require("./resolve.cjs");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
async function loadTsConfig(
|
|
16
|
-
let
|
|
17
|
-
if (!(0, _exists.existsSync)(
|
|
18
|
-
|
|
19
|
-
}), !(0, _exists.existsSync)(
|
|
20
|
-
let o = await (0, _json.readJsonFile)(
|
|
21
|
-
if (o?.compilerOptions?.baseUrl && (o.compilerOptions.baseUrl = (0, _joinPaths.joinPaths)((0, _filePathFns.findFilePath)(
|
|
15
|
+
async function loadTsConfig(s = (0, _cwd.cwd)()) {
|
|
16
|
+
let n = (0, _filePathFns.findFileExtension)(s) === "json" ? s : (0, _joinPaths.joinPaths)(s, "tsconfig.json");
|
|
17
|
+
if (!(0, _exists.existsSync)(n) && (n = await (0, _resolve.resolve)(s, {
|
|
18
|
+
extensions: ["json"]
|
|
19
|
+
}), !(0, _exists.existsSync)(n))) throw new Error(`tsconfig.json not found at ${n}. Please ensure the file exists.`);
|
|
20
|
+
let o = await (0, _json.readJsonFile)(n);
|
|
21
|
+
if (o?.compilerOptions?.baseUrl && (o.compilerOptions.baseUrl = (0, _joinPaths.joinPaths)((0, _filePathFns.findFilePath)(n), o.compilerOptions.baseUrl)), o?.extends) {
|
|
22
22
|
const f = Array.isArray(o.extends) ? o.extends : [o.extends];
|
|
23
23
|
for (const m of f) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const i = await loadTsConfig((0, _joinPaths.joinPaths)((0, _filePathFns.findFilePath)(n), m));
|
|
25
|
+
i && (o = (0, _defu.default)(o, i ?? {}));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
return o.extends = void 0, o;
|
package/dist/tsconfig.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cwd as a}from"@stryke/path/cwd";import{findFilePath as
|
|
1
|
+
import{cwd as a}from"@stryke/path/cwd";import{findFileExtension as p,findFilePath as t}from"@stryke/path/file-path-fns";import{joinPaths as e}from"@stryke/path/join-paths";import d from"defu";import{existsSync as r}from"./exists";import{readJsonFile as c}from"./json";import{resolve as l}from"./resolve";export async function loadTsConfig(s=a()){let n=p(s)==="json"?s:e(s,"tsconfig.json");if(!r(n)&&(n=await l(s,{extensions:["json"]}),!r(n)))throw new Error(`tsconfig.json not found at ${n}. Please ensure the file exists.`);let o=await c(n);if(o?.compilerOptions?.baseUrl&&(o.compilerOptions.baseUrl=e(t(n),o.compilerOptions.baseUrl)),o?.extends){const f=Array.isArray(o.extends)?o.extends:[o.extends];for(const m of f){const i=await loadTsConfig(e(t(n),m));i&&(o=d(o,i??{}))}}return o.extends=void 0,o}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/fs",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
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": {
|
|
@@ -410,5 +410,5 @@
|
|
|
410
410
|
"main": "./dist/index.cjs",
|
|
411
411
|
"module": "./dist/index.mjs",
|
|
412
412
|
"types": "./dist/index.d.ts",
|
|
413
|
-
"gitHead": "
|
|
413
|
+
"gitHead": "3cf741f324ff7f8e7bad04b543c84ce374c15481"
|
|
414
414
|
}
|