Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"dev": "tsup --watch src --onSuccess 'node dist/index.js'",
"build": "tsc",
"start": "node dist/index.js",
"test": "vitest run",
Expand Down Expand Up @@ -33,6 +33,7 @@
"@types/supertest": "^6.0.3",
"@types/ws": "^8.5.0",
"supertest": "^7.2.2",
"tsup": "^8.3.6",
"tsx": "^4.19.0",
"typescript": "^5.7.0",
"vitest": "^3.0.0"
Expand Down
20 changes: 20 additions & 0 deletions packages/agent/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'tsup'

// Dev/watch build for the agent entrypoint.
// tsx's ESM loader cannot instantiate @bonfida/spl-name-service@3.0.21's
// vendored borsh ESM bundle (see #253); building with tsup (esbuild) and
// running the output with plain `node` avoids that loader entirely.
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm'],
target: 'node22',
dts: false,
clean: true,
sourcemap: true,
splitting: false,
// Transpile only the agent's own source; let Node resolve node_modules at
// runtime. Bundling the transitive CJS chain (bs58 -> safe-buffer ->
// require("buffer")) into a single ESM file breaks with "Dynamic require
// not supported". Plain Node handles those deps (and Bonfida's ESM) fine.
skipNodeModulesBundle: true,
})
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading