@prenta/plugin-commerce 0.2.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/CHANGELOG.md +262 -0
- package/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/__tests__/checkout.test.d.ts +2 -0
- package/dist/__tests__/checkout.test.d.ts.map +1 -0
- package/dist/__tests__/checkout.test.js +83 -0
- package/dist/__tests__/checkout.test.js.map +1 -0
- package/dist/__tests__/client.test.d.ts +2 -0
- package/dist/__tests__/client.test.d.ts.map +1 -0
- package/dist/__tests__/client.test.js +74 -0
- package/dist/__tests__/client.test.js.map +1 -0
- package/dist/__tests__/customer.test.d.ts +2 -0
- package/dist/__tests__/customer.test.d.ts.map +1 -0
- package/dist/__tests__/customer.test.js +21 -0
- package/dist/__tests__/customer.test.js.map +1 -0
- package/dist/__tests__/hooks.test.d.ts +2 -0
- package/dist/__tests__/hooks.test.d.ts.map +1 -0
- package/dist/__tests__/hooks.test.js +119 -0
- package/dist/__tests__/hooks.test.js.map +1 -0
- package/dist/__tests__/index.test.d.ts +2 -0
- package/dist/__tests__/index.test.d.ts.map +1 -0
- package/dist/__tests__/index.test.js +37 -0
- package/dist/__tests__/index.test.js.map +1 -0
- package/dist/__tests__/products.test.d.ts +2 -0
- package/dist/__tests__/products.test.d.ts.map +1 -0
- package/dist/__tests__/products.test.js +39 -0
- package/dist/__tests__/products.test.js.map +1 -0
- package/dist/__tests__/webhooks.test.d.ts +2 -0
- package/dist/__tests__/webhooks.test.d.ts.map +1 -0
- package/dist/__tests__/webhooks.test.js +71 -0
- package/dist/__tests__/webhooks.test.js.map +1 -0
- package/dist/admin/CommerceDashboard.d.ts +35 -0
- package/dist/admin/CommerceDashboard.d.ts.map +1 -0
- package/dist/admin/CommerceDashboard.js +36 -0
- package/dist/admin/CommerceDashboard.js.map +1 -0
- package/dist/admin/DiscountManager.d.ts +24 -0
- package/dist/admin/DiscountManager.d.ts.map +1 -0
- package/dist/admin/DiscountManager.js +77 -0
- package/dist/admin/DiscountManager.js.map +1 -0
- package/dist/admin/OrderDetail.d.ts +62 -0
- package/dist/admin/OrderDetail.d.ts.map +1 -0
- package/dist/admin/OrderDetail.js +62 -0
- package/dist/admin/OrderDetail.js.map +1 -0
- package/dist/admin/OrderList.d.ts +29 -0
- package/dist/admin/OrderList.d.ts.map +1 -0
- package/dist/admin/OrderList.js +30 -0
- package/dist/admin/OrderList.js.map +1 -0
- package/dist/admin/ProductEdit.d.ts +43 -0
- package/dist/admin/ProductEdit.d.ts.map +1 -0
- package/dist/admin/ProductEdit.js +68 -0
- package/dist/admin/ProductEdit.js.map +1 -0
- package/dist/admin/ProductList.d.ts +21 -0
- package/dist/admin/ProductList.d.ts.map +1 -0
- package/dist/admin/ProductList.js +39 -0
- package/dist/admin/ProductList.js.map +1 -0
- package/dist/client.d.ts +107 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +71 -0
- package/dist/client.js.map +1 -0
- package/dist/collections.d.ts +4 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +335 -0
- package/dist/collections.js.map +1 -0
- package/dist/fields.d.ts +4 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +3 -0
- package/dist/fields.js.map +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +33 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/stripe/checkout.d.ts +39 -0
- package/dist/stripe/checkout.d.ts.map +1 -0
- package/dist/stripe/checkout.js +60 -0
- package/dist/stripe/checkout.js.map +1 -0
- package/dist/stripe/customer.d.ts +11 -0
- package/dist/stripe/customer.d.ts.map +1 -0
- package/dist/stripe/customer.js +22 -0
- package/dist/stripe/customer.js.map +1 -0
- package/dist/stripe/products.d.ts +25 -0
- package/dist/stripe/products.d.ts.map +1 -0
- package/dist/stripe/products.js +29 -0
- package/dist/stripe/products.js.map +1 -0
- package/dist/stripe/webhooks.d.ts +28 -0
- package/dist/stripe/webhooks.d.ts.map +1 -0
- package/dist/stripe/webhooks.js +103 -0
- package/dist/stripe/webhooks.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ProductData {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
images?: string[];
|
|
6
|
+
metadata?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface StripeProduct {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
active: boolean;
|
|
12
|
+
metadata: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export interface StripePrice {
|
|
15
|
+
id: string;
|
|
16
|
+
productId: string;
|
|
17
|
+
unitAmount: number;
|
|
18
|
+
currency: string;
|
|
19
|
+
active: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Creates or updates a Stripe product to mirror an Prenta product record. */
|
|
22
|
+
export declare function syncProduct(product: ProductData): Promise<StripeProduct>;
|
|
23
|
+
/** Creates or updates a Stripe price for a given Stripe product. */
|
|
24
|
+
export declare function syncPrice(productId: string, amount: number, currency: string): Promise<StripePrice>;
|
|
25
|
+
//# sourceMappingURL=products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/stripe/products.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,8EAA8E;AAC9E,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAe9E;AAED,oEAAoE;AACpE,wBAAsB,SAAS,CAC7B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,CAWtB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Creates or updates a Stripe product to mirror an Prenta product record. */
|
|
2
|
+
export async function syncProduct(product) {
|
|
3
|
+
// TODO: Search Stripe for product by metadata.prentaProductId,
|
|
4
|
+
// then create or update via stripe.products API
|
|
5
|
+
return {
|
|
6
|
+
id: `prod_stub_${Date.now()}`,
|
|
7
|
+
name: product.name,
|
|
8
|
+
active: true,
|
|
9
|
+
// Spread caller metadata FIRST so it can never override the authoritative
|
|
10
|
+
// prentaProductId that links this Stripe product back to the Prenta record.
|
|
11
|
+
metadata: {
|
|
12
|
+
...product.metadata,
|
|
13
|
+
prentaProductId: product.id,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Creates or updates a Stripe price for a given Stripe product. */
|
|
18
|
+
export async function syncPrice(productId, amount, currency) {
|
|
19
|
+
// TODO: stripe.prices.create({ product: productId, unit_amount, currency })
|
|
20
|
+
// Stripe prices are immutable — deactivate old price and create new one if changed
|
|
21
|
+
return {
|
|
22
|
+
id: `price_stub_${Date.now()}`,
|
|
23
|
+
productId,
|
|
24
|
+
unitAmount: Math.round(amount * 100),
|
|
25
|
+
currency: currency.toLowerCase(),
|
|
26
|
+
active: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/stripe/products.ts"],"names":[],"mappings":"AAuBA,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAoB;IACpD,+DAA+D;IAC/D,sDAAsD;IAEtD,OAAO;QACL,EAAE,EAAE,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE;QAC7B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,IAAI;QACZ,0EAA0E;QAC1E,4EAA4E;QAC5E,QAAQ,EAAE;YACR,GAAG,OAAO,CAAC,QAAQ;YACnB,eAAe,EAAE,OAAO,CAAC,EAAE;SAC5B;KACF,CAAA;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,SAAiB,EACjB,MAAc,EACd,QAAgB;IAEhB,4EAA4E;IAC5E,yFAAyF;IAEzF,OAAO;QACL,EAAE,EAAE,cAAc,IAAI,CAAC,GAAG,EAAE,EAAE;QAC9B,SAAS;QACT,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;QACpC,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;QAChC,MAAM,EAAE,IAAI;KACb,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface WebhookResult {
|
|
2
|
+
handled: boolean;
|
|
3
|
+
event: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface VerifyOptions {
|
|
7
|
+
/** Reject events whose timestamp is further than this from now. Default 300s. */
|
|
8
|
+
toleranceSeconds?: number;
|
|
9
|
+
/** Current time in ms — injectable for deterministic tests. Default Date.now(). */
|
|
10
|
+
now?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Verify a Stripe webhook signature (the `Stripe-Signature` header) against the
|
|
14
|
+
* raw request body using the endpoint's signing secret. This is a
|
|
15
|
+
* dependency-free equivalent of `stripe.webhooks.constructEvent`:
|
|
16
|
+
*
|
|
17
|
+
* signed_payload = `${t}.${rawBody}`
|
|
18
|
+
* expected = HMAC-SHA256(signed_payload, secret) // hex
|
|
19
|
+
* valid = any provided v1 == expected (constant-time) AND |now - t| ≤ tolerance
|
|
20
|
+
*
|
|
21
|
+
* Throws on any failure. Multiple `v1` signatures (key rotation) are supported.
|
|
22
|
+
* Without this, a forged POST with any non-empty signature would be processed —
|
|
23
|
+
* a fake "payment succeeded" is a direct money/fraud risk.
|
|
24
|
+
*/
|
|
25
|
+
export declare function verifyStripeSignature(payload: string, signatureHeader: string, secret: string, options?: VerifyOptions): void;
|
|
26
|
+
/** Verifies and processes a Stripe webhook event payload. */
|
|
27
|
+
export declare function handleStripeWebhook(payload: string, signature: string, secret: string, options?: VerifyOptions): Promise<WebhookResult>;
|
|
28
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/stripe/webhooks.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAUD,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,aAAkB,GAC1B,IAAI,CAkCN;AAgCD,6DAA6D;AAC7D,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,aAAa,CAAC,CA8BxB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
/** Default replay-protection window, matching Stripe's SDK (5 minutes). */
|
|
3
|
+
const DEFAULT_TOLERANCE_SECONDS = 300;
|
|
4
|
+
/**
|
|
5
|
+
* Verify a Stripe webhook signature (the `Stripe-Signature` header) against the
|
|
6
|
+
* raw request body using the endpoint's signing secret. This is a
|
|
7
|
+
* dependency-free equivalent of `stripe.webhooks.constructEvent`:
|
|
8
|
+
*
|
|
9
|
+
* signed_payload = `${t}.${rawBody}`
|
|
10
|
+
* expected = HMAC-SHA256(signed_payload, secret) // hex
|
|
11
|
+
* valid = any provided v1 == expected (constant-time) AND |now - t| ≤ tolerance
|
|
12
|
+
*
|
|
13
|
+
* Throws on any failure. Multiple `v1` signatures (key rotation) are supported.
|
|
14
|
+
* Without this, a forged POST with any non-empty signature would be processed —
|
|
15
|
+
* a fake "payment succeeded" is a direct money/fraud risk.
|
|
16
|
+
*/
|
|
17
|
+
export function verifyStripeSignature(payload, signatureHeader, secret, options = {}) {
|
|
18
|
+
if (!secret)
|
|
19
|
+
throw new Error('Missing webhook signing secret');
|
|
20
|
+
if (!signatureHeader)
|
|
21
|
+
throw new Error('Missing webhook signature');
|
|
22
|
+
let timestamp;
|
|
23
|
+
const signatures = [];
|
|
24
|
+
for (const part of signatureHeader.split(',')) {
|
|
25
|
+
const eq = part.indexOf('=');
|
|
26
|
+
if (eq === -1)
|
|
27
|
+
continue;
|
|
28
|
+
const key = part.slice(0, eq).trim();
|
|
29
|
+
const value = part.slice(eq + 1).trim();
|
|
30
|
+
if (key === 't')
|
|
31
|
+
timestamp = value;
|
|
32
|
+
else if (key === 'v1')
|
|
33
|
+
signatures.push(value);
|
|
34
|
+
}
|
|
35
|
+
if (!timestamp || signatures.length === 0) {
|
|
36
|
+
throw new Error('Malformed webhook signature header');
|
|
37
|
+
}
|
|
38
|
+
const timestampSec = Number(timestamp);
|
|
39
|
+
if (!Number.isFinite(timestampSec))
|
|
40
|
+
throw new Error('Invalid webhook timestamp');
|
|
41
|
+
const nowSec = Math.floor((options.now ?? Date.now()) / 1000);
|
|
42
|
+
const tolerance = options.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;
|
|
43
|
+
if (Math.abs(nowSec - timestampSec) > tolerance) {
|
|
44
|
+
throw new Error('Webhook timestamp outside tolerance (possible replay)');
|
|
45
|
+
}
|
|
46
|
+
const expected = createHmac('sha256', secret).update(`${timestamp}.${payload}`).digest('hex');
|
|
47
|
+
const expectedBuf = Buffer.from(expected);
|
|
48
|
+
const matches = signatures.some((sig) => {
|
|
49
|
+
const sigBuf = Buffer.from(sig);
|
|
50
|
+
return sigBuf.length === expectedBuf.length && timingSafeEqual(sigBuf, expectedBuf);
|
|
51
|
+
});
|
|
52
|
+
if (!matches)
|
|
53
|
+
throw new Error('Webhook signature mismatch');
|
|
54
|
+
}
|
|
55
|
+
async function handleCheckoutCompleted(session) {
|
|
56
|
+
const customerEmail = session['customer_email'];
|
|
57
|
+
const paymentIntentId = session['payment_intent'];
|
|
58
|
+
const amountTotal = session['amount_total'];
|
|
59
|
+
// TODO: Create order record from session data
|
|
60
|
+
console.info(`[commerce:webhook] Checkout completed — email=${customerEmail} payment=${paymentIntentId} total=${amountTotal}`);
|
|
61
|
+
}
|
|
62
|
+
async function handlePaymentSucceeded(paymentIntent) {
|
|
63
|
+
const intentId = paymentIntent['id'];
|
|
64
|
+
const amount = paymentIntent['amount'];
|
|
65
|
+
// TODO: Update payment record status to "succeeded"
|
|
66
|
+
console.info(`[commerce:webhook] Payment succeeded — intent=${intentId} amount=${amount}`);
|
|
67
|
+
}
|
|
68
|
+
async function handleChargeRefunded(charge) {
|
|
69
|
+
const chargeId = charge['id'];
|
|
70
|
+
const amountRefunded = charge['amount_refunded'];
|
|
71
|
+
const paymentIntentId = charge['payment_intent'];
|
|
72
|
+
// TODO: Update payment record status to "refunded", adjust order status
|
|
73
|
+
console.info(`[commerce:webhook] Charge refunded — charge=${chargeId} intent=${paymentIntentId} refunded=${amountRefunded}`);
|
|
74
|
+
}
|
|
75
|
+
/** Verifies and processes a Stripe webhook event payload. */
|
|
76
|
+
export async function handleStripeWebhook(payload, signature, secret, options = {}) {
|
|
77
|
+
let event;
|
|
78
|
+
try {
|
|
79
|
+
verifyStripeSignature(payload, signature, secret, options);
|
|
80
|
+
event = JSON.parse(payload);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return {
|
|
84
|
+
handled: false,
|
|
85
|
+
event: 'unknown',
|
|
86
|
+
error: `Webhook verification failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
switch (event.type) {
|
|
90
|
+
case 'checkout.session.completed':
|
|
91
|
+
await handleCheckoutCompleted(event.data.object);
|
|
92
|
+
return { handled: true, event: event.type };
|
|
93
|
+
case 'payment_intent.succeeded':
|
|
94
|
+
await handlePaymentSucceeded(event.data.object);
|
|
95
|
+
return { handled: true, event: event.type };
|
|
96
|
+
case 'charge.refunded':
|
|
97
|
+
await handleChargeRefunded(event.data.object);
|
|
98
|
+
return { handled: true, event: event.type };
|
|
99
|
+
default:
|
|
100
|
+
return { handled: false, event: event.type };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/stripe/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAazD,2EAA2E;AAC3E,MAAM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AE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;QAE7C,KAAK,0BAA0B;YAC7B,MAAM,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;QAE7C,KAAK,iBAAiB;YACpB,MAAM,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;QAE7C;YACE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;IAChD,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prenta/plugin-commerce",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/actuate-media/prenta.git",
|
|
8
|
+
"directory": "packages/plugin-commerce"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"CHANGELOG.md"
|
|
26
|
+
],
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/react": "^19.0.0",
|
|
29
|
+
"typescript": "^5.7.0",
|
|
30
|
+
"vitest": "^4.1.0",
|
|
31
|
+
"@prenta/core": "0.118.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@prenta/core": ">=0.1.0",
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc --project tsconfig.json",
|
|
39
|
+
"type-check": "tsc --noEmit",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"clean": "rm -rf dist .turbo"
|
|
42
|
+
}
|
|
43
|
+
}
|