Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
drwpow committed Oct 3, 2023
1 parent c2cb6b1 commit 312b7ba
Show file tree
Hide file tree
Showing 33 changed files with 328,874 additions and 317,645 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-llamas-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"openapi-typescript": minor
---

**Feature:** allow configuration of schemas via `apis` key in redocly.config.yaml (see https://redocly.com/docs/cli/configuration/)
16 changes: 13 additions & 3 deletions packages/openapi-typescript/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { loadConfig } from "@redocly/openapi-core";
import glob from "fast-glob";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import parser from "yargs-parser";
import openapiTS, {
Expand Down Expand Up @@ -130,10 +131,19 @@ async function generateSchema(url) {

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

const inputDisplay =
url.protocol === "file:"
? path.relative(fileURLToPath(CWD), fileURLToPath(url))
: url.href;
const outputDisplay = path.relative(
fileURLToPath(CWD),
fileURLToPath(outputFilePath),
);

console.log(
`🚀 ${c.green(
`${fileURLToPath(url)}${c.bold(fileURLToPath(outputFilePath))}`,
)} ${c.dim(`[${formatTime(performance.now() - timeStart)}]`)}`,
`🚀 ${c.green(`${inputDisplay}${c.bold(outputDisplay)}`)} ${c.dim(
`[${formatTime(performance.now() - timeStart)}]`,
)}`,
);
} else {
process.stdout.write(result);
Expand Down

0 comments on commit 312b7ba

Please sign in to comment.