Skip to content

Commit dc766a8

Browse files
VinciGit00claude
andcommitted
fix(ci): build scrapegraph-js in-place and update smoke test for v2
The SDK is pinned to a GitHub commit (not on npm yet) and ships without a prebuilt dist/, so module resolution fails right after bun install. Build it as a post-install CI step until v2 lands on npm. Also rewrite tests/smoke.test.ts — the old test still imported the v1 symbols (smartScraper, HISTORY_SERVICES) that no longer exist; replace with a sanity check against the v2 scrapegraphai() factory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent af777a8 commit dc766a8

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: oven-sh/setup-bun@v2
1616
- run: bun install
17+
# scrapegraph-js is pinned to a GitHub commit (not yet on npm) and ships
18+
# without a prebuilt dist/ — build it in-place so module resolution works.
19+
- run: cd node_modules/scrapegraph-js && bun install && bun run build
1720
- run: bun test
1821

1922
lint:
@@ -23,4 +26,5 @@ jobs:
2326
- uses: actions/checkout@v4
2427
- uses: oven-sh/setup-bun@v2
2528
- run: bun install
29+
- run: cd node_modules/scrapegraph-js && bun install && bun run build
2630
- run: bun run check

tests/smoke.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import { expect, test } from "bun:test";
2-
import { HISTORY_SERVICES, smartScraper } from "scrapegraph-js";
2+
import { scrapegraphai } from "scrapegraph-js";
33

4-
test("sdk exports are available", () => {
5-
expect(typeof smartScraper).toBe("function");
6-
expect(HISTORY_SERVICES.length).toBeGreaterThan(0);
4+
test("sdk v2 factory is callable and exposes expected methods", () => {
5+
expect(typeof scrapegraphai).toBe("function");
6+
7+
const client = scrapegraphai({ apiKey: "sgai-test" });
8+
expect(typeof client.scrape).toBe("function");
9+
expect(typeof client.extract).toBe("function");
10+
expect(typeof client.search).toBe("function");
11+
expect(typeof client.credits).toBe("function");
12+
expect(typeof client.history).toBe("function");
13+
expect(typeof client.crawl.start).toBe("function");
14+
expect(typeof client.crawl.status).toBe("function");
715
});

0 commit comments

Comments
 (0)