CLASP
Chester Wyke April 17, 2023 Updated: April 15, 2025 #miscThings to Remember
Cannon MG3600
PDF Garbled (Fix)
Replit
Anydesk
OBS
Copy Source
CSS Display Reference
CLASP
Firefox Extensions
Discord
Documentation Update
Google Storage
Markdown / HTML Guide
Tera Guide
Zola
PHP
Links
YouTube Reference Videos
Remote Desktop Protocol (RDP)
Wireshark
Chromecast
VNC Ubuntu
VeraCrypt
Today I Learned (TIL)
Controllers
phpMyAdmin
Quotes
Colors
Regex
Resume writing
Projects and Contributions
Presentation Animation Removal
QR Codes
Leetcode
New project setup
- Create New Repo using Git GUI
- Create Scripts project (On Google Scripts, Sheets, etc.)
- Clone Scripts Project into repo folder using clasp
- Copy Hook and .gitignore from template
folder
repos/zTemplates/clasp/CopyContentsToProjectRoot/
or create folder to copy from using this zip file.
Steps if using TypeScript (TS)
This version is was based on the then version of https://developers.google.com/apps-script/guides/typescript which linked out to https://github.com/google/clasp/blob/master/docs/typescript.md but they no longer provide typescript. See excerpt from the github readme below.
Drop typescript support
Clasp no longer transpiles typescript code. For typescript projects, use typescript with a bundler like Rollup to transform code prior to pushing with clasp.
- Add Type definitions for Apps Script
-
Add ts_lib
- Part of wykies
- Outside of wykies
-
(Optional) Use the following command to push and watch the ts files. Watch is not required.
TypeScript Modules, exports and imports
Original Source was: https://github.com/google/clasp/blob/master/docs/typescript.md#the-namespace-statement-workaround but they are dropping typescript support.
Instead of normal imports use the following as import is not supported in GAS
// module.ts
// anyFiles.ts
; // address a namespace's exported content directly
Steps if using Javascript (JS)
- Add js_lib
Converting an existing Javascript (JS) project to TypeScript (TS)
- Copy over from template to update ignore and hooks last step in new
- Remove
js_lib
if in use see removal instructions for submodule - Change all
.js
files to.ts
files - Follow normal instructions from New TS project
Useful Commands
clasp clone <scriptID>
Clone an existing projectclasp pull
Download a script projectclasp push
Upload a script projectclasp open
Open the project in the Apps Script editor
Ignore files
File location
Source: https://github.com/google/clasp#ignore-file-claspignore
Put a .claspignore
in the root of the project’s directory.
All paths are relative to root.
Format
Uses multimatch
*
matches any number of characters, but not /?
matches a single character, but not /**
matches any number of characters, including /, as long as it’s the only thing in a path part{}
allows for a comma-separated list of “or” expressions!
at the beginning of a pattern will negate the match
Example
js_lib/**
Installation
Source: https://developers.google.com/apps-script/guides/clasp#installation
First install Install Node.js