Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 470
feat(sdks): Add sdkMetadata to Clerk singleton, populate it for each SDK#1857
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
68b7cc34749db89ec139277a1006529fbeb680c218b563235dd4c507e5fedd6File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| 'gatsby-plugin-clerk': patch | ||
| '@clerk/clerk-js': patch | ||
| '@clerk/chrome-extension': patch | ||
| '@clerk/fastify': patch | ||
| '@clerk/nextjs': patch | ||
| '@clerk/clerk-react': patch | ||
| '@clerk/remix': patch | ||
| '@clerk/types': patch | ||
| '@clerk/clerk-expo': patch | ||
| --- | ||
| Introduce a new property on the core Clerk singleton, `sdkMetadata`. This will be populated by each host SDK. This metadata will be used to make logging and debugging easier. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -39,6 +39,7 @@ yarn-error.log | ||
| testem.log | ||
| /typings | ||
| **/coverage/** | ||
| *.tsbuildinfo | ||
| # System Files | ||
| .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export {}; | ||
| declare global { | ||
| const PACKAGE_NAME: string; | ||
| const PACKAGE_VERSION: string; | ||
| const __DEV__: boolean; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export {}; | ||
| declare global { | ||
| const PACKAGE_NAME: string; | ||
| const PACKAGE_VERSION: string; | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "skipLibCheck": true, | ||
| "noEmit": false, | ||
| "declaration": true, | ||
| "emitDeclarationOnly": true, | ||
| "declarationMap": true, | ||
| "sourceMap": false, | ||
| "declarationDir": "./dist" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,26 @@ | ||
| { | ||
| "extends": "./tsconfig.build.json", | ||
| "compilerOptions": { | ||
| "outDir": "dist", | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should extend this from a root/base tsconfig.json But that's for another PR | ||
| "baseUrl": ".", | ||
| "lib": ["es6", "dom"], | ||
| "jsx": "react", | ||
| "module": "commonjs", | ||
| "moduleResolution": "node", | ||
| "importHelpers": true, | ||
| "declaration": true, | ||
| "declarationMap": false, | ||
| "noImplicitReturns": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "resolveJsonModule": true, | ||
| "sourceMap": false, | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "allowJs": true, | ||
| "target": "ES2019", | ||
| "noEmitOnError": false, | ||
| "incremental": true | ||
| } | ||
| }, | ||
| "include": ["src"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import type { Options } from 'tsup'; | ||
| import { defineConfig } from 'tsup'; | ||
| import { runAfterLast } from '../../scripts/utils'; | ||
| import { version as clerkJsVersion } from '../clerk-js/package.json'; | ||
| import { name, version } from './package.json'; | ||
| export default defineConfig(overrideOptions => { | ||
| const isWatch = !!overrideOptions.watch; | ||
| const shouldPublish = !!overrideOptions.env?.publish; | ||
| const options: Options = { | ||
| format: 'cjs', | ||
| outDir: './dist', | ||
| entry: ['./src/**/*.{ts,tsx,js,jsx}'], | ||
| bundle: false, | ||
| clean: true, | ||
| minify: false, | ||
| sourcemap: true, | ||
| legacyOutput: true, | ||
| define: { | ||
| PACKAGE_NAME: `"${name}"`, | ||
| PACKAGE_VERSION: `"${version}"`, | ||
| JS_PACKAGE_VERSION: `"${clerkJsVersion}"`, | ||
| __DEV__: `${isWatch}`, | ||
| }, | ||
| }; | ||
| return runAfterLast(['npm run build:declarations', shouldPublish && 'npm run publish:local'])(options); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export {}; | ||
| declare global { | ||
| const PACKAGE_NAME: string; | ||
| const PACKAGE_VERSION: string; | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "skipLibCheck": true, | ||
| "noEmit": false, | ||
| "declaration": true, | ||
| "emitDeclarationOnly": true, | ||
| "declarationMap": true, | ||
| "sourceMap": false, | ||
| "declarationDir": "./dist" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,26 @@ | ||
| { | ||
| "extends": "./tsconfig.build.json", | ||
| "compilerOptions": { | ||
| "outDir": "dist", | ||
| "baseUrl": ".", | ||
| "lib": ["es6", "dom"], | ||
| "jsx": "react", | ||
| "module": "commonjs", | ||
| "moduleResolution": "node", | ||
| "importHelpers": true, | ||
| "declaration": true, | ||
| "declarationMap": false, | ||
| "noImplicitReturns": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "resolveJsonModule": true, | ||
| "sourceMap": false, | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "allowJs": true, | ||
| "target": "ES2019", | ||
| "noEmitOnError": false, | ||
| "incremental": true | ||
| } | ||
| }, | ||
| "include": ["src"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import type { Options } from 'tsup'; | ||
| import { defineConfig } from 'tsup'; | ||
| import { runAfterLast } from '../../scripts/utils'; | ||
| import { version as clerkJsVersion } from '../clerk-js/package.json'; | ||
| import { name, version } from './package.json'; | ||
| export default defineConfig(overrideOptions => { | ||
| const isWatch = !!overrideOptions.watch; | ||
| const shouldPublish = !!overrideOptions.env?.publish; | ||
| const options: Options = { | ||
| format: 'cjs', | ||
| outDir: './dist', | ||
| entry: ['./src/**/*.{ts,tsx,js,jsx}'], | ||
| bundle: false, | ||
| clean: true, | ||
| minify: false, | ||
| sourcemap: true, | ||
| legacyOutput: true, | ||
| define: { | ||
| PACKAGE_NAME: `"${name}"`, | ||
| PACKAGE_VERSION: `"${version}"`, | ||
| JS_PACKAGE_VERSION: `"${clerkJsVersion}"`, | ||
| __DEV__: `${isWatch}`, | ||
| }, | ||
| }; | ||
| return runAfterLast(['npm run build:declarations', shouldPublish && 'npm run publish:local'])(options); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -198,6 +198,8 @@ export default class IsomorphicClerk { | ||
| await global.Clerk.load(this.options); | ||
| } | ||
| global.Clerk.sdkMetadata = this.options.sdkMetadata ?? { name: PACKAGE_NAME, version: PACKAGE_VERSION }; | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For SDKs that use | ||
| if (global.Clerk?.loaded || global.Clerk?.isReady()) { | ||
| return this.hydrateClerkJS(global.Clerk); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
I know that we do this in the other packages but IMO we should just use
tsupto also output the types and not use TSCBut that can happen in another PR