Skip to content

Commit 312b7ba

Browse files
committed
Update examples
1 parent c2cb6b1 commit 312b7ba

33 files changed

+328874
-317645
lines changed

.changeset/short-llamas-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-typescript": minor
3+
---
4+
5+
**Feature:** allow configuration of schemas via `apis` key in redocly.config.yaml (see https://redocly.com/docs/cli/configuration/)

packages/openapi-typescript/bin/cli.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { loadConfig } from "@redocly/openapi-core";
44
import glob from "fast-glob";
55
import fs from "node:fs";
6+
import path from "node:path";
67
import { fileURLToPath } from "node:url";
78
import parser from "yargs-parser";
89
import openapiTS, {
@@ -130,10 +131,19 @@ async function generateSchema(url) {
130131

131132
fs.writeFileSync(outputFilePath, result, "utf8");
132133

134+
const inputDisplay =
135+
url.protocol === "file:"
136+
? path.relative(fileURLToPath(CWD), fileURLToPath(url))
137+
: url.href;
138+
const outputDisplay = path.relative(
139+
fileURLToPath(CWD),
140+
fileURLToPath(outputFilePath),
141+
);
142+
133143
console.log(
134-
`🚀 ${c.green(
135-
`${fileURLToPath(url)}${c.bold(fileURLToPath(outputFilePath))}`,
136-
)} ${c.dim(`[${formatTime(performance.now() - timeStart)}]`)}`,
144+
`🚀 ${c.green(`${inputDisplay}${c.bold(outputDisplay)}`)} ${c.dim(
145+
`[${formatTime(performance.now() - timeStart)}]`,
146+
)}`,
137147
);
138148
} else {
139149
process.stdout.write(result);

0 commit comments

Comments
 (0)