-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3944a69
commit e04eff5
Showing
13 changed files
with
58 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import GameMeta from './types/GameMeta' | ||
import { dirname, normalize } from 'path' | ||
|
||
const gamesContext = require.context('./games', true, /meta\.ts/) | ||
|
||
const games = new Map<string, GameMeta>(gamesContext.keys().map(k => [ | ||
normalize(dirname(k)), | ||
gamesContext(k).default | ||
])) | ||
const games = import.meta.glob<GameMeta>('./games/*/meta.ts', { eager: true, import: 'default' }) | ||
|
||
export default games |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import * as React from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import IndexPage from './IndexPage' | ||
import light from './light.lazy.css' | ||
import dark from './dark.lazy.css' | ||
import light from 'antd/dist/antd.css?raw' | ||
import dark from 'antd/dist/antd.dark.css?raw' | ||
import { DefaultThemes } from 'mobx-theme' | ||
import LazyCss from './LazyCss' | ||
import { autorunCleanup } from 'mobx-autorun-cleanup' | ||
import theme from './theme' | ||
import never from 'never' | ||
import { autorun } from 'mobx' | ||
|
||
const themes: Record<DefaultThemes, LazyCss> = { light, dark } | ||
const themes: Record<DefaultThemes, string> = { light, dark } | ||
|
||
createRoot(document.getElementById('app') ?? never()).render(<IndexPage />) | ||
|
||
autorunCleanup(() => { | ||
const themeStyleElement = document.createElement('style') | ||
document.head.appendChild(themeStyleElement) | ||
autorun(() => { | ||
const currentTheme = theme.theme | ||
themes[currentTheme].use() | ||
return () => themes[currentTheme].unuse() | ||
themeStyleElement.innerText = themes[currentTheme] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import 'vite/client' | ||
|
||
interface LazyCss { | ||
use: () => void | ||
unuse: () => void | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export type { default as Db } from './Db' | ||
export { default as openDb } from './openDb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import react from '@vitejs/plugin-react' | ||
|
||
/** @type {import('vite').UserConfig} */ | ||
const config = { | ||
resolve: { | ||
alias: { | ||
assert: require.resolve('assert-browserify') | ||
} | ||
}, | ||
define: { | ||
process: require('process/browser'), | ||
global: 'globalThis' | ||
}, | ||
plugins: [react()], | ||
build: { | ||
sourcemap: true | ||
} | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters