@doccov/sdk 0.10.0 → 0.10.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/index.js +10 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2320,9 +2320,9 @@ async function detectEntryPoint(fs5, packagePath = ".") {
|
|
|
2320
2320
|
"source/index.ts"
|
|
2321
2321
|
];
|
|
2322
2322
|
for (const fallback of fallbacks) {
|
|
2323
|
-
const
|
|
2324
|
-
if (await fs5.exists(
|
|
2325
|
-
return { path:
|
|
2323
|
+
const checkPath = packagePath === "." ? fallback : `${packagePath}/${fallback}`;
|
|
2324
|
+
if (await fs5.exists(checkPath)) {
|
|
2325
|
+
return { path: fallback, source: "fallback", isDeclarationOnly: false };
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
2328
|
throw new Error("Could not detect TypeScript entry point. No types field in package.json and no common entry paths found.");
|
|
@@ -2338,12 +2338,11 @@ async function parseTsConfig(fs5, packagePath) {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
async function resolveToSource(fs5, basePath, filePath, tsConfig) {
|
|
2340
2340
|
const normalized = filePath.replace(/^\.\//, "");
|
|
2341
|
-
const
|
|
2341
|
+
const checkPath = (p) => basePath === "." ? p : `${basePath}/${p}`;
|
|
2342
2342
|
const isSourceTs = normalized.endsWith(".ts") && !normalized.endsWith(".d.ts") || normalized.endsWith(".tsx");
|
|
2343
2343
|
if (isSourceTs) {
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
return { path: path5, isDeclarationOnly: false };
|
|
2344
|
+
if (await fs5.exists(checkPath(normalized))) {
|
|
2345
|
+
return { path: normalized, isDeclarationOnly: false };
|
|
2347
2346
|
}
|
|
2348
2347
|
}
|
|
2349
2348
|
const candidates = [];
|
|
@@ -2384,15 +2383,13 @@ async function resolveToSource(fs5, basePath, filePath, tsConfig) {
|
|
|
2384
2383
|
for (const candidate of candidates) {
|
|
2385
2384
|
if (candidate.endsWith(".d.ts"))
|
|
2386
2385
|
continue;
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
return { path: path5, isDeclarationOnly: false };
|
|
2386
|
+
if (await fs5.exists(checkPath(candidate))) {
|
|
2387
|
+
return { path: candidate, isDeclarationOnly: false };
|
|
2390
2388
|
}
|
|
2391
2389
|
}
|
|
2392
2390
|
if (normalized.endsWith(".d.ts")) {
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
return { path: path5, isDeclarationOnly: true };
|
|
2391
|
+
if (await fs5.exists(checkPath(normalized))) {
|
|
2392
|
+
return { path: normalized, isDeclarationOnly: true };
|
|
2396
2393
|
}
|
|
2397
2394
|
}
|
|
2398
2395
|
return null;
|