Skip to content

Commit a0ed8aa

Browse files
Merge pull request cerebral#5 from cerebral/devtools
feat(overmind): all pieces working, time to get to work
2 parents aef0cfb + 57c4e83 commit a0ed8aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+7502
-6333
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"overrides": [
2525
{
26-
"files": ["*.ts"],
26+
"files": ["*.ts", "*.tsx"],
2727
"parser": "typescript-eslint-parser",
2828
"plugins": ["typescript"],
2929
"rules": {

package-lock.json

Lines changed: 4643 additions & 5543 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@
2424
"dependencies": {
2525
"@types/node": "10.5.1",
2626
"eventemitter3": "3.1.0",
27-
"tslib": "1.9.3",
2827
"electron": "2.0.4",
29-
"is-plain-object": "2.0.4"
28+
"is-plain-object": "2.0.4",
29+
"electron-json-storage": "4.1.0",
30+
"react": "16.4.1",
31+
"react-dom": "16.4.1",
32+
"styled-components": "3.3.3",
33+
"ws": "5.2.1",
34+
"color": "3.0.0",
35+
"tslib": "1.9.3"
3036
},
3137
"devDependencies": {
3238
"@types/jest": "23.1.4",
39+
"@types/react": "16.4.6",
40+
"@types/react-dom": "16.0.6",
3341
"commitizen": "^2.10.1",
3442
"concurrently": "^3.6.0",
3543
"cz-customizable": "^5.2.0",
3644
"cz-customizable-ghooks": "^1.5.0",
37-
"dts-bundle": "0.7.3",
3845
"eslint": "^5.0.1",
3946
"eslint-config-prettier": "^2.9.0",
4047
"eslint-config-standard": "^11.0.0",
@@ -46,25 +53,23 @@
4653
"eslint-plugin-react": "^7.10.0",
4754
"eslint-plugin-standard": "^3.1.0",
4855
"eslint-plugin-typescript": "^0.12.0",
56+
"html-webpack-plugin": "^3.2.0",
4957
"husky": "^0.14.3",
5058
"jest": "23.3.0",
5159
"lint-staged": "^7.2.0",
52-
"parcel-bundler": "^1.9.4",
53-
"pascal-case": "2.0.1",
5460
"prettier": "1.13.7",
61+
"react": "16.4.1",
5562
"react-test-renderer": "16.4.1",
5663
"repo-cooker": "^6.2.2",
5764
"rimraf": "2.6.2",
58-
"rollup": "0.62.0",
59-
"rollup-plugin-commonjs": "9.1.3",
60-
"rollup-plugin-node-builtins": "2.1.2",
61-
"rollup-plugin-node-globals": "1.2.1",
62-
"rollup-plugin-node-resolve": "3.3.0",
63-
"rollup-plugin-sourcemaps": "0.4.2",
64-
"rollup-plugin-uglify": "4.0.0",
6565
"ts-jest": "23.0.0",
66+
"ts-loader": "4.4.2",
67+
"tslib": "1.9.3",
6668
"typescript": "2.9.2",
67-
"typescript-eslint-parser": "^16.0.1"
69+
"typescript-eslint-parser": "^16.0.1",
70+
"webpack": "4.15.1",
71+
"webpack-cli": "3.0.8",
72+
"webpack-dev-server": "^3.1.4"
6873
},
6974
"lint-staged": {
7075
"*.{js,ts,tsx}": [
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
collectCoverage: true,
3+
collectCoverageFrom: ['src/**/*.{t,j}s?(x)', '!src/**/*.d.ts'],
4+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
5+
transform: {
6+
'^.+\\.tsx?$': 'ts-jest',
7+
},
8+
testRegex: '\\.test\\.tsx?$',
9+
testPathIgnorePatterns: [
10+
'/dist/',
11+
'/es/',
12+
'/lib/',
13+
'<rootDir>/node_modules/',
14+
],
15+
transformIgnorePatterns: ['<rootDir>/node_modules/'],
16+
coveragePathIgnorePatterns: ['<rootDir>/node_modules/'],
17+
haste: {
18+
// This option is needed or else globbing ignores <rootDir>/node_modules.
19+
providesModuleNodeModules: ['overmind-devtools'],
20+
},
21+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "todomvc",
3+
"version": "1.0.0-alpha1",
4+
"description": "Overmind todomvc demo",
5+
"author": "Christian Alfoni <[email protected]>",
6+
"license": "MIT",
7+
"repository": "git+https://github.com/cerebral/overmind.git",
8+
"scripts": {
9+
"start": "webpack-dev-server --port 4000",
10+
"typecheck": "tsc --noEmit",
11+
"prepare": "npm run build",
12+
"posttest": "npm run typecheck"
13+
},
14+
"keywords": [
15+
"overmind",
16+
"demo"
17+
],
18+
"dependencies": {
19+
"@types/node": "^10.5.1",
20+
"overmind": "next",
21+
"color": "^3.0.0",
22+
"react": "^16.4.1",
23+
"react-dom": "^16.4.1",
24+
"styled-components": "^3.3.3"
25+
},
26+
"devDependencies": {
27+
"@types/react": "^16.4.6",
28+
"@types/react-dom": "^16.0.6",
29+
"ts-loader": "^4.4.2",
30+
"tslib": "^1.9.3",
31+
"typescript": "^2.9.2",
32+
"webpack": "^4.15.1",
33+
"webpack-cli": "^3.0.8"
34+
}
35+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as React from 'react'
2+
import { Action } from './'
3+
4+
export default (action: Action) => ({
5+
changeNewTodoTitle: action<React.ChangeEvent<HTMLInputElement>>()
6+
.map((event) => event.currentTarget.value)
7+
.mutation((value, state) => (state.newTodoTitle = value)),
8+
})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import App, { TConnect, TContext, IAction } from 'overmind/react'
2+
import * as providers from './providers'
3+
import actions from './actions'
4+
import state from './state'
5+
6+
export type Context = TContext<typeof state, typeof providers>
7+
8+
export type Action = IAction<typeof state, Context>
9+
10+
const app = new App(
11+
{
12+
state,
13+
actions,
14+
providers,
15+
},
16+
{
17+
devtools: 'localhost:1234',
18+
}
19+
)
20+
21+
export type Connect = TConnect<typeof app.state, typeof app.actions>
22+
23+
export const connect = app.connect.bind(app)
24+
25+
export default app
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const foo = {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export type Todo = {
2+
title: string
3+
completed: boolean
4+
}
5+
6+
export type State = {
7+
todos: Todo[]
8+
newTodoTitle: string
9+
}
10+
11+
const state: State = {
12+
todos: [],
13+
newTodoTitle: '',
14+
}
15+
16+
export default state
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import styled from '../../styled-components'
2+
3+
export const Wrapper = styled.div`
4+
display: flex;
5+
justify-content: center;
6+
align-items: center;
7+
`

0 commit comments

Comments
 (0)