Skip to content

jerrywdlee/typescript-gas-scaffold

Repository files navigation

GAS Typescript Scaffold

clasp

About

This is a scaffold for writing Google Apps Script in TypeScript and building with webpack.
Japanese README

Requirements

  • Git
  • Node.js 8.10.0 or higher

Install & Initiation

Clone Repo

$ git clone https://github.com/jerrywdlee/typescript-gas-scaffold.git <YOUR-NEW-REPO-NAME>
$ cd <YOUR-NEW-REPO-NAME>

Install packages

$ npm i

Init Project

$ npm run reset
# It will delete exist .git folder and run git init

Usage

Development

If you watnt to use watch mode,

$ npm run watch

Do Dev

Edit code in src/app.ts (and/or other codes in /src), then enjoy it ;)

Deploy by Google Clasp

May Need Enable the Apps Script API at https://script.google.com/home/usersettings

Login

$ npm run clasp login
# OR
$ cd build/ && $(npm bin)/clasp login

Clone

Change code.gs (or other name) generated automatically to bundle.gs

$ npm run clasp clone <scriptId>
# OR
$ cd build/ && $(npm bin)/clasp clone <scriptId>

Pull

$ npm run clasp pull
# OR
$ cd build/ && $(npm bin)/clasp pull

Push

Need Do Clone and Pull first!
May need refresh work space to show change

$ npm run push
# OR
$ npm run clasp push
# OR
$ cd build/ && $(npm bin)/clasp push

Watch & Push

If Clasp is configed, run npm run watch:push will be faster.

Notice

  • If want connect to Spreadsheets ect. Need run on dev console first and apply permission
  • If want update your REST API, need update web app setting after deploy your app

Reference

Google Clasp.
Reffered From Here.
node-google-apps-script.

About

A scaffold for writing Google Apps Script in TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published