mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-30 06:05:14 +00:00
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]>
62 lines
1.7 KiB
JavaScript
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 {}
|
|
}
|