Skip to content

Commit bb238d6

Browse files
anandgupta42claude
andauthored
fix: bundle @altimateai/altimate-core — required at runtime for CLI to work (#250)
altimate-core is a napi binary that must be in the compiled binary. Marking it external causes 'Cannot find module' at runtime. The ~35MB size increase (86→122MB per binary) is acceptable — it's the Rust SQL engine that powers all 34 analysis methods. dbt-integration stays external (heavy transitive deps, loaded lazily). Database drivers stay external (installed per warehouse on demand). Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 170b8c9 commit bb238d6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/opencode/script/build.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,13 @@ for (const item of targets) {
199199
tsconfig: "./tsconfig.json",
200200
plugins: [solidPlugin],
201201
sourcemap: "external",
202-
// Packages that must NOT be bundled into the compiled binary.
203-
// They are loaded lazily via dynamic import() at runtime.
202+
// Packages excluded from the compiled binary — loaded lazily at runtime.
203+
// NOTE: @altimateai/altimate-core is intentionally NOT external — it's a
204+
// napi binary that must be bundled for the CLI to work out of the box.
204205
external: [
205-
// altimate-core napi binary — ~50MB per platform, loaded on first tool call
206-
"@altimateai/altimate-core",
207-
// dbt integration — heavy transitive deps (electron, aws-sdk, etc.)
206+
// dbt integration — heavy transitive deps, loaded on first dbt operation
208207
"@altimateai/dbt-integration",
209-
// Database drivers — users install on demand
208+
// Database drivers — users install on demand per warehouse
210209
"pg", "snowflake-sdk", "@google-cloud/bigquery", "@databricks/sql",
211210
"mysql2", "mssql", "oracledb", "duckdb", "better-sqlite3",
212211
// Optional infra packages

0 commit comments

Comments
 (0)