Add Electron to `clerk init` framework detection and `--framework`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- electron, typescript
- Ambito
- cli
Direzione di ricerca
Inizia da packages/cli-core/src/lib/framework.ts e dal relativo FRAMEWORK_MAP, poi esamina packages/cli-core/src/commands/env/pull.ts e il flusso di init. Verifica che i progetti Electron Forge vengano rilevati come Electron, che vengano selezionate le impostazioni dell’ambiente per Electron SDK e publishable key e che CLERK_SECRET_KEY venga omesso; verifica se sia necessario aggiornare anche il comportamento dello starter e i test esistenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
clerk init cannot set up @clerk/electron. --framework has no electron choice, and detection (packages/cli-core/src/lib/framework.ts FRAMEWORK_MAP) matches an Electron Forge project as React once react is installed (React precedes Vite in the map) or as Vite/JavaScript before that, so init installs @clerk/react or @clerk/clerk-js. clerk env pull writes the right variable name (VITE_CLERK_PUBLISHABLE_KEY) but also writes CLERK_SECRET_KEY, because packages/cli-core/src/commands/env/pull.ts includes the secret key for every npm framework. A secret key has no use in an Electron app, so the docs cannot recommend env pull either.
The Electron docs (clerk/clerk#3382) therefore use the manual Publishable Key step and carry no CLI instructions.
Proposal
Add an entry to FRAMEWORK_MAP before the react and vite entries, since Electron Forge projects contain both:
{
dep: "electron",
name: "Electron",
sdk: "@clerk/electron",
envVar: "VITE_CLERK_PUBLISHABLE_KEY",
envFile: ".env",
},
Notes for the implementer:
@clerk/electronneedselectron-storeinstalled alongside it (optional peer used by@clerk/electron/storage);sdkInstallmay need to cover both.- Electron has no secret key;
initandenv pullshould skipCLERK_SECRET_KEYfor this framework the way the iOS and Android entries do (extendisNpmFramework/includeSecretKeyor add a per-framework flag). - The Electron renderer's Content Security Policy needs the instance's Frontend API host; the docs put it in
.envasVITE_CLERK_FRONTEND_API_HOST, whichenv pullcould write too. --startercould scaffold with Electron Forge:npm init electron-app@latest <name> -- --template=vite-typescriptplus React, matching the docs quickstart at https://clerk.com/docs/electron/getting-started/quickstart.- Keyless is not supported by the Electron SDK today (the SDK requires
publishableKey).
Follow-up in docs
Once shipped, the quickstart gains a "For AI agents" block with npx clerk@latest init --framework electron and a <PromptOnly> card (tracked in Linear DOCS, linked from the docs PR).
- Lingua principale
- TypeScript
- Stelle
- 55
- Fork
- 5
- Merge medio
- 1g 16h
- PR unite (30g)
- 17
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di clerk/cli
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
-
when i type clerk init Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
Issue simili
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Crush Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ElementsProject/cln-application#167 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Quantco/pnpm-licenses#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100