Skip to content

Commit 0b63c1c

Browse files
committed
refactor(clerk-js): re-export from base entry point and add export parity test
Eliminate duplicated exports in index.native.ts by using 'export * from ./index'. Add a test that verifies the native entry point exports match the base entry point.
1 parent e1d72d5 commit 0b63c1c

2 files changed

Lines changed: 12 additions & 19 deletions

File tree

packages/clerk-js/src/__tests__/index.native.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,14 @@ describe('index.native', () => {
4040

4141
expect(client1?.client).not.toBe(client2?.client);
4242
});
43+
44+
it('exports the same public API as the base entry point', async () => {
45+
const nativeExports = await import('../index.native');
46+
const baseExports = await import('../index');
47+
48+
const nativeKeys = Object.keys(nativeExports).sort();
49+
const baseKeys = Object.keys(baseExports).sort();
50+
51+
expect(nativeKeys).toEqual(baseKeys);
52+
});
4353
});

packages/clerk-js/src/index.native.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,5 @@ if (originalDescriptor) {
2323
});
2424
}
2525

26-
export {
27-
ClerkAPIResponseError,
28-
ClerkRuntimeError,
29-
EmailLinkError,
30-
EmailLinkErrorCode,
31-
EmailLinkErrorCodeStatus,
32-
isClerkAPIResponseError,
33-
isClerkRuntimeError,
34-
isEmailLinkError,
35-
isKnownError,
36-
isMetamaskError,
37-
isUserLockedError,
38-
type MetamaskError,
39-
} from '@clerk/shared/error';
40-
export { Clerk };
41-
42-
if (module.hot) {
43-
module.hot.accept();
44-
}
26+
// Re-export everything from the base entry point to avoid duplicating exports.
27+
export * from './index';

0 commit comments

Comments
 (0)