Hi, I was trying to clone the react-dates from github to modify as my own personal customization (support time format), but I have problem installing the module to use it the same as before (npm install react-dates). Do you guys have any idea how should I do install it in my own project?
There's a build process; it can't be consumed from github unless you commit the build output.
How do I achieve that? Is it possible?
@dopt you could remove the lib folder from the .gitignore in your own package.
@majapw I can use it like your way as extra components, rather than module, but that would required lots of new package to be install (stated in react-dates->package.json file), nevertheless this is one of the way if I cannot build the customized version as a module/library. Let me think about it, thanks.
@ljharb how do we build the local module, so that it behaves like a npm package?
You certainly can't use react-dates without all of the dependencies in package.json.
@ljharb let's say I have 2 projects now, I have install all the dependencies in "react-dates" project (that I customized) + running, and I have another project named "playground", can I just directly use the react dates in my "playround" project, without install the dependencies, but only "react-dates"?
p/s: the reason why I ask such a favor, is to keep the package.json in my "playground" project clean and clear.
No. You'd have to add react-dates as a dependency (or your fork of react-dates), and install it and all of its transitive dependencies.
react-dates' dependencies are required for it to work - that's why they're dependencies :-)
@ljharb can I as a regular user, possible to publish/build my "react-dates" as local/online npm instead to make this work?
Sure. You can publish it under your own scope, or you can publish to a private registry, but the easiest is probably to do https://github.com/airbnb/react-dates/issues/1250#issuecomment-403534998 and consume it from your git repo.
My decision is to build the wrapper on top on the existing library instead to support the datetime range format, using html/css tricks. I guess this makes the maintenance/deployment work simpler.
Thank you all for the responses.