Skip to content

Commit e8dbe8c

Browse files
feat(overmind): all pieces working, time to get to work
1 parent aef0cfb commit e8dbe8c

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

+6221
-5081
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: 3362 additions & 4292 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,22 @@
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"
3034
},
3135
"devDependencies": {
3236
"@types/jest": "23.1.4",
37+
"@types/react": "16.4.6",
38+
"@types/react-dom": "16.0.6",
3339
"commitizen": "^2.10.1",
3440
"concurrently": "^3.6.0",
3541
"cz-customizable": "^5.2.0",
3642
"cz-customizable-ghooks": "^1.5.0",
37-
"dts-bundle": "0.7.3",
3843
"eslint": "^5.0.1",
3944
"eslint-config-prettier": "^2.9.0",
4045
"eslint-config-standard": "^11.0.0",
@@ -46,25 +51,23 @@
4651
"eslint-plugin-react": "^7.10.0",
4752
"eslint-plugin-standard": "^3.1.0",
4853
"eslint-plugin-typescript": "^0.12.0",
54+
"html-webpack-plugin": "^3.2.0",
4955
"husky": "^0.14.3",
5056
"jest": "23.3.0",
5157
"lint-staged": "^7.2.0",
52-
"parcel-bundler": "^1.9.4",
53-
"pascal-case": "2.0.1",
5458
"prettier": "1.13.7",
59+
"react": "16.4.1",
5560
"react-test-renderer": "16.4.1",
5661
"repo-cooker": "^6.2.2",
5762
"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",
6563
"ts-jest": "23.0.0",
64+
"ts-loader": "^4.4.2",
65+
"tslib": "^1.9.3",
6666
"typescript": "2.9.2",
67-
"typescript-eslint-parser": "^16.0.1"
67+
"typescript-eslint-parser": "^16.0.1",
68+
"webpack": "^4.15.1",
69+
"webpack-cli": "^3.0.8",
70+
"webpack-dev-server": "^3.1.4"
6871
},
6972
"lint-staged": {
7073
"*.{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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
"bin": {
9+
"overmind-devtools": "bin.js"
10+
},
11+
"scripts": {
12+
"start": "webpack-dev-server --port 4000",
13+
"typecheck": "tsc --noEmit",
14+
"test": "jest",
15+
"test:watch": "jest --watch --updateSnapshot --coverage false",
16+
"prepare": "npm run build",
17+
"posttest": "npm run typecheck"
18+
},
19+
"keywords": [
20+
"overmind",
21+
"devtool"
22+
],
23+
"dependencies": {
24+
"@types/node": "^10.5.1",
25+
"overmind": "next",
26+
"color": "^3.0.0",
27+
"react": "^16.4.1",
28+
"react-dom": "^16.4.1",
29+
"styled-components": "^3.3.3"
30+
},
31+
"devDependencies": {
32+
"@types/jest": "^23.1.4",
33+
"@types/react": "^16.4.6",
34+
"@types/react-dom": "^16.0.6",
35+
"jest": "^23.3.0",
36+
"ts-jest": "^23.0.0",
37+
"ts-loader": "^4.4.2",
38+
"tslib": "^1.9.3",
39+
"typescript": "^2.9.2",
40+
"webpack": "^4.15.1",
41+
"webpack-cli": "^3.0.8"
42+
}
43+
}
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+
.mutate((state, value) => (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)