@kerne/react 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Kerne
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.tsx
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ KerneClient: () => KerneClient,
24
+ KerneProvider: () => KerneProvider,
25
+ createKerneClient: () => createKerneClient,
26
+ useAuth: () => useAuth,
27
+ useBilling: () => useBilling,
28
+ useKerne: () => useKerne
29
+ });
30
+ module.exports = __toCommonJS(index_exports);
31
+ var import_react = require("react");
32
+ var import_server = require("@kerne/server");
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var DEFAULT_STORAGE_KEY = "kerne_auth";
35
+ var KerneClient = class {
36
+ kerne;
37
+ storage;
38
+ storageKey;
39
+ onAuthChange;
40
+ currentUser = null;
41
+ currentToken = null;
42
+ constructor(config) {
43
+ this.storage = config.storage ?? (typeof window !== "undefined" ? localStorage : null);
44
+ this.storageKey = config.storageKey ?? DEFAULT_STORAGE_KEY;
45
+ this.onAuthChange = config.onAuthChange;
46
+ this.kerne = new import_server.Kerne({
47
+ baseUrl: config.baseUrl,
48
+ appId: config.appId,
49
+ timeout: config.timeout
50
+ });
51
+ this.loadSession();
52
+ }
53
+ loadSession() {
54
+ if (!this.storage) return;
55
+ try {
56
+ const data = this.storage.getItem(this.storageKey);
57
+ if (data) {
58
+ const { user, token, expires_at } = JSON.parse(data);
59
+ if (new Date(expires_at) > /* @__PURE__ */ new Date()) {
60
+ this.currentUser = user;
61
+ this.currentToken = token;
62
+ this.kerne = this.kerne.withToken(token);
63
+ } else {
64
+ this.storage.removeItem(this.storageKey);
65
+ }
66
+ }
67
+ } catch {
68
+ this.storage.removeItem(this.storageKey);
69
+ }
70
+ }
71
+ saveSession(response) {
72
+ this.currentUser = response.user;
73
+ this.currentToken = response.token;
74
+ this.kerne = this.kerne.withToken(response.token);
75
+ if (this.storage) {
76
+ this.storage.setItem(this.storageKey, JSON.stringify(response));
77
+ }
78
+ this.onAuthChange?.(response.user);
79
+ }
80
+ clearSession() {
81
+ this.currentUser = null;
82
+ this.currentToken = null;
83
+ if (this.storage) {
84
+ this.storage.removeItem(this.storageKey);
85
+ }
86
+ this.onAuthChange?.(null);
87
+ }
88
+ get user() {
89
+ return this.currentUser;
90
+ }
91
+ get token() {
92
+ return this.currentToken;
93
+ }
94
+ get isAuthenticated() {
95
+ return this.currentToken !== null;
96
+ }
97
+ get client() {
98
+ return this.kerne;
99
+ }
100
+ get projects() {
101
+ return this.kerne.projects;
102
+ }
103
+ async register(params) {
104
+ const [firstName, ...lastNameParts] = (params.name || "").split(" ");
105
+ const lastName = lastNameParts.join(" ");
106
+ const response = await this.kerne.auth.signup({
107
+ email: params.email,
108
+ password: params.password,
109
+ first_name: firstName,
110
+ last_name: lastName || void 0
111
+ });
112
+ this.saveSession(response);
113
+ return response;
114
+ }
115
+ async login(params) {
116
+ const response = await this.kerne.auth.login({
117
+ email: params.email,
118
+ password: params.password
119
+ });
120
+ this.saveSession(response);
121
+ return response;
122
+ }
123
+ async refreshToken() {
124
+ if (!this.currentToken) return null;
125
+ const response = await this.kerne.auth.refreshToken({
126
+ refresh_token: this.currentToken
127
+ });
128
+ this.saveSession(response);
129
+ return response;
130
+ }
131
+ logout() {
132
+ this.clearSession();
133
+ }
134
+ async refreshUser() {
135
+ if (!this.currentToken) return null;
136
+ try {
137
+ const user = await this.kerne.users.me();
138
+ this.currentUser = user;
139
+ this.onAuthChange?.(user);
140
+ return user;
141
+ } catch {
142
+ this.clearSession();
143
+ return null;
144
+ }
145
+ }
146
+ async checkEntitlement(featureKey, requested) {
147
+ try {
148
+ const check = await this.kerne.billing.checkEntitlement(featureKey, requested);
149
+ return check.has_access;
150
+ } catch {
151
+ return false;
152
+ }
153
+ }
154
+ async createCheckout(planId, options) {
155
+ const { url } = await this.kerne.billing.createCheckout(planId, {
156
+ success_url: options?.successUrl,
157
+ cancel_url: options?.cancelUrl
158
+ });
159
+ return url;
160
+ }
161
+ async openCheckout(planId, options) {
162
+ const url = await this.createCheckout(planId, options);
163
+ if (typeof window !== "undefined") {
164
+ window.location.href = url;
165
+ }
166
+ }
167
+ async createPortal(returnUrl) {
168
+ const { url } = await this.kerne.billing.createPortal({ return_url: returnUrl });
169
+ return url;
170
+ }
171
+ async openPortal(returnUrl) {
172
+ const url = await this.createPortal(returnUrl);
173
+ if (typeof window !== "undefined") {
174
+ window.location.href = url;
175
+ }
176
+ }
177
+ };
178
+ function createKerneClient(config) {
179
+ return new KerneClient(config);
180
+ }
181
+ var KerneContext = (0, import_react.createContext)(null);
182
+ function KerneProvider({ children, ...config }) {
183
+ const [user, setUser] = (0, import_react.useState)(null);
184
+ const client = (0, import_react.useMemo)(() => {
185
+ return new KerneClient({
186
+ ...config,
187
+ onAuthChange: (u) => {
188
+ setUser(u);
189
+ config.onAuthChange?.(u);
190
+ }
191
+ });
192
+ }, [config.appId, config.baseUrl]);
193
+ (0, import_react.useEffect)(() => {
194
+ setUser(client.user);
195
+ }, [client]);
196
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KerneContext.Provider, { value: client, children });
197
+ }
198
+ function useKerne() {
199
+ const context = (0, import_react.useContext)(KerneContext);
200
+ if (!context) {
201
+ throw new Error("useKerne must be used within a KerneProvider");
202
+ }
203
+ return context;
204
+ }
205
+ function useAuth() {
206
+ const client = useKerne();
207
+ const [user, setUser] = (0, import_react.useState)(client.user);
208
+ (0, import_react.useEffect)(() => {
209
+ setUser(client.user);
210
+ }, [client.user]);
211
+ return {
212
+ user,
213
+ isAuthenticated: client.isAuthenticated,
214
+ login: client.login.bind(client),
215
+ register: client.register.bind(client),
216
+ logout: client.logout.bind(client),
217
+ refreshUser: client.refreshUser.bind(client)
218
+ };
219
+ }
220
+ function useBilling() {
221
+ const client = useKerne();
222
+ return {
223
+ checkEntitlement: client.checkEntitlement.bind(client),
224
+ createCheckout: client.createCheckout.bind(client),
225
+ openCheckout: client.openCheckout.bind(client),
226
+ createPortal: client.createPortal.bind(client),
227
+ openPortal: client.openPortal.bind(client)
228
+ };
229
+ }
230
+ // Annotate the CommonJS export names for ESM import in node:
231
+ 0 && (module.exports = {
232
+ KerneClient,
233
+ KerneProvider,
234
+ createKerneClient,
235
+ useAuth,
236
+ useBilling,
237
+ useKerne
238
+ });
@@ -0,0 +1,87 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _kerne_server from '@kerne/server';
3
+ import { KerneConfig, Kerne } from '@kerne/server';
4
+ import React from 'react';
5
+ import { User, AuthResponse } from '@kerne/types';
6
+
7
+ interface KerneReactConfig extends Omit<KerneConfig, 'secretKey'> {
8
+ storage?: Storage;
9
+ storageKey?: string;
10
+ onAuthChange?: (user: User | null) => void;
11
+ }
12
+ declare class KerneClient {
13
+ private kerne;
14
+ private storage;
15
+ private storageKey;
16
+ private onAuthChange?;
17
+ private currentUser;
18
+ private currentToken;
19
+ constructor(config: KerneReactConfig);
20
+ private loadSession;
21
+ private saveSession;
22
+ private clearSession;
23
+ get user(): User | null;
24
+ get token(): string | null;
25
+ get isAuthenticated(): boolean;
26
+ get client(): Kerne;
27
+ get projects(): _kerne_server.ProjectsResource;
28
+ register(params: {
29
+ email: string;
30
+ password: string;
31
+ name?: string;
32
+ }): Promise<AuthResponse>;
33
+ login(params: {
34
+ email: string;
35
+ password: string;
36
+ }): Promise<AuthResponse>;
37
+ refreshToken(): Promise<AuthResponse | null>;
38
+ logout(): void;
39
+ refreshUser(): Promise<User | null>;
40
+ checkEntitlement(featureKey: string, requested?: number): Promise<boolean>;
41
+ createCheckout(planId: string, options?: {
42
+ successUrl?: string;
43
+ cancelUrl?: string;
44
+ }): Promise<string>;
45
+ openCheckout(planId: string, options?: {
46
+ successUrl?: string;
47
+ cancelUrl?: string;
48
+ }): Promise<void>;
49
+ createPortal(returnUrl?: string): Promise<string>;
50
+ openPortal(returnUrl?: string): Promise<void>;
51
+ }
52
+ declare function createKerneClient(config: KerneReactConfig): KerneClient;
53
+ interface KerneProviderProps extends KerneReactConfig {
54
+ children: React.ReactNode;
55
+ }
56
+ declare function KerneProvider({ children, ...config }: KerneProviderProps): react_jsx_runtime.JSX.Element;
57
+ declare function useKerne(): KerneClient;
58
+ declare function useAuth(): {
59
+ user: User | null;
60
+ isAuthenticated: boolean;
61
+ login: (params: {
62
+ email: string;
63
+ password: string;
64
+ }) => Promise<AuthResponse>;
65
+ register: (params: {
66
+ email: string;
67
+ password: string;
68
+ name?: string;
69
+ }) => Promise<AuthResponse>;
70
+ logout: () => void;
71
+ refreshUser: () => Promise<User | null>;
72
+ };
73
+ declare function useBilling(): {
74
+ checkEntitlement: (featureKey: string, requested?: number) => Promise<boolean>;
75
+ createCheckout: (planId: string, options?: {
76
+ successUrl?: string;
77
+ cancelUrl?: string;
78
+ }) => Promise<string>;
79
+ openCheckout: (planId: string, options?: {
80
+ successUrl?: string;
81
+ cancelUrl?: string;
82
+ }) => Promise<void>;
83
+ createPortal: (returnUrl?: string) => Promise<string>;
84
+ openPortal: (returnUrl?: string) => Promise<void>;
85
+ };
86
+
87
+ export { KerneClient, KerneProvider, type KerneProviderProps, type KerneReactConfig, createKerneClient, useAuth, useBilling, useKerne };
@@ -0,0 +1,87 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _kerne_server from '@kerne/server';
3
+ import { KerneConfig, Kerne } from '@kerne/server';
4
+ import React from 'react';
5
+ import { User, AuthResponse } from '@kerne/types';
6
+
7
+ interface KerneReactConfig extends Omit<KerneConfig, 'secretKey'> {
8
+ storage?: Storage;
9
+ storageKey?: string;
10
+ onAuthChange?: (user: User | null) => void;
11
+ }
12
+ declare class KerneClient {
13
+ private kerne;
14
+ private storage;
15
+ private storageKey;
16
+ private onAuthChange?;
17
+ private currentUser;
18
+ private currentToken;
19
+ constructor(config: KerneReactConfig);
20
+ private loadSession;
21
+ private saveSession;
22
+ private clearSession;
23
+ get user(): User | null;
24
+ get token(): string | null;
25
+ get isAuthenticated(): boolean;
26
+ get client(): Kerne;
27
+ get projects(): _kerne_server.ProjectsResource;
28
+ register(params: {
29
+ email: string;
30
+ password: string;
31
+ name?: string;
32
+ }): Promise<AuthResponse>;
33
+ login(params: {
34
+ email: string;
35
+ password: string;
36
+ }): Promise<AuthResponse>;
37
+ refreshToken(): Promise<AuthResponse | null>;
38
+ logout(): void;
39
+ refreshUser(): Promise<User | null>;
40
+ checkEntitlement(featureKey: string, requested?: number): Promise<boolean>;
41
+ createCheckout(planId: string, options?: {
42
+ successUrl?: string;
43
+ cancelUrl?: string;
44
+ }): Promise<string>;
45
+ openCheckout(planId: string, options?: {
46
+ successUrl?: string;
47
+ cancelUrl?: string;
48
+ }): Promise<void>;
49
+ createPortal(returnUrl?: string): Promise<string>;
50
+ openPortal(returnUrl?: string): Promise<void>;
51
+ }
52
+ declare function createKerneClient(config: KerneReactConfig): KerneClient;
53
+ interface KerneProviderProps extends KerneReactConfig {
54
+ children: React.ReactNode;
55
+ }
56
+ declare function KerneProvider({ children, ...config }: KerneProviderProps): react_jsx_runtime.JSX.Element;
57
+ declare function useKerne(): KerneClient;
58
+ declare function useAuth(): {
59
+ user: User | null;
60
+ isAuthenticated: boolean;
61
+ login: (params: {
62
+ email: string;
63
+ password: string;
64
+ }) => Promise<AuthResponse>;
65
+ register: (params: {
66
+ email: string;
67
+ password: string;
68
+ name?: string;
69
+ }) => Promise<AuthResponse>;
70
+ logout: () => void;
71
+ refreshUser: () => Promise<User | null>;
72
+ };
73
+ declare function useBilling(): {
74
+ checkEntitlement: (featureKey: string, requested?: number) => Promise<boolean>;
75
+ createCheckout: (planId: string, options?: {
76
+ successUrl?: string;
77
+ cancelUrl?: string;
78
+ }) => Promise<string>;
79
+ openCheckout: (planId: string, options?: {
80
+ successUrl?: string;
81
+ cancelUrl?: string;
82
+ }) => Promise<void>;
83
+ createPortal: (returnUrl?: string) => Promise<string>;
84
+ openPortal: (returnUrl?: string) => Promise<void>;
85
+ };
86
+
87
+ export { KerneClient, KerneProvider, type KerneProviderProps, type KerneReactConfig, createKerneClient, useAuth, useBilling, useKerne };
package/dist/index.js ADDED
@@ -0,0 +1,208 @@
1
+ // src/index.tsx
2
+ import { createContext, useContext, useEffect, useState, useMemo } from "react";
3
+ import { Kerne } from "@kerne/server";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var DEFAULT_STORAGE_KEY = "kerne_auth";
6
+ var KerneClient = class {
7
+ kerne;
8
+ storage;
9
+ storageKey;
10
+ onAuthChange;
11
+ currentUser = null;
12
+ currentToken = null;
13
+ constructor(config) {
14
+ this.storage = config.storage ?? (typeof window !== "undefined" ? localStorage : null);
15
+ this.storageKey = config.storageKey ?? DEFAULT_STORAGE_KEY;
16
+ this.onAuthChange = config.onAuthChange;
17
+ this.kerne = new Kerne({
18
+ baseUrl: config.baseUrl,
19
+ appId: config.appId,
20
+ timeout: config.timeout
21
+ });
22
+ this.loadSession();
23
+ }
24
+ loadSession() {
25
+ if (!this.storage) return;
26
+ try {
27
+ const data = this.storage.getItem(this.storageKey);
28
+ if (data) {
29
+ const { user, token, expires_at } = JSON.parse(data);
30
+ if (new Date(expires_at) > /* @__PURE__ */ new Date()) {
31
+ this.currentUser = user;
32
+ this.currentToken = token;
33
+ this.kerne = this.kerne.withToken(token);
34
+ } else {
35
+ this.storage.removeItem(this.storageKey);
36
+ }
37
+ }
38
+ } catch {
39
+ this.storage.removeItem(this.storageKey);
40
+ }
41
+ }
42
+ saveSession(response) {
43
+ this.currentUser = response.user;
44
+ this.currentToken = response.token;
45
+ this.kerne = this.kerne.withToken(response.token);
46
+ if (this.storage) {
47
+ this.storage.setItem(this.storageKey, JSON.stringify(response));
48
+ }
49
+ this.onAuthChange?.(response.user);
50
+ }
51
+ clearSession() {
52
+ this.currentUser = null;
53
+ this.currentToken = null;
54
+ if (this.storage) {
55
+ this.storage.removeItem(this.storageKey);
56
+ }
57
+ this.onAuthChange?.(null);
58
+ }
59
+ get user() {
60
+ return this.currentUser;
61
+ }
62
+ get token() {
63
+ return this.currentToken;
64
+ }
65
+ get isAuthenticated() {
66
+ return this.currentToken !== null;
67
+ }
68
+ get client() {
69
+ return this.kerne;
70
+ }
71
+ get projects() {
72
+ return this.kerne.projects;
73
+ }
74
+ async register(params) {
75
+ const [firstName, ...lastNameParts] = (params.name || "").split(" ");
76
+ const lastName = lastNameParts.join(" ");
77
+ const response = await this.kerne.auth.signup({
78
+ email: params.email,
79
+ password: params.password,
80
+ first_name: firstName,
81
+ last_name: lastName || void 0
82
+ });
83
+ this.saveSession(response);
84
+ return response;
85
+ }
86
+ async login(params) {
87
+ const response = await this.kerne.auth.login({
88
+ email: params.email,
89
+ password: params.password
90
+ });
91
+ this.saveSession(response);
92
+ return response;
93
+ }
94
+ async refreshToken() {
95
+ if (!this.currentToken) return null;
96
+ const response = await this.kerne.auth.refreshToken({
97
+ refresh_token: this.currentToken
98
+ });
99
+ this.saveSession(response);
100
+ return response;
101
+ }
102
+ logout() {
103
+ this.clearSession();
104
+ }
105
+ async refreshUser() {
106
+ if (!this.currentToken) return null;
107
+ try {
108
+ const user = await this.kerne.users.me();
109
+ this.currentUser = user;
110
+ this.onAuthChange?.(user);
111
+ return user;
112
+ } catch {
113
+ this.clearSession();
114
+ return null;
115
+ }
116
+ }
117
+ async checkEntitlement(featureKey, requested) {
118
+ try {
119
+ const check = await this.kerne.billing.checkEntitlement(featureKey, requested);
120
+ return check.has_access;
121
+ } catch {
122
+ return false;
123
+ }
124
+ }
125
+ async createCheckout(planId, options) {
126
+ const { url } = await this.kerne.billing.createCheckout(planId, {
127
+ success_url: options?.successUrl,
128
+ cancel_url: options?.cancelUrl
129
+ });
130
+ return url;
131
+ }
132
+ async openCheckout(planId, options) {
133
+ const url = await this.createCheckout(planId, options);
134
+ if (typeof window !== "undefined") {
135
+ window.location.href = url;
136
+ }
137
+ }
138
+ async createPortal(returnUrl) {
139
+ const { url } = await this.kerne.billing.createPortal({ return_url: returnUrl });
140
+ return url;
141
+ }
142
+ async openPortal(returnUrl) {
143
+ const url = await this.createPortal(returnUrl);
144
+ if (typeof window !== "undefined") {
145
+ window.location.href = url;
146
+ }
147
+ }
148
+ };
149
+ function createKerneClient(config) {
150
+ return new KerneClient(config);
151
+ }
152
+ var KerneContext = createContext(null);
153
+ function KerneProvider({ children, ...config }) {
154
+ const [user, setUser] = useState(null);
155
+ const client = useMemo(() => {
156
+ return new KerneClient({
157
+ ...config,
158
+ onAuthChange: (u) => {
159
+ setUser(u);
160
+ config.onAuthChange?.(u);
161
+ }
162
+ });
163
+ }, [config.appId, config.baseUrl]);
164
+ useEffect(() => {
165
+ setUser(client.user);
166
+ }, [client]);
167
+ return /* @__PURE__ */ jsx(KerneContext.Provider, { value: client, children });
168
+ }
169
+ function useKerne() {
170
+ const context = useContext(KerneContext);
171
+ if (!context) {
172
+ throw new Error("useKerne must be used within a KerneProvider");
173
+ }
174
+ return context;
175
+ }
176
+ function useAuth() {
177
+ const client = useKerne();
178
+ const [user, setUser] = useState(client.user);
179
+ useEffect(() => {
180
+ setUser(client.user);
181
+ }, [client.user]);
182
+ return {
183
+ user,
184
+ isAuthenticated: client.isAuthenticated,
185
+ login: client.login.bind(client),
186
+ register: client.register.bind(client),
187
+ logout: client.logout.bind(client),
188
+ refreshUser: client.refreshUser.bind(client)
189
+ };
190
+ }
191
+ function useBilling() {
192
+ const client = useKerne();
193
+ return {
194
+ checkEntitlement: client.checkEntitlement.bind(client),
195
+ createCheckout: client.createCheckout.bind(client),
196
+ openCheckout: client.openCheckout.bind(client),
197
+ createPortal: client.createPortal.bind(client),
198
+ openPortal: client.openPortal.bind(client)
199
+ };
200
+ }
201
+ export {
202
+ KerneClient,
203
+ KerneProvider,
204
+ createKerneClient,
205
+ useAuth,
206
+ useBilling,
207
+ useKerne
208
+ };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@kerne/react",
3
+ "version": "0.1.0",
4
+ "description": "Kerne React SDK",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "license": "MIT",
8
+ "author": {
9
+ "name": "Kerne",
10
+ "url": "https://kerne.io"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/kerne-io/kerne.git"
15
+ },
16
+ "type": "module",
17
+ "types": "dist/index.d.ts",
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsup src/index.tsx --format cjs,esm --dts --clean",
23
+ "dev": "tsup src/index.tsx --format cjs,esm --dts --watch",
24
+ "typecheck": "tsc --noEmit"
25
+ },
26
+ "dependencies": {
27
+ "@kerne/server": "workspace:*",
28
+ "@kerne/types": "workspace:*"
29
+ },
30
+ "peerDependencies": {
31
+ "react": "^18.0.0 || ^19.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/react": "^18.0.0 || ^19.0.0",
35
+ "react": "^19.0.0",
36
+ "tsup": "^8.3.0",
37
+ "typescript": "^5.7.0"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ }
42
+ }