enso/app/gui2/e2e/main.ts
Adam Obuchowicz ee381369b0
Remove vite-plugin-top-level-await plugin (#9038)
We've used the vite-plugin-top-level-await to support top level await. But most of them were removed anyway, because the ide-desktop/lib/client is bundled as CJS and use some of gui2 code. And the plugin [is causing problems](https://github.com/Menci/vite-plugin-top-level-await/issues/25), [also in our CI](https://github.com/enso-org/enso/actions/runs/7842841953/job/21402194728?pr=9013#step:8:458)
2024-02-14 09:42:37 +00:00

60 lines
1.5 KiB
TypeScript

import 'enso-dashboard/src/tailwind.css'
import { createPinia } from 'pinia'
import { initializeFFI } from 'shared/ast/ffi'
import { createApp, ref } from 'vue'
import { mockDataHandler, mockLSHandler } from '../mock/engine'
import '../src/assets/base.css'
import { provideGuiConfig } from '../src/providers/guiConfig'
import { provideVisualizationConfig } from '../src/providers/visualizationConfig'
import { Vec2 } from '../src/util/data/vec2'
import { MockTransport, MockWebSocket } from '../src/util/net'
import MockApp from './MockApp.vue'
MockTransport.addMock('engine', mockLSHandler)
MockWebSocket.addMock('data', mockDataHandler)
const app = createApp(MockApp)
app.use(createPinia())
provideGuiConfig._mock(
ref({
startup: {
project: 'Mock',
displayedProjectName: 'Mock Project',
},
engine: { rpcUrl: 'mock://engine', dataUrl: 'mock://data' },
}),
app,
)
// Required for visualization stories.
provideVisualizationConfig._mock(
{
fullscreen: false,
width: 200,
height: 150,
hide() {},
isCircularMenuVisible: false,
nodeSize: new Vec2(200, 150),
currentType: {
module: { kind: 'Builtin' },
name: 'Current Type',
},
types: [
{
module: { kind: 'Builtin' },
name: 'Example',
},
{
module: { kind: 'Builtin' },
name: 'Types',
},
{
module: { kind: 'Builtin' },
name: 'Here',
},
],
updateType() {},
},
app,
)
initializeFFI().then(() => app.mount('#app'))