Closed ryyppy closed 8 years ago
Solves issue #5
@oskarcieslik take a look ;)
@zzarcon checking :)
Hi @ryyppy! I checked this PR and my thoughts are:
"//eslint-disable-line"
comments from files and instead use solutions I proposed or if you have your own idea how to solve it, I'd love to hear it :)gh-emoji.js.flow
shouldn't go into dist
folder since it's only for transpiled / minified .js code to be used in browser by putting it in tag. Instead please create folder lib
/ src
and put it there. (Maybe we should create flow
sub-folder for flow interfaces, declarations, etc?)types-test.js
is supposed to do, can you explain it to me? :)Thanks @ryyppy :)
Cool, thanks for the instant review :-)
So for your points:
//eslint-disable-line
and will rename it to emojiMap
dist/gh-emoji.js.flow
... but if we set dist/gh-emoji.js
as main, we need to make sure the js.flow
file is in the same directory, otherwise flowtype
won't pick up the definitions... I have two proposals how we could settle this:
cp src/gh-emoji.js.flow dist
in the dist script (probably the best solution for now)types-test.js
is basically a test file you can open, just to see if flowtype picks up the js.flow
definitions correctly... this will be important for tests in the flow-typed projectLet me know what you think!
+1 for the eslint
and for adding cp src/gh-emoji.js.flow
into the dist
npm script.
Should be ready to merge after those changes :muscle:
I think cp src/gh-emoji.js.flow dist
is fine! :) How about having two directories bin
and dist
, where:
dist
will be for user who wants to manually download script and put it in script tagbin
will be for npm's starting pointThis way we can cp src/gh-emoji.js.flow bin
and user will not be confused about .flow
file in dist
By separating js.flow
files into another directory, this will force flowtype users to add another [lib]
path to their .flowconfig
.
So they end up with another installation step (e.g. with following .flowconfig
):
[lib]
interfaces/
node_modules/gh-emoji/bin/gh-emoji.js.flow
Do you think this is a huge problem for webdevs to deal with this extra files? Usually you also pack stuff into dist
like .js.map
or .min.js
and they cherry pick stuff either via bower or via node? :-)
Yeah, you're right :)
To summarize and make this PR work I need to do following:
//eslint-disable-line
stuffflow.js
into a directory called definitions
cp definitions/gh-emoji.js.flow dist
to thedist
commandflow check gh-emoji.js
to the dist
commandYes, that's right :)
@ryyppy looks good for me 👍
same here :)
See commit messages for more info