Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #9 from akameco/pr/s2s-babel-flow-types
Browse files Browse the repository at this point in the history
Add s2s-babel-flow-types
  • Loading branch information
akameco committed Oct 3, 2017
2 parents 4bca27d + d217dc8 commit 434a8d4
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 114 deletions.
1 change: 1 addition & 0 deletions packages/babel-plugin-s2s-action-creater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"main": "lib/index.js",
"files": ["lib"],
"dependencies": {
"s2s-babel-flow-types": "^0.0.0",
"babel-add-flow-comments": "^0.2.0",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-template": "^6.26.0",
Expand Down
20 changes: 1 addition & 19 deletions packages/babel-plugin-s2s-action-creater/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@ import snakeCase from 'lodash.snakecase'
import camelCase from 'lodash.camelcase'
import { removeFlowComment, addFlowComment } from 'babel-add-flow-comments'
// import blog from 'babel-log'

type Node = {
type: string,
[key: string]: any
}

type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}

type File = Object

type State = {
opts: Object,
file: File
}
import type { Path, State } from 's2s-babel-flow-types'

const constantCase = (str: string) => snakeCase(str).toUpperCase()

Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-s2s-action-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"main": "lib/index.js",
"files": ["lib"],
"dependencies": {
"s2s-babel-flow-types": "^0.0.0",
"babel-add-flow-comments": "^0.2.0",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-template": "^6.26.0",
Expand Down
20 changes: 1 addition & 19 deletions packages/babel-plugin-s2s-action-root/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,7 @@ import { removeFlowComment, addFlowComment } from 'babel-add-flow-comments'
import globby from 'globby'
import slash from 'slash'
import upperCamelCase from 'uppercamelcase'

type Node = {
type: string,
[key: string]: any
}

type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}

type File = Object

type State = {
opts: Object,
file: File
}
import type { Path, State } from 's2s-babel-flow-types'

const babylonOpts = { sourceType: 'module', plugins: ['flow'] }

Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-s2s-action-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"main": "lib/index.js",
"files": ["lib"],
"dependencies": {
"s2s-babel-flow-types": "^0.0.0",
"babel-add-flow-comments": "^0.2.0",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-template": "^6.26.0",
Expand Down
20 changes: 1 addition & 19 deletions packages/babel-plugin-s2s-action-types/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,9 @@ import * as t from 'babel-types'
import template from 'babel-template'
import snakeCase from 'lodash.snakecase'
import { removeFlowComment, addFlowComment } from 'babel-add-flow-comments'
import type { Path, State, File } from 's2s-babel-flow-types'
// import blog from 'babel-log'

type Node = {
type: string,
[key: string]: any
}

type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}

type File = Object

type State = {
opts: Object,
file: File
}

const constantCase = (str: string) => snakeCase(str).toUpperCase()

const babylonOpts = { sourceType: 'module', plugins: ['flow'] }
Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-s2s-reducer-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"main": "lib/index.js",
"files": ["lib"],
"dependencies": {
"s2s-babel-flow-types": "^0.0.0",
"babel-add-flow-comments": "^0.2.0",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-template": "^6.26.0",
Expand Down
20 changes: 1 addition & 19 deletions packages/babel-plugin-s2s-reducer-root/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@ import { removeFlowComment, addFlowComment } from 'babel-add-flow-comments'
import globby from 'globby'
import slash from 'slash'
import upperCamelCase from 'uppercamelcase'

type Node = {
type: string,
[key: string]: any
}

type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}

type File = Object

type State = {
opts: Object,
file: File
}
import type { Path, State } from 's2s-babel-flow-types'

const wrapTemp = (tmpl: string) =>
template(tmpl, { sourceType: 'module', plugins: ['flow'] })
Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-s2s-reducer-test-case/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"babel-template": "^6.26.0",
"babel-types": "^6.26.0",
"camelcase": "^4.1.0",
"s2s-babel-flow-types": "^0.0.0",
"s2s-helper-get-initial-state": "^0.1.0",
"s2s-helper-get-reducer-case": "^0.1.1"
}
Expand Down
20 changes: 1 addition & 19 deletions packages/babel-plugin-s2s-reducer-test-case/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,7 @@ import getInitialStae from 's2s-helper-get-initial-state'
// import blog from 'babel-log'

/* ::
type Node = {
type: string,
[key: string | number]: any
}
type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}
type Opts = {
from: string
}
type State = {
opts: Opts
}
import type {Path, State} from 's2s-babel-flow-types'
*/

const babylonOpts = { sourceType: 'module', plugins: ['flow'] }
Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-s2s-state-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"main": "lib/index.js",
"files": ["lib"],
"dependencies": {
"s2s-babel-flow-types": "^0.0.0",
"babel-add-flow-comments": "^0.2.0",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-template": "^6.26.0",
Expand Down
20 changes: 1 addition & 19 deletions packages/babel-plugin-s2s-state-root/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@ import { removeFlowComment, addFlowComment } from 'babel-add-flow-comments'
import globby from 'globby'
import slash from 'slash'
import upperCamelCase from 'uppercamelcase'

type Node = {
type: string,
[key: string]: any
}

type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}

type File = Object

type State = {
opts: Object,
file: File
}
import type { Path, State } from 's2s-babel-flow-types'

const wrapTemp = (tmpl: string) =>
template(tmpl, { sourceType: 'module', plugins: ['flow'] })
Expand Down
22 changes: 22 additions & 0 deletions packages/s2s-babel-flow-types/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @flow
/* ::
export type Node = {
type: string,
[key: string | number]: any
}
export type Path = {
type: string,
node: Node,
[key: string]: any,
get(key: string): Node
}
export type File = Object
export type State = {
opts: Object,
file: File
}
*/
17 changes: 17 additions & 0 deletions packages/s2s-babel-flow-types/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "s2s-babel-flow-types",
"version": "0.0.0",
"description": "Flow types for s2s plugins",
"license": "MIT",
"repository": "akameco/s2s-plugins",
"author": {
"name": "akameco",
"email": "akameco.t@gmail.com",
"url": "akameco.github.io"
},
"engines": {
"node": ">=4"
},
"main": "index.js",
"files": ["index.js"]
}

0 comments on commit 434a8d4

Please sign in to comment.