Files
shop/package.json
T
libretech 5c773a99e6 feat(orders): pass the CMS's status and safe error fields to the browser
The order routes (get, put, add-product, remove-product, checkout, capture)
call forwardToCms, which throws a CMS error on as
createError({ statusCode, statusMessage, data: { message, errors?, missing? } }),
built by the pure shopErrorFromCms (server/utils/cmsError.ts).

Before, the FetchError was thrown on as it was: the browser got the CMS's
status, but Nitro treated it as unhandled, answered "Server Error" without
data and logged every CMS 4xx as [unhandled]. Now the browser also gets the
CMS's message, the errors of a rejected update and the fields a checkout
misses, and no other field. A status that is the shop's own fault (401, 403,
...) is answered 500, a CMS that does not answer 503; 5xx are logged without
the query and the order uuid.

npm test runs tests/unit with Node's type stripping and no dependencies, as
in libreshop/cms. nuxt.config keeps tests/ out of the app's type check.

Refs libretech/mp#71
2026-10-09 02:32:14 +02:00

36 lines
970 B
JSON

{
"name": "shop",
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"test": "node --experimental-strip-types --import ./tests/unit/support/register.mjs --test 'tests/unit/**/*.test.ts'"
},
"dependencies": {
"@headlessui/vue": "^1.7.23",
"@nuxt/image": "^2.0.0",
"@nuxtjs/sitemap": "^7.4.7",
"@nuxtjs/tailwindcss": "^6.14.0",
"@paypal/paypal-js": "^9.0.1",
"@pinia/nuxt": "^0.11.3",
"debug": "^4.4.3",
"marked": "^17.0.1",
"nuxt": "^4.2.1",
"vue": "^3.5.25",
"vue-confetti-explosion": "^1.0.2",
"vue-markdown-render": "^2.3.0",
"vue-router": "^4.6.3",
"vue-strapi-blocks-renderer": "^0.2.2",
"vue3-carousel": "^0.17.0"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.10",
"@types/debug": "^4.1.12",
"typescript": "^5.9.3"
}
}