RyanMcG / lein-npm

Manage Node dependencies for CLJS projects
295 stars 43 forks source link

added support for persisting package.json #53

Closed yogthos closed 7 years ago

yogthos commented 7 years ago

Fix #24 Close #35 Close #38

RyanMcG commented 7 years ago

@yogthos Thanks for doing this!

Please do some manual testing this with your own projects. I'll merge when you report back.

yogthos commented 7 years ago

I tested with my projects locally, and it seems to be working as expected. The only time package.json is persisted is when :ephemeral? is set to true explicitly. The ephemeral file appears to generate as well when it's not. So, everything looks good from my end.

RyanMcG commented 7 years ago

Merged in and pushed as 0.7.0-rc1.

Let me know how it goes.

yogthos commented 7 years ago

great thanks

Nipperstick commented 7 years ago

Some runtime environments want to take your .js file(s) and package.json as inputs, then generate the node_modules on your behalf. Is it reasonable to enhance the plugin to generate a permanent package.json as a part of the build, presumably as a different command? ATM I am invoking npm-debug and piping the contents into package.json as a stopgap.

RyanMcG commented 7 years ago

@Nipperstick I don't actively use this project anymore so I may just be out-of-the-loop, but it seems to me that this PR should work for your use-case. Basically any lein npm command will write the package.json. lein npm pprint should print it to stdout, and, if :ephemeral? is truthy, write it to the filesystem without removing it.