Skip to content

Commit 756a904

Browse files
committed
fix ts and buildx
1 parent e19ca9e commit 756a904

5 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎apps/cli/src/build.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,30 @@ const buildBinaries = async (targets: Target[]) => {
155155
target: bunTarget(target) as any,
156156
outfile: join(binDir, binaryName(target)),
157157
},
158+
plugins: [
159+
{
160+
name: "stub-node-stdlib-browser",
161+
setup(build) {
162+
// @secure-exec re-exports polyfill helpers that eagerly resolve
163+
// Node stdlib browser polyfill paths at import time (e.g. require.resolve("assert/")),
164+
// which fails in compiled binaries. Our code never uses these polyfills, so stub them out.
165+
const stubTargets = /node-stdlib-browser|web-streams-polyfill/;
166+
build.onResolve({ filter: stubTargets }, (args) => ({
167+
path: args.path,
168+
namespace: "stub",
169+
}));
170+
build.onResolve({ filter: /polyfills/ }, (args) => {
171+
if (args.importer.includes("secure-exec")) {
172+
return { path: args.path, namespace: "stub" };
173+
}
174+
});
175+
build.onLoad({ filter: /.*/, namespace: "stub" }, () => ({
176+
contents: `export default {}; export const POLYFILL_CODE_MAP = {}; export const bundlePolyfill = () => {}; export const getAvailableStdlib = () => []; export const hasPolyfill = () => false; export const prebundleAllPolyfills = () => ({});`,
177+
loader: "js",
178+
}));
179+
},
180+
},
181+
],
158182
});
159183

160184
// Copy QuickJS WASM next to binary — loaded at runtime by the server

‎apps/cloud/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"type": "module",
66
"dependencies": {
7+
"@effect-atom/atom": "^0.5.0",
78
"@effect-atom/atom-react": "^0.5.0",
89
"@effect/platform": "catalog:",
910
"@executor/api": "workspace:*",

‎apps/local/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"outDir": "dist",
1010
"rootDir": ".",
1111
"jsx": "react-jsx",
12-
"typeRoots": ["../../node_modules/@types"],
12+
"types": ["bun-types"],
1313
"plugins": [
1414
{
1515
"name": "@effect/language-service"

‎bun.lock‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/react/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"@base-ui/react": "^1.3.0",
1717
"@effect/platform": "catalog:",
18+
"@effect-atom/atom": "^0.5.0",
1819
"@effect-atom/atom-react": "^0.5.0",
1920
"@executor/api": "workspace:*",
2021
"@executor/sdk": "workspace:*",

0 commit comments

Comments
 (0)