{"_id":"@commerce-atoms/cart","_rev":"2-90d6086e6be7d90d04b05c5d7cd80424","name":"@commerce-atoms/cart","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@commerce-atoms/cart","version":"0.0.1","keywords":["shopify","hydrogen","cart","ecommerce","utilities","line-items"],"author":{"name":"Commerce Atoms"},"license":"MIT","_id":"@commerce-atoms/cart@0.0.1","maintainers":[{"name":"doctor.undefined","email":"contact@soundefined.com"}],"homepage":"https://github.com/commerce-atoms/shoppy/tree/main/packages/cart","bugs":{"url":"https://github.com/commerce-atoms/shoppy/issues"},"dist":{"shasum":"45d7ef5617fd7b06868700f3a81b27ab22e8785d","tarball":"https://registry.npmjs.org/@commerce-atoms/cart/-/cart-0.0.1.tgz","fileCount":23,"integrity":"sha512-6kFCcL+htqGHN+V+5jUlAB9xqef76QYgUi7zBYlSxoqN5ufSX4aP6Ol1OJ43/K5ofTgfbWBcwW7jlu+mWbSWLw==","signatures":[{"sig":"MEYCIQCxDwiklSe+SQA/dA6hKZFT/LB+AuNUhSRCUH3YIuSDFgIhANyhvCX/M3N5/oGWeMq3GUsGuNKC4ZuG907APIS4RKVe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@commerce-atoms%2fcart@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11768},"type":"module","engines":{"node":">=18.0.0"},"exports":{"./types/cart":{"types":"./dist/types/cart.d.ts","import":"./dist/types/cart.js"},"./package.json":"./package.json","./types/cartLine":{"types":"./dist/types/cartLine.d.ts","import":"./dist/types/cartLine.js"},"./line/addCartLine":{"types":"./dist/line/addCartLine.d.ts","import":"./dist/line/addCartLine.js"},"./line/getCartLineKey":{"types":"./dist/line/getCartLineKey.d.ts","import":"./dist/line/getCartLineKey.js"},"./line/mergeCartLines":{"types":"./dist/line/mergeCartLines.d.ts","import":"./dist/line/mergeCartLines.js"},"./line/removeCartLine":{"types":"./dist/line/removeCartLine.d.ts","import":"./dist/line/removeCartLine.js"},"./line/updateCartLine":{"types":"./dist/line/updateCartLine.d.ts","import":"./dist/line/updateCartLine.js"},"./normalize/normalizeCart":{"types":"./dist/normalize/normalizeCart.d.ts","import":"./dist/normalize/normalizeCart.js"},"./totals/calculateSubtotal":{"types":"./dist/totals/calculateSubtotal.d.ts","import":"./dist/totals/calculateSubtotal.js"},"./totals/calculateTotalQuantity":{"types":"./dist/totals/calculateTotalQuantity.d.ts","import":"./dist/totals/calculateTotalQuantity.js"}},"gitHead":"aad0c0352718bf059706547692bab550e44b087d","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","pack:check":"npm pack --dry-run --silent","prepublishOnly":"npm run build"},"_npmUser":{"name":"doctor.undefined","email":"contact@soundefined.com"},"repository":{"url":"git+https://github.com/commerce-atoms/shoppy.git","type":"git","directory":"packages/cart"},"_npmVersion":"10.9.4","description":"Pure cart line math engine for Shopify products","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","dependencies":{},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cart_0.0.1_1766431525438_0.15425590109528087","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@commerce-atoms/cart","version":"0.0.3","description":"Pure cart line math engine for Shopify products","type":"module","sideEffects":false,"keywords":["shopify","hydrogen","cart","ecommerce","utilities","line-items"],"author":{"name":"Commerce Atoms"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/commerce-atoms/shoppy.git","directory":"packages/cart"},"homepage":"https://github.com/commerce-atoms/shoppy/tree/main/packages/cart","bugs":{"url":"https://github.com/commerce-atoms/shoppy/issues"},"publishConfig":{"access":"public","provenance":true},"exports":{"./package.json":"./package.json","./totals/calculateSubtotal":{"types":"./dist/totals/calculateSubtotal.d.ts","import":"./dist/totals/calculateSubtotal.js"},"./totals/calculateTotalQuantity":{"types":"./dist/totals/calculateTotalQuantity.d.ts","import":"./dist/totals/calculateTotalQuantity.js"},"./line/addCartLine":{"types":"./dist/line/addCartLine.d.ts","import":"./dist/line/addCartLine.js"},"./line/updateCartLine":{"types":"./dist/line/updateCartLine.d.ts","import":"./dist/line/updateCartLine.js"},"./line/removeCartLine":{"types":"./dist/line/removeCartLine.d.ts","import":"./dist/line/removeCartLine.js"},"./line/mergeCartLines":{"types":"./dist/line/mergeCartLines.d.ts","import":"./dist/line/mergeCartLines.js"},"./line/getCartLineKey":{"types":"./dist/line/getCartLineKey.d.ts","import":"./dist/line/getCartLineKey.js"},"./normalize/normalizeCart":{"types":"./dist/normalize/normalizeCart.d.ts","import":"./dist/normalize/normalizeCart.js"},"./types/cartLine":{"types":"./dist/types/cartLine.d.ts","import":"./dist/types/cartLine.js"},"./types/cart":{"types":"./dist/types/cart.d.ts","import":"./dist/types/cart.js"}},"dependencies":{},"engines":{"node":">=18.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","pack:check":"npm pack --dry-run --silent","prepublishOnly":"npm run build"},"gitHead":"cb71c4946a520552b92a61c1cf54fe03eefdd1c6","_id":"@commerce-atoms/cart@0.0.3","_nodeVersion":"22.21.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-y0J/TOmcZeErHJgDRTpXAboUygYo8kO586HATxOvv36iwe8vUEqPRhJpsOfuWqY8TJ84gc+A3ynMiC3QvfUoWQ==","shasum":"ad169bdad0a725e7fd16087b686d643772650fd1","tarball":"https://registry.npmjs.org/@commerce-atoms/cart/-/cart-0.0.3.tgz","fileCount":23,"unpackedSize":11768,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@commerce-atoms%2fcart@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEHJgmMNaDZ7+/Dc3O2pv6Gy5Uri1w6ZKm+Di/f/mLR+AiAaUwNvOqO+Ggq9AtcfA8sT06w7QqTRyr0BF5JEyH11Sw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:ad1bcf90-4173-44fb-aa95-8f861bd6bb36"}},"directories":{},"maintainers":[{"name":"doctor.undefined","email":"contact@soundefined.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cart_0.0.3_1766434929686_0.5259056526388866"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-22T19:25:25.338Z","modified":"2025-12-22T20:22:10.186Z","0.0.1":"2025-12-22T19:25:25.596Z","0.0.3":"2025-12-22T20:22:09.818Z"},"bugs":{"url":"https://github.com/commerce-atoms/shoppy/issues"},"author":{"name":"Commerce Atoms"},"license":"MIT","homepage":"https://github.com/commerce-atoms/shoppy/tree/main/packages/cart","keywords":["shopify","hydrogen","cart","ecommerce","utilities","line-items"],"repository":{"type":"git","url":"git+https://github.com/commerce-atoms/shoppy.git","directory":"packages/cart"},"description":"Pure cart line math engine for Shopify products","maintainers":[{"name":"doctor.undefined","email":"contact@soundefined.com"}],"readme":"# @commerce-atoms/cart\n\n**Pure cart line math engine for Shopify products.**\n\n## Purpose\n\nProvides utilities for cart operations and calculations that are framework-agnostic:\n\n- Adding/merging/updating cart items\n- Computing `subtotal`, `totalQuantity`, and discounts\n- Normalizing cart structure\n- Line-by-line math operations\n\n## Non-goals\n\nThis package explicitly does **NOT**:\n\n- ❌ Store cart state in localStorage or sessions\n- ❌ Provide UI components (`<CartSummary />`)\n- ❌ Fetch cart data from Shopify\n- ❌ Include routing logic\n- ❌ Manage React state or context\n\n## API\n\n### Core Functions\n\n```typescript\n// Calculate cart subtotal from line items\nimport { calculateSubtotal } from \"@commerce-atoms/cart/totals/calculateSubtotal\";\n\nconst subtotal = calculateSubtotal(cartLines);\n// Returns: 199.97\n\n// Add a new line to cart\nimport { addCartLine } from \"@commerce-atoms/cart/line/addCartLine\";\n\nconst updatedLines = addCartLine(lines, {\n  id: \"123\",\n  quantity: 2,\n  price: 10.0,\n});\n\n// Update line quantity\nimport { updateCartLine } from \"@commerce-atoms/cart/line/updateCartLine\";\n\nconst updatedLines = updateCartLine(lines, \"line-id\", { quantity: 5 });\n\n// Remove line from cart\nimport { removeCartLine } from \"@commerce-atoms/cart/line/removeCartLine\";\n\nconst updatedLines = removeCartLine(lines, \"line-id\");\n\n// Merge duplicate lines\nimport { mergeCartLines } from \"@commerce-atoms/cart/line/mergeCartLines\";\n\nconst mergedLines = mergeCartLines(lines1, lines2);\n```\n\n## Types\n\n```typescript\nimport type { CartLine } from \"@commerce-atoms/cart/types/cartLine\";\nimport type { Cart } from \"@commerce-atoms/cart/types/cart\";\n```\n","readmeFilename":"README.md"}