-
Notifications
You must be signed in to change notification settings - Fork 297
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
feat(sdks): Add sdkMetadata to Clerk singleton, populate it for each SDK #1857
Merged
+315
−88
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
68b7cc3
feat(repo): Add sdkMetadata to Clerk singleton, populate it for each SDK
brkalow 4749db8
chore(repo): Add changeset
brkalow 9ec1392
chore(repo): Adjust changeset
brkalow 77a1006
feat(chrome-extension): Fix types
brkalow 529fbeb
chore(chrome-extension): Fix jest config
brkalow 680c218
fix(nextjs): Fix variable names
brkalow b563235
feat(repo): Introduce tsup to all remaining packages
brkalow dd4c507
chore(repo): Excldue .tsbuildinfo files from git
brkalow e5fedd6
feat(clerk-expo): Adjust how we set sdkMetadata
brkalow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,26 @@ | ||
{ | ||
"extends": "./tsconfig.build.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
tsup
to also output the types and not use TSCBut that can happen in another PR