From fcefac004060204fbf20d6d702110dd6c1230d14 Mon Sep 17 00:00:00 2001 From: Pavel Chertorogov Date: Mon, 29 May 2017 11:51:10 +0600 Subject: [PATCH] Copy `src/**file.js` to `lib/**file.js.flow` for auto-exporting flow annotations Describe classes via `flow-typed` is too lazy and it may stale with time. The moreover types are already in the code. So let export them, like it done in `graphql-js`. Related: https://github.com/graphql/graphql-js/pull/412 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7038eda..463e687 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "main": "lib/EventEmitter.js", "repository": "facebook/emitter", "scripts": { - "build": "gulp build", + "build": "gulp build && npm run build-dot-flow", + "build-dot-flow": "find ./src -name '*.js' -not -path '*/__tests__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib\\//g'`.flow; done", "prepublish": "npm run build", "test": "NODE_ENV=test jest" },