Skip to content

Commit 8365fd1

Browse files
Merge pull request cerebral#287 from cerebral/vscode
Vscode
2 parents fb83a86 + 615903d commit 8365fd1

File tree

6 files changed

+28
-11
lines changed

6 files changed

+28
-11
lines changed

packages/node_modules/overmind-devtools-client/DevtoolBackend.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DevtoolBackend {
7777
this.options.onRelaunch()
7878
break
7979
default:
80-
this.clientSockets[parsedMessage.appName].send(
80+
this.clientSockets[parsedMessage.data.appName].send(
8181
JSON.stringify(parsedMessage.data)
8282
)
8383
}

packages/node_modules/overmind-devtools-client/src/components/Devtools/index.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createElement, FunctionComponent, Fragment } from 'react'
22
import { useOvermind } from '../../overmind'
33
import * as styles from './styles'
44
import * as text from '../../styles/text'
5+
import { colors } from '../../theme'
56
import Input from '../common/Input'
67
import Button from '../common/Button'
78
import Workspace from '../Workspace'
@@ -62,13 +63,29 @@ const Devtools: FunctionComponent = () => {
6263
)
6364
}
6465

65-
let code = `const overmind = createOvermind(config, {
66-
devtools: "localhost:${state.port}",
67-
})`
6866
return state.isConnecting ? (
6967
<div className={styles.wrapper}>
7068
<h1>Waiting for an app to connect to {state.port}...</h1>
71-
<pre className={styles.code}>{code}</pre>
69+
<pre className={styles.code}>
70+
<span style={{ color: colors.purple }}>const</span> overmind ={' '}
71+
{state.port === 3031 ? (
72+
<Fragment>
73+
<span style={{ color: colors.green }}>createOvermind</span>(config)
74+
</Fragment>
75+
) : (
76+
<Fragment>
77+
<span style={{ color: colors.green }}>createOvermind</span>(config,{' '}
78+
{'{'}
79+
{`\n`}
80+
{' '}devtools:{' '}
81+
<span style={{ color: colors.yellow }}>
82+
"localhost:{state.port}"
83+
</span>
84+
{`\n`}
85+
{'}'})
86+
</Fragment>
87+
)}
88+
</pre>
7289
</div>
7390
) : (
7491
<Workspace />

packages/node_modules/overmind-devtools-client/src/components/Devtools/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const input = css({
2727
})
2828

2929
export const code = css({
30-
border: '2px dashed var(--colors-white4)',
30+
borderRadius: 3,
3131
padding: '10px',
32-
background: 'var(--colors-black2)'
32+
background: colors.dark,
3333
})

packages/node_modules/overmind-devtools-client/src/overmind/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const changeNewPortValue: Action<string> = ({ state }, port) => {
5151
export const addConnection: Action = ({ state, effects }) => {
5252
state.error = null
5353
state.isConnecting = true
54-
state.port = state.newPortValue
54+
state.port = Number(state.newPortValue)
5555
state.newPortValue = ''
5656
effects.connector.connect(state.port)
5757
}

packages/node_modules/overmind-devtools-client/src/overmind/state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
type State = {
2323
isConnecting: boolean
2424
error: string
25-
port: string
25+
port: number
2626
apps: Apps
2727
currentAppName: string
2828
newPortValue: string
@@ -48,7 +48,7 @@ const state: State = {
4848
error: null,
4949
showApps: false,
5050
currentAppName: null,
51-
port: '3031',
51+
port: 3031,
5252
apps: {},
5353
newPortValue: '',
5454
currentTab: Tab.State,

packages/node_modules/overmind-devtools-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Overmind Devtools VSCode",
44
"description": "Devtools for Overmind",
55
"publisher": "christianalfoni",
6-
"version": "0.0.3",
6+
"version": "0.0.4",
77
"engines": {
88
"vscode": "^1.35.0"
99
},

0 commit comments

Comments
 (0)