Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/dull-ducks-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/perfect-dots-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
File renamed without changes.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
"version": "npx changeset version && ./scripts/version-info.sh",
"version:snapshot": "./scripts/snapshot.mjs",
"version:staging": "./scripts/staging.mjs",
"release": "FORCE_COLOR=1 npm run build -- --force && npx changeset publish && git push --follow-tags",
"release:snapshot": "FORCE_COLOR=1 npm run build && npx changeset publish --tag snapshot --no-git-tag",
"release:staging": "FORCE_COLOR=1 npm run build && npx changeset publish --tag staging --no-git-tag",
"release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_CONCURRENCY=4 npm run build && npx changeset publish --no-git-tag; fi",
"release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && npx changeset publish && git push --follow-tags",
"release:snapshot": "TURBO_FORCE=true ORCE_COLOR=1 npm run build && npx changeset publish --tag snapshot --no-git-tag",
"release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && npx changeset publish --tag staging --no-git-tag",
"release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && npx changeset publish --no-git-tag; fi",
"update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo"
}
}
1 change: 1 addition & 0 deletions packages/backend/src/tokens/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export function createAuthenticateRequest(params: CreateAuthenticateRequestOptio
publishableKey: runtimePublishableKey || buildtimePublishableKey,
proxyUrl: runtimeProxyUrl || buildProxyUrl,
isSatellite: runtimeIsSatellite || buildtimeIsSatellite,
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
domain: (runtimeDomain || buildtimeDomain) as any,
userAgent: runtimeUserAgent || buildUserAgent,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/chrome-extension/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {

roots: ['<rootDir>/src'],
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>../../setupJest.afterEnv.ts'],
setupFilesAfterEnv: ['<rootDir>../../jest.setup-after-env.ts'],

moduleDirectories: ['node_modules', '<rootDir>/src'],
transform: {
Expand Down
6 changes: 3 additions & 3 deletions packages/clerk-js/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const config = {
displayName: 'clerk-js',
injectGlobals: true,

testEnvironment: '<rootDir>/jsdom-with-timezone.ts',
testEnvironment: '<rootDir>/jest.jsdom-with-timezone.ts',
roots: ['<rootDir>/src'],
setupFiles: ['./setupJest.ts'],
setupFilesAfterEnv: ['./setupJestAfterEnv.ts'],
setupFiles: ['./jest.setup.ts'],
setupFilesAfterEnv: ['./jest.setup-after-env.ts'],
testRegex: [
'/__tests__/(.+/)*.*.test.[jt]sx?$',
'/ui/.*/__tests__/.*.test.[jt]sx?$',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/clerk-js/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["src/**/*", "./setupJestAfterEnv.ts"],
"include": ["src/**/*", "./jest.setup-after-env.ts"],
"exclude": ["node_modules"]
}
69 changes: 69 additions & 0 deletions packages/clerk-js/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"headless/**",
"src/**",
"tsconfig.json",
"tsconfig.build.json",
"tsconfig.declarations.json",
"tsup.config.ts",
"webpack.config.js",

"!**/**/*.test.*",
"!**/test/**",
"!**/tests/**",
"!**/__tests__/**",
"!**/__mocks__/**",
"!**/__snapshots__/**",
"!coverage/**",
"!examples/**",
"!node_modules/**"
]
},
"test": {
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"jest.*",
"src/**",
"svgTransform.js",
"tests/**",
"tsconfig.json",
"tsconfig.*.json",
"tsup.config.ts",
"webpack.config.js",

"!**/__snapshots__/**",
"!coverage/**",
"!examples/**",
"!node_modules/**"
]
},
"test:ci": {
"dependsOn": ["build"],
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"jest.*",
"src/**",
"tests/**",
"tsconfig.json",
"tsconfig.*.json",
"tsup.config.ts",
"webpack.config.js",

"!**/__snapshots__/**",
"!coverage/**",
"!examples/**",
"!node_modules/**"
]
}
}
}
2 changes: 1 addition & 1 deletion packages/react/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {

roots: ['<rootDir>/src'],
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>../../setupJest.afterEnv.ts'],
setupFilesAfterEnv: ['<rootDir>../../jest.setup-after-env.ts'],

moduleDirectories: ['node_modules', '<rootDir>/src'],
transform: {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/controlComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const ClerkLoading = ({ children }: React.PropsWithChildren<unknown>): JS

export const RedirectToSignIn = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignInProps>) => {
const { client, session } = clerk;
// TODO: Remove temp use of __unstable__environment
const { __unstable__environment } = clerk as any;
// @ts-expect-error - TODO: Remove temp use of __unstable__environment
const { __unstable__environment } = clerk;

const hasActiveSessions = client.activeSessions && client.activeSessions.length > 0;

Expand Down
24 changes: 16 additions & 8 deletions packages/react/src/components/uiComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export const SignIn = withClerk(({ clerk, ...props }: WithClerkProp<SignInProps>
<Portal
mount={clerk.mountSignIn}
unmount={clerk.unmountSignIn}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -83,7 +84,8 @@ export const SignUp = withClerk(({ clerk, ...props }: WithClerkProp<SignUpProps>
<Portal
mount={clerk.mountSignUp}
unmount={clerk.unmountSignUp}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -94,7 +96,8 @@ export const UserProfile = withClerk(({ clerk, ...props }: WithClerkProp<UserPro
<Portal
mount={clerk.mountUserProfile}
unmount={clerk.unmountUserProfile}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -105,7 +108,8 @@ export const UserButton = withClerk(({ clerk, ...props }: WithClerkProp<UserButt
<Portal
mount={clerk.mountUserButton}
unmount={clerk.unmountUserButton}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -116,7 +120,8 @@ export const OrganizationProfile = withClerk(({ clerk, ...props }: WithClerkProp
<Portal
mount={clerk.mountOrganizationProfile}
unmount={clerk.unmountOrganizationProfile}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -127,7 +132,8 @@ export const CreateOrganization = withClerk(({ clerk, ...props }: WithClerkProp<
<Portal
mount={clerk.mountCreateOrganization}
unmount={clerk.unmountCreateOrganization}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -138,7 +144,8 @@ export const OrganizationSwitcher = withClerk(({ clerk, ...props }: WithClerkPro
<Portal
mount={clerk.mountOrganizationSwitcher}
unmount={clerk.unmountOrganizationSwitcher}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand All @@ -149,7 +156,8 @@ export const OrganizationList = withClerk(({ clerk, ...props }: WithClerkProp<Or
<Portal
mount={clerk.mountOrganizationList}
unmount={clerk.unmountOrganizationList}
updateProps={(clerk as any).__unstable__updateProps}
// @ts-expect-error - TODO: update usage of __unstable__updateProps
updateProps={clerk.__unstable__updateProps}
props={props}
/>
);
Expand Down
6 changes: 5 additions & 1 deletion packages/react/src/isomorphicClerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,11 @@ export default class IsomorphicClerk {
signOutCallbackOrOptions?: SignOutCallback | SignOutOptions,
options?: SignOutOptions,
): Promise<void> => {
const callback = () => this.clerkjs?.signOut(signOutCallbackOrOptions as any, options);
const callback =
typeof signOutCallbackOrOptions === 'function'
? () => this.clerkjs?.signOut(signOutCallbackOrOptions, options)
: () => this.clerkjs?.signOut(signOutCallbackOrOptions);

if (this.clerkjs && this.#loaded) {
return callback() as Promise<void>;
} else {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/utils/loadClerkJsScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type LoadClerkJsScriptOptions = Omit<IsomorphicClerkOptions, 'proxyUrl' | 'domai
domain: string;
};

// eslint-disable-next-line @typescript-eslint/require-await
export const loadClerkJsScript = async (opts: LoadClerkJsScriptOptions) => {
const { frontendApi, publishableKey } = opts;

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-node/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
transform: {
'^.+\\.ts$': 'ts-jest',
},
setupFiles: ['<rootDir>/setupEnvVars.js'],
setupFiles: ['<rootDir>/jest.setup.js'],
collectCoverage: true,
// Jest currently does not support package.json subpath imports
// so we manually map them to the actual files. See @clerk/backend/package.json
Expand Down
File renamed without changes.
28 changes: 28 additions & 0 deletions packages/sdk-node/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"inputs": [
"*.d.ts",
"**/package.json",
"cjs/**",
"esm/**",
"src/**",
"scripts/**",
"tsconfig.json",
"tsconfig.declarations.json",
"tsup.config.ts",

"!**/**/*.test.*",
"!**/test/**",
"!**/tests/**",
"!**/__tests__/**",
"!**/__mocks__/**",
"!**/__snapshots__/**",
"!coverage/**",
"!examples/**",
"!node_modules/**"
]
}
}
}
2 changes: 1 addition & 1 deletion packages/shared/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = {

testEnvironment: 'jsdom',
roots: ['<rootDir>/src'],
setupFiles: ['./setupJest.ts'],
setupFiles: ['./jest.setup.ts'],

collectCoverage: false,
coverageProvider: 'v8',
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion packages/shared/src/hooks/useOrganization.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
ActiveSessionResource,
ClerkPaginationParams,
GetDomainsParams,
GetInvitationsParams,
Expand Down Expand Up @@ -365,7 +366,10 @@ export const useOrganization: UseOrganization = params => {
isLoaded: !isMembershipsLoading && !isInvitationsLoading,
organization,
membershipList,
membership: getCurrentOrganizationMembership(session!.user.organizationMemberships, organization.id), // your membership in the current org
membership: getCurrentOrganizationMembership(
(session as ActiveSessionResource).user.organizationMemberships,
organization.id,
), // your membership in the current org
invitationList,
unstable__mutate: () => {
void mutateMembershipList();
Expand Down
16 changes: 8 additions & 8 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"allowJs": true
},
"include": [
".eslintrc.js",
"commitlint.config.js",
"jest.*.ts",
"integration/*/*.js",
"integration/**/*.ts",
"integration/**/*.tsx",
"packages/*/src",
"packages/*/*.js",
"packages/**/*.ts",
"packages/**/*.tsx",
"packages/*/*.js",
"integration/**/*.ts",
"integration/**/*.tsx",
"integration/*/*.js",
".eslintrc.js",
"commitlint.config.js",
"scripts/*.mjs",
"setupJest.afterEnv.ts"
"scripts/*.mjs"
]
}
Loading