@plutocms/pluto 0.14.0 → 0.14.1
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/.prettierignore
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [0.14.1](https://github.com/plutocms/pluto/compare/v0.14.0...v0.14.1) (2026-10-18)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **i18n:** prefer the response body message in usePlutoErrorText ([#165](https://github.com/plutocms/pluto/issues/165)) ([0c5d183](https://github.com/plutocms/pluto/commit/0c5d183f66fa328e0e18b1a27ced77f7d0fded89))
|
|
10
|
+
|
|
4
11
|
## [0.14.0](https://github.com/plutocms/pluto/compare/v0.13.0...v0.14.0) (2026-10-18)
|
|
5
12
|
|
|
6
13
|
|
|
@@ -34,7 +34,11 @@ params?: MessageParams
|
|
|
34
34
|
* Turns an error into text for an admin. Order:
|
|
35
35
|
*
|
|
36
36
|
* 1. The translated `data.i18n` of a server `createPlutoError`.
|
|
37
|
-
* 2. The
|
|
37
|
+
* 2. The `statusMessage`, then the `message`, of the response body
|
|
38
|
+
* (English). Then the `statusMessage` of the error itself. A `$fetch`
|
|
39
|
+
* error copies that one from the HTTP status text. The status text can
|
|
40
|
+
* be a generic phrase ("Unsupported Media Type") and is empty over
|
|
41
|
+
* HTTP/2, so the body comes first.
|
|
38
42
|
* 3. The translated fallback key.
|
|
39
43
|
*/
|
|
40
44
|
export function resolveErrorText(
|
|
@@ -53,6 +57,6 @@ te: (key: string) => boolean
|
|
|
53
57
|
return i18n.t(tag.key, tag.params)
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
const server = nonEmpty(
|
|
60
|
+
const server = nonEmpty(data?.statusMessage) ?? nonEmpty(data?.message) ?? nonEmpty(source?.statusMessage)
|
|
57
61
|
return server ?? i18n.t(fallbackKey)
|
|
58
62
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plutocms/pluto",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.1",
|
|
5
5
|
"description": "The layerable CMS",
|
|
6
6
|
"author": "Victor Ribeiro",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"postinstall": "nuxt prepare",
|
|
30
30
|
"prettier": "prettier --write .",
|
|
31
31
|
"lint": "eslint .",
|
|
32
|
-
"lint:fix": "eslint . --fix
|
|
32
|
+
"lint:fix": "eslint . --fix",
|
|
33
33
|
"typecheck": "nuxt prepare && vue-tsc -b --noEmit",
|
|
34
34
|
"test": "vitest run"
|
|
35
35
|
},
|