From 9386ca61640f121c6db30682951832cf9da62175 Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Wed, 18 Mar 2026 00:39:58 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20bundle=20@altimateai/altimate-core=20?= =?UTF-8?q?=E2=80=94=20required=20at=20runtime=20for=20CLI=20to=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- packages/opencode/script/build.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index 5514a2d650..e103eec6d4 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -199,14 +199,13 @@ for (const item of targets) { tsconfig: "./tsconfig.json", plugins: [solidPlugin], sourcemap: "external", - // Packages that must NOT be bundled into the compiled binary. - // They are loaded lazily via dynamic import() at runtime. + // Packages excluded from the compiled binary — loaded lazily at runtime. + // NOTE: @altimateai/altimate-core is intentionally NOT external — it's a + // napi binary that must be bundled for the CLI to work out of the box. external: [ - // altimate-core napi binary — ~50MB per platform, loaded on first tool call - "@altimateai/altimate-core", - // dbt integration — heavy transitive deps (electron, aws-sdk, etc.) + // dbt integration — heavy transitive deps, loaded on first dbt operation "@altimateai/dbt-integration", - // Database drivers — users install on demand + // Database drivers — users install on demand per warehouse "pg", "snowflake-sdk", "@google-cloud/bigquery", "@databricks/sql", "mysql2", "mssql", "oracledb", "duckdb", "better-sqlite3", // Optional infra packages