What are peoples thoughts on keeping package-lock....
# dev-ops
d
What are peoples thoughts on keeping package-lock.json in your repo?
s
I think that should be checked in.
d
ya, i read that a lot. the merge conflicts it causes sometimes though
s
if it's causing merge conflicts then it's helping you out.
if you didn't commit it, you'd have different versions of things silently being used and silently ignored when you merged.
d
Maybe I'm naive, but doesn't the package.json keep that inline?
s
I think the link above explains the purpose well enough?
perhaps put another way, package.json is the top level, package-lock.json is the detail.
d
Ya, I've read it all ... was getting some community feedback
s
it's likely less critical in NS work depending on how you're using NPM I suppose.
j
We keep ours in our Repo, but I'm not sure if that's the best practice.. We are still in the early stages of setting up our workflow.
s
it is definitely best practice imho
j
@stalbert thanks for sharing the NPM docs. I'll definitely check it out.
m
It's definitely best practice in general, but for NetSuite specifically node dependencies would almost always be dev dependencies. At worst version discrepancies would break the build but not actual scripts
s
I use node modules in actual scripts
m
Do you have a build process that copies from node_modules to file cabinet directory?
s
no, but I certainly could. since sometimes I have to edit the node source to be NS compatible.... but it's good to know exactly where the original source came from
I hope that NS devs can use node modules more often over time - think of all the many thousands of libs it represents
m
If you are copying manually then you don't really have a concern of version updates breaking things
I played around with webpack at some point to be able to do this https://github.com/michoelchaikin/netsuite-webpack
👏 1
I have heard that NetSuite is working on a supported way to import npm modules directly
💯 1
netsuite halo 1
s
if they would just support native JS modules I'd be happy