Skip to content
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

fix(repo): Standardize ambient global.d.ts #4919

Merged
merged 6 commits into from
Jan 17, 2025
Merged
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
15 changes: 15 additions & 0 deletions .changeset/weak-rivers-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@clerk/chrome-extension': patch
'@clerk/tanstack-start': patch
'@clerk/react-router': patch
'@clerk/clerk-js': patch
'@clerk/elements': patch
'@clerk/express': patch
'@clerk/shared': patch
'@clerk/astro': patch
'@clerk/clerk-react': patch
'@clerk/remix': patch
'@clerk/clerk-expo': patch
---

Standardizing ambient declaration files for all SDKs
2 changes: 1 addition & 1 deletion packages/astro/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ pnpm-debug.log*
*.d.ts.map
!env.d.ts
!client.d.ts
!globals.d.ts
!global.d.ts
2 changes: 2 additions & 0 deletions packages/astro/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
6 changes: 0 additions & 6 deletions packages/astro/src/globals.d.ts

This file was deleted.

3 changes: 3 additions & 0 deletions packages/chrome-extension/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
declare const __DEV__: boolean;
7 changes: 0 additions & 7 deletions packages/chrome-extension/src/globals.d.ts

This file was deleted.

18 changes: 18 additions & 0 deletions packages/clerk-js/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,22 @@ declare module '@clerk/ui/styles.css' {
export default content;
}

declare module '*.svg' {
const value: React.FC<React.SVGAttributes<SVGElement>>;
export default value;
}

declare const BUILD_ENABLE_NEW_COMPONENTS: string;
declare const __PKG_NAME__: string;
declare const __PKG_VERSION__: string;
declare const __DEV__: boolean;

/**
* Build time feature flags.
*/
declare const __BUILD_DISABLE_RHC__: string;

interface Window {
__unstable__onBeforeSetActive: () => Promise<void> | void;
__unstable__onAfterSetActive: () => Promise<void> | void;
}
21 changes: 0 additions & 21 deletions packages/clerk-js/src/globals.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/common/BlockButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const AddBlockButton = (props: BlockButtonProps) => {
sx={theme => ({ justifyContent: 'flex-start', gap: theme.space.$2 })}
leftIcon={
<Icon
/* @ts-expect-error FIXME: icon prop typing */
icon={leftIcon || Plus}
sx={theme => ({
width: theme.sizes.$2x5,
Expand Down
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/elements/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ export const SelectButton = (
elementDescriptor={descriptors.selectButtonIcon}
elementId={descriptors.selectButtonIcon.setId(elementId)}
size='md'
/* @ts-expect-error FIXME: icon prop typing */
icon={icon || ChevronDown}
sx={iconSx}
/>
Expand Down
3 changes: 3 additions & 0 deletions packages/elements/src/types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
declare const __DEV__: boolean;
7 changes: 0 additions & 7 deletions packages/elements/src/types/globals.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/expo/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
6 changes: 0 additions & 6 deletions packages/expo/src/globals.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/express/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
6 changes: 0 additions & 6 deletions packages/express/src/globals.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/express/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"types": ["jest"]
},
"exclude": ["node_modules"],
"include": ["src/index.ts", "src/globals.d.ts"]
"include": ["src/index.ts", "src/global.d.ts"]
}
2 changes: 2 additions & 0 deletions packages/react-router/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
6 changes: 0 additions & 6 deletions packages/react-router/src/globals.d.ts

This file was deleted.

9 changes: 9 additions & 0 deletions packages/react/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
declare const JS_PACKAGE_VERSION: string;
declare const __DEV__: boolean;

declare module globalThis {
// eslint-disable-next-line no-var
var __BUILD_DISABLE_RHC__: boolean;
}
9 changes: 0 additions & 9 deletions packages/react/src/globals.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react/src/isomorphicClerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import type {
} from './types';
import { isConstructor } from './utils';

if (typeof __BUILD_DISABLE_RHC__ === 'undefined') {
if (typeof globalThis.__BUILD_DISABLE_RHC__ === 'undefined') {
globalThis.__BUILD_DISABLE_RHC__ = false;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"importHelpers": false,
"sourceMap": true
},
"include": ["src/globals.d.ts", "src/**/*.test.ts", "src/**/*.test.tsx"],
"include": ["src/global.d.ts", "src/**/*.test.ts", "src/**/*.test.tsx"],
"exclude": []
}
2 changes: 2 additions & 0 deletions packages/remix/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
6 changes: 0 additions & 6 deletions packages/remix/src/globals.d.ts

This file was deleted.

11 changes: 4 additions & 7 deletions packages/shared/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export {};

declare global {
const PACKAGE_VERSION: string;
const JS_PACKAGE_VERSION: string;
const __DEV__: boolean;
}
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
declare const JS_PACKAGE_VERSION: string;
declare const __DEV__: boolean;
4 changes: 4 additions & 0 deletions packages/tanstack-start/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare const PACKAGE_NAME: string;
declare const PACKAGE_VERSION: string;
declare const __DEV__: boolean;
declare const JS_PACKAGE_VERSION: string;
8 changes: 0 additions & 8 deletions packages/tanstack-start/src/globals.d.ts

This file was deleted.

Loading