gas-bun
v0.1.2
Published
Modern build tool for Google Apps Script development with Bun
Maintainers
Readme
gas-bun
Modern build tool for Google Apps Script development with Bun
Features
- 🚀 Fast builds with Bun
- 📦 TypeScript support out of the box
- 🔄 Automatic export to global functions
- 🛠️ Project scaffolding CLI
- 📝 Type-safe development with
@types/google-apps-script
Installation
# Create new project
bunx gas-bun create
# Or add to existing project
bun add -d gas-bunUsage
Create New Project
bunx gas-bun createThis will:
- Prompt for project name
- Copy template files
- Install dependencies
- Build the project
- Optionally create Apps Script project with clasp
Available Commands
# Build TypeScript to GAS
bunx gas-bun build
# Push code to Apps Script
bunx gas-bun push
# Deploy to Apps Script
bunx gas-bun deploy
# Open project in browser
bunx gas-bun openHow It Works
TypeScript to GAS Conversion
Input (index.ts):
function myFunction() {
Logger.log('Hello via Bun!');
}
export { myFunction };Output (dist/Code.gs):
function myFunction() {
Logger.log('Hello via Bun!');
}Project Structure
your-project/
├── index.ts # Entry point
├── public/
│ └── appsscript.json # GAS configuration
├── dist/
│ ├── Code.gs # Built output
│ └── appsscript.json # Copied configuration
├── package.json
└── tsconfig.jsonAPI
buildGAS(options)
Build TypeScript code for Google Apps Script.
import { buildGAS } from 'gas-bun';
await buildGAS({
srcDir: '.',
distDir: './dist',
publicDir: './public',
entryFile: './index.ts',
outputFile: './dist/Code.gs',
packageJsonPath: './package.json',
minify: false,
});Options
| Option | Type | Description |
| ----------------- | --------- | ------------------------------------ |
| srcDir | string | Source directory |
| distDir | string | Output directory |
| publicDir | string | Public assets directory (optional) |
| entryFile | string | Entry point file |
| outputFile | string | Output file path |
| packageJsonPath | string | Path to package.json |
| minify | boolean | Enable minification (default: false) |
Requirements
Contributing
See CONTRIBUTING.md for development guidelines.
License
MIT
