Skip to content

fix(create-script): accept --type webapp and --type api as standalone aliases#1155

Open
sheitabrk wants to merge 1 commit into
google:masterfrom
sheitabrk:fix/create-script-webapp-api-aliases
Open

fix(create-script): accept --type webapp and --type api as standalone aliases#1155
sheitabrk wants to merge 1 commit into
google:masterfrom
sheitabrk:fix/create-script-webapp-api-aliases

Conversation

@sheitabrk
Copy link
Copy Markdown

Fixes #1154.

The --type option advertises webapp and api as valid values but the code only handled standalone and the container types in DRIVE_FILE_MIMETYPES. Anything else fell through to "Invalid container file type", so users following the documented examples hit a wall.

Treat webapp and api as aliases of standalone (which is what they were in clasp v2 and what they effectively are now, since deploying as a web app or API happens through clasp create-deployment, not at script creation). When one of those aliases is used, print a short tip pointing at clasp create-deployment and the relevant appsscript.json field. The error message for genuinely unknown types now lists every valid value.

Tests added in test/commands/create-script.ts cover both aliases and the invalid-type case.

Note: npm run check (biome + tsc) passes locally. npm test cannot run on Node 24 in this repo today (mocha loader hits resolveSync not implemented), reproducible on master without this diff, so the new tests will be confirmed by CI.

… aliases

The CLI advertises both as valid types but the code only handled
`standalone` and the container types in DRIVE_FILE_MIMETYPES, so any
user following the documented examples got 'Invalid container file
type'.

Treat webapp and api as aliases of standalone (which is what they were
in clasp v2 and what they effectively are now, since deploying as a
web app or API happens through `clasp create-deployment`, not at
script creation). When either alias is used, print a tip pointing at
`clasp create-deployment` and the right `appsscript.json` field.
The error message for genuinely unknown types now lists every valid
value.

Fixes google#1154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clasp create-script --type webapp not supported

1 participant