Skip to content

Commit 9890097

Browse files
authored
verify jsr packaging rules (#1486)
1 parent 8a5a02a commit 9890097

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ jobs:
8181
- name: Install dependencies
8282
run: npm ci
8383

84+
- name: Check JSR
85+
run: npm run check:jsr
86+
8487
- name: Type Check
8588
run: npm run test:types
8689

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"scripts": {
2424
"clean": "rimraf dist docs/v2",
2525
"format": "prettier --write \"{src,test}/**/*.ts\"",
26+
"check:jsr": "jsr publish --dry-run",
2627
"build": "run-s clean format build:*",
2728
"build:main": "tsc -p tsconfig.json",
2829
"build:module": "tsc -p tsconfig.module.json",

src/SupabaseClient.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FunctionsClient } from '@supabase/functions-js'
2-
import { AuthChangeEvent } from '@supabase/auth-js'
2+
import { AuthChangeEvent, Subscription } from '@supabase/auth-js'
33
import {
44
PostgrestClient,
55
PostgrestFilterBuilder,
@@ -278,7 +278,7 @@ export default class SupabaseClient<
278278
return this.realtime.removeAllChannels()
279279
}
280280

281-
protected async _getAccessToken() {
281+
protected async _getAccessToken(): Promise<string | null> {
282282
if (this.accessToken) {
283283
return await this.accessToken()
284284
}
@@ -301,7 +301,7 @@ export default class SupabaseClient<
301301
}: SupabaseAuthClientOptions,
302302
headers?: Record<string, string>,
303303
fetch?: Fetch
304-
) {
304+
): SupabaseAuthClient {
305305
const authHeaders = {
306306
Authorization: `Bearer ${this.supabaseKey}`,
307307
apikey: `${this.supabaseKey}`,
@@ -324,14 +324,14 @@ export default class SupabaseClient<
324324
})
325325
}
326326

327-
protected _initRealtimeClient(options: RealtimeClientOptions) {
327+
protected _initRealtimeClient(options: RealtimeClientOptions): RealtimeClient {
328328
return new RealtimeClient(this.realtimeUrl.href, {
329329
...options,
330330
params: { ...{ apikey: this.supabaseKey }, ...options?.params },
331331
})
332332
}
333333

334-
protected async _listenForAuthEvents() {
334+
protected async _listenForAuthEvents(): Promise<{ data: { subscription: Subscription } }> {
335335
return await this.auth.onAuthStateChange((event, session) => {
336336
setTimeout(
337337
async () => await this._handleTokenChanged(event, 'CLIENT', session?.access_token),

0 commit comments

Comments
 (0)