bcherny / json-schema-to-typescript

Compile JSON Schema to TypeScript type declarations
https://bcherny.github.io/json-schema-to-typescript-browser/
MIT License
2.95k stars 392 forks source link

Update to Glob 10 #592

Closed evert closed 7 months ago

evert commented 7 months ago

We've been dealing with some Typescript issues in our codebase for a while, and tracing everything back I believe upgrading Glob should fix this.

Unfortunately I had some build issues that I didn't fully understand and seemed unrelated to this change.

Lmk what I can do get this merged!

Edit: upon some further inspection I this is similar to #590 .

Fixes #587

evert commented 7 months ago

This PR causes one test to fail:

  ✖ files in (-i), pipe out Did not match snapshot
  files in (-i), pipe out

  Did not match snapshot

  Difference:

    `/* eslint-disable */␊
    /**␊
     * This file was automatically generated by json-schema-to-typescript.␊
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,␊
     * and run json-schema-to-typescript to regenerate this file.␊
     */␊
    ␊
  - export interface BSchema {␊
  -   x?: string;␊
  -   y: number;␊
  -   [k: string]: unknown;␊
  - }␊
  - /* eslint-disable */␊
  + export interface ASchema {␊
  +   f: string;␊
  +   g?: number;␊
  + }␊
  + /* eslint-disable */␊
    /**␊
     * This file was automatically generated by json-schema-to-typescript.␊
     * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,␊
     * and run json-schema-to-typescript to regenerate this file.␊
     */␊
    ␊
  - export interface ASchema {␊
  -   f: string;␊
  -   g?: number;␊
  + export interface BSchema {␊
  +   x?: string;␊
  +   y: number;␊
  +   [k: string]: unknown;␊
    }␊
    `

  › <anonymous> (test/testCLI.ts:107:7)
evert commented 7 months ago

For some reason that test failed because the output came out in a different order. I rebuilt the snapshots, so this should be good to go now!

bcherny commented 7 months ago

Thanks for the contribution! Done in 4f4795275b184f32a14f621c60a9c89b8cc0fd86, since it needed some other upgrades + test fixes.

evert commented 7 months ago

Thank you! Can finally remove a bunch of awkward workarounds! 😍

evert commented 7 months ago

You should remove @types/glob too!

bcherny commented 6 months ago

Published 14.0.2.