@nosto/nosto-cli 1.2.9 → 1.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosto/nosto-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"main": "./src/index.ts",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nosto": "./src/bootstrap.mjs"
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@inquirer/prompts": "^8.0.1",
|
|
33
33
|
"chalk": "^5.6.2",
|
|
34
34
|
"commander": "^14.0.1",
|
|
35
|
-
"esbuild": "^0.
|
|
35
|
+
"esbuild": "^0.28.0",
|
|
36
36
|
"ignore": "^7.0.5",
|
|
37
|
-
"ky": "^
|
|
37
|
+
"ky": "^2.0.0",
|
|
38
38
|
"open": "^11.0.0",
|
|
39
39
|
"ora": "^9.0.0",
|
|
40
40
|
"preact": "^10.27.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"eslint": "^10.0.1",
|
|
52
52
|
"eslint-config-prettier": "^10.1.8",
|
|
53
53
|
"eslint-plugin-prettier": "^5.5.4",
|
|
54
|
-
"eslint-plugin-simple-import-sort": "^
|
|
54
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
55
55
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
56
56
|
"husky": "^9.1.7",
|
|
57
57
|
"memfs": "^4.48.1",
|
|
@@ -22,6 +22,7 @@ export async function withErrorHandler(fn: () => void | Promise<void>): Promise<
|
|
|
22
22
|
Logger.error(`HTTP Request failed:`)
|
|
23
23
|
Logger.error(`- ${error.response.status} ${error.response.statusText}`)
|
|
24
24
|
Logger.error(`- ${error.request.method} ${error.request.url}`)
|
|
25
|
+
Logger.error(`- ${await error.response.text()}`)
|
|
25
26
|
printStack(error)
|
|
26
27
|
} else if (error instanceof TimeoutError) {
|
|
27
28
|
Logger.error(`HTTP Request timed out:`)
|
|
@@ -70,8 +70,9 @@ describe("Error Handler", () => {
|
|
|
70
70
|
throw new HTTPError(
|
|
71
71
|
{
|
|
72
72
|
status: 500,
|
|
73
|
-
statusText: "Internal Server Error"
|
|
74
|
-
|
|
73
|
+
statusText: "Internal Server Error",
|
|
74
|
+
text: () => Promise.resolve("Internal Server Error body")
|
|
75
|
+
} as unknown as Response,
|
|
75
76
|
{
|
|
76
77
|
method: "GET",
|
|
77
78
|
url: "https://example.com/api"
|
|
@@ -80,8 +81,9 @@ describe("Error Handler", () => {
|
|
|
80
81
|
)
|
|
81
82
|
})
|
|
82
83
|
|
|
83
|
-
expect(
|
|
84
|
+
await expect(withErrorHandler(mockFn)).resolves.toBeUndefined()
|
|
84
85
|
expect(terminal.getSpy("error")).toHaveBeenCalledWith("- GET https://example.com/api")
|
|
86
|
+
expect(terminal.getSpy("error")).toHaveBeenCalledWith("- Internal Server Error body")
|
|
85
87
|
})
|
|
86
88
|
|
|
87
89
|
it("should handle HTTPError", async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { describe, expect, it, vi } from "vitest"
|
|
2
2
|
|
|
3
3
|
import { parseSearchTemplatesConfigFile } from "#config/searchTemplatesConfig.ts"
|
|
4
4
|
import { buildSearchTemplate } from "#modules/search-templates/build.ts"
|
|
@@ -13,9 +13,6 @@ const server = setupMockServer()
|
|
|
13
13
|
const terminal = setupMockConsole()
|
|
14
14
|
|
|
15
15
|
describe("Search Templates build / modern", () => {
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
setupMockStarterManifest()
|
|
18
|
-
})
|
|
19
16
|
it("should build templates without watch mode", async () => {
|
|
20
17
|
const manifest = setupMockStarterManifest({
|
|
21
18
|
mockScript: { onBuild: vi.fn() }
|