Repository navigation
Tags
Tags
feat(doctor): warn when a pinned JWT key needs a newer @clerk/backend (… …#669) * feat(doctor): warn when a pinned JWT key needs a newer @clerk/backend Signing key size differs per instance, and newer instances use 3072-bit keys. With a pinned JWT key, `@clerk/backend` before 3.36.0 (Core 3) or 2.35.0 (Core 2) fails those tokens with token-invalid-signature. The new "Pinned JWT key" check looks for a non-empty *CLERK_JWT_KEY in the env file doctor reads and in the environment (names only, never values), resolves the `@clerk/backend` the framework SDK loads, and warns with an upgrade or remove-the-key remedy. It passes as skipped when no key is pinned and is not auto-fixable. * fix(doctor): read both env files and hoisted SDKs in the pinned JWT key check Read .env and .env.local together, find a framework SDK hoisted to the workspace root before looking for its nested `@clerk/backend`, and skip projects without a Clerk JavaScript SDK instead of warning. Tests clear prefixed *CLERK_JWT_KEY vars from the host shell. * docs(doctor): note the pinned JWT key check skips projects without a Clerk JS SDK * fix(doctor): only skip the pinned JWT key check when there is no package.json A JavaScript project that gets Clerk through an internal package still warns when `@clerk/backend` can't be found, rather than passing.
feat(init): skip agent skills the running agent already has (#657) * feat(init): skip agent skills the running agent already has Before running skills add, init checks the agent it's running inside (Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Cline) for each Clerk skill: an enabled Claude Code plugin that ships it, or a SKILL.md in a skills folder the agent reads. It installs only what's missing and says what it skipped. Anything it can't tell counts as missing, so an unrecognized agent installs as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): don't count a Claude Code plugin installed mid-session Claude Code loads plugins only at session start. Checked with Claude Code 2.1.325: a plugin installed by `claude plugin install` or `plugins add` during a session stays unavailable until the next one, while standalone skills added to an existing `~/.claude/skills` load right away. So a plugin counts only when its `installedAt` is before the start of the `CLAUDE_PID` process; otherwise, or when either time is unknown, init installs the standalone skills. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): don't count a Claude Code plugin the session hasn't loaded A project-scoped plugin now counts only from its own project folder, since Claude Code doesn't load it when started in a subfolder. A plugin also counts only when the settings file that enables it hasn't changed since the session started, so one enabled mid-session isn't mistaken for loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): split the skills detection rules into steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): check more specific Claude settings for mid-session changes A plugin enabled in user settings but disabled by a project override at session start wasn't loaded. If the override was dropped mid-session, init only checked the user file and counted it. Now any change since the session started to the enabling file or a more specific one counts the plugin as not loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): tighten the skills detection wording Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): address CodeRabbit review on skills detection - Count a deleted, more specific Claude settings file as changed when its folder changed after the session started, since deleting it may have dropped a disable the session read. - Read the clock before sampling ps, so the session start estimate errs earlier, never later. - Say which skills are missing instead of announcing an install before the prompt or runner lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): check Claude Code project plugins against the session's folder Claude Code reads project plugins, project settings, and its project skills folder from the folder its session started in. Init checked the folder it runs in, so a session started elsewhere that then ran init in another project could count that project's plugin or skills as loaded. Init now reads the session folder from the CLAUDE_PID process's working directory (/proc or lsof) and checks those against it. When it can't read it, only global skills count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(init): expect no session folder on Windows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
feat(init): tag accountless apps with CLERK_ACCOUNTLESS_SOURCE (#654) * feat(init): tag accountless apps with CLERK_ACCOUNTLESS_SOURCE Automated runs (Docs agent evals, add-auth CI evals) set this env var so the accountless apps clerk init creates are stored with a distinct from_source (e.g. cli-eval), letting Data exclude them from CLI onboarding metrics. An env var keeps it out of the setup prompt the evaluated agent follows. Unset or blank, init sends source=cli as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): describe CLERK_ACCOUNTLESS_SOURCE as an opt-in Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): note CLERK_ACCOUNTLESS_SOURCE must reach the clerk process Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): use clerk-eval as the example accountless source The value names who created the app, the clerk-evals harness. A value starting with cli could be counted as CLI onboarding by a prefix match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
test: isolate unit tests from the host environment (#659) * test: isolate unit tests from the host environment Give each test file its own TMPDIR (removed after its tests), stop git discovery at its parent, point CLERK_CONFIG_DIR into it, and clear the developer's CLERK_* settings and colour vars. Concurrent runs no longer collide on the migrate lock, a TMPDIR inside a checkout no longer writes into that checkout, and nothing reaches the real config dirs. * test(e2e): run e2e from test/e2e with its own bunfig The root bunfig.toml preloads the unit test preload, which now clears the CLERK_* credentials e2e needs. test:e2e runs bun --cwd=test/e2e test so every parallel worker reads test/e2e/bunfig.toml; Bun's workers ignore --config. The e2e preload clears only the MCP client config vars and keeps a relative E2E_HAR_DIR relative to the repo root. * test(init): commit the iOS workflow fixtures unsigned The fixture commits ran with the developer's own Git config, so a required signature that couldn't be made failed three tests. * docs(changeset): add empty changeset
feat(init): warn when a native registration's App ID Prefix differs f… …rom the signing team (#638) * fix(init): warn when a native registration's App ID Prefix differs from the signing team After an Apple app moves to another team, its App ID Prefix changes, but `clerk init` kept using the prefix from the existing Clerk registration without a word, so passkeys and native Sign in with Apple broke silently. Prefix precedence is unchanged. When the prefix comes from a matching registration and differs from the single signing team, init now warns in the preview, among the remaining steps, in `identity.warnings`, and as an `app-id-prefix-review` item in `handoff.remaining`; `clerk doctor` reports an "App ID Prefix" check. The warning says to edit the registration's prefix in the Clerk Dashboard, or, for an iOS App ID with a legacy prefix, to confirm it with `--app-id-prefix`. macOS never had legacy prefixes, so there the wording says the registration is wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(init): add doctor --app-id-prefix and tighten the App ID Prefix warning Review fixes for the App ID Prefix vs signing team warning: - `clerk doctor` accepts `--app-id-prefix` (validated like init's, selects the Apple checks) so a legacy iOS prefix can be confirmed there, and the "App ID Prefix" check carries its own remedy. - On a mismatch, doctor's production check no longer treats the registered prefix as confirmed: iOS gets no expected prefix, macOS is checked against the signing team. - A Mac App ID never has a legacy prefix, so on macOS `--app-id-prefix` doesn't clear the warning. - The warning says passkeys and password AutoFill (and device attestation) fail, not Sign in with Apple: Clerk accepts the native Apple token by Bundle ID alone. - The remedy starts by looking up the Bundle ID's owner in Apple Developer, since the Xcode team can be the wrong side, then compares prefixes; the flag is suggested only for a legacy prefix on the owning team. - `identity.warnings` is always present in init's JSON result; init's `--app-id-prefix` help covers confirming a legacy prefix. - Changeset bumped to minor for the new public flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): warn when production's App ID Prefix differs from the signing team On a development mismatch, doctor stopped passing the stale prefix to the production check, so production fell back to its own registration. When that registration also differed from the release build's signing team, the check passed. Surface production discovery's mismatch as a Production App ID Prefix warning, with production wording in the remedy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): say passkeys fail only when the prefix differs from the App ID's A legacy iOS prefix can differ from the signing team and still be right, so the changeset and doctor README now tie the failure to the App ID's actual prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(init): say when doctor reports the production prefix as a conflict Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
fix(init): create new iOS entitlements in the app's synchronized fold… …er (#622) * fix(init): create new iOS entitlements in the app's synchronized folder When an app target has no entitlements file, clerk init created <Target>.entitlements at SRCROOT, next to the .xcodeproj. In projects from Xcode 16+ templates the target's sources live in a synchronized folder, so that file was outside it and Xcode's navigator never showed it. Xcode itself creates the file inside that folder (e.g. MyApp/MyApp.entitlements). The project adapter now reports the target's synchronized folders (a .pbxproj target's PBXFileSystemSynchronizedRootGroups, a .xcproj target's member folders), and the planner creates the new file in the one named like the target, else the first, when it's an ordinary folder inside the project root. Otherwise the file stays at SRCROOT. Projects with classic groups keep the old behavior. verify-capabilities now also covers a synchronized-folder pbxproj and builds each fixture: the iOS simulator build is signed ad hoc and must carry the edited entitlements, and no build may bundle a .entitlements file. verify-starter checks the starter gets its file in MyApp/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(init): address review findings for new entitlements in the synchronized folder - Accept synchronized folder names with spaces, punctuation and non-ASCII letters; only "$", control characters and empty/"."/".." parts fall back to SRCROOT. - Share one .pbxproj group-location resolver (pbxprojLocations) between target-sources.ts and project.ts instead of keeping two copies. - Write verify-capabilities.ts build output to /tmp/clerk-capability-build-*.log like the other Apple probes. - Make the changeset summary imperative. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
fix(init): treat .ts/.tsx sources as TypeScript without a tsconfig.js… …on (#590) Next.js writes tsconfig.json on the first next dev or next build, so a new project with app/layout.tsx was treated as JavaScript: init skipped the layout and wrote .js/.jsx files. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
PreviousNext