Skip to content

Commit 0d7cd98

Browse files
Copilotmrjf
andauthored
fix: exclude read_excel from browser bundle (uses node:zlib)
read_excel.ts uses `node:zlib` which has no browser polyfill. This caused the `bun build --target browser` step to fail in CI. Removed read_excel from barrel exports (src/index.ts, src/io/index.ts) — users who need it in Node/Bun can import directly from "tsb/io/read_excel". Updated read_excel.test.ts to import from the module file. Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/fa19ae27-a6ef-46a6-a974-a3c323b8b6a2 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent 4a8ccc3 commit 0d7cd98

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,7 @@ export type {
469469
// PR #120 unique modules — re-exported from sub-barrels
470470
export { astypeSeries, astype, castScalar } from "./core/index.ts";
471471
export type { AstypeOptions, DataFrameAstypeOptions } from "./core/index.ts";
472-
export { readExcel, xlsxSheetNames } from "./io/index.ts";
473-
export type { ReadExcelOptions } from "./io/index.ts";
472+
// readExcel / xlsxSheetNames use node:zlib — import from "tsb/io/read_excel" directly
474473
export { clipAdvancedSeries, clipAdvancedDataFrame } from "./stats/index.ts";
475474
export type {
476475
SeriesBound,

src/io/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ export { readJson, toJson } from "./json.ts";
1010
export type { ReadJsonOptions, ToJsonOptions, JsonOrient } from "./json.ts";
1111
export { jsonNormalize } from "./json_normalize.ts";
1212
export type { JsonPath, JsonNormalizeOptions } from "./json_normalize.ts";
13-
export { readExcel, xlsxSheetNames } from "./read_excel.ts";
14-
export type { ReadExcelOptions } from "./read_excel.ts";
13+
// readExcel / xlsxSheetNames use node:zlib and cannot be bundled for the
14+
// browser. Import them directly from "tsb/io/read_excel" when running in
15+
// Node / Bun.

tests/io/read_excel.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
*/
44
import { describe, expect, it } from "bun:test";
55
import fc from "fast-check";
6-
import { DataFrame, readExcel, xlsxSheetNames } from "../../src/index.ts";
6+
import { DataFrame } from "../../src/index.ts";
7+
import { readExcel, xlsxSheetNames } from "../../src/io/read_excel.ts";
78

89
// ─── minimal XLSX fixture builder ─────────────────────────────────────────────
910

0 commit comments

Comments
 (0)