enuchi / React-Google-Apps-Script

This is your boilerplate project for developing React apps inside Google Sheets, Docs, Forms and Slides projects. It's perfect for personal projects and for publishing complex add-ons in the Google Workspace Marketplace.
MIT License
1.34k stars 178 forks source link

Add build in setup command #136

Closed malomarrec closed 2 years ago

malomarrec commented 2 years ago

When using this repo for the first time and following README instructions, users won't have a build dist in the folder. Running nm run setup will fail. Adding npm run build in npm run setup makes it so you can "just follow the README instructions".

enuchi commented 2 years ago

Sure, let me take a look at this. Do you know why setup is failing if there's no dist folder?

enuchi commented 2 years ago

Looking more into this it looks like clasp was updated at some point and now tries to add the .clasp.json file and appscript.json manifest into the rootDir (./dist in this case).

Was able to find a relevant issue described here: https://github.com/google/clasp/issues/869 Relevant code in PR that changed this behavior: https://github.com/google/clasp/pull/865/files#diff-b6d810b0306723c2b160e529addd463ae24be806303358ff1f6a2209bc13357dR108-R114

Thanks for flagging this. Need to think if running build first is the best solution though. May need to just reorganize files and update README.

enuchi commented 2 years ago

I'm going to create a new PR here: https://github.com/enuchi/React-Google-Apps-Script/pull/137

This is somewhat of a workaround and less than ideal, but think it is the least disruptive to the project and allows users to just follow the README steps for setup. It should work now without a dist directory.