This commit is contained in:
2026-08-18 18:11:28 -04:00
parent 0e9a650fa2
commit bbaf47028f
259 changed files with 0 additions and 0 deletions
@@ -0,0 +1,27 @@
/**
* Standalone pack binding. Must be a **static** import from
* `bare-os-standalone-pack-imports.mjs` / `standalone.mjs` so bare-pack
* rewrites `discord.js` into app.bundle. Do not load this from file:/pear
* checkouts (use vendored bare-discord-js via createRequire).
*/
import discord from 'discord.js'
import { registerPackedDiscordJs } from './bare-os-ctx-discord-registry.js'
function unwrap(mod) {
if (mod && typeof mod.Client === 'function') return mod
const def = mod && mod.default
if (def && typeof def.Client === 'function') return def
return null
}
function applyShims(d) {
if (!d || typeof d !== 'object') return d
const events = d.Events
if (events && events.ClientReady && events.Ready == null) {
events.Ready = events.ClientReady
}
return d
}
export const bareDiscordJs = registerPackedDiscordJs(applyShims(unwrap(discord)))
export default bareDiscordJs