GAS files: how to free global space from polution?

45 Views Asked by At

How do I clean up my global space without having to create +1000 lines .gs files

  • Here follows two photos of some of my files/folders. Mind how low the scroll bar can slide (30+ GAS files) ↓

Files and folders used in my project enter image description here

  • In Apps Script, .gs files cannot be manually mixed like .js modules, which means I cannot import or export (right?), neither control what will be shown when you search for completions;
  • If I wrap it around an interface, I usually end up with +1000 lines of code, which made the whole project difficult to read;
function groupOfFunctions() {
    this.doThis = function() { /* hundreds of lines */ };
    this.doThat = function() { /* hundreds of lines */ };
    // ...
    this.subFunc_N = function() { /* hundreds of lines */ };
    return this; // <-- makes tired face after this
};
  • To avoid that, the project's been organized in a way all Functions rest on the global space;
  • New problem: eventually, my global space has gotten heavily poluted with tons of Functions;

enter image description here enter image description here

  • The scenario is: I usually forget what Functions do, or even that they exist (so many times I coded something that was ready, but lost a
  • I've found no Youtube videos, questions in forums or anything like it anywhere on the internet that talks about how to deal with it, so the question is:

How do I clean up my global space without having to create +1000 lines .gs files

Articles, blogs, videos etc. are welcome.

0

There are 0 best solutions below