Skip to content

Commit

Permalink
docs: update contributing.md with oclif guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Nov 17, 2024
1 parent f9468cc commit e990a2b
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@

## Running Shell Commands Locally 🐚

To run test commands from within the repository, run the build and then run your commands from the root of the repository and use `./bin/run.js` instead of `rdme` so it properly points to the command executable, like so:
To get started, run the `prebuild` script to create a symlink with `package.json` (required for our `oclif` setup to read our commands properly). You only need to do this the first time you clone the repository.

```sh
npm run build
./bin/run.js openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
npm run prebuild
```

To run test commands, use `./bin/dev.js` instead of `rdme`. For example, if the command you're testing looks like this...

```sh
rdme openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
```

If you need to debug commands quicker and re-building TS everytime is becoming cumbersome, you can use the debug command, like so:
... your local command will look like this:

```sh
npm run debug -- openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
./bin/dev.js openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
```

The `bin/dev.js` file returns extra verbose error messages which are helpful in development. To recreate the exact `rdme` experience that our users will have, use the `bin/run.js` file instead. You'll need to re-run the TypeScript compiler (i.e., `npm run build`) every time you make a change:

```sh
npm run build
./bin/run.js openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
```

## Running GitHub Actions Locally 🐳
Expand Down

0 comments on commit e990a2b

Please sign in to comment.