Add framework selection prompt during autoconfig#12479
Conversation
🦋 Changeset detectedLatest commit: 3597daa The changes in this PR will be included in the next version bump. 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 |
|
Claude finished @dario-piotrowicz's task —— View job Changeset Review
✅ All changesets look good The changeset
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
1c52873 to
6ba9aa2
Compare
6ba9aa2 to
3597daa
Compare
| @@ -18,39 +18,37 @@ import type { Framework } from "."; | |||
| export type FrameworkInfo = { | |||
There was a problem hiding this comment.
Thought for the future...
I wonder if you could put id and name as static props on the class, and then avoid needing this type? Might need to rename name to title though...
E.g.
export interface FrameworkClass {
id: string;
title: string;
new (...args: any[]): any;
}
class Angular extends Framework {
static id = "angular";
static title = "Angular"
}
const allKnownFrameworks: FrameworkClass[] = [
Analog,
Angular,
...
] as const;expect(allKnownFrameworks[0].id).toEqual("angular");
expect(allKnownFrameworks[0].title).toEqual("Angular");This might be too awkward to implement but just thought it might be interesting to consider.
There was a problem hiding this comment.
I wonder if you could put
idandnameas static props on the class, and then avoid needing this type? Might need to renamenametotitlethough...
Yes, I definitely thought of this as well in the past! 👍
The tricky bit is that we currently get this info from the netlify package, so although we could have static fields of our own, we'd be unnecessarily duplicate these values... I think it's work reconsidering this at some point 🙂
Fixes https://jira.cfdata.org/browse/DEVX-2457
When running autoconfig in interactive mode, users are now prompted to confirm or change the detected framework. This allows correcting misdetected frameworks or selecting a framework when none was detected, defaulting to "Static" in that case.
A picture of a cute animal (not mandatory, but encouraged)