orval icon indicating copy to clipboard operation
orval copied to clipboard

feat: sort schema barrel file

Open SamKirkland opened this issue 2 years ago • 1 comments

Fix #483 sort schema barrel file

Note

When testing this change I found the output of many example folders to be out of date. I didn't want to pollute this PR so I left those files out of this PR. I did leave the samples/react-query/basic/src/api/model/index.ts file in this PR as an example of what this change accomplishes.

Status

READY

Description

The contents of the schema barrel files (model/index.ts) should be stable between builds - the output between re-runs should be identical. This has several benefits, including less noisy git diffs.

This change also reduces IO trashing because it removes 2 IO operations that were previously within a loop (read file, append file)

Related PRs

Non

Todos

  • [x] Tests
  • [ ] Documentation - N/A
  • [ ] Changelog Entry (unreleased)

Steps to Test or Reproduce

  1. Clone [email protected]
  2. Open samples/react-query/basic
  3. run npm install
  4. run orval --config ./orval.config.ts
  5. Look at the output of samples/react-query/basic/src/api/model/index.ts
  6. Delete the file (or a single line)
  7. re-run orval --config ./orval.config.ts
  8. Note how the file contents is not stable, the contents can be in any order

SamKirkland avatar Aug 11 '22 14:08 SamKirkland

Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel.

@anymaniax first needs to authorize it.

vercel[bot] avatar Aug 11 '22 14:08 vercel[bot]

Changes made, requesting re-review

SamKirkland avatar Aug 23 '22 15:08 SamKirkland

@SamKirkland Thanks

anymaniax avatar Aug 23 '22 19:08 anymaniax