chore(electron): Fix cjs/esm exports#8959
Conversation
🦋 Changeset detectedLatest commit: 4807231 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe ChangesElectron SDK ESM/CJS build restructure
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
!snapshot |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/electron/tsdown.config.mts (1)
9-10: 🩺 Stability & Availability | 🔵 TrivialConsider explicit type checking for the
publishflag to prevent accidental publish runs if the env value is ever passed as a string.
!!overrideOptions.env?.publishrelies on JavaScript truthiness, which can coerce non-empty strings (like"false") totrue. While the current pattern uses--env.publishas a boolean, explicit type checking would be more robust if the configuration ever receives string values.Suggested improvement
- const shouldPublish = !!overrideOptions.env?.publish; + const publishEnv = overrideOptions.env?.publish; + const shouldPublish = + publishEnv === true || + (typeof publishEnv === 'string' && ['1', 'true', 'yes'].includes(publishEnv.toLowerCase()));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/electron/tsdown.config.mts` around lines 9 - 10, The shouldPublish constant uses JavaScript truthiness coercion on overrideOptions.env?.publish, which will incorrectly evaluate string values like "false" as true. Replace the double negation operator truthiness check with explicit type checking that compares overrideOptions.env?.publish to the string "true" or validates it as a boolean true value, ensuring that string-based configuration values are handled correctly and accidental publish runs are prevented.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/common.mjs`:
- Around line 20-23: The second find command for native packages in the
packages/electron-passkeys/npm directory is using .nothrow() to suppress all
errors without checking the exitCode or stderr, which can mask real discovery
failures and exclude packages from workflows. Remove the .nothrow() call from
the nativeResult assignment to match the error handling behavior of the first
find command, or if .nothrow() must be kept, add explicit checks for
nativeResult.exitCode and nativeResult.stderr to differentiate between missing
directories (acceptable) and actual errors (which should be thrown or logged).
---
Nitpick comments:
In `@packages/electron/tsdown.config.mts`:
- Around line 9-10: The shouldPublish constant uses JavaScript truthiness
coercion on overrideOptions.env?.publish, which will incorrectly evaluate string
values like "false" as true. Replace the double negation operator truthiness
check with explicit type checking that compares overrideOptions.env?.publish to
the string "true" or validates it as a boolean true value, ensuring that
string-based configuration values are handled correctly and accidental publish
runs are prevented.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 02e2d0a8-1ca2-4c70-bf47-4db67ea0e0a3
📒 Files selected for processing (9)
packages/electron-passkeys/.gitignorepackages/electron-passkeys/npm/darwin-arm64/electron-passkeys.darwin-arm64.nodepackages/electron-passkeys/npm/darwin-x64/electron-passkeys.darwin-x64.nodepackages/electron-passkeys/npm/win32-arm64-msvc/electron-passkeys.win32-arm64-msvc.nodepackages/electron-passkeys/npm/win32-x64-msvc/electron-passkeys.win32-x64-msvc.nodepackages/electron/package.jsonpackages/electron/tsconfig.declarations.jsonpackages/electron/tsdown.config.mtsscripts/common.mjs
|
!snapshot |
|
!snapshot |
|
Hey @wobsoriano - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@3.4.7-snapshot.v20260622234151 --save-exact
npm i @clerk/backend@3.8.3-snapshot.v20260622234151 --save-exact
npm i @clerk/chrome-extension@3.1.42-snapshot.v20260622234151 --save-exact
npm i @clerk/clerk-js@6.21.0-snapshot.v20260622234151 --save-exact
npm i @clerk/electron@0.0.2-snapshot.v20260622234151 --save-exact
npm i @clerk/electron-passkeys@0.0.2-snapshot.v20260622234151 --save-exact
npm i @clerk/eslint-plugin@0.1.1-snapshot.v20260622234151 --save-exact
npm i @clerk/expo@3.5.3-snapshot.v20260622234151 --save-exact
npm i @clerk/expo-passkeys@1.1.9-snapshot.v20260622234151 --save-exact
npm i @clerk/express@2.1.31-snapshot.v20260622234151 --save-exact
npm i @clerk/fastify@3.1.41-snapshot.v20260622234151 --save-exact
npm i @clerk/headless@0.0.3-snapshot.v20260622234151 --save-exact
npm i @clerk/hono@0.1.41-snapshot.v20260622234151 --save-exact
npm i @clerk/localizations@4.9.3-snapshot.v20260622234151 --save-exact
npm i @clerk/msw@0.0.39-snapshot.v20260622234151 --save-exact
npm i @clerk/nextjs@7.5.8-snapshot.v20260622234151 --save-exact
npm i @clerk/nuxt@2.6.7-snapshot.v20260622234151 --save-exact
npm i @clerk/react@6.11.0-snapshot.v20260622234151 --save-exact
npm i @clerk/react-router@3.4.8-snapshot.v20260622234151 --save-exact
npm i @clerk/shared@4.21.0-snapshot.v20260622234151 --save-exact
npm i @clerk/swingset@0.0.8-snapshot.v20260622234151 --save-exact
npm i @clerk/tanstack-react-start@1.4.8-snapshot.v20260622234151 --save-exact
npm i @clerk/testing@2.1.6-snapshot.v20260622234151 --save-exact
npm i @clerk/ui@1.20.1-snapshot.v20260622234151 --save-exact
npm i @clerk/upgrade@2.0.5-snapshot.v20260622234151 --save-exact
npm i @clerk/vue@2.4.7-snapshot.v20260622234151 --save-exact |
…darwin-arm64.node
…eys.win32-arm64-msvc.node
…s.win32-x64-msvc.node
Description
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit