claudiajs / claudia

Deploy Node.js projects to AWS Lambda and API Gateway easily
https://claudiajs.com
MIT License
3.8k stars 274 forks source link

Claudia Pack not including all files #191

Closed jlarmstrongiv closed 5 years ago

jlarmstrongiv commented 5 years ago

claudia pack: Packages node_modules, even those symlinked with npm link, into the zip.

claudia pack: Only packages some files symlinked with npm link into the zip.

Specifically, I ran npm link inside apollo-server-agnostic and then ran npm link apollo-server-agnostic inside my example project.

Attached are the results from running claudia pack and npm pack. For some reason, claudia pack only includes the out/indexjs file, without out/ApolloServer.js and out/lambdaApollo.js. Links to github and npm.

If there’s not enough details to reproduce the issue, just close it. I ended up publishing the package to npm, which worked.

claudia-pack-apollo-server-agnostic.zip npm-pack-apollo-server-agnostic-0.0.0.tgz.zip (had to compress it into a zip, since GitHub doesn’t allow tgz)

gojko commented 5 years ago

you seem to have a .npmignore (https://github.com/jlarmstrongiv/apollo-server-agnostic/blob/master/.npmignore) that probably causes the issue. claudia does npm pack to grab the source files, and npm pack is likely excluding those files. try running npm pack in the dependent project directly and see if it packs those files. if not, you'll need to modify .npmignore and/or .gitignore to pack it

check out https://claudiajs.com/tutorials/packaging.html for more info on how claudia includes files

gojko commented 5 years ago

on a related note, use npm local dependencies (file:) with a relative path instead of npm link, this will make sure claudia is packing the dependent project from the right directory on your disk. then you do not have to use npm links