Skip to content
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
14 changes: 12 additions & 2 deletions packages/core/supabase-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,28 @@
"src"
],
"main": "dist/main/index.js",
"module": "dist/module/index.js",
"module": "dist/esm/wrapper.mjs",
"types": "dist/module/index.d.ts",
"exports": {
".": {
"types": "./dist/module/index.d.ts",
"import": "./dist/esm/wrapper.mjs",
"require": "./dist/main/index.js"
},
"./dist/module/*": "./dist/module/*",
"./package.json": "./package.json"
},
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/supabase/supabase-js.git",
"directory": "packages/core/supabase-js"
},
"scripts": {
"build": "npm run build:main && npm run build:module && npm run build:umd",
"build": "npm run build:main && npm run build:module && npm run build:esm && npm run build:umd",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"build:esm": "node scripts/copy-wrapper.cjs",
"build:umd": "webpack --env mode=production",
"test": "npm run test:types && npm run test:run",
"test:all": "npm run test:types && npm run test:run && npm run test:integration && npm run test:integration:browser",
Expand Down
9 changes: 9 additions & 0 deletions packages/core/supabase-js/scripts/copy-wrapper.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const fs = require('fs')
const path = require('path')

const src = path.join(__dirname, '..', 'wrapper.mjs')
const destDir = path.join(__dirname, '..', 'dist', 'esm')
const dest = path.join(destDir, 'wrapper.mjs')

fs.mkdirSync(destDir, { recursive: true })
fs.copyFileSync(src, dest)
94 changes: 94 additions & 0 deletions packages/core/supabase-js/wrapper.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import * as index from '../main/index.js'
const {
PostgrestError,
FunctionsHttpError,
FunctionsFetchError,
FunctionsRelayError,
FunctionsError,
FunctionRegion,
SupabaseClient,
createClient,
GoTrueAdminApi,
GoTrueClient,
AuthAdminApi,
AuthClient,
navigatorLock,
NavigatorLockAcquireTimeoutError,
lockInternals,
processLock,
SIGN_OUT_SCOPES,
AuthError,
AuthApiError,
AuthUnknownError,
CustomAuthError,
AuthSessionMissingError,
AuthInvalidTokenResponseError,
AuthInvalidCredentialsError,
AuthImplicitGrantRedirectError,
AuthPKCEGrantCodeExchangeError,
AuthRetryableFetchError,
AuthWeakPasswordError,
AuthInvalidJwtError,
isAuthError,
isAuthApiError,
isAuthSessionMissingError,
isAuthImplicitGrantRedirectError,
isAuthRetryableFetchError,
isAuthWeakPasswordError,
RealtimePresence,
RealtimeChannel,
RealtimeClient,
REALTIME_LISTEN_TYPES,
REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
REALTIME_PRESENCE_LISTEN_EVENTS,
REALTIME_SUBSCRIBE_STATES,
REALTIME_CHANNEL_STATES,
} = index.default || index

export {
PostgrestError,
FunctionsHttpError,
FunctionsFetchError,
FunctionsRelayError,
FunctionsError,
FunctionRegion,
SupabaseClient,
createClient,
GoTrueAdminApi,
GoTrueClient,
AuthAdminApi,
AuthClient,
navigatorLock,
NavigatorLockAcquireTimeoutError,
lockInternals,
processLock,
SIGN_OUT_SCOPES,
AuthError,
AuthApiError,
AuthUnknownError,
CustomAuthError,
AuthSessionMissingError,
AuthInvalidTokenResponseError,
AuthInvalidCredentialsError,
AuthImplicitGrantRedirectError,
AuthPKCEGrantCodeExchangeError,
AuthRetryableFetchError,
AuthWeakPasswordError,
AuthInvalidJwtError,
isAuthError,
isAuthApiError,
isAuthSessionMissingError,
isAuthImplicitGrantRedirectError,
isAuthRetryableFetchError,
isAuthWeakPasswordError,
RealtimePresence,
RealtimeChannel,
RealtimeClient,
REALTIME_LISTEN_TYPES,
REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
REALTIME_PRESENCE_LISTEN_EVENTS,
REALTIME_SUBSCRIBE_STATES,
REALTIME_CHANNEL_STATES,
}

export default index.default || index
Loading