Closed tinybike closed 7 years ago
in case if somebody going to merge this... can we ignore es5 folder for git?
@fanatid I'm not attached at all to this particular way of solving the problem. I'm sure there's a way of doing this that doesn't require putting the es5 source file in the repo. I'm just not so good at compilation/build-system stuff so I don't know how!
hmm @tinybike im not sure this is the best solution either. But I can't propose a better one... not sure what to do here yet
You can .gitignore
the es5
folder but not .npmignore
it. That way when you publish, it publishes the generated files. You can see that in ethereumjs-blockstream, notice that the output
folder is empty. When you compile it will fill that folder and npmpublish will publish its contents (along with the original TS files for source mapping and auto-complete).
That makes sense -- ok, just pushed updated .gitignore and .npmignore. Let me know if this PR needs other changes; I'd like to add this repo back to our normal workflow!
@tinybike you also can pass *
to only flag (in babel), then ethereumjs-tx
and other node_modules will be compiled to es5 on fly
@fanatid Right, as I understand it the issue is that ES5-only repos don't normally have babel as part of their build process. IMO it's a good practice for ES6 libraries to publish ES5 versions so that ES5 projects with ethereumjs-tx as a dependency don't have to include babel in their toolchain just for ethereumjs-tx.
@wanderer Let me know if you'd prefer not to have ES5 code as part of this repo at all -- I can just publish a separate ethereumjs-tx-es5 package on npm.
@tinybike ok i think it looks good now thanks!
@tinybike How do you use this in your project?
I believe this fixes #59 and fixes #53. I have this npm linked locally for the sake of avoiding a special compilation step for ethereumjs-tx in our dependent repos. Sending this PR in case it can be helpful to others.