Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ To update snapshots, run `npm run e2e -- -u`.

If you made any changes, make sure to compile the code before running the tests.

### Performance benchmark

To run the performance benchmark locally, you should have `hyperfine` (v1.16.1+) installed on your machine.
Prepare the local build, go to the `benchmark` folder, clean it up, do the preparations, and run the actual benchmark:

```sh
(npm run compile && npm run pack:prepare && cd benchmark/ && git clean -dX -f . && git clean -dX -ff . && npm i && npm run make-test && npm test)
```

You might need to adjust the CLI versions that need to be tested in the `benchmark/package.json` file.

## Project structure

- **`__mocks__`**: contains basic mocks for e2e tests.
Expand Down
4 changes: 3 additions & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"cli-1.25": "npm:@redocly/[email protected]",
"cli-1.26": "npm:@redocly/[email protected]",
"cli-1.27": "npm:@redocly/[email protected]",
"cli-1.28": "npm:@redocly/[email protected]",
"cli-1.28": "npm:@redocly/[email protected]",
"cli-1.29": "npm:@redocly/[email protected]",
"cli-1.30": "npm:@redocly/[email protected]",
"cli-next": "file:../redocly-cli.tgz"
}
}
6 changes: 3 additions & 3 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { handleTranslations } from './commands/translations';
import { handleEject } from './commands/eject';
import { PRODUCT_PLANS } from './commands/preview-project/constants';
import { commonPushHandler } from './commands/push';
import { handleRun } from '@redocly/respect-core';

import type { Arguments } from 'yargs';
import type { OutputFormat, RuleSeverity } from '@redocly/openapi-core';
Expand All @@ -34,7 +33,7 @@ import type { PushStatusOptions } from './reunite/commands/push-status';
import type { PushArguments } from './types';
import type { EjectOptions } from './commands/eject';

dotenv.config({ path: path.resolve(__dirname, '../.env') });
dotenv.config({ path: path.resolve(process.cwd(), './.env') });

if (!('replaceAll' in String.prototype)) {
require('core-js/actual/string/replace-all');
Expand Down Expand Up @@ -938,8 +937,9 @@ yargs
},
});
},
(argv) => {
async (argv) => {
process.env.REDOCLY_CLI_COMMAND = 'respect';
const { handleRun } = await import('@redocly/respect-core');
commandWrapper(handleRun)(argv);
}
)
Expand Down
Loading