Closed jeffp42ker closed 2 years ago
Oh, it's an oversight on this line: https://github.com/jacobobryant/platypub/blob/master/src/com/platypub/netlify.clj#L14. Quick fix is to install zip-it-and-ship-it globally: sudo npm install @netlify/zip-it-and-ship-it -g
.
To avoid the need for a global install, we could include zip-it in themes/default/package.json
and invoke with npx zip-it-and-...
, however that'll make the npm install
at https://github.com/jacobobryant/platypub/blob/master/src/com/platypub/netlify.clj#L13 even slower since it'll have to install every time you publish. Ideal solution is probably to add a package.json file to platypub's root folder and include a one-time npm install
as part of platypub's setup process.
While we're on the topic, that npm install
line linked above should probably be changed to omit dev dependencies, which are only needed for local theme development. That'll speed up publishing. (https://stackoverflow.com/questions/9268259/how-do-you-prevent-install-of-devdependencies-npm-modules-for-node-js-package). Though looks like for the default theme I do have at least one dev dependency that should be a production dependency (@tailwindcss/forms
, https://github.com/jacobobryant/platypub/blob/master/themes.TEMPLATE/default/package.json#L17), so that would need to be fixed as well...
Thanks. As you've indicate, globally installing @netlify/zip-it-and-ship-it solves the issue. It still takes a significant time to publish.
I'm able to successfully "Export" and "Preview" a site as configured, yet when clicking "Publish", after a long pause I'm seeing "Preparing functions..." then after another long pause while npm runs, I'm getting this exception: