File size: 796 Bytes
4d70170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import './assets/style/index.styl'
import './assets/style/index.postcss'

import type { Shell } from '@vue-devtools/shared-utils'
import { initStorage } from '@vue-devtools/shared-utils'
import { connectApp, createApp } from './app'
import { setAppConnected } from './features/connection'
import { getBridge } from './features/bridge'

export { setAppConnected } from './features/connection'

/**
 * Create the main devtools app. Expects to be called with a shell interface
 * which implements a connect method.
 */
export async function initDevTools(shell: Shell) {
  await initStorage()
  const app = createApp()
  app.mount('#app')
  connectApp(app, shell)
  shell.onReload(() => {
    setAppConnected(false, true, true)
    getBridge()?.removeAllListeners()
    connectApp(app, shell)
  })
}