C3: Error when an unsupported platform is specified for a framework#10695
Conversation
🦋 Changeset detectedLatest commit: 730970a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
|
|
||
| frameworkConfig = frameworkConfig.platformVariants[platform]; | ||
| } else { | ||
| if (frameworkConfig.platform !== args.platform) { |
There was a problem hiding this comment.
Coudn't args.platform be undefined ?
I think it is --platform=<args.platform> so not required?
Could the else if be a elseif (provided it is still possible after potential changes are applied)
There was a problem hiding this comment.
Coudn't
args.platformbeundefined?
Yes I've addressed that 🙂
There was a problem hiding this comment.
Could the else if be a elseif (provided it is still possible after potential changes are applied)
Switched to else if 👍
| throw new Error( | ||
| `The ${frameworkConfig.displayName} framework doesn't support the "${args.platform}" platform`, |
There was a problem hiding this comment.
If the previous version passed the tests then we have a hole in the coverage and we should add a test.
There was a problem hiding this comment.
Fixes https://jira.cfdata.org/browse/DEVX-2195
Currently providing an invalid platform via the
--platformargument for a framework causes the option to simply be ignored, this makes C3 create the application using the supported framework's platform instead, this can be surprising and confusing to users, so as a DX improvement here I am updating C3 to hard-error instead.