Holesail Service Daemon + Bin Client

This commit is contained in:
Raven Scott
2026-04-09 20:42:54 -04:00
parent 3a69906046
commit c8c877f688
168 changed files with 387155 additions and 30713 deletions
+19 -1
View File
@@ -18,6 +18,23 @@ import * as esbuild from 'esbuild'
const __dirname = dirname(fileURLToPath(import.meta.url))
const repoRoot = join(__dirname, '..', '..')
const booterNodeModules = join(repoRoot, 'packages/bare-os-booter/node_modules')
/**
* esbuild `platform: 'node'` marks builtins external; drive IIFEs run under `new Function`
* on Pear with no `globalThis.require`. Map Node core modules to Bare shims so they bundle in.
* Use package names (not absolute paths) so esbuild resolves them via `nodePaths`.
*/
function bareDriveBundleNodeBuiltinAliases() {
return {
assert: 'bare-assert',
crypto: 'bare-crypto',
events: 'bare-node-events',
fs: 'bare-node-fs',
net: 'bare-node-net',
url: 'bare-url'
}
}
const manifestPath = join(
repoRoot,
'packages/bare-os-booter/lib/bare-module-manifest.json'
@@ -141,7 +158,8 @@ export async function buildBareLibs() {
format: 'iife',
globalName: IIFE_GLOBAL,
platform: 'node',
nodePaths: [join(repoRoot, 'node_modules')],
alias: bareDriveBundleNodeBuiltinAliases(),
nodePaths: [booterNodeModules, join(repoRoot, 'node_modules')],
plugins: [bareNativeConditionalImportsPlugin()],
outfile,
footer: { js: footer },