gasup v0.4.4
Gasup
Gasup is a command-line interface (CLI) tool designed to simplify the process.
- building
- bundling
- pushing
- deploying
- change development, staging, production
It offers an easy way to automate tasks and manage your deployments without the need to manually interact with the Apps Script dashboard.
Installation
To get started with gasup, you need clasp first.
Then you can install gasup like below.
npm i -D gasupUsage
Build
Simple build.
gasup --buildThis command compiles your code with tsc.
Bundle
Bundle with esbuild into one file.
gasup --bundleThis allows you to use libraries that are not natively available in Google Apps Script.
Push
Simply push using "clasp push".
gasup --pushDeploy
Deploy to the latest deployment. If no previous deployments exist, a new deployment will be created.
gasup --deployappsscript.json affects deployment. Be sure to check your appsscript.json.
If you want to deploy webapp, appsscript is like below.
{
"webapp": {
"executeAs": "USER_DEPLOYING",
"access": "ANYONE_ANONYMOUS"
}
}Change Environment
If you need to switch between different environments (e.g., development, staging, production), you can use the --env flag to modify the appsscript.json file accordingly.
gasup --env <envpath>Environment file details:
GASUP_SCRIPT_ID=xxx
GASUP_PARENT_ID=yyy,zzzChain
Chan command is available like below.
gasup --env .env.production --bundle --push --deployConfig
The config file will below.
// gasup.config.ts
import { Config } from 'gasup';
const config:Config = {
srcDir: './src';
}
export default config;export interface Config {
appsScriptJsonPath?: string;
bundleEntries?: string[];
bundleOutfile?: string;
srcDir?: string;
distDir?: string;
}License
MIT