https://github.com/battis/gas-lighter
https://github.com/battis/gas-lighter
clasp google-apps-script typescript webpack
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/battis/gas-lighter
- Owner: battis
- License: gpl-3.0
- Created: 2023-01-16T14:39:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-25T18:12:38.000Z (about 1 year ago)
- Last Synced: 2024-04-26T18:48:10.419Z (about 1 year ago)
- Topics: clasp, google-apps-script, typescript, webpack
- Language: TypeScript
- Homepage: https://battis.github.io/gas-lighter/
- Size: 2.01 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @battis/gas-lighter
[](https://badge.fury.io/js/@battis%2Fgas-lighter)
[](https://nodejs.org/api/modules.html#modules-commonjs-modules)## Caution
This is an idiosyncratic collection of add-ons and helpers for writing TypeScript code to be compiled into Google Apps Script. It is under constant evolution and tweaking. My basic approach has been that, whenever I start to see the same slog of boiler plate repetitivity in my GAS scripts, I try to exile it to this library to a) allow myself to write shorter code and b) ensure that my boilerplate is, in fact, consistent.
Use at your own peril. And make pull requests with your own improvements.
-- Seth
## Install
```bash
npm i @battis/gas-lighter
npm i -D npm-run-all
```If installing with `pnpm` a postinstall script will "shamefully" hoist dependencies
If working on an existing Google Apps Script project:
```bash
npx clasp clone [script ID]
```If creating a new project:
```bash
npx clasp create [Script Title]
```In `.claspignore`:
```
**/**
!appsscript.json
!build/*.js
!css/*.html
!js/*.html
!templates/*.html
.git/**
node_modules/**
```In `.gitignore`:
```
/.clasp.json
/build/
```In `tsconfig.json`:
```json
{
"extends": "@battis/gas-lighter/tsconfig.json",
"compilerOptions": {
"outDir": "build"
},
"include": ["src"]
}
```In `webpack.config.js`:
```js
module.exports = require('@battis/gas-lighter/webpack.config')({
root: __dirname
});
```In `package.json`:
```json
{
"scripts": {
"build": "webpack",
"deploy": "run-s deploy:*",
"deploy:build": "npm run build",
"deploy:push": "clasp push"
},
"eslintConfig": {
"extends": "@battis/gas-lighter/.eslintrc.json"
}
}
```## Configuration
Configuration options include, with defaults:
```js
{
root, // absolute path
build: "build", // path relative to root
bundle: "main", // string name
entry: "./src/index.ts" // path relative to webpack.config.js
}
```