-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(*): Improve @clerk/backend DX [Part 1 - Refactoring] #2360
Conversation
🦋 Changeset detectedLatest commit: 3eb7f72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
d941960
to
88fab3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, one minor comment about the crypto imports
packages/backend/src/runtime.ts
Outdated
|
||
// @ts-ignore - These are package subpaths | ||
import crypto from '#crypto'; | ||
let webcrypto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the subpath import here? Are you trying to make Jest work without configuring a moduleMapper
? If so, Jest claims that that subpath imports work since this release: https://github.com/jestjs/jest/releases/tag/v29.4.0 :) #til
I haven't tested the following, but this is what I had in mind for #crypto
:
node/crypto.mjs
:
export { webcrypto } from 'node:crypto';
node/crypto.js
:
module.exports.webcrypto = require('node:crypto').webcrypto;
package.json
:
"imports": {
"#crypto": {
"edge-light": "./dist/runtime/browser/crypto.mjs",
"worker": "./dist/runtime/browser/crypto.mjs",
"browser": "./dist/runtime/browser/crypto.mjs",
"node": {
"require": "./dist/runtime/node/crypto.js",
"import": "./dist/runtime/node/crypto.mjs"
},
"default": "./dist/runtime/browser/crypto.mjs"
}
},
runtime.ts
:
import { webcrypto } from '#crypto';
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change reverted and suggestion applied.
88fab3a
to
98dae0d
Compare
98dae0d
to
3eb7f72
Compare
Description
Apply some internal refactoring and restructuring to
@clerk/backend
.Review it per commit for more information.
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/clerk-expo
@clerk/fastify
gatsby-plugin-clerk
@clerk/localizations
@clerk/nextjs
@clerk/clerk-react
@clerk/remix
@clerk/clerk-sdk-node
@clerk/shared
@clerk/themes
@clerk/types
build/tooling/chore