fix(create-script): accept --type webapp and --type api as standalone aliases#1155
Open
sheitabrk wants to merge 1 commit into
Open
fix(create-script): accept --type webapp and --type api as standalone aliases#1155sheitabrk wants to merge 1 commit into
sheitabrk wants to merge 1 commit into
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1154.
The
--typeoption advertiseswebappandapias valid values but the code only handledstandaloneand the container types inDRIVE_FILE_MIMETYPES. Anything else fell through to "Invalid container file type", so users following the documented examples hit a wall.Treat
webappandapias aliases ofstandalone(which is what they were in clasp v2 and what they effectively are now, since deploying as a web app or API happens throughclasp create-deployment, not at script creation). When one of those aliases is used, print a short tip pointing atclasp create-deploymentand the relevantappsscript.jsonfield. The error message for genuinely unknown types now lists every valid value.Tests added in
test/commands/create-script.tscover both aliases and the invalid-type case.Note:
npm run check(biome + tsc) passes locally.npm testcannot run on Node 24 in this repo today (mocha loader hitsresolveSyncnot implemented), reproducible onmasterwithout this diff, so the new tests will be confirmed by CI.