Files
zeekayandHanzo Dev 751ef5c778 rename the framework to @hanzo/gui and the loader to @hanzogui/loader
Both old names are owned by a different npm account (artemis-prime), so
publishing them returns 403 — which is how this surfaced: the 8.0.0 run
shipped @hanzogui/logo and @hanzogui/demos depending on [email protected], a
version that cannot be published and therefore does not exist. Those two
were uninstallable.

@hanzo/gui and @hanzogui/* are ours, so the framework now carries the name
it is imported by everywhere downstream, and the loader moves under the
scope we control.

The rewrite is limited to package references. `DEBUG?.startsWith('hanzogui')`
is a log-namespace filter and join(dir, 'hanzogui') is a path — rewriting
either would change behaviour, so both are untouched.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-30 20:23:18 -07:00

62 lines
1.7 KiB
JavaScript

// Learn more https://docs.expo.io/guides/customizing-metro
/**
* @type {import('expo/metro-config').MetroConfig}
*/
const { getDefaultConfig } = require('expo/metro-config')
const config = getDefaultConfig(__dirname, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: true,
})
// Enable Gui and add nice web support with optimizing compiler + CSS extraction
const { withGui } = require('@hanzogui/metro-plugin')
module.exports = withGui(config, {
components: ['@hanzo/gui'],
config: './hanzogui.config.ts',
})
config.resolver.sourceExts.push('mjs')
module.exports = config
// REMOVE THIS (just for hanzogui internal devs to work in monorepo):
console.info(`Starting metro`)
if (process.env.IS_GUI_DEV && __dirname.includes('hanzogui')) {
console.info('🧑‍💻 using monorepo packages')
const fs = require('fs')
const path = require('path')
const projectRoot = __dirname
const monorepoRoot = path.resolve(projectRoot, '../..')
config.watchFolders = [monorepoRoot]
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
]
// have to manually de-deupe
try {
fs.rmSync(path.join(projectRoot, 'node_modules', '@hanzogui'), {
recursive: true,
force: true,
})
} catch {}
// try {
// fs.rmSync(path.join(projectRoot, 'node_modules', 'hanzogui'), {
// recursive: true,
// force: true,
// })
// } catch {}
try {
fs.rmSync(path.join(projectRoot, 'node_modules', 'react'), {
recursive: true,
force: true,
})
} catch {}
try {
fs.rmSync(path.join(projectRoot, 'node_modules', 'react-dom'), {
recursive: true,
force: true,
})
} catch {}
}