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
nikosdouvlis
left a comment
There was a problem hiding this comment.
This makes sense to me, one minor comment about the crypto imports
|
|
||
| // @ts-ignore - These are package subpaths | ||
| import crypto from '#crypto'; | ||
| let webcrypto; |
There was a problem hiding this comment.
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.
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 testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/clerk-expo@clerk/fastifygatsby-plugin-clerk@clerk/localizations@clerk/nextjs@clerk/clerk-react@clerk/remix@clerk/clerk-sdk-node@clerk/shared@clerk/themes@clerk/typesbuild/tooling/chore