Skip to content

Commit 11827c5

Browse files
nodkzleebyron
authored andcommitted
export flow types in build (without test folders) (#412)
* export flow types in build (without test folders) Another implementation of @nmn PR Flow types very needed to avoid this trash: https://github.com/nodkz/graphql-compose/blob/master/src/definition.js (and graphql-js as git submodule) Also solved @nmn issue #400 FYI `npm run cp-flow` correctly works if sub-folders exist in `dist/` otherwise it prints `No such file or directory`. * Copy source files with `.flow` extension in build proccess * Move from `master` flag `--optional runtime` for build script
1 parent c23f578 commit 11827c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"lint": "eslint src || (printf '\\033[33mTry: \\033[7m npm run lint -- --fix \\033[0m\\n' && exit 1)",
2828
"check": "flow check",
2929
"check-cover": "for file in {src/*.js,src/**/*.js}; do echo $file; flow coverage $file; done",
30-
"build": "babel src --ignore __tests__ --out-dir dist/ && cp package.json dist/",
30+
"build": "babel src --optional runtime --ignore __tests__ --out-dir dist/ && cp package.json dist/ && npm run build-dot-flow",
31+
"build-dot-flow": "find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\\/src\\\//\\\/dist\\\//g'`.flow; done",
3132
"watch": "babel-node ./resources/watch.js",
3233
"cover": "babel-node ./node_modules/.bin/isparta cover --root src --report html _mocha -- $npm_package_options_mocha",
3334
"cover:lcov": "babel-node ./node_modules/.bin/isparta cover --root src --report lcovonly _mocha -- $npm_package_options_mocha",

0 commit comments

Comments
 (0)