@query-farm/vgi 0.24.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@query-farm/vgi",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
4
4
  "description": "TypeScript framework for extending DuckDB with user-defined functions via the Vector Gateway Interface (VGI) over Arrow IPC.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Query Farm LLC (https://query.farm)",
@@ -69,15 +69,18 @@
69
69
  "files": [
70
70
  "dist",
71
71
  "src",
72
+ "scripts/postinstall.cjs",
72
73
  "!src/**/__tests__/**",
73
74
  "!src/**/*.test.ts",
74
75
  "!src/**/*.spec.ts"
75
76
  ],
77
+ "//imports": "`browser` maps to arrow-js DELIBERATELY, not flechette. Measured on the client surface (VgiClient + Arguments + batch helpers), a minified browser bundle is 84 KB gzip via arrow-js vs 116 KB via flechette — arrow-js tree-shakes to the subset the client touches, while flechette links as a unit. Flechette still wins for `worker-cf`, which exercises far more of the Arrow API and cannot take a peer dep. Keep `browser` AFTER `workerd`/`worker`: conditions match in key order, so a workerd build (which sets both) must hit flechette first.",
76
78
  "imports": {
77
79
  "#arrow-impl": {
78
80
  "flechette": "./src/arrow/impl-flechette/index.ts",
79
81
  "workerd": "./src/arrow/impl-flechette/index.ts",
80
82
  "worker": "./src/arrow/impl-flechette/index.ts",
83
+ "browser": "./src/arrow/impl-arrowjs/index.ts",
81
84
  "default": "./src/arrow/impl-arrowjs/index.ts"
82
85
  }
83
86
  },
@@ -87,12 +90,12 @@
87
90
  },
88
91
  "peerDependencies": {
89
92
  "@query-farm/apache-arrow": "^21.1.1",
90
- "@query-farm/vgi-rpc": "^0.17.0"
93
+ "@query-farm/vgi-rpc": ">=0.18.1 <0.19.0"
91
94
  },
92
95
  "devDependencies": {
93
96
  "@duckdb/node-api": "^1.5.2-r.1",
94
97
  "@query-farm/apache-arrow": "^21.1.1",
95
- "@query-farm/vgi-rpc": "^0.17.0",
98
+ "@query-farm/vgi-rpc": "^0.18.1",
96
99
  "@types/bun": "latest",
97
100
  "typescript": "^6.0.3"
98
101
  },
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ // Copyright 2025, 2026 Query Farm LLC - https://query.farm
3
+ // Postinstall: deduplicate @query-farm/apache-arrow across @query-farm/vgi-rpc
4
+ // to avoid dual-package instanceof issues.
5
+ //
6
+ // This is a LOCAL DEVELOPMENT-only fixup for the vgi-typescript monorepo, where
7
+ // @query-farm/vgi-rpc is a `file:` link with its own nested copy of apache-arrow.
8
+ // It must NOT run when this package is installed as a dependency of someone
9
+ // else's project — so it no-ops unless the sibling vgi-rpc-typescript checkout
10
+ // is present next to this repo. (Published consumers get a single hoisted
11
+ // apache-arrow from the registry, so no dedup is needed there.)
12
+ const fs = require("fs");
13
+ const path = require("path");
14
+
15
+ const PKG = "@query-farm/apache-arrow";
16
+
17
+ // Resolve everything relative to the repo root (this file lives in <repo>/scripts),
18
+ // not the process cwd, so behavior doesn't depend on where the installer runs us.
19
+ const repoRoot = path.resolve(__dirname, "..");
20
+
21
+ // Dev-monorepo signal: the sibling vgi-rpc source checkout. When this package is
22
+ // installed as a dependency, that path resolves inside the consumer's node_modules
23
+ // and won't exist — so we bail and leave their tree untouched.
24
+ const devSibling = path.resolve(repoRoot, "..", "vgi-rpc-typescript", "package.json");
25
+ if (!fs.existsSync(devSibling)) {
26
+ process.exit(0);
27
+ }
28
+
29
+ // Deduplicate: replace vgi-rpc's nested copy with a symlink to ours.
30
+ // Without this, two separate DataType classes exist at runtime and
31
+ // instanceof checks fail across package boundaries.
32
+ // Bun uses per-file symlinks for file: deps, so module resolution follows
33
+ // the real path. We must target the REAL node_modules of vgi-rpc-typescript.
34
+ const ourArrow = path.join(repoRoot, "node_modules", PKG);
35
+ const rpcPkgLink = path.join(repoRoot, "node_modules", "@query-farm", "vgi-rpc", "package.json");
36
+ try {
37
+ const realPkgPath = fs.realpathSync(rpcPkgLink);
38
+ const rpcRoot = path.dirname(realPkgPath);
39
+ const rpcArrow = path.join(rpcRoot, "node_modules", PKG);
40
+ const st = fs.lstatSync(rpcArrow);
41
+ if (!st.isSymbolicLink()) {
42
+ fs.rmSync(rpcArrow, { recursive: true });
43
+ fs.symlinkSync(ourArrow, rpcArrow);
44
+ }
45
+ } catch (e) {
46
+ if (e.code !== "ENOENT") throw e;
47
+ }