Clasp: Apps Script Manifest Autocompletion

Created on 3 Aug 2018  路  4Comments  路  Source: google/clasp

Expected Behavior

Creating an Apps Script manifest should be easy. Manifest editing should have these features:

  • Autocompletion
  • Syntax errors
  • Integration with clasp (clasp create --webapp)

Actual Behavior

  • You have to create this file by hand. No autocompletion on script.google.com or local IDEs.

Suggestion Solution

  • appsscript.ts

    • PRO: Simple setup (rename appscript.json to appsscript.ts, add type)

    • CON: A bit unnatural. May be reverse incompatible since ts allows comments, no quotes, etc.

  • VSCode Extension:

    • PRO: You don't need to rename your file to appsscript.ts or do any funky things.

    • CON: You must install an extension. The code is separate from clasp. A lot of maintainence work. Only works for VSCode.

Example

{
  timeZone: string,
  oauthScopes: [
    string
  ],
  dependencies: {
    enabledAdvancedServices: [
      {
        userSymbol: string,
        serviceId: string,
        version: string,
      }
    ],
    libraries: [
      {
        userSymbol: string,
        libraryId: string,
        version: string,
        developmentMode: boolean,
      }
    ]
  },
  exceptionLogging: string,
  webapp: {
    access: string,
    executeAs: string,
  },
  executionApi: {
    access: string,
  },
  urlFetchWhitelist: [
    string
  ]
}: GoogleAppsScript.Manifest
feature request

All 4 comments

I consider it is good that to publish json schema for appsscript.json on http://schemastore.org/json/ .
Various editors and IDEs has direct support for schemas hosted on SchemaStore.org. VSCode, IntelliJ, etc.
Even if VSCode Extension is not implemented, clasp also will be able to generate json file to mapping appsscritpt.json to json schema in VSCode workspace.

Please see for mapping to a json schema: https://code.visualstudio.com/docs/languages/json#_mapping-to-a-schema-in-the-workspace.

Thanks @fossamagna! I created this PR https://github.com/SchemaStore/schemastore/pull/522.

Looks like we don't need any ts hacks or VSCode extensions for this feature.

I've also added a .clasp.json schema here: https://github.com/SchemaStore/schemastore/pull/525

I think that's it in terms of config files.

The .clasprc.json file is a generated file from the googleapis module, so I don't think I'll add that one.

I'm guessing the schemas will be published in a week or so we can try it out and close this bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinmichels picture dustinmichels  路  4Comments

hariharasuthan-balaji picture hariharasuthan-balaji  路  8Comments

dskeithbuck picture dskeithbuck  路  5Comments

grant picture grant  路  8Comments

nirazul picture nirazul  路  7Comments