Add Electron to `clerk init` framework detection and `--framework`
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- electron, typescript
- 領域
- cli
調査の方向性
packages/cli-core/src/lib/framework.ts とその FRAMEWORK_MAP から始め、次に packages/cli-core/src/commands/env/pull.ts と init フローを確認します。Electron Forge プロジェクトが Electron として検出され、Electron SDK と publishable key の環境設定が選択され、CLERK_SECRET_KEY が除外されることを検証します。starter の動作と既存のテストも更新する必要があるか確認します。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- TypeScript
- スター
- 55
- フォーク
- 5
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 17
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
clerk/cli のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
bcgov/bc-wallet-mobile#4761 · コメント 1 件 ·
-
external-issue to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100