Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
| 🚥 Resolves RM-11384 | | :------------------- | ## 🧰 Changes `rdme openapi` has now been replaced by `rdme openapi upload` 🚀 highlights: - much simpler flag structure - more intuitive slug-based identifying system, thanks to API v2 - better error messages, thanks to API v2 code review notes - a lot of the diff is related to setting up boilerplate for interacting with API v2 - feedback appreciated on the docs — feel free to review `documentation/commands/openapi.md` or `src/commands/openapi/upload.ts` - feedback appreciated on whether the optional flag should be called `--slug` or `--identifier` or something else. went with `--slug` since it's short and it was easy to write clear explainer docs around <details> <summary>outstanding tasks (archived)</summary> - [x] command - [x] tests - [x] ~~optional `--action` arg?~~ **edit**: might be a good enhancement further down the line, but going to pass on this for now! - [x] tests for `useSpecVersion` - [x] test for `pending` timeout (there's a nock API for duplicating an interceptor, use that!) - [x] finalize command docs - [x] set up [test project](https://rdme-refactored-test.readme.io) for syncing in CI (i.e., adding back what i removed in d69d1aa) </details> <details> <summary>follow-up enhancements</summary> - tests for `readmeAPIv2Fetch` - optional `--action` arg for use in CI to prevent accidental overwrites - optional `--timeout` arg to allow user to configure timeout - GHA onboarding support </details> ## 🧬 QA & Testing this can only be tested locally for now: 1. in your local dev server, load up a project that uses readme refactored 2. set up an API key for said project 3. change the value on [this line](https://github.com/readmeio/rdme/blob/af0e0dca7f715847bd5359d5bf60e1df63a81246/src/lib/config.ts#L4) to be `http://api.readme.local:3000/v2` 4. check out this branch and run the following: ```sh # setup npm ci && npm run build # try running any or all of the following: bin/dev.js openapi upload # try logging in bin/dev.js openapi upload --key <key> # try selecting a file bin/dev.js openapi upload --key <key> __tests__/__fixtures__/petstore-simple-weird-version.json # without a version arg bin/dev.js openapi upload --key <key> __tests__/__fixtures__/petstore-simple-weird-version.json --version=1.0 # with a version arg bin/dev.js openapi upload --key <key> __tests__/__fixtures__/petstore-simple-weird-version.json --useSpecVersion # use the version defined in the spec ``` --------- Co-authored-by: Jon Ursenbach <[email protected]>
- Loading branch information