This repository aims at defining how one or more Google Apps Script (GAS) projects can be organized while satisfying the goals below.
- Modern javascript features (Typescript)
- Optional static and infered typing (Typescript)
- Code isolation and reuse (by using Typescript
namespace
statements and project references) - Incremental builds (Typescript 3.4)
- Fine control on how source
*.ts
files get compiled into target*.js
files (i.e. overcome thets2gas
library limitations) - Code pretty printing and linting (Prettier and Tslint)
- clone this repository:
git clone https://github.com/PopGoesTheWza/ts-gas-project-starter.git
- install (globally) the Clasp CLI:
npm install --global @google/clasp
- install local dependencies:
npm install
Several commands are available as NPM scripts: npm run <command>
. The most commonly used are:
build
andbuild-clean
to compile all projectsformat
andlint
to normalise code and check its correctenesspush-all
,push-project1
andpush-project2
to publish the GAS projects