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.
@@ -33,12 +33,12 @@
33
33
  },
34
34
  {
35
35
  "name": "toolcraft-openapi",
36
- "version": "0.0.363",
36
+ "version": "0.0.364",
37
37
  "license": "MIT"
38
38
  },
39
39
  {
40
40
  "name": "toolcraft-schema",
41
- "version": "0.0.363",
41
+ "version": "0.0.364",
42
42
  "license": "MIT"
43
43
  },
44
44
  {
@@ -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
- process.stdout.write(`${heading}${body}\n`);
27
+ write(`${heading}${body}\n`);
28
28
  return;
29
29
  }
30
30
  if (format === "json") {
31
- process.stdout.write(`${JSON.stringify({
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
- process.stdout.write(`${renderTerminalNote(message, title)}\n`);
38
+ write(`${renderTerminalNote(message, title)}\n`);
39
39
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.363",
3
+ "version": "0.0.364",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-openapi",
3
- "version": "0.0.363",
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.363",
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.363",
48
+ "toolcraft-schema": "0.0.364",
49
49
  "toolcraft-design": "*",
50
50
  "@poe-code/frontmatter": "*"
51
51
  },