From 6125738bceb14b36b1055626cebe156d81d91dcf Mon Sep 17 00:00:00 2001 From: LFades Date: Thu, 13 Jan 2022 19:39:18 -0500 Subject: [PATCH] Updated setup of bigcommerce --- package-lock.json | 393 +++++++++++++++++- packages/bigcommerce/package.json | 10 +- .../src/api/endpoints/cart/index.ts | 4 +- .../catalog/products/get-products.ts | 2 +- .../api/endpoints/catalog/products/index.ts | 4 +- .../src/api/endpoints/checkout/index.ts | 4 +- .../src/api/endpoints/customer/index.ts | 4 +- .../src/api/endpoints/login/index.ts | 4 +- .../src/api/endpoints/login/login.ts | 2 +- .../src/api/endpoints/logout/index.ts | 4 +- .../src/api/endpoints/signup/index.ts | 4 +- .../src/api/endpoints/wishlist/index.ts | 4 +- packages/bigcommerce/src/api/index.ts | 2 +- .../src/api/operations/get-all-pages.ts | 2 +- .../api/operations/get-all-product-paths.ts | 2 +- .../src/api/operations/get-all-products.ts | 2 +- .../api/operations/get-customer-wishlist.ts | 2 +- .../src/api/operations/get-page.ts | 2 +- .../src/api/operations/get-product.ts | 2 +- .../src/api/operations/get-site-info.ts | 2 +- .../bigcommerce/src/api/operations/login.ts | 2 +- .../src/api/utils/fetch-graphql-api.ts | 4 +- packages/bigcommerce/src/auth/use-login.tsx | 6 +- packages/bigcommerce/src/auth/use-logout.tsx | 4 +- packages/bigcommerce/src/auth/use-signup.tsx | 6 +- .../bigcommerce/src/cart/use-add-item.tsx | 8 +- packages/bigcommerce/src/cart/use-cart.tsx | 6 +- .../bigcommerce/src/cart/use-remove-item.tsx | 8 +- .../bigcommerce/src/cart/use-update-item.tsx | 8 +- .../bigcommerce/src/checkout/use-checkout.tsx | 4 +- .../src/customer/address/use-add-item.tsx | 4 +- .../src/customer/card/use-add-item.tsx | 4 +- .../bigcommerce/src/customer/use-customer.tsx | 4 +- packages/bigcommerce/src/fetcher.ts | 4 +- packages/bigcommerce/src/index.tsx | 2 +- .../bigcommerce/src/product/use-price.tsx | 4 +- .../bigcommerce/src/product/use-search.tsx | 4 +- packages/bigcommerce/src/types/cart.ts | 4 +- packages/bigcommerce/src/types/checkout.ts | 2 +- packages/bigcommerce/src/types/common.ts | 2 +- packages/bigcommerce/src/types/customer.ts | 4 +- packages/bigcommerce/src/types/login.ts | 4 +- packages/bigcommerce/src/types/logout.ts | 2 +- packages/bigcommerce/src/types/page.ts | 4 +- packages/bigcommerce/src/types/product.ts | 2 +- packages/bigcommerce/src/types/signup.ts | 2 +- packages/bigcommerce/src/types/site.ts | 4 +- packages/bigcommerce/src/types/wishlist.ts | 4 +- .../bigcommerce/src/wishlist/use-add-item.tsx | 6 +- .../src/wishlist/use-remove-item.tsx | 6 +- .../bigcommerce/src/wishlist/use-wishlist.tsx | 4 +- packages/bigcommerce/tsconfig.json | 22 + 52 files changed, 514 insertions(+), 95 deletions(-) create mode 100644 packages/bigcommerce/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 0fc59ae55..b601259bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1173,6 +1173,12 @@ "integrity": "sha512-PhoQPbwPYspXqf7lkwtF7aJzAwL88t+9E/e0b2X84tlHpU8ZuS9UNnLtkT0XhyZJYHpET5qRfIdZ0HBIxuc7HQ==", "dev": true }, + "node_modules/@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true + }, "node_modules/@types/js-cookie": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-2.2.7.tgz", @@ -1185,12 +1191,30 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "node_modules/@types/jsonwebtoken": { + "version": "8.5.7", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.7.tgz", + "integrity": "sha512-CBHN+1unePowgS94ayLE7aVp7AfyhgG/3l2O+AjkhOMY4kAAfVI1OnbbLnOeDMAdTNLP5ZjJ3kdZanRtRQaK3Q==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/lodash": { "version": "4.14.178", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==", "dev": true }, + "node_modules/@types/lodash.debounce": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz", + "integrity": "sha512-4WTmnnhCfDvvuLMaF3KV4Qfki93KebocUF45msxhYyjMttZDQYzHkO639ohhk8+oco2cluAFL3t5+Jn4mleylQ==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/lodash.random": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/@types/lodash.random/-/lodash.random-3.2.6.tgz", @@ -1271,6 +1295,11 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, + "node_modules/@types/uuid": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==" + }, "node_modules/@typescript-eslint/parser": { "version": "5.9.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.1.tgz", @@ -1376,6 +1405,10 @@ "resolved": "packages/commerce", "link": true }, + "node_modules/@vercel/commerce-bigcommerce": { + "resolved": "packages/bigcommerce", + "link": true + }, "node_modules/@vercel/commerce-local": { "resolved": "packages/local", "link": true @@ -2002,6 +2035,11 @@ "ieee754": "^1.1.4" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2239,6 +2277,14 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "peer": true }, + "node_modules/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/core-js-pure": { "version": "3.20.2", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.20.2.tgz", @@ -2754,6 +2800,14 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.37", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.37.tgz", @@ -3961,6 +4015,11 @@ "node": ">=12.0.0" } }, + "node_modules/immutability-helper": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-3.1.1.tgz", + "integrity": "sha512-Q0QaXjPjwIju/28TsugCHNEASwoCcJSyJV3uO1sOIQGI0jKgm9f41Lvz0DZj3n46cNCyAZTsEYoY4C2bVRUzyQ==" + }, "node_modules/import-cwd": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz", @@ -4458,6 +4517,35 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=4", + "npm": ">=1.4.28" + } + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/jsx-ast-utils": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz", @@ -4471,6 +4559,25 @@ "node": ">=4.0" } }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keen-slider": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/keen-slider/-/keen-slider-6.6.3.tgz", @@ -4699,12 +4806,52 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, "node_modules/lodash.random": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash.random/-/lodash.random-3.2.0.tgz", @@ -8914,6 +9061,23 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/uuidv4": { + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.12.tgz", + "integrity": "sha512-UnN4ThIYWhv3ZUE8UwDnnCvh4JafCNu+sQkxmLyjCVwK3rjLfkg3DYiEv6oCMDIAIVEDP4INg4kX/C5hKaRzZA==", + "dependencies": { + "@types/uuid": "8.3.1", + "uuid": "8.3.2" + } + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -9178,6 +9342,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/bigcommerce": { + "name": "@vercel/commerce-bigcommerce", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "@vercel/fetch": "^6.1.1", + "cookie": "^0.4.1", + "immutability-helper": "^3.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.debounce": "^4.0.8", + "swr": "^0.5.6", + "uuidv4": "^6.2.12" + }, + "devDependencies": { + "@types/cookie": "^0.4.1", + "@types/jsonwebtoken": "^8.5.7", + "@types/lodash.debounce": "^4.0.6", + "@types/node": "^15.12.4", + "@types/react": "^17.0.8", + "lint-staged": "^12.1.7", + "next": "^12.0.3", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "typescript": "^4.6.0-dev.20220108" + }, + "peerDependencies": { + "next": "^12", + "react": "^17", + "react-dom": "^17" + } + }, + "packages/bigcommerce/node_modules/typescript": { + "version": "4.6.0-dev.20220113", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-dev.20220113.tgz", + "integrity": "sha512-hZj5awMxIZp7IhDt1B1ZAEnL0nSTqJiAUP8mTlGA9EXLrRMSZMwSnknu8fxJjMg/miexSfwk4+Y0Ja7M+6PyXw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "packages/commerce": { "name": "@vercel/commerce", "version": "0.0.1", @@ -10167,6 +10376,12 @@ "integrity": "sha512-PhoQPbwPYspXqf7lkwtF7aJzAwL88t+9E/e0b2X84tlHpU8ZuS9UNnLtkT0XhyZJYHpET5qRfIdZ0HBIxuc7HQ==", "dev": true }, + "@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true + }, "@types/js-cookie": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-2.2.7.tgz", @@ -10179,12 +10394,30 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "@types/jsonwebtoken": { + "version": "8.5.7", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.7.tgz", + "integrity": "sha512-CBHN+1unePowgS94ayLE7aVp7AfyhgG/3l2O+AjkhOMY4kAAfVI1OnbbLnOeDMAdTNLP5ZjJ3kdZanRtRQaK3Q==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/lodash": { "version": "4.14.178", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==", "dev": true }, + "@types/lodash.debounce": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz", + "integrity": "sha512-4WTmnnhCfDvvuLMaF3KV4Qfki93KebocUF45msxhYyjMttZDQYzHkO639ohhk8+oco2cluAFL3t5+Jn4mleylQ==", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, "@types/lodash.random": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/@types/lodash.random/-/lodash.random-3.2.6.tgz", @@ -10264,6 +10497,11 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, + "@types/uuid": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==" + }, "@typescript-eslint/parser": { "version": "5.9.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.1.tgz", @@ -10344,6 +10582,37 @@ } } }, + "@vercel/commerce-bigcommerce": { + "version": "file:packages/bigcommerce", + "requires": { + "@types/cookie": "*", + "@types/jsonwebtoken": "*", + "@types/lodash.debounce": "^4.0.6", + "@types/node": "^15.12.4", + "@types/react": "^17.0.8", + "@vercel/fetch": "^6.1.1", + "cookie": "^0.4.1", + "immutability-helper": "^3.1.1", + "jsonwebtoken": "^8.5.1", + "lint-staged": "^12.1.7", + "lodash.debounce": "^4.0.8", + "next": "^12.0.3", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "swr": "^0.5.6", + "typescript": "^4.6.0-dev.20220108", + "uuidv4": "^6.2.12" + }, + "dependencies": { + "typescript": { + "version": "4.6.0-dev.20220113", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-dev.20220113.tgz", + "integrity": "sha512-hZj5awMxIZp7IhDt1B1ZAEnL0nSTqJiAUP8mTlGA9EXLrRMSZMwSnknu8fxJjMg/miexSfwk4+Y0Ja7M+6PyXw==", + "dev": true + } + } + }, "@vercel/commerce-local": { "version": "file:packages/local", "requires": { @@ -10351,9 +10620,9 @@ "@types/react": "^17.0.8", "@vercel/commerce": "^0.0.1", "@vercel/fetch": "^6.1.1", - "lint-staged": "*", + "lint-staged": "^12.1.7", "next": "^12.0.3", - "prettier": "*", + "prettier": "^2.5.1", "react": "^17.0.2", "react-dom": "^17.0.2", "swr": "^0.5.6", @@ -10859,6 +11128,11 @@ "ieee754": "^1.1.4" } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -11050,6 +11324,11 @@ } } }, + "cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" + }, "core-js-pure": { "version": "3.20.2", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.20.2.tgz", @@ -11446,6 +11725,14 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "electron-to-chromium": { "version": "1.4.37", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.37.tgz", @@ -12356,6 +12643,11 @@ "queue": "6.0.2" } }, + "immutability-helper": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-3.1.1.tgz", + "integrity": "sha512-Q0QaXjPjwIju/28TsugCHNEASwoCcJSyJV3uO1sOIQGI0jKgm9f41Lvz0DZj3n46cNCyAZTsEYoY4C2bVRUzyQ==" + }, "import-cwd": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz", @@ -12699,6 +12991,30 @@ "universalify": "^2.0.0" } }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, "jsx-ast-utils": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz", @@ -12709,6 +13025,25 @@ "object.assign": "^4.1.2" } }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "keen-slider": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/keen-slider/-/keen-slider-6.6.3.tgz", @@ -12887,12 +13222,52 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, "lodash.random": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash.random/-/lodash.random-3.2.0.tgz", @@ -16055,6 +16430,20 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "uuidv4": { + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.12.tgz", + "integrity": "sha512-UnN4ThIYWhv3ZUE8UwDnnCvh4JafCNu+sQkxmLyjCVwK3rjLfkg3DYiEv6oCMDIAIVEDP4INg4kX/C5hKaRzZA==", + "requires": { + "@types/uuid": "8.3.1", + "uuid": "8.3.2" + } + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", diff --git a/packages/bigcommerce/package.json b/packages/bigcommerce/package.json index 07fd5a6ff..0f27c9603 100644 --- a/packages/bigcommerce/package.json +++ b/packages/bigcommerce/package.json @@ -46,7 +46,12 @@ }, "dependencies": { "@vercel/fetch": "^6.1.1", - "swr": "^0.5.6" + "cookie": "^0.4.1", + "immutability-helper": "^3.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.debounce": "^4.0.8", + "swr": "^0.5.6", + "uuidv4": "^6.2.12" }, "peerDependencies": { "next": "^12", @@ -54,6 +59,9 @@ "react-dom": "^17" }, "devDependencies": { + "@types/cookie": "^0.4.1", + "@types/jsonwebtoken": "^8.5.7", + "@types/lodash.debounce": "^4.0.6", "@types/node": "^15.12.4", "@types/react": "^17.0.8", "lint-staged": "^12.1.7", diff --git a/packages/bigcommerce/src/api/endpoints/cart/index.ts b/packages/bigcommerce/src/api/endpoints/cart/index.ts index ae2414d70..376651178 100644 --- a/packages/bigcommerce/src/api/endpoints/cart/index.ts +++ b/packages/bigcommerce/src/api/endpoints/cart/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import cartEndpoint from '@commerce/api/endpoints/cart' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import cartEndpoint from '@vercel/commerce/api/endpoints/cart' import type { CartSchema } from '../../../types/cart' import type { BigcommerceAPI } from '../..' import getCart from './get-cart' diff --git a/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts b/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts index 6dde39e28..f88a231e1 100644 --- a/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts +++ b/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts @@ -1,4 +1,4 @@ -import { Product } from '@commerce/types/product' +import { Product } from '@vercel/commerce/types/product' import { ProductsEndpoint } from '.' const SORT: { [key: string]: string | undefined } = { diff --git a/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts b/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts index 555740f60..24472434d 100644 --- a/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts +++ b/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import productsEndpoint from '@commerce/api/endpoints/catalog/products' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import productsEndpoint from '@vercel/commerce/api/endpoints/catalog/products' import type { ProductsSchema } from '../../../../types/product' import type { BigcommerceAPI } from '../../..' import getProducts from './get-products' diff --git a/packages/bigcommerce/src/api/endpoints/checkout/index.ts b/packages/bigcommerce/src/api/endpoints/checkout/index.ts index 9d6c548a0..83bc4ae08 100644 --- a/packages/bigcommerce/src/api/endpoints/checkout/index.ts +++ b/packages/bigcommerce/src/api/endpoints/checkout/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' import type { CheckoutSchema } from '../../../types/checkout' import type { BigcommerceAPI } from '../..' import getCheckout from './get-checkout' diff --git a/packages/bigcommerce/src/api/endpoints/customer/index.ts b/packages/bigcommerce/src/api/endpoints/customer/index.ts index cb0f6787a..5efff392c 100644 --- a/packages/bigcommerce/src/api/endpoints/customer/index.ts +++ b/packages/bigcommerce/src/api/endpoints/customer/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import customerEndpoint from '@commerce/api/endpoints/customer' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import customerEndpoint from '@vercel/commerce/api/endpoints/customer' import type { CustomerSchema } from '../../../types/customer' import type { BigcommerceAPI } from '../..' import getLoggedInCustomer from './get-logged-in-customer' diff --git a/packages/bigcommerce/src/api/endpoints/login/index.ts b/packages/bigcommerce/src/api/endpoints/login/index.ts index 2b454c7c2..1ad6f7102 100644 --- a/packages/bigcommerce/src/api/endpoints/login/index.ts +++ b/packages/bigcommerce/src/api/endpoints/login/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import loginEndpoint from '@commerce/api/endpoints/login' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import loginEndpoint from '@vercel/commerce/api/endpoints/login' import type { LoginSchema } from '../../../types/login' import type { BigcommerceAPI } from '../..' import login from './login' diff --git a/packages/bigcommerce/src/api/endpoints/login/login.ts b/packages/bigcommerce/src/api/endpoints/login/login.ts index f55c3b54f..0ebc5b110 100644 --- a/packages/bigcommerce/src/api/endpoints/login/login.ts +++ b/packages/bigcommerce/src/api/endpoints/login/login.ts @@ -1,4 +1,4 @@ -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import type { LoginEndpoint } from '.' const invalidCredentials = /invalid credentials/i diff --git a/packages/bigcommerce/src/api/endpoints/logout/index.ts b/packages/bigcommerce/src/api/endpoints/logout/index.ts index 0dbb23bab..94a246f4b 100644 --- a/packages/bigcommerce/src/api/endpoints/logout/index.ts +++ b/packages/bigcommerce/src/api/endpoints/logout/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import logoutEndpoint from '@commerce/api/endpoints/logout' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import logoutEndpoint from '@vercel/commerce/api/endpoints/logout' import type { LogoutSchema } from '../../../types/logout' import type { BigcommerceAPI } from '../..' import logout from './logout' diff --git a/packages/bigcommerce/src/api/endpoints/signup/index.ts b/packages/bigcommerce/src/api/endpoints/signup/index.ts index 6ce8be271..64521f964 100644 --- a/packages/bigcommerce/src/api/endpoints/signup/index.ts +++ b/packages/bigcommerce/src/api/endpoints/signup/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import signupEndpoint from '@commerce/api/endpoints/signup' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import signupEndpoint from '@vercel/commerce/api/endpoints/signup' import type { SignupSchema } from '../../../types/signup' import type { BigcommerceAPI } from '../..' import signup from './signup' diff --git a/packages/bigcommerce/src/api/endpoints/wishlist/index.ts b/packages/bigcommerce/src/api/endpoints/wishlist/index.ts index 31af234ce..87728225d 100644 --- a/packages/bigcommerce/src/api/endpoints/wishlist/index.ts +++ b/packages/bigcommerce/src/api/endpoints/wishlist/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import wishlistEndpoint from '@commerce/api/endpoints/wishlist' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import wishlistEndpoint from '@vercel/commerce/api/endpoints/wishlist' import type { WishlistSchema } from '../../../types/wishlist' import type { BigcommerceAPI } from '../..' import getWishlist from './get-wishlist' diff --git a/packages/bigcommerce/src/api/index.ts b/packages/bigcommerce/src/api/index.ts index ecc0d0e0e..b4999642b 100644 --- a/packages/bigcommerce/src/api/index.ts +++ b/packages/bigcommerce/src/api/index.ts @@ -3,7 +3,7 @@ import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi, -} from '@commerce/api' +} from '@vercel/commerce/api' import createFetchGraphqlApi from './utils/fetch-graphql-api' import createFetchStoreApi from './utils/fetch-store-api' diff --git a/packages/bigcommerce/src/api/operations/get-all-pages.ts b/packages/bigcommerce/src/api/operations/get-all-pages.ts index 3a9b64b1f..3117b73fc 100644 --- a/packages/bigcommerce/src/api/operations/get-all-pages.ts +++ b/packages/bigcommerce/src/api/operations/get-all-pages.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { Page, GetAllPagesOperation } from '../../types/page' import type { RecursivePartial, RecursiveRequired } from '../utils/types' import { BigcommerceConfig, Provider } from '..' diff --git a/packages/bigcommerce/src/api/operations/get-all-product-paths.ts b/packages/bigcommerce/src/api/operations/get-all-product-paths.ts index da7b457eb..3184e2fc1 100644 --- a/packages/bigcommerce/src/api/operations/get-all-product-paths.ts +++ b/packages/bigcommerce/src/api/operations/get-all-product-paths.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetAllProductPathsQuery } from '../../schema' import type { GetAllProductPathsOperation } from '../../types/product' import type { RecursivePartial, RecursiveRequired } from '../utils/types' diff --git a/packages/bigcommerce/src/api/operations/get-all-products.ts b/packages/bigcommerce/src/api/operations/get-all-products.ts index c2652f5bf..01bde1a09 100644 --- a/packages/bigcommerce/src/api/operations/get-all-products.ts +++ b/packages/bigcommerce/src/api/operations/get-all-products.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetAllProductsQuery, GetAllProductsQueryVariables, diff --git a/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts b/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts index 5227ee663..dc0dd0d9a 100644 --- a/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts +++ b/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetCustomerWishlistOperation, Wishlist, diff --git a/packages/bigcommerce/src/api/operations/get-page.ts b/packages/bigcommerce/src/api/operations/get-page.ts index 6a1fea9d0..dc38e5088 100644 --- a/packages/bigcommerce/src/api/operations/get-page.ts +++ b/packages/bigcommerce/src/api/operations/get-page.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetPageOperation, Page } from '../../types/page' import type { RecursivePartial, RecursiveRequired } from '../utils/types' import type { BigcommerceConfig, Provider } from '..' diff --git a/packages/bigcommerce/src/api/operations/get-product.ts b/packages/bigcommerce/src/api/operations/get-product.ts index fb356e952..d724c42ba 100644 --- a/packages/bigcommerce/src/api/operations/get-product.ts +++ b/packages/bigcommerce/src/api/operations/get-product.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetProductOperation } from '../../types/product' import type { GetProductQuery, GetProductQueryVariables } from '../../schema' import setProductLocaleMeta from '../utils/set-product-locale-meta' diff --git a/packages/bigcommerce/src/api/operations/get-site-info.ts b/packages/bigcommerce/src/api/operations/get-site-info.ts index 0dd94dd9d..334870ed7 100644 --- a/packages/bigcommerce/src/api/operations/get-site-info.ts +++ b/packages/bigcommerce/src/api/operations/get-site-info.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetSiteInfoOperation } from '../../types/site' import type { GetSiteInfoQuery } from '../../schema' import filterEdges from '../utils/filter-edges' diff --git a/packages/bigcommerce/src/api/operations/login.ts b/packages/bigcommerce/src/api/operations/login.ts index 021ba3c65..604a1a52a 100644 --- a/packages/bigcommerce/src/api/operations/login.ts +++ b/packages/bigcommerce/src/api/operations/login.ts @@ -2,7 +2,7 @@ import type { ServerResponse } from 'http' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { LoginOperation } from '../../types/login' import type { LoginMutation } from '../../schema' import type { RecursivePartial } from '../utils/types' diff --git a/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts b/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts index 8cc76c067..ad385fee6 100644 --- a/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts +++ b/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { GraphQLFetcher } from '@commerce/api' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' import type { BigcommerceConfig } from '../index' import fetch from './fetch' diff --git a/packages/bigcommerce/src/auth/use-login.tsx b/packages/bigcommerce/src/auth/use-login.tsx index a8c049603..fadf2093a 100644 --- a/packages/bigcommerce/src/auth/use-login.tsx +++ b/packages/bigcommerce/src/auth/use-login.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import type { LoginHook } from '../types/login' import useCustomer from '../customer/use-customer' diff --git a/packages/bigcommerce/src/auth/use-logout.tsx b/packages/bigcommerce/src/auth/use-logout.tsx index 1e8e9c666..bc5c3a4c0 100644 --- a/packages/bigcommerce/src/auth/use-logout.tsx +++ b/packages/bigcommerce/src/auth/use-logout.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import useLogout, { UseLogout } from '@commerce/auth/use-logout' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' import type { LogoutHook } from '../types/logout' import useCustomer from '../customer/use-customer' diff --git a/packages/bigcommerce/src/auth/use-signup.tsx b/packages/bigcommerce/src/auth/use-signup.tsx index 8f183685f..7701c7949 100644 --- a/packages/bigcommerce/src/auth/use-signup.tsx +++ b/packages/bigcommerce/src/auth/use-signup.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useSignup, { UseSignup } from '@commerce/auth/use-signup' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' import type { SignupHook } from '../types/signup' import useCustomer from '../customer/use-customer' diff --git a/packages/bigcommerce/src/cart/use-add-item.tsx b/packages/bigcommerce/src/cart/use-add-item.tsx index bdad1862c..f65e82bc7 100644 --- a/packages/bigcommerce/src/cart/use-add-item.tsx +++ b/packages/bigcommerce/src/cart/use-add-item.tsx @@ -1,8 +1,8 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item' -import type { AddItemHook } from '@commerce/types/cart' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import type { AddItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' export default useAddItem as UseAddItem diff --git a/packages/bigcommerce/src/cart/use-cart.tsx b/packages/bigcommerce/src/cart/use-cart.tsx index 53fd3471c..f8c4691bf 100644 --- a/packages/bigcommerce/src/cart/use-cart.tsx +++ b/packages/bigcommerce/src/cart/use-cart.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { SWRHook } from '@commerce/utils/types' -import useCart, { UseCart } from '@commerce/cart/use-cart' -import type { GetCartHook } from '@commerce/types/cart' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' export default useCart as UseCart diff --git a/packages/bigcommerce/src/cart/use-remove-item.tsx b/packages/bigcommerce/src/cart/use-remove-item.tsx index daf155c26..8bea34f41 100644 --- a/packages/bigcommerce/src/cart/use-remove-item.tsx +++ b/packages/bigcommerce/src/cart/use-remove-item.tsx @@ -2,10 +2,10 @@ import { useCallback } from 'react' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' -import type { Cart, LineItem, RemoveItemHook } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' +import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' export type RemoveItemFn = T extends LineItem diff --git a/packages/bigcommerce/src/cart/use-update-item.tsx b/packages/bigcommerce/src/cart/use-update-item.tsx index a4c7d178e..b15690ed7 100644 --- a/packages/bigcommerce/src/cart/use-update-item.tsx +++ b/packages/bigcommerce/src/cart/use-update-item.tsx @@ -3,10 +3,10 @@ import debounce from 'lodash.debounce' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' -import type { LineItem, UpdateItemHook } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item' +import type { LineItem, UpdateItemHook } from '@vercel/commerce/types/cart' import { handler as removeItemHandler } from './use-remove-item' import useCart from './use-cart' diff --git a/packages/bigcommerce/src/checkout/use-checkout.tsx b/packages/bigcommerce/src/checkout/use-checkout.tsx index 942f85b83..cab52bb60 100644 --- a/packages/bigcommerce/src/checkout/use-checkout.tsx +++ b/packages/bigcommerce/src/checkout/use-checkout.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useCheckout, { UseCheckout } from '@commerce/checkout/use-checkout' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout' export default useCheckout as UseCheckout diff --git a/packages/bigcommerce/src/customer/address/use-add-item.tsx b/packages/bigcommerce/src/customer/address/use-add-item.tsx index ac9dcd5cf..fabd11b1d 100644 --- a/packages/bigcommerce/src/customer/address/use-add-item.tsx +++ b/packages/bigcommerce/src/customer/address/use-add-item.tsx @@ -1,5 +1,5 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/address/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem diff --git a/packages/bigcommerce/src/customer/card/use-add-item.tsx b/packages/bigcommerce/src/customer/card/use-add-item.tsx index 7e3afa9c5..938e6cd61 100644 --- a/packages/bigcommerce/src/customer/card/use-add-item.tsx +++ b/packages/bigcommerce/src/customer/card/use-add-item.tsx @@ -1,5 +1,5 @@ -import useAddItem, { UseAddItem } from '@commerce/customer/card/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem diff --git a/packages/bigcommerce/src/customer/use-customer.tsx b/packages/bigcommerce/src/customer/use-customer.tsx index ddecc2fcf..36bf88617 100644 --- a/packages/bigcommerce/src/customer/use-customer.tsx +++ b/packages/bigcommerce/src/customer/use-customer.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer' import type { CustomerHook } from '../types/customer' export default useCustomer as UseCustomer diff --git a/packages/bigcommerce/src/fetcher.ts b/packages/bigcommerce/src/fetcher.ts index f8ca0c578..bc8a6b9aa 100644 --- a/packages/bigcommerce/src/fetcher.ts +++ b/packages/bigcommerce/src/fetcher.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { Fetcher } from '@commerce/utils/types' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { Fetcher } from '@vercel/commerce/utils/types' async function getText(res: Response) { try { diff --git a/packages/bigcommerce/src/index.tsx b/packages/bigcommerce/src/index.tsx index 3259836b9..a7de60924 100644 --- a/packages/bigcommerce/src/index.tsx +++ b/packages/bigcommerce/src/index.tsx @@ -1,4 +1,4 @@ -import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' import { bigcommerceProvider, BigcommerceProvider } from './provider' export { bigcommerceProvider } diff --git a/packages/bigcommerce/src/product/use-price.tsx b/packages/bigcommerce/src/product/use-price.tsx index 0174faf5e..fd42d7033 100644 --- a/packages/bigcommerce/src/product/use-price.tsx +++ b/packages/bigcommerce/src/product/use-price.tsx @@ -1,2 +1,2 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/packages/bigcommerce/src/product/use-search.tsx b/packages/bigcommerce/src/product/use-search.tsx index 76fab00a4..fd918e341 100644 --- a/packages/bigcommerce/src/product/use-search.tsx +++ b/packages/bigcommerce/src/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' import type { SearchProductsHook } from '../types/product' export default useSearch as UseSearch diff --git a/packages/bigcommerce/src/types/cart.ts b/packages/bigcommerce/src/types/cart.ts index 33c01e4c6..3b5d8288b 100644 --- a/packages/bigcommerce/src/types/cart.ts +++ b/packages/bigcommerce/src/types/cart.ts @@ -1,6 +1,6 @@ -import * as Core from '@commerce/types/cart' +import * as Core from '@vercel/commerce/types/cart' -export * from '@commerce/types/cart' +export * from '@vercel/commerce/types/cart' // TODO: this type should match: // https://developer.bigcommerce.com/api-reference/cart-checkout/server-server-cart-api/cart/getacart#responses diff --git a/packages/bigcommerce/src/types/checkout.ts b/packages/bigcommerce/src/types/checkout.ts index 4e2412ef6..d139db685 100644 --- a/packages/bigcommerce/src/types/checkout.ts +++ b/packages/bigcommerce/src/types/checkout.ts @@ -1 +1 @@ -export * from '@commerce/types/checkout' +export * from '@vercel/commerce/types/checkout' diff --git a/packages/bigcommerce/src/types/common.ts b/packages/bigcommerce/src/types/common.ts index b52c33a4d..23b8daa11 100644 --- a/packages/bigcommerce/src/types/common.ts +++ b/packages/bigcommerce/src/types/common.ts @@ -1 +1 @@ -export * from '@commerce/types/common' +export * from '@vercel/commerce/types/common' diff --git a/packages/bigcommerce/src/types/customer.ts b/packages/bigcommerce/src/types/customer.ts index 427bc0b03..6e66366be 100644 --- a/packages/bigcommerce/src/types/customer.ts +++ b/packages/bigcommerce/src/types/customer.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/customer' +import * as Core from '@vercel/commerce/types/customer' -export * from '@commerce/types/customer' +export * from '@vercel/commerce/types/customer' export type CustomerSchema = Core.CustomerSchema diff --git a/packages/bigcommerce/src/types/login.ts b/packages/bigcommerce/src/types/login.ts index 24d5077ff..643a0cc96 100644 --- a/packages/bigcommerce/src/types/login.ts +++ b/packages/bigcommerce/src/types/login.ts @@ -1,7 +1,7 @@ -import * as Core from '@commerce/types/login' +import * as Core from '@vercel/commerce/types/login' import type { LoginMutationVariables } from '../schema' -export * from '@commerce/types/login' +export * from '@vercel/commerce/types/login' export type LoginOperation = Core.LoginOperation & { variables: LoginMutationVariables diff --git a/packages/bigcommerce/src/types/logout.ts b/packages/bigcommerce/src/types/logout.ts index 9f0a466af..1de06f8dc 100644 --- a/packages/bigcommerce/src/types/logout.ts +++ b/packages/bigcommerce/src/types/logout.ts @@ -1 +1 @@ -export * from '@commerce/types/logout' +export * from '@vercel/commerce/types/logout' diff --git a/packages/bigcommerce/src/types/page.ts b/packages/bigcommerce/src/types/page.ts index 2bccfade2..ccbc29f7b 100644 --- a/packages/bigcommerce/src/types/page.ts +++ b/packages/bigcommerce/src/types/page.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/page' -export * from '@commerce/types/page' +import * as Core from '@vercel/commerce/types/page' +export * from '@vercel/commerce/types/page' export type Page = Core.Page diff --git a/packages/bigcommerce/src/types/product.ts b/packages/bigcommerce/src/types/product.ts index c776d58fa..72ca02f02 100644 --- a/packages/bigcommerce/src/types/product.ts +++ b/packages/bigcommerce/src/types/product.ts @@ -1 +1 @@ -export * from '@commerce/types/product' +export * from '@vercel/commerce/types/product' diff --git a/packages/bigcommerce/src/types/signup.ts b/packages/bigcommerce/src/types/signup.ts index 58543c6f6..3f0d1af5a 100644 --- a/packages/bigcommerce/src/types/signup.ts +++ b/packages/bigcommerce/src/types/signup.ts @@ -1 +1 @@ -export * from '@commerce/types/signup' +export * from '@vercel/commerce/types/signup' diff --git a/packages/bigcommerce/src/types/site.ts b/packages/bigcommerce/src/types/site.ts index 12dd7038c..44e03f9ee 100644 --- a/packages/bigcommerce/src/types/site.ts +++ b/packages/bigcommerce/src/types/site.ts @@ -1,7 +1,7 @@ -import * as Core from '@commerce/types/site' +import * as Core from '@vercel/commerce/types/site' import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../schema' -export * from '@commerce/types/site' +export * from '@vercel/commerce/types/site' export type BCCategory = NonNullable< GetSiteInfoQuery['site']['categoryTree'] diff --git a/packages/bigcommerce/src/types/wishlist.ts b/packages/bigcommerce/src/types/wishlist.ts index 9e9c52353..67cf58c26 100644 --- a/packages/bigcommerce/src/types/wishlist.ts +++ b/packages/bigcommerce/src/types/wishlist.ts @@ -1,8 +1,8 @@ -import * as Core from '@commerce/types/wishlist' +import * as Core from '@vercel/commerce/types/wishlist' import { definitions } from '../api/definitions/wishlist' import type { ProductEdge } from '../api/operations/get-all-products' -export * from '@commerce/types/wishlist' +export * from '@vercel/commerce/types/wishlist' export type WishlistItem = NonNullable< definitions['wishlist_Full']['items'] diff --git a/packages/bigcommerce/src/wishlist/use-add-item.tsx b/packages/bigcommerce/src/wishlist/use-add-item.tsx index 6b3f7778d..fbe85d2f3 100644 --- a/packages/bigcommerce/src/wishlist/use-add-item.tsx +++ b/packages/bigcommerce/src/wishlist/use-add-item.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useAddItem, { UseAddItem } from '@commerce/wishlist/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useAddItem, { UseAddItem } from '@vercel/commerce/wishlist/use-add-item' import type { AddItemHook } from '../types/wishlist' import useCustomer from '../customer/use-customer' import useWishlist from './use-wishlist' diff --git a/packages/bigcommerce/src/wishlist/use-remove-item.tsx b/packages/bigcommerce/src/wishlist/use-remove-item.tsx index bb8e6415e..6b5ef6dd9 100644 --- a/packages/bigcommerce/src/wishlist/use-remove-item.tsx +++ b/packages/bigcommerce/src/wishlist/use-remove-item.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' import useRemoveItem, { UseRemoveItem, -} from '@commerce/wishlist/use-remove-item' +} from '@vercel/commerce/wishlist/use-remove-item' import type { RemoveItemHook } from '../types/wishlist' import useCustomer from '../customer/use-customer' import useWishlist from './use-wishlist' diff --git a/packages/bigcommerce/src/wishlist/use-wishlist.tsx b/packages/bigcommerce/src/wishlist/use-wishlist.tsx index 7c09f835a..e77d6885b 100644 --- a/packages/bigcommerce/src/wishlist/use-wishlist.tsx +++ b/packages/bigcommerce/src/wishlist/use-wishlist.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { SWRHook } from '@commerce/utils/types' -import useWishlist, { UseWishlist } from '@commerce/wishlist/use-wishlist' +import { SWRHook } from '@vercel/commerce/utils/types' +import useWishlist, { UseWishlist } from '@vercel/commerce/wishlist/use-wishlist' import type { GetWishlistHook } from '../types/wishlist' import useCustomer from '../customer/use-customer' diff --git a/packages/bigcommerce/tsconfig.json b/packages/bigcommerce/tsconfig.json new file mode 100644 index 000000000..81ac7f650 --- /dev/null +++ b/packages/bigcommerce/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "outDir": "dist", + "baseUrl": "src", + "lib": ["dom", "dom.iterable", "esnext"], + "declaration": true, + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "pretty": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +}