@absolutejs/auth 0.45.0 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +82 -18
- package/dist/apikeys/postgresStores.d.ts +4 -4
- package/dist/cli/migrate.js +11 -3
- package/dist/cli/migrate.js.map +18 -18
- package/dist/client/index.js.map +3 -3
- package/dist/client/react.js.map +4 -4
- package/dist/client/solid.js.map +2 -2
- package/dist/client/svelte.js.map +2 -2
- package/dist/client/vue.js.map +3 -3
- package/dist/fingerprint-client/index.js +5 -2
- package/dist/fingerprint-client/index.js.map +3 -3
- package/dist/index.js +124 -50
- package/dist/index.js.map +48 -48
- package/dist/organizations/postgresOrganizationStore.d.ts +2 -2
- package/dist/plugins/index.js.map +2 -2
- package/dist/portal/postgresSetupSessionStore.d.ts +2 -2
- package/dist/scim/postgresScimTokenStore.d.ts +2 -2
- package/dist/sso/postgresSsoConnectionStore.d.ts +2 -2
- package/dist/stores/postgres.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyPgDatabase } from '../stores/postgres';
|
|
1
|
+
import { type AnyPgDatabase, type PgQueryResultHKT } from '../stores/postgres';
|
|
2
2
|
import type { InvitationState, MembershipStatus, OrganizationStore } from './types';
|
|
3
3
|
export declare const organizationInvitationsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
4
|
name: "auth_organization_invitations";
|
|
@@ -409,4 +409,4 @@ export declare const organizationsTable: import("drizzle-orm/pg-core").PgTableWi
|
|
|
409
409
|
dialect: "pg";
|
|
410
410
|
}>;
|
|
411
411
|
export declare const createNeonOrganizationStore: (databaseUrl: string) => OrganizationStore;
|
|
412
|
-
export declare const createPostgresOrganizationStore: (db: AnyPgDatabase) => OrganizationStore;
|
|
412
|
+
export declare const createPostgresOrganizationStore: <Q extends PgQueryResultHKT>(db: AnyPgDatabase<Q>) => OrganizationStore;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
"import { resolveMx } from 'node:dns/promises';\n\n// Email deliverability validation for sign-up — format, disposable-domain block, and an\n// optional MX check. A starter disposable list ships built-in; extend it with your own.\n\nexport type EmailValidationResult = {\n\tok: boolean;\n\treason?: 'disposable' | 'invalid_format' | 'no_mx';\n};\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/u;\n\nconst DISPOSABLE_DOMAINS = new Set([\n\t'10minutemail.com',\n\t'fakeinbox.com',\n\t'getnada.com',\n\t'guerrillamail.com',\n\t'mailinator.com',\n\t'maildrop.cc',\n\t'sharklasers.com',\n\t'temp-mail.org',\n\t'tempmail.com',\n\t'throwaway.email',\n\t'trashmail.com',\n\t'yopmail.com'\n]);\n\nconst domainOf = (email: string) =>\n\temail.slice(email.lastIndexOf('@') + 1).toLowerCase();\n\nconst hasMxRecord = async (domain: string) => {\n\ttry {\n\t\treturn (await resolveMx(domain)).length > 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n// Whether an email's domain is a known disposable/temporary provider (built-in list plus any\n// `extraDomains` you pass).\nexport const isDisposableEmail = (\n\temail: string,\n\textraDomains?: Iterable<string>\n) => {\n\tconst domain = domainOf(email);\n\n\treturn (\n\t\tDISPOSABLE_DOMAINS.has(domain) ||\n\t\t(extraDomains !== undefined && new Set(extraDomains).has(domain))\n\t);\n};\n\n// Validate an email for sign-up. With `checkMx`, also confirms the domain has MX records\n// (a network lookup). Wire it into your register flow before creating the user.\nexport const validateEmailDeliverability = async (\n\temail: string,\n\toptions?: { checkMx?: boolean; disposableDomains?: Iterable<string> }\n): Promise<EmailValidationResult> => {\n\tconst normalized = email.trim().toLowerCase();\n\tif (!EMAIL_PATTERN.test(normalized)) {\n\t\treturn { ok: false, reason: 'invalid_format' };\n\t}\n\tif (isDisposableEmail(normalized, options?.disposableDomains)) {\n\t\treturn { ok: false, reason: 'disposable' };\n\t}\n\tif (\n\t\toptions?.checkMx === true &&\n\t\t!(await hasMxRecord(domainOf(normalized)))\n\t) {\n\t\treturn { ok: false, reason: 'no_mx' };\n\t}\n\n\treturn { ok: true };\n};\n",
|
|
6
6
|
"// Tiny wrapper around the existing `isDisposableEmail` so it slots into the\n// CredentialsConfig.onCreateCredentialUser hook chain. Composes with whatever else the\n// consumer is doing in onCreateCredentialUser — call this first, fall through on pass.\n//\n// ~10 lines; mostly here as a concrete demonstration that \"plugin\" = \"named function\".\n\nimport { isDisposableEmail } from '../credentials/emailValidation';\n\nexport type DenyDisposableEmailDecision =\n\t| { allow: false; reason: string }\n\t| { allow: true };\n\nexport const denyDisposableEmailPlugin = async (\n\temail: string\n): Promise<DenyDisposableEmailDecision> => {\n\tconst trimmed = email.trim().toLowerCase();\n\tif (await isDisposableEmail(trimmed)) {\n\t\treturn { allow: false, reason: 'disposable_email' };\n\t}\n\n\treturn { allow: true };\n};\n",
|
|
7
7
|
"// Discord webhook plugin — same shape as slackAlert, slightly different payload.\n// ~20 lines; copy + modify if you want embeds, mentions, etc.\n\nimport type { AuditEvent, AuditEventType, AuditSink } from '../audit/types';\n\nexport type DiscordAlertOptions = {\n\tevents?: readonly AuditEventType[];\n\tformatContent?: (event: AuditEvent) => string;\n\twebhookUrl: string;\n};\n\nconst defaultContent = (event: AuditEvent) => {\n\tconst when = new Date(event.at).toISOString();\n\tconst who = event.userId ?? event.ip ?? 'unknown';\n\n\treturn `🔐 **${event.type}** — ${who} at ${when}`;\n};\n\nexport const discordAlertPlugin = ({\n\tevents,\n\tformatContent = defaultContent,\n\twebhookUrl\n}: DiscordAlertOptions): AuditSink => ({\n\tappend: async (event) => {\n\t\tif (events !== undefined && !events.includes(event.type)) return;\n\t\tawait fetch(webhookUrl, {\n\t\t\tbody: JSON.stringify({ content: formatContent(event) }),\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tmethod: 'POST'\n\t\t}).catch(() => undefined);\n\t}\n});\n",
|
|
8
|
-
"// Geo-block plugin — gate credential login on the request's country (from\n// `x-client-country` or `cf-ipcountry`). Pair with `isMfaRequired` (force MFA in\n// blocked countries) OR fail closed by throwing in your own login handler.\n//\n// ~25 lines; one Set lookup.\n\nconst readCountry = (headers: Record<string, string | undefined>) =>\n\theaders['x-client-country']?.toUpperCase() ??\n\theaders['cf-ipcountry']?.toUpperCase();\n\nexport type GeoBlockOptions =\n\t| { allowCountries: readonly string[]; denyCountries?: never }\n\t| { allowCountries?: never; denyCountries: readonly string[] };\n\n// Returns `true` when the request should be BLOCKED (i.e. the user is in a deny-listed\n// country, or not in the allow-list). The consumer uses the return to either force\n// MFA via `isMfaRequired` or to reject the login outright.\nexport const geoBlockPlugin = (options: GeoBlockOptions) => {\n\tconst allow =\n\t\toptions.allowCountries === undefined\n\t\t\t? undefined\n\t\t\t: new Set(
|
|
8
|
+
"// Geo-block plugin — gate credential login on the request's country (from\n// `x-client-country` or `cf-ipcountry`). Pair with `isMfaRequired` (force MFA in\n// blocked countries) OR fail closed by throwing in your own login handler.\n//\n// ~25 lines; one Set lookup.\n\nconst readCountry = (headers: Record<string, string | undefined>) =>\n\theaders['x-client-country']?.toUpperCase() ??\n\theaders['cf-ipcountry']?.toUpperCase();\n\nexport type GeoBlockOptions =\n\t| { allowCountries: readonly string[]; denyCountries?: never }\n\t| { allowCountries?: never; denyCountries: readonly string[] };\n\n// Returns `true` when the request should be BLOCKED (i.e. the user is in a deny-listed\n// country, or not in the allow-list). The consumer uses the return to either force\n// MFA via `isMfaRequired` or to reject the login outright.\nexport const geoBlockPlugin = (options: GeoBlockOptions) => {\n\tconst allow =\n\t\toptions.allowCountries === undefined\n\t\t\t? undefined\n\t\t\t: new Set(\n\t\t\t\t\toptions.allowCountries.map((country) =>\n\t\t\t\t\t\tcountry.toUpperCase()\n\t\t\t\t\t)\n\t\t\t\t);\n\tconst deny =\n\t\toptions.denyCountries === undefined\n\t\t\t? undefined\n\t\t\t: new Set(\n\t\t\t\t\toptions.denyCountries.map((country) =>\n\t\t\t\t\t\tcountry.toUpperCase()\n\t\t\t\t\t)\n\t\t\t\t);\n\n\treturn (headers: Record<string, string | undefined>) => {\n\t\tconst country = readCountry(headers);\n\t\tif (country === undefined) return false;\n\t\tif (deny !== undefined) return deny.has(country);\n\t\tif (allow !== undefined) return !allow.has(country);\n\n\t\treturn false;\n\t};\n};\n",
|
|
9
9
|
"// PagerDuty Events API v2 plugin. Posts a trigger event to a PagerDuty service —\n// pair with security-critical audit events (credentials_login_failed, mfa_challenge_failed,\n// impersonation_started) by passing `events: [...]`. Severity defaults to 'warning' but\n// most consumers wire 'critical' for these.\n//\n// Get a routing key from a PagerDuty integration: Service → Integrations → +Add → Events API v2.\n\nimport type { AuditEventType, AuditSink } from '../audit/types';\n\nconst PAGERDUTY_EVENTS_URL = 'https://events.pagerduty.com/v2/enqueue';\n\nexport type PagerDutySeverity = 'critical' | 'error' | 'info' | 'warning';\n\nexport type PagerDutyAlertOptions = {\n\tevents?: readonly AuditEventType[];\n\troutingKey: string;\n\tseverity?: PagerDutySeverity;\n\t// Optional source identifier (e.g. your service name) for grouping in PagerDuty.\n\tsource?: string;\n};\n\nexport const pagerdutyAlertPlugin = ({\n\tevents,\n\troutingKey,\n\tseverity = 'warning',\n\tsource = 'absolutejs-auth'\n}: PagerDutyAlertOptions): AuditSink => ({\n\tappend: async (event) => {\n\t\tif (events !== undefined && !events.includes(event.type)) return;\n\t\tawait fetch(PAGERDUTY_EVENTS_URL, {\n\t\t\tbody: JSON.stringify({\n\t\t\t\tevent_action: 'trigger',\n\t\t\t\tpayload: {\n\t\t\t\t\tcustom_details: event.metadata ?? {},\n\t\t\t\t\tseverity,\n\t\t\t\t\tsource,\n\t\t\t\t\tsummary: `auth event: ${event.type} (user=${event.userId ?? 'unknown'})`,\n\t\t\t\t\ttimestamp: new Date(event.at).toISOString()\n\t\t\t\t},\n\t\t\t\trouting_key: routingKey\n\t\t\t}),\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tmethod: 'POST'\n\t\t}).catch(() => undefined);\n\t}\n});\n",
|
|
10
10
|
"// PostHog server-side identify. Pair with audit events that have a `userId` (register,\n// credentials_login, oauth_login, …) to push the user to PostHog with their\n// email/properties so server-side events tie back to the right person.\n//\n// ~25 lines; one POST per event. Drop into the audit chain via composition or use as\n// an `AuditSink` directly.\n\nimport type { AuditEvent, AuditSink } from '../audit/types';\n\nexport type PosthogIdentifyOptions = {\n\thost?: string; // defaults to PostHog Cloud US\n\tprojectApiKey: string;\n\t// Pull the properties to send from the audit event metadata + your own enrichment.\n\tproperties?: (event: AuditEvent) => Record<string, unknown>;\n};\n\nconst DEFAULT_HOST = 'https://us.i.posthog.com';\n\nexport const posthogIdentifyPlugin = ({\n\thost = DEFAULT_HOST,\n\tprojectApiKey,\n\tproperties = (event) => ({ ...(event.metadata ?? {}) })\n}: PosthogIdentifyOptions): AuditSink => ({\n\tappend: async (event) => {\n\t\tif (event.userId === undefined) return;\n\t\tawait fetch(`${host}/capture/`, {\n\t\t\tbody: JSON.stringify({\n\t\t\t\tapi_key: projectApiKey,\n\t\t\t\tdistinct_id: event.userId,\n\t\t\t\tevent: '$identify',\n\t\t\t\tproperties: {\n\t\t\t\t\t$set: properties(event),\n\t\t\t\t\t$set_once: { first_seen_event: event.type }\n\t\t\t\t},\n\t\t\t\ttimestamp: new Date(event.at).toISOString()\n\t\t\t}),\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tmethod: 'POST'\n\t\t}).catch(() => undefined);\n\t}\n});\n",
|
|
11
11
|
"// Slack webhook plugin. Pair with `audit.onAuditEvent` OR drop into the audit chain\n// (it's a valid `AuditSink`) to post a one-line summary of chosen audit events to a\n// Slack channel webhook. Fire-and-forget, ~30 lines — copy + modify if you want a\n// different message shape.\n\nimport type { AuditEvent, AuditEventType, AuditSink } from '../audit/types';\n\nexport type SlackAlertOptions = {\n\t// Optional event-type allow-list. Without it, EVERY event posts — typically you\n\t// want to filter to security-relevant events like login failures + MFA failures.\n\tevents?: readonly AuditEventType[];\n\t// Build the Slack message body from the event. Default is one short line; override\n\t// to use Block Kit, attachments, mentions, etc.\n\tformatMessage?: (event: AuditEvent) => string;\n\twebhookUrl: string;\n};\n\nconst defaultFormat = (event: AuditEvent) => {\n\tconst when = new Date(event.at).toISOString();\n\tconst who = event.userId ?? event.ip ?? 'unknown';\n\n\treturn `🔐 *${event.type}* — ${who} at ${when}`;\n};\n\nexport const slackAlertPlugin = ({\n\tevents,\n\tformatMessage = defaultFormat,\n\twebhookUrl\n}: SlackAlertOptions): AuditSink => ({\n\tappend: async (event) => {\n\t\tif (events !== undefined && !events.includes(event.type)) return;\n\t\tawait fetch(webhookUrl, {\n\t\t\tbody: JSON.stringify({ text: formatMessage(event) }),\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tmethod: 'POST'\n\t\t}).catch(() => undefined);\n\t}\n});\n"
|
|
12
12
|
],
|
|
13
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAUA,IAAM,gBAAgB;AAEtB,IAAM,qBAAqB,IAAI,IAAI;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAED,IAAM,WAAW,CAAC,UACjB,MAAM,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE,YAAY;AAErD,IAAM,cAAc,OAAO,WAAmB;AAAA,EAC7C,IAAI;AAAA,IACH,QAAQ,MAAM,UAAU,MAAM,GAAG,SAAS;AAAA,IACzC,MAAM;AAAA,IACP,OAAO;AAAA;AAAA;AAMF,IAAM,oBAAoB,CAChC,OACA,iBACI;AAAA,EACJ,MAAM,SAAS,SAAS,KAAK;AAAA,EAE7B,OACC,mBAAmB,IAAI,MAAM,KAC5B,iBAAiB,aAAa,IAAI,IAAI,YAAY,EAAE,IAAI,MAAM;AAAA;AAM1D,IAAM,8BAA8B,OAC1C,OACA,YACoC;AAAA,EACpC,MAAM,aAAa,MAAM,KAAK,EAAE,YAAY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AAM,MAAM,GAAG,iBAAiB;AAAA,MAC/B,MAAM,KAAK,UAAU;AAAA,QACpB,SAAS;AAAA,QACT,aAAa,MAAM;AAAA,QACnB,OAAO;AAAA,QACP,YAAY;AAAA,UACX,MAAM,WAAW,KAAK;AAAA,UACtB,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAAA,QAC3C;AAAA,QACA,WAAW,IAAI,KAAK,MAAM,EAAE,EAAE,YAAY;AAAA,MAC3C,CAAC;AAAA,MACD,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,QAAQ;AAAA,IACT,CAAC,EAAE,MAAM,MAAG;AAAA,MAAG;AAAA,KAAS;AAAA;AAE1B;;ACvBA,IAAM,gBAAgB,CAAC,UAAsB;AAAA,EAC5C,MAAM,OAAO,IAAI,KAAK,MAAM,EAAE,EAAE,YAAY;AAAA,EAC5C,MAAM,MAAM,MAAM,UAAU,MAAM,MAAM;AAAA,EAExC,OAAO,iBAAM,MAAM,gBAAW,UAAU;AAAA;AAGlC,IAAM,mBAAmB;AAAA,EAC/B;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,OACoC;AAAA,EACpC,QAAQ,OAAO,UAAU;AAAA,IACxB,IAAI,WAAW,aAAa,CAAC,OAAO,SAAS,MAAM,IAAI;AAAA,MAAG;AAAA,IAC1D,MAAM,MAAM,YAAY;AAAA,MACvB,MAAM,KAAK,UAAU,EAAE,MAAM,cAAc,KAAK,EAAE,CAAC;AAAA,MACnD,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,QAAQ;AAAA,IACT,CAAC,EAAE,MAAM,MAAG;AAAA,MAAG;AAAA,KAAS;AAAA;AAE1B;",
|
|
14
14
|
"debugId": "A678C9E5494B63D064756E2164756E21",
|
|
15
15
|
"names": []
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyPgDatabase } from '../stores/postgres';
|
|
1
|
+
import { type AnyPgDatabase, type PgQueryResultHKT } from '../stores/postgres';
|
|
2
2
|
import type { SetupCapability, SetupSessionStore } from './types';
|
|
3
3
|
export declare const setupSessionsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
4
|
name: "auth_setup_sessions";
|
|
@@ -137,4 +137,4 @@ export declare const setupSessionsTable: import("drizzle-orm/pg-core").PgTableWi
|
|
|
137
137
|
dialect: "pg";
|
|
138
138
|
}>;
|
|
139
139
|
export declare const createNeonSetupSessionStore: (databaseUrl: string) => SetupSessionStore;
|
|
140
|
-
export declare const createPostgresSetupSessionStore: (db: AnyPgDatabase) => SetupSessionStore;
|
|
140
|
+
export declare const createPostgresSetupSessionStore: <Q extends PgQueryResultHKT>(db: AnyPgDatabase<Q>) => SetupSessionStore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyPgDatabase } from '../stores/postgres';
|
|
1
|
+
import { type AnyPgDatabase, type PgQueryResultHKT } from '../stores/postgres';
|
|
2
2
|
import type { ScimTokenStore } from './types';
|
|
3
3
|
export declare const scimTokensTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
4
|
name: "auth_scim_tokens";
|
|
@@ -99,4 +99,4 @@ export declare const scimTokensTable: import("drizzle-orm/pg-core").PgTableWithC
|
|
|
99
99
|
dialect: "pg";
|
|
100
100
|
}>;
|
|
101
101
|
export declare const createNeonScimTokenStore: (databaseUrl: string) => ScimTokenStore;
|
|
102
|
-
export declare const createPostgresScimTokenStore: (db: AnyPgDatabase) => ScimTokenStore;
|
|
102
|
+
export declare const createPostgresScimTokenStore: <Q extends PgQueryResultHKT>(db: AnyPgDatabase<Q>) => ScimTokenStore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnyPgDatabase } from '../stores/postgres';
|
|
1
|
+
import { type AnyPgDatabase, type PgQueryResultHKT } from '../stores/postgres';
|
|
2
2
|
import type { OidcConnectionConfig, SamlConnectionConfig, SSOConnectionStore, SSOConnectionType } from './types';
|
|
3
3
|
export declare const ssoConnectionsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
4
|
name: "auth_sso_connections";
|
|
@@ -136,4 +136,4 @@ export declare const ssoConnectionsTable: import("drizzle-orm/pg-core").PgTableW
|
|
|
136
136
|
dialect: "pg";
|
|
137
137
|
}>;
|
|
138
138
|
export declare const createNeonSsoConnectionStore: (databaseUrl: string) => SSOConnectionStore;
|
|
139
|
-
export declare const createPostgresSsoConnectionStore: (db: AnyPgDatabase) => SSOConnectionStore;
|
|
139
|
+
export declare const createPostgresSsoConnectionStore: <Q extends PgQueryResultHKT>(db: AnyPgDatabase<Q>) => SSOConnectionStore;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PgDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
2
|
-
export type AnyPgDatabase = PgDatabase<
|
|
2
|
+
export type AnyPgDatabase<Q extends PgQueryResultHKT = PgQueryResultHKT> = PgDatabase<Q>;
|
|
3
|
+
export type { PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
4
|
export declare const createNeonDatabase: (databaseUrl: string) => import("drizzle-orm/neon-http").NeonHttpDatabase<Record<string, never>> & {
|
|
4
5
|
$client: import("@neondatabase/serverless").NeonQueryFunction<false, false>;
|
|
5
6
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.45.
|
|
2
|
+
"version": "0.45.1",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"bin": {
|
|
11
11
|
"absolute-auth": "./dist/cli/migrate.js"
|
|
12
12
|
},
|
|
13
|
-
"license": "
|
|
13
|
+
"license": "BSL-1.1",
|
|
14
14
|
"author": "Alex Kahn",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "rm -rf dist && bun build src/index.ts src/htmx/index.ts src/client/index.ts src/client/react.ts src/client/vue.ts src/client/solid.ts src/client/svelte.ts src/plugins/index.ts src/providers/index.ts --root src --outdir dist --sourcemap --target=bun --external elysia --external react --external vue --external solid-js --external svelte --external @opentelemetry/api && bun build src/cli/migrate.ts --outdir dist/cli --sourcemap --target=bun --external @neondatabase/serverless --external drizzle-orm && bun build src/fingerprint-client/index.ts --outdir dist/fingerprint-client --sourcemap --target=browser && tsc --emitDeclarationOnly --project tsconfig.json && chmod +x dist/cli/migrate.js",
|