|
1 | | -import { Bun, getPackageJson, getPackageTypes } from "@jsdocs-io/extractor"; |
| 1 | +import { Bun, getPackageApi, getPackageJson, getPackageTypes } from "@jsdocs-io/extractor"; |
2 | 2 | import { goTry } from "go-go-try"; |
3 | 3 | import { join } from "pathe"; |
4 | 4 | import { PackageApiMemDb } from "../../db/package-api-mem-db"; |
@@ -137,20 +137,19 @@ export async function handlePackage(slug: string) { |
137 | 137 | }; |
138 | 138 | } |
139 | 139 |
|
140 | | - // // Extract the package API. |
141 | | - // const pkgApiRes = yield * Effect.either(extractPackageApi({ pkg, subpath })); |
142 | | - // if (Either.isLeft(pkgApiRes)) { |
143 | | - // yield * Effect.logError(pkgApiRes.left); |
144 | | - // return { |
145 | | - // status: "no-api" as const, |
146 | | - // pkgId, |
147 | | - // subpath, |
148 | | - // pkgJson, |
149 | | - // generatedAt: generatedAt(), |
150 | | - // generatedIn: generatedIn(start), |
151 | | - // }; |
152 | | - // } |
153 | | - // const pkgApi = pkgApiRes.right; |
| 140 | + // Extract the package API. |
| 141 | + const [pkgApiErr, pkgApi] = await goTry(getPackageApi({ pkg, subpath, bun })); |
| 142 | + if (pkgApiErr !== undefined) { |
| 143 | + log.error({ err: pkgApiErr }); |
| 144 | + return { |
| 145 | + status: "pkg-has-no-api" as const, |
| 146 | + pkgId, |
| 147 | + subpath, |
| 148 | + pkgJson, |
| 149 | + generatedAt: generatedAt(), |
| 150 | + generatedIn: generatedIn(start), |
| 151 | + }; |
| 152 | + } |
154 | 153 |
|
155 | 154 | // // Store the package API in the DB. |
156 | 155 | // const setPkgApiRes = yield * Effect.either(db.setPackageApi({ pkg, subpath, pkgApi })); |
|
0 commit comments