Summary
Binary builds (scripts/build-binaries.sh) fail because bun build --compile cannot resolve deep wildcard subpath exports from @archon/adapters.
Error
55 | import { GiteaAdapter } from '@archon/adapters/community/forge/gitea';
^
error: Could not resolve: "@archon/adapters/community/forge/gitea". Maybe you need to "bun install"?
at packages/server/src/index.ts:55:30
56 | import { GitLabAdapter } from '@archon/adapters/community/forge/gitlab';
^
error: Could not resolve: "@archon/adapters/community/forge/gitlab". Maybe you need to "bun install"?
at packages/server/src/index.ts:56:31
Root Cause
packages/adapters/package.json uses a wildcard export map:
"exports": {
".": "./src/index.ts",
"./*": "./src/*"
}
This works at Bun runtime (e.g. bun dev, bun -e "import ..." from packages/server/) but bun build --compile from the repo root cannot resolve the deep subpath @archon/adapters/community/forge/gitea through the wildcard.
The adapters exist at packages/adapters/src/community/forge/gitea/ and packages/adapters/src/community/forge/gitlab/ — the files are all there. They're just not reachable by the bundler.
Reproduction
# From repo root:
bun build --compile --target=bun-darwin-arm64 --outfile=/dev/null packages/cli/src/cli.ts
# Fails with the above errors
# But runtime resolution works fine:
cd packages/server && bun -e "import { GiteaAdapter } from '@archon/adapters/community/forge/gitea'; console.log('OK:', typeof GiteaAdapter);"
# OK: function
Fix Options
-
Add explicit export entries in packages/adapters/package.json:
"exports": {
".": "./src/index.ts",
"./*": "./src/*",
"./community/forge/gitea": "./src/community/forge/gitea/index.ts",
"./community/forge/gitlab": "./src/community/forge/gitlab/index.ts"
}
-
Re-export from main index — add GiteaAdapter and GitLabAdapter to packages/adapters/src/index.ts and update the imports in packages/server/src/index.ts.
Option 1 is the minimal change; option 2 is more consistent with how other adapters are exported.
Impact
- Binary builds are broken on
dev
- CI release workflow will fail on next release tag
bun dev and runtime are unaffected
Summary
Binary builds (
scripts/build-binaries.sh) fail becausebun build --compilecannot resolve deep wildcard subpath exports from@archon/adapters.Error
Root Cause
packages/adapters/package.jsonuses a wildcard export map:This works at Bun runtime (e.g.
bun dev,bun -e "import ..."frompackages/server/) butbun build --compilefrom the repo root cannot resolve the deep subpath@archon/adapters/community/forge/giteathrough the wildcard.The adapters exist at
packages/adapters/src/community/forge/gitea/andpackages/adapters/src/community/forge/gitlab/— the files are all there. They're just not reachable by the bundler.Reproduction
Fix Options
Add explicit export entries in
packages/adapters/package.json:Re-export from main index — add
GiteaAdapterandGitLabAdaptertopackages/adapters/src/index.tsand update the imports inpackages/server/src/index.ts.Option 1 is the minimal change; option 2 is more consistent with how other adapters are exported.
Impact
devbun devand runtime are unaffected