@doccov/sdk 0.10.0 → 0.11.0

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -13
  2. 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 fullPath = packagePath === "." ? fallback : `${packagePath}/${fallback}`;
2324
- if (await fs5.exists(fullPath)) {
2325
- return { path: fullPath, source: "fallback", isDeclarationOnly: false };
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 fullPath = (p) => basePath === "." ? p : `${basePath}/${p}`;
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
- const path5 = fullPath(normalized);
2345
- if (await fs5.exists(path5)) {
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
- const path5 = fullPath(candidate);
2388
- if (await fs5.exists(path5)) {
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
- const path5 = fullPath(normalized);
2394
- if (await fs5.exists(path5)) {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/sdk",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "DocCov SDK - Documentation coverage and drift detection for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",