toolcraft-openapi 0.0.363 → 0.0.364
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/dist/composition.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function note(message: string, title?: string): void;
|
|
1
|
+
export declare function note(message: string, title?: string, write?: (chunk: string) => void): void;
|
|
@@ -16,7 +16,7 @@ function renderTerminalNote(message, title) {
|
|
|
16
16
|
const bottom = color.gray(`├${"─".repeat(contentWidth + 2)}╯`);
|
|
17
17
|
return [color.gray("│"), titleLine, ...content, bottom].join("\n");
|
|
18
18
|
}
|
|
19
|
-
export function note(message, title) {
|
|
19
|
+
export function note(message, title, write = process.stdout.write.bind(process.stdout)) {
|
|
20
20
|
const format = resolveOutputFormat();
|
|
21
21
|
const strippedMessage = stripAnsi(message);
|
|
22
22
|
const strippedTitle = stripAnsi(title ?? "").replaceAll("\r\n", " ").replaceAll("\n", " ").replaceAll("\r", " ");
|
|
@@ -24,16 +24,16 @@ export function note(message, title) {
|
|
|
24
24
|
const lines = strippedMessage.split("\n");
|
|
25
25
|
const heading = strippedTitle ? `> **${strippedTitle}**\n` : "";
|
|
26
26
|
const body = lines.map((line) => `> ${line}`).join("\n");
|
|
27
|
-
|
|
27
|
+
write(`${heading}${body}\n`);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
if (format === "json") {
|
|
31
|
-
|
|
31
|
+
write(`${JSON.stringify({
|
|
32
32
|
type: "note",
|
|
33
33
|
title: strippedTitle,
|
|
34
34
|
message: strippedMessage
|
|
35
35
|
})}\n`);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
write(`${renderTerminalNote(message, title)}\n`);
|
|
39
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft-openapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.364",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"toolcraft-openapi-generate": "dist/bin/generate.js"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"toolcraft": "0.0.
|
|
33
|
+
"toolcraft": "0.0.364",
|
|
34
34
|
"fast-string-width": "^3.0.2",
|
|
35
35
|
"fast-wrap-ansi": "^0.2.0",
|
|
36
36
|
"sisteransi": "^1.0.5",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"directory": "packages/toolcraft-openapi"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"toolcraft-schema": "0.0.
|
|
48
|
+
"toolcraft-schema": "0.0.364",
|
|
49
49
|
"toolcraft-design": "*",
|
|
50
50
|
"@poe-code/frontmatter": "*"
|
|
51
51
|
},
|