@zappie/sdk 0.20.0 → 0.21.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 +12 -0
- package/README.md +19 -0
- package/dist/debug.js +1 -1
- package/dist/index.js +1 -1
- package/dist/menu/index.d.ts +39 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.js.map +6 -0
- package/dist/rich-text/index.d.ts +18 -0
- package/dist/rich-text/index.js +2 -0
- package/dist/rich-text/index.js.map +6 -0
- package/package.json +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zappie/sdk
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 50fb80a: `@zappie/sdk/menu` reads a menu the way a menu page lists it: `sectionsOf`, `categoriesOf` (categories with items, counted, each once), `itemsOf`, `categoryOfItem`, `sectionOfCategory`, `itemHref`, `menuHref`, `orderTypesOf` and `directionsHref`, with the `Section`, `CategoryView` and `OrderType` types.
|
|
8
|
+
|
|
9
|
+
The starter's menu lists its menus and categories with them, so a menu or category with nothing to sell no longer shows.
|
|
10
|
+
|
|
11
|
+
- e93e157: `@zappie/sdk/rich-text` reads merchant rich text without a DOM, so it runs in a loader, a Worker or SSR: `parseRichText` gives its nodes with the entities decoded, and `plainText` its text on one line. `@zappie/foundations/rich-text` re-exports both and adds `sanitizeRichText`, the shared sanitizer on that parser. `zappie/no-unsafe-html` accepts HTML passed through the imported `sanitizeRichText`.
|
|
12
|
+
|
|
13
|
+
The starter's item sheet shows a description's formatting, and the About page shows descriptions as text, never as tags.
|
|
14
|
+
|
|
3
15
|
## 0.20.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -64,6 +64,8 @@ Prices always come from Zappie. The cart shows a local estimate while it waits,
|
|
|
64
64
|
| `@zappie/sdk/places` | Address search and delivery-zone checks |
|
|
65
65
|
| `@zappie/sdk/pricing` | An item's starting price, its price with given choices, and whether to show it as "From" |
|
|
66
66
|
| `@zappie/sdk/display` | Phone numbers spaced for reading, and what a branch calls an in-person order |
|
|
67
|
+
| `@zappie/sdk/rich-text` | Merchant rich text read without a DOM: its nodes and its plain text |
|
|
68
|
+
| `@zappie/sdk/menu` | A menu's sections and categories, its items once each, item and menu links, order types and directions |
|
|
67
69
|
| `@zappie/sdk/branches` | The nearest branch to a shopper, and each branch's distance from them |
|
|
68
70
|
| `@zappie/sdk/options` | Option group rules: radio or checkbox, the group's limit, its labels and the note limit |
|
|
69
71
|
| `@zappie/sdk/server` | Server-side reads, storefront URLs, `verifyWebhook()`, menu snapshots, sign-in crypto and a site's Worker, cache rules, robots, sitemap and old-address redirects |
|
|
@@ -321,6 +323,23 @@ written without a country code.
|
|
|
321
323
|
`inVenueLabel(branch)` says what an order placed at the branch is called:
|
|
322
324
|
"Walk-in" when `branch.category` is `"RETAIL"`, and "Dine-in" otherwise.
|
|
323
325
|
|
|
326
|
+
### Menu model
|
|
327
|
+
|
|
328
|
+
`@zappie/sdk/menu` reads a `Menu` the way a menu page lists it, with no React:
|
|
329
|
+
`sectionsOf(menu)` (its menus, or the whole menu as one), `categoriesOf(menu,
|
|
330
|
+
section?)` (categories with items, counted, each once), `itemsOf(menu,
|
|
331
|
+
categories)` (each item once), `categoryOfItem`, `sectionOfCategory`,
|
|
332
|
+
`itemHref(itemId, menuId?)`, `menuHref(menuId?, categoryId?)`,
|
|
333
|
+
`orderTypesOf(branch, menu)` (the order types the branch and its menus both
|
|
334
|
+
take) and `directionsHref(store, branch)`.
|
|
335
|
+
|
|
336
|
+
### Rich text without a DOM
|
|
337
|
+
|
|
338
|
+
`parseRichText(html)` from `@zappie/sdk/rich-text` reads a description into
|
|
339
|
+
nodes in a loader, a Worker or SSR, and decodes its entities. `plainText(html)`
|
|
340
|
+
is the same text on one line, for a card or a meta description. To render
|
|
341
|
+
HTML, sanitize it with `sanitizeRichText` from `@zappie/foundations/rich-text`.
|
|
342
|
+
|
|
324
343
|
### Tables and bills
|
|
325
344
|
|
|
326
345
|
A guest who scans a table code lands on one of three pages the platform owns:
|
package/dist/debug.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var VERSION=true?"0.
|
|
1
|
+
var VERSION=true?"0.21.0":"0.0.0-development";function installDebug(client){if(typeof window==="undefined"||client.mode!=="test"){return}const events=[];let quote;const emit=(name,detail)=>{const event={name,detail,at:new Date().toISOString()};events.push(event);window.dispatchEvent(new CustomEvent("zappie:event",{detail:event}))};globalThis.__zappieEmit=emit;window.__zappie={version:VERSION,store:client.config.store,async catalogue(){await client.cart.hydrate();const branch=(await client.store.get()).branches.find(value=>value.id===client.cart.getSnapshot().branchId);return{branch,menu:await client.menu.get({branch:branch.id})}},cart:Object.assign(()=>client.cart.getSnapshot(),{async inject(input){await client.cart.hydrate();if(input.lines.length>100||input.lines.some(line=>!Number.isInteger(line.quantity??1)||(line.quantity??1)<1||(line.quantity??1)>99)){throw new Error("Use up to 100 cart lines with whole quantities from 1 to 99.")}const snapshot=client.cart.getSnapshot();const value={v:1,menuVersion:client._internal.cartCatalogue().version,updatedAt:Date.now(),fulfilment:snapshot.fulfilment,promoCode:snapshot.promoCode,lines:input.lines.map((line,index)=>({...line,id:`debug_${index}`,name:line.itemId,quantity:line.quantity??1,choices:(line.choices??[]).map(choice=>({...choice,quantity:choice.quantity??1})),inputs:line.inputs??{},addedAt:new Date().toISOString()}))};const scope=client.config.cart?.storageScope;(client.config.storage??window.localStorage).setItem(`zappie:cart:v1:${client.config.store}:${snapshot.branchId}${scope?`:${scope}`:""}`,JSON.stringify(value))}}),quote:()=>quote,events};client.on("add_to_cart",detail=>emit("add_to_cart",detail));client.cart.subscribe(()=>{const state=client.cart.state;const next="quote"in state?state.quote:void 0;if(next&&next!==quote){quote=next;emit("quote",next)}})}export{installDebug};
|
|
2
2
|
//# sourceMappingURL=debug.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ZappieCartError}from"./cart/errors.js";import{holdsForLater,isHeldQuote}from"./cart/held.js";import{previewItem}from"./cart/preview.js";import{estimateUnitPrice}from"./cart/price.js";import{resolveSourceMenu}from"./cart/source-menu.js";import{validateLine}from"./cart/validate.js";import{createZappie}from"./client.js";import{API_VERSION}from"./config.js";import{ZappieError,isZappieError}from"./errors.js";export*from"./models.js";import{format,money}from"./money.js";import{RestTransport}from"./transport/rest.js";var VERSION=true?"0.
|
|
1
|
+
import{ZappieCartError}from"./cart/errors.js";import{holdsForLater,isHeldQuote}from"./cart/held.js";import{previewItem}from"./cart/preview.js";import{estimateUnitPrice}from"./cart/price.js";import{resolveSourceMenu}from"./cart/source-menu.js";import{validateLine}from"./cart/validate.js";import{createZappie}from"./client.js";import{API_VERSION}from"./config.js";import{ZappieError,isZappieError}from"./errors.js";export*from"./models.js";import{format,money}from"./money.js";import{RestTransport}from"./transport/rest.js";var VERSION=true?"0.21.0":"0.0.0-development";export{API_VERSION,RestTransport,VERSION,ZappieCartError,ZappieError,createZappie,estimateUnitPrice,format,holdsForLater,isHeldQuote,isZappieError,money,previewItem,resolveSourceMenu,validateLine};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Category, MenuSection, Menu, Branch, Item } from '@zappie/sdk';
|
|
2
|
+
|
|
3
|
+
/** One of the branch's menus (Food, Drinks) with its categories, or the whole menu when it has none. */
|
|
4
|
+
type Section = Pick<MenuSection, "id" | "name" | "categoryIds"> & Partial<MenuSection>;
|
|
5
|
+
/** A category with the number of its items the menu has. */
|
|
6
|
+
type CategoryView = Category & {
|
|
7
|
+
itemCount: number;
|
|
8
|
+
};
|
|
9
|
+
/** An order type a site's switch offers. */
|
|
10
|
+
type OrderType = "delivery" | "pickup";
|
|
11
|
+
/** The branch's menus that list a category, or the whole menu as one section when it lists no menus. */
|
|
12
|
+
declare function sectionsOf(menu: Menu): Section[];
|
|
13
|
+
/**
|
|
14
|
+
* The categories with something to sell, in a section's order, or across every section in the order the menus list
|
|
15
|
+
* them, each once.
|
|
16
|
+
*/
|
|
17
|
+
declare function categoriesOf(menu: Menu, section?: Pick<Section, "categoryIds">): CategoryView[];
|
|
18
|
+
/** Each item of the categories once, in the order they list them. */
|
|
19
|
+
declare function itemsOf(menu: Menu, categories: readonly Pick<Category, "itemIds">[]): Item[];
|
|
20
|
+
/** The first category that lists the item. */
|
|
21
|
+
declare function categoryOfItem(menu: Menu, itemId: string): Category | undefined;
|
|
22
|
+
/** The first section that lists the category. */
|
|
23
|
+
declare function sectionOfCategory<S extends Pick<Section, "categoryIds">>(sections: readonly S[], categoryId: string | undefined): S | undefined;
|
|
24
|
+
/** An item's page, opened from the menu it is on (`?menu=`), so it is ordered by the rules of the one shown. */
|
|
25
|
+
declare const itemHref: (itemId: string, menuId?: string) => string;
|
|
26
|
+
/** The menu page, at a menu (`?menu=`) and a category (`?category=`). */
|
|
27
|
+
declare function menuHref(sectionId?: string, categoryId?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* The order types the branch offers that its menus take. A menu may list its own; when none lists any, the branch's
|
|
30
|
+
* stand.
|
|
31
|
+
*/
|
|
32
|
+
declare function orderTypesOf(branch: Pick<Branch, "fulfilment">, menu: Menu | undefined): OrderType[];
|
|
33
|
+
/** Directions to the branch in Google Maps: to its pin, or a search for its address, then the store's name. */
|
|
34
|
+
declare function directionsHref(store: {
|
|
35
|
+
name: string;
|
|
36
|
+
}, branch: Pick<Branch, "coordinates" | "address">): string;
|
|
37
|
+
|
|
38
|
+
export { categoriesOf, categoryOfItem, directionsHref, itemHref, itemsOf, menuHref, orderTypesOf, sectionOfCategory, sectionsOf };
|
|
39
|
+
export type { CategoryView, OrderType, Section };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function sectionsOf(menu){return menu.menus?.length?menu.menus.filter(section=>section.categoryIds.length>0):[{id:menu.id,name:menu.name,categoryIds:menu.categories.map(category=>category.id)}]}function categoriesOf(menu,section){const ids=section?.categoryIds??sectionsOf(menu).flatMap(entry=>entry.categoryIds);return[...new Set(ids)].map(id=>menu.categories.find(category=>category.id===id)).filter(category=>Boolean(category)).map(category=>({...category,itemCount:category.itemIds.filter(itemId=>menu.items[itemId]).length})).filter(category=>category.itemCount>0)}function itemsOf(menu,categories){const ids=new Set(categories.flatMap(category=>category.itemIds));return[...ids].flatMap(id=>menu.items[id]??[])}function categoryOfItem(menu,itemId){return menu.categories.find(category=>category.itemIds.includes(itemId))}function sectionOfCategory(sections,categoryId){return categoryId?sections.find(section=>section.categoryIds.includes(categoryId)):void 0}var itemHref=(itemId,menuId)=>`/item/${encodeURIComponent(itemId)}${menuId?`?menu=${encodeURIComponent(menuId)}`:""}`;function menuHref(sectionId,categoryId){const query=new URLSearchParams;if(sectionId){query.set("menu",sectionId)}if(categoryId){query.set("category",categoryId)}const search=query.toString();return search?`/menu?${search}`:"/menu"}function orderTypesOf(branch,menu){const listed=menu?.menus?.flatMap(section=>section.fulfilment??[]);const offers=["delivery","pickup"].filter(type=>branch.fulfilment[type]);return listed?.length?offers.filter(type=>listed.includes(type)):offers}function directionsHref(store,branch){return branch.coordinates?`https://www.google.com/maps/dir/?api=1&destination=${branch.coordinates.lat},${branch.coordinates.lng}`:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(branch.address??store.name)}`}export{categoriesOf,categoryOfItem,directionsHref,itemHref,itemsOf,menuHref,orderTypesOf,sectionOfCategory,sectionsOf};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/menu/index.ts"],
|
|
4
|
+
"mappings": "AAeO,SAAS,WAAW,KAAuB,CAChD,OAAO,KAAK,OAAO,OACf,KAAK,MAAM,OAAQ,SAAY,QAAQ,YAAY,OAAS,CAAC,EAC7D,CACE,CACE,GAAI,KAAK,GACT,K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AS,aACd,OACA,KACa,CACb,MAAM,OAAS,MAAM,OAAO,QAAS,SAAY,QAAQ,YAAc,CAAC,CAAC,EACzE,MAAM,OAAU,CAAC,WAAY,QAAQ,EAAY,OAC9C,MAAS,OAAO,WAAW,IAAI,CAClC,EACA,OAAO,QAAQ,OACX,OAAO,OAAQ,MAAS,OAAO,SAAS,IAAI,CAAC,EAC7C,MACN,CAGO,SAAS,eACd,MACA,OACA,CACA,OAAO,OAAO,YACV,sDAAsD,OAAO,YAAY,GAAG,IAAI,OAAO,YAAY,GAAG,GACtG,mDAAmD,mBAAmB,OAAO,SAAW,MAAM,IAAI,CAAC,EACzG",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** A node of merchant rich text: a tag with its children, or text. Attributes are not kept. */
|
|
2
|
+
type RichTextNode = {
|
|
3
|
+
type: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
data?: string;
|
|
6
|
+
children?: RichTextNode[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Parse merchant rich text into nodes without a DOM, so it runs in a loader, a Worker or SSR. Pair it with
|
|
10
|
+
* `createSanitizeRichText` from `@zappie/foundations/rich-text` before you render HTML.
|
|
11
|
+
* Decodes numeric entities, Latin-1 names and the typographic marks menus use; leaves unknown names as text.
|
|
12
|
+
*/
|
|
13
|
+
declare function parseRichText(html: string): RichTextNode[];
|
|
14
|
+
/** Merchant rich text as plain text, for a card's lines, a search or a meta description: tags dropped, entities decoded, spaces collapsed. */
|
|
15
|
+
declare function plainText(html: string): string;
|
|
16
|
+
|
|
17
|
+
export { parseRichText, plainText };
|
|
18
|
+
export type { RichTextNode };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var tag=/<(\/?)\s*([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/g;var voidTags=new Set(["br","hr","img","input","meta","link"]);var latin1="iexcl cent pound curren yen brvbar sect uml copy ordf laquo not shy reg macr deg plusmn sup2 sup3 acute micro para middot cedil sup1 ordm raquo frac14 frac12 frac34 iquest Agrave Aacute Acirc Atilde Auml Aring AElig Ccedil Egrave Eacute Ecirc Euml Igrave Iacute Icirc Iuml ETH Ntilde Ograve Oacute Ocirc Otilde Ouml times Oslash Ugrave Uacute Ucirc Uuml Yacute THORN szlig agrave aacute acirc atilde auml aring aelig ccedil egrave eacute ecirc euml igrave iacute icirc iuml eth ntilde ograve oacute ocirc otilde ouml divide oslash ugrave uacute ucirc uuml yacute thorn yuml";var marks="OElig 152 oelig 153 Scaron 160 scaron 161 Yuml 178 fnof 192 circ 2c6 tilde 2dc ensp 2002 emsp 2003 thinsp 2009 ndash 2013 mdash 2014 lsquo 2018 rsquo 2019 sbquo 201a ldquo 201c rdquo 201d bdquo 201e dagger 2020 Dagger 2021 bull 2022 hellip 2026 permil 2030 prime 2032 Prime 2033 lsaquo 2039 rsaquo 203a euro 20ac trade 2122 larr 2190 rarr 2192 minus 2212 check 2713";var named;var entities=()=>{if(!named){named={amp:"&",AMP:"&",apos:"'",gt:">",GT:">",lt:"<",LT:"<",nbsp:"\xA0",quot:'"',QUOT:'"'};latin1.split(" ").forEach((name,index)=>{named[name]=String.fromCodePoint(161+index)});const pairs=marks.split(" ");for(let index=0;index<pairs.length;index+=2){named[pairs[index]]=String.fromCodePoint(Number.parseInt(pairs[index+1],16))}}return named};var decodeEntities=value=>value.replace(/&(?:#([0-9]+)|#x([0-9a-f]+)|([a-z][a-z0-9]*));/gi,(entity,decimal,hexadecimal,name)=>{if(name){return entities()[name]??entity}const code=Number.parseInt(decimal||hexadecimal,hexadecimal?16:10);return code>0&&code<=1114111&&!(code>=55296&&code<=57343)?String.fromCodePoint(code):"\uFFFD"});function parseRichText(html){const root={type:"root",children:[]};const stack=[root];let last=0;const appendText=value=>{if(value){stack.at(-1)?.children?.push({type:"text",data:decodeEntities(value)})}};for(const match of html.matchAll(tag)){appendText(html.slice(last,match.index));last=match.index+match[0].length;const name=match[2].toLowerCase();if(match[1]){let position=stack.length-1;while(position>0&&stack[position].name!==name){position--}if(position>0){stack.length=position}continue}const node={type:"tag",name,children:[]};stack.at(-1)?.children?.push(node);if(!voidTags.has(name)&&!match[0].endsWith("/>")){stack.push(node)}}appendText(html.slice(last));return root.children}function plainText(html){const text=[];const walk=nodes=>{for(const node of nodes){if(node.type==="text"){text.push(node.data)}else{walk(node.children);text.push(" ")}}};walk(parseRichText(html));return text.join("").replace(/\s+/g," ").trim()}export{parseRichText,plainText};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/rich-text/index.ts"],
|
|
4
|
+
"mappings": "AAQA,IAAM,IAAM,2CACZ,IAAM,SAAW,IAAI,IAAI,CAAC,KAAM,KAAM,MAAO,QAAS,OAAQ,MAAM,CAAC,EAGrE,IAAM,OACJ,gkBACF,IAAM,MACJ,gXACF,IAAI,MAEJ,IAAM,SAAW,IAAM,CACrB,GAAI,CAAC,MAAO,CACV,MAAQ,CACN,IAAK,IACL,IAAK,IACL,KAAM,IACN,GAAI,IACJ,GAAI,IACJ,GAAI,IACJ,GAAI,IACJ,KAAM,OACN,KAAM,IACN,KAAM,GACR,EACA,OAAO,MAAM,GAAG,EAAE,QAAQ,CAAC,KAAM,QAAU,CACzC,MAAO,IAAI,EAAI,OAAO,cAAc,IAAO,KAAK,CAClD,CAAC,EACD,MAAM,MAAQ,MAAM,MAAM,GAAG,EAC7B,QAAS,MAAQ,EAAG,MAAQ,MAAM,OAAQ,OAAS,EAAG,CACpD,MAAM,MAAM,KAAK,CAAE,EAAI,OAAO,cAC5B,OAAO,SAAS,MAAM,MAAQ,CAAC,EAAI,EAAE,CACvC,CACF,CACF,CACA,OAAO,KACT,EAEA,IAAM,eAAkB,OACtB,MAAM,QACJ,mDACA,CAAC,OAAQ,QAAiB,YAAqB,OAAiB,CAC9D,GAAI,KAAM,CACR,OAAO,SAAS,E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OAAQ,CACxB,KAAK,KAAK,KAAK,IAAK,CACtB,KAAO,CACL,KAAK,KAAK,QAAS,EACnB,KAAK,KAAK,GAAG,CACf,CACF,CACF,EACA,KAAK,cAAc,IAAI,CAAC,EACxB,OAAO,KAAK,KAAK,EAAE,EAAE,QAAQ,OAAQ,GAAG,EAAE,KAAK,CACjD",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappie/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Typed, framework-agnostic client for Zappie menus, carts, checkout, auth and events.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -123,6 +123,14 @@
|
|
|
123
123
|
"types": "./dist/display/index.d.ts",
|
|
124
124
|
"import": "./dist/display/index.js"
|
|
125
125
|
},
|
|
126
|
+
"./rich-text": {
|
|
127
|
+
"types": "./dist/rich-text/index.d.ts",
|
|
128
|
+
"import": "./dist/rich-text/index.js"
|
|
129
|
+
},
|
|
130
|
+
"./menu": {
|
|
131
|
+
"types": "./dist/menu/index.d.ts",
|
|
132
|
+
"import": "./dist/menu/index.js"
|
|
133
|
+
},
|
|
126
134
|
"./branches": {
|
|
127
135
|
"types": "./dist/branches/index.d.ts",
|
|
128
136
|
"import": "./dist/branches/index.js"
|
|
@@ -227,7 +235,7 @@
|
|
|
227
235
|
"vite": "8.3.5"
|
|
228
236
|
},
|
|
229
237
|
"scripts": {
|
|
230
|
-
"build": "node ../../scripts/release-packages/build-declarations.mjs tsup.config.ts tsup.checkout.config.ts tsup.checkout-defaults.config.ts tsup.customer.config.ts tsup.loyalty.config.ts tsup.in-venue.config.ts tsup.account.config.ts tsup.places.config.ts tsup.url.config.ts tsup.redirect.config.ts tsup.navigation.config.ts tsup.services.config.ts tsup.visits.config.ts tsup.pricing.config.ts tsup.display.config.ts tsup.branches.config.ts tsup.options.config.ts tsup.site-config.config.ts tsup.template.config.ts tsup.error-pages.config.ts tsup.site-error.config.ts tsup.site-closed.config.ts tsup.navigation-progress.config.ts tsup.receipts.config.ts && node ../../scripts/release-packages/build-modules.mjs --no-sources-content --unmapped=studio/index.js --unmapped=testing/index.js --unmapped=vite/index.js",
|
|
238
|
+
"build": "node ../../scripts/release-packages/build-declarations.mjs tsup.config.ts tsup.checkout.config.ts tsup.checkout-defaults.config.ts tsup.customer.config.ts tsup.loyalty.config.ts tsup.in-venue.config.ts tsup.account.config.ts tsup.places.config.ts tsup.url.config.ts tsup.redirect.config.ts tsup.navigation.config.ts tsup.services.config.ts tsup.visits.config.ts tsup.pricing.config.ts tsup.display.config.ts tsup.rich-text.config.ts tsup.menu.config.ts tsup.branches.config.ts tsup.options.config.ts tsup.site-config.config.ts tsup.template.config.ts tsup.error-pages.config.ts tsup.site-error.config.ts tsup.site-closed.config.ts tsup.navigation-progress.config.ts tsup.receipts.config.ts && node ../../scripts/release-packages/build-modules.mjs --no-sources-content --unmapped=studio/index.js --unmapped=testing/index.js --unmapped=vite/index.js",
|
|
231
239
|
"test": "vitest run --root ../.. packages/sdk/test",
|
|
232
240
|
"size": "node ../../scripts/release-packages/size-sdk.mjs && size-limit"
|
|
233
241
|
}
|