0.3.1 • Published 24 days ago

@gasstack/manifest v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
24 days ago

@gasstack/manifest

The package is meant to ease and automate the process of creating a Google App Script manifest file, expecially the options regarding addons.

Description

The package provide a fluent based api to configure a manifest file, managing entangled options such as function names, necessary oauth scopes and url whitelisting both for UrlFetch and OpenLink scenarios.

The package contains also a Rollup / Vite compatible plugin, which serach for the .clasp.json configuration file and rewrites the appsscript.json manifest file according to the fluent configuration.

Usage

Export a constant created with the fluent manifest configuration:

export const CONFIG = defineManifest((builder) =>
  builder
    .withScopes((p) => p.withTriggerManagement())
    .withAddOn("Test", "https://logo.org", test_home, (b) =>
      b.forCalendar((t) => t.withCurrentEventAccess("READ_WRITE")).forDrive()
    )
);

Configure Vite or Rollup withthe given plugin:

import { defineConfig } from "vite";
import { manifestPligin } from "@gasstack/manifest";
import { CONFIG } from "./index";

export default defineConfig({
  root: "./src",
  plugins: [manifestPligin({ manifest: manifest })],
});

Example

Have a look to the e2e test.

API

API Reference