google / aside

🚀 Apps Script development with formatting, linting, testing and more!
Apache License 2.0
328 stars 5 forks source link
apps-script typescript

Apps Script in IDE (ASIDE)

NPM Version GitHub Action: CI Code Style: Google

Overview

Apps Script in IDE (ASIDE) supports modern, robust and scalable Apps Script development by providing a framework for a local coding environment capable of formatting, linting, testing and much more.

Here are the main features:

Getting Started

The simplest way to get started is:

npx @google/aside init

What it does

After running the init command above, ASIDE will go ahead and do the following:

Options

You can provide the init command with some convenience options:

Troubleshooting

Unknown token 'export'

While bundling generally resolves all exports and imports it keeps exports in the entrypoint causing clasp to fail pushing. This can be an issue for example if you're trying to export functions from index.ts for testing.

The recommended approach is to use the entrypoint (index.ts) only to expose global functions to Apps Script while importing all business logic from separate modules.

Module not included in bundle

Bundling includes treeshaking of unused files to keep the bundle size as small as possible. If any of your modules contain only global functions with no import-path leading to the entrypoint (e.g. to be called from the menu), those would not be included in the bundle.

To avoid this, you can use a side-effect import.

import './path/to/module';

This will ensure that Rollup will not remove it from the bundle.

Disclaimer

This is not an officially supported Google product.