Skip to content

Commit

Permalink
docs: more contrib doc touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Nov 18, 2024
1 parent 467617b commit 6d06223
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Running Shell Commands Locally 🐚

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.
To get started, run the `build` 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 prebuild
npm run build
```

To run test commands, use `./bin/dev.js` instead of `rdme`. For example, if the command you're testing looks like this...
Expand All @@ -17,16 +17,23 @@ rdme openapi:validate __tests__/__fixtures__/ref-oas/petstore.json
... your local command will look like this:

```sh
./bin/dev.js 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:
The `bin/dev.js` file has a few features that are useful for local development:

- It reads directly from your TypeScript files (so no need to re-run the TypeScript compiler every time you make a change)
- It returns error messages with full stack traces

`bin/dev.js` is convenient for useful for rapid development but it's not a 1:1 recreation of what the end-user experience with `rdme` is like. To recreate the production `rdme` experience, 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. So for example:

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

Your changes to the command code may make changes to [the command reference document](./documentation/commands.md) — it is up to you whether you include those changes in your PR or if you let the release process take care of it. More information on that can be found in [MAINTAINERS.md](./MAINTAINERS.md).

## Running GitHub Actions Locally 🐳

To run GitHub Actions locally, we'll be using [`act`](https://github.com/nektos/act) (make sure to read their [prerequisites list](https://github.com/nektos/act#necessary-prerequisites-for-running-act) and have that ready to go before installing `act`)!
Expand Down

0 comments on commit 6d06223

Please sign in to comment.