labnol / apps-script-starter

Setup a local development environment inside Visual Studio Code and build Google Workspace add-ons with Google Apps Script
https://www.youtube.com/watch?v=KxdCIbeO4Uk
MIT License
1.1k stars 176 forks source link

How/Where can I add a reference to an existing project? #37

Closed NoSubstitute closed 4 years ago

NoSubstitute commented 4 years ago

Hi, I already have a few projects that I'd like to continue develop using your starter kit. At the end of your video you show how we can deploy to a specific web app.

But can I use clasp pull, or something similar, to grab the current existing code into your starter kit structure? I obviously don't want to create new projects, as some are already used by a lot of people.

labnol commented 4 years ago

You can use npx clasp pull to download the existing project into the local folder.

Also, the .clasp.json file should have a structure like this:

{   
  "scriptId": "<<Script ID>>",  
  "rootDir": "dist" 
}   
NoSubstitute commented 4 years ago

Yeah, I did that, but ran into so many error messages so I thought there was something wrong with that process.

Turns out there are instead too many changes in the starter kit since original publication that your guide doesn't even work anymore.

I think I also need to learn how to disable some of the checks in the starter kit, as it refuses to build code that I have in production, which I know works fine.

labnol commented 4 years ago

Apps Script moved to V8 runtime and the kit was updated to supported V8.

NoSubstitute commented 4 years ago

But, was it necessary to refuse all older code?

Even if I set my code to use V8 runtime, it still works, so it's not really broken. I mean, I have the code running now, and regardless if I have V8 active or not, it runs fine, without errors, in Sheets, and web apps.

The kit also hides most errors, so I can't even see what's wrong, or how to fix it.

Anyway, this still means that your guide on how to use the kit is outdated.