Skip to content

Commit b57db0b

Browse files
Merge branch 'release/bin/revamp' into feat/bin/split
2 parents 77df55f + 66bcaee commit b57db0b

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/quicktype-core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@types/unicode-properties": "^1.3.0",
3737
"@types/urijs": "^1.19.25",
3838
"@types/wordwrap": "^1.0.3",
39+
"command-line-args": "^5.2.1",
3940
"typescript": "~5.8.3"
4041
},
4142
"overrides": {

packages/quicktype-core/src/RendererOptions/types.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import type { EnumOption, Option } from "./index";
2+
import type { OptionDefinition as CommandLineArgsOptionDefinition } from "command-line-args";
23

34
/**
45
* Primary options show up in the web UI in the "Language" settings tab,
56
* Secondary options in "Other".
67
* CLI is only for cli
78
*/
89
export type OptionKind = "primary" | "secondary" | "cli";
10+
export type OptionType = "string" | "boolean" | "enum";
911

10-
export interface OptionDefinition<Name extends string = string, T = unknown> {
12+
export interface OptionDefinition<Name extends string = string, T = unknown>
13+
extends CommandLineArgsOptionDefinition {
1114
/** Option Name */
1215
name: Name;
13-
/** Option Alias for CLI */
14-
alias?: string;
1516
/** Option Description */
1617
description: string;
1718
/** Category of Option */
18-
optionType: "string" | "boolean" | "enum";
19+
optionType: OptionType;
1920
/** Default Value for Option */
2021
defaultValue?: T;
2122
/** Enum only, map of possible keys and values */

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { parseCLIOptions } from "./cli.options";
1515
import { inferCLIOptions } from "./inference";
1616
import { makeQuicktypeOptions } from "./quicktype.options";
1717
import type { CLIOptions } from "./CLIOptions.types";
18+
export type { CLIOptions };
1819

1920
export function writeOutput(
2021
cliOptions: CLIOptions,

test/test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function main(sources: string[]) {
2020
if (fixturesFromCmdline) {
2121
const fixtureNames = fixturesFromCmdline.split(",");
2222
fixtures = fixtures.filter((fixture) =>
23-
fixtureNames.some(fixture.runForName),
23+
fixtureNames.some((name) => fixture.runForName(name)),
2424
);
2525
}
2626

@@ -70,7 +70,9 @@ async function main(sources: string[]) {
7070
},
7171

7272
map: async ({ sample, fixtureName }: WorkItem, index) => {
73-
const fixture = fixtures.find(({ name }) => name === fixtureName);
73+
const fixture = fixtures.find(
74+
(fixture) => fixture.name === fixtureName,
75+
);
7476

7577
try {
7678
await fixture?.runWithSample(sample, index, tests.length);

0 commit comments

Comments
 (0)