Hi there. I’m interested in contributing to chat widget. But now I’m struggling with project building.
I follow the recommendations from here n8n/CONTRIBUTING.md at master · n8n-io/n8n · GitHub but on every machine (Windows and Debian) I’ve got the same result: error - Potential missing package.json files: chat.umd.js, chat.es.js, types/index.d.ts, index.mjs, index.js, style.css
As a result after pnpm run build there is no chat.bundle.es.js ,chat.bundle.umd.js and other working project files in chat widget directory.
Could you help how to build chat widget project properly?
Hey @GDRIVE_ADVAGA! Super happy to hear you want to contribute to the chat widget.
The error you’re seeing when building is expected. We’re running a postbuild script (see packages/@n8n/chat/scripts/postbuild.js) that essentially restructures the output files into a publishing-ready package in the dist folder.
If you look at the .np-config file, the configuration file for np (the publishing tool that we use), you’ll see that the publishing directory is set to dist.
This allows us to publish the @n8n/chat package without the intermediary dist folder, making importing package files cleaner for the end-user. The script was written before the exports field of package.json was fully supported by all build tools.
Last but not least, looking forward to your future contributions. Thank you!