Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["redoc"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}
12 changes: 4 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
*
!src/
!config
!demo/favicon.png

!custom.d.ts
!typings/styled-patch.d.ts
!tsconfig.json
!webpack.config.ts

!scripts/
!package.json
!package-lock.json
!vite.config.ts
!tsconfig.json
!config/
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc.js

This file was deleted.

3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* @Redocly/keyboard-warriors
/docs/ @Redocly/technical-writers
* @Redocly/keyboard-warriors
44 changes: 16 additions & 28 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Before submitting a pull request, please make sure the following is done:
2. Run `npm install` in the repository root.
3. If you’ve fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`npm test`). Tip: `npm test -- --watch TestName` is helpful in development.
5. Format your code with prettier (`npm run prettier`).
5. Lint your code with eslint (`npm run lint`).

## Development Setup

You need [Node.js](http://nodejs.org) at `v12.0.0+`.
You need [Node.js](http://nodejs.org) at `Node LTS+`.

After cloning the repo, run:

Expand All @@ -38,61 +38,49 @@ $ npm install # or npm
# dev-server, watch and auto reload playground
$ npm start

# start playground app in production environment
$ npm run start:prod

# runt tslint
# run tslint
$ npm run lint

# try autofix tslint issues
$ npm run lint -- --fix
$ npm run lint:fix

# run unit tests
$ npm run unit

# run e2e tests
$ npm run e2e
# Make sure you have created bundle before running e2e test
# E.g. run `npm run bundle` and wait for the finishing process.
# E.g. run `npm run build` and wait for the finishing process.

# open cypress UI to debug e2e test
$ npm run cy:open
# open Playwright UI to debug e2e test
$ npm run e2e:ui

# run the unit tests (includes linting and license checks)
$ npm test

# prepare bundles
$ npm run bundle

# format the code using prettier
$ npm run prettier
$ npm run build

# auto-generate changelog
$ npm run changelog
```

There are some other scripts available in the `scripts` section of the `package.json` file.

## Project Structure

- **`benchmark`**: contains basic perf benchmark. Not fully ready yet
- **`examples`**: contains project demos

- **`demo`**: contains project demo with demo specs and HMR playground used in development

- `demo/playground`: HMR Playground used in development
- **`playground`**: HMR Playground used in development

- **`docs`**: contains extra docs (linked from README.md)

- **`e2e`**: contains e2e tests. The e2e tests are written and run with [Cypress](https://www.cypress.io/).

- **`playwright`**: contains e2e tests. The e2e tests are written and run with [Playwright](https://playwright.dev/).

- **`src`**: contains the source code. The codebase is written in Typescript. CSS styles are managed with [Styled components](https://www.styled-components.com/). State is managed by [MobX](https://github.com/mobxjs/mobx)
- **`src`**: contains the source code. The codebase is written in Typescript. CSS styles are managed with [Styled components](https://www.styled-components.com/). State is managed by [Jotai](https://github.com/pmndrs/jotai)

- **`src/common-elements`**: contains common Styled elements or components used in multiple places
- **`src/components`**: contains main visual components
- **`src/services`**: contains different services used by Redoc including MobX stores
- **`src/services/models`**: contains classes for OpenAPI entities (e.g. Response, Operations, etc)
- **`src/services`**: contains different services used by Redoc including Jotai stores
- **`src/models`**: contains classes for OpenAPI entities (e.g. Response, Operations, etc)
- **`src/types`**: contains extra typescript typings including OpenAPI doc typings
- **`src/utils`**: utility functions
- **`src/styled-components.ts`**: - reexports styled-components with proper typescript annotations using theme
- **`src/theme.ts`**: - default theme (colors, fonts, etc) used by all the components
- **`src/jotai`**: - contains Jotai store files
- **`src/hooks`**: - contains global react hooks for application
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ A clear and concise description of what you expected to happen.

**Minimal reproducible OpenAPI snippet(if possible)**


**Version (of Redoc, Node, OS, Browser)**


**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/actions/get-package-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Get version from package.json
description: Get version from package.json
outputs:
value:
description: "Version from package.json"
value: ${{ steps.package_version.outputs.value }}
runs:
using: composite
steps:
- name: Get version
shell: bash
id: package_version
run: |
echo "value=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
21 changes: 21 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node setup
description: Setup Node
runs:
using: composite
steps:
- name: 🚀 Starting Node setup
shell: bash
run: |
echo -e "\033[32m----- setup Node started -----\033[0m"
echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: 📦 Install Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.17.1
cache: npm
- name: ✅ Finished Node setup
shell: bash
run: |
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
echo -e "\033[32m----- setup Node finished in ${DURATION}s -----\033[0m"
36 changes: 36 additions & 0 deletions .github/actions/setup-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Playwright setup
description: Setup Playwright

runs:
using: composite
steps:
- name: 🚀 Starting Playwright setup
shell: bash
run: |
echo -e "\033[32m----- setup Playwright started -----\033[0m"
echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
- name: Get Playwright version
id: playwright-version
shell: bash
run: |
echo "PLAYWRIGHT_VERSION=$(jq -r '.devDependencies["@playwright/test"]' package.json)" >> $GITHUB_OUTPUT
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
name: Check if Playwright browser is cached
id: playwright-cache
with:
path: ${{ runner.os == 'Windows' && 'C:\Users\runneradmin\AppData\Local\ms-playwright' || runner.os == 'Linux' && '~/.cache/ms-playwright' || runner.os == 'macOS' && '~/Library/Caches/ms-playwright' || '' }}
key: ${{ runner.os }}-Playwright-${{steps.playwright-version.outputs.PLAYWRIGHT_VERSION}}
- name: 📦 Install Playwright browser if not cached
if: steps.playwright-cache.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Installing Playwright in root"
echo "Installing @playwright/test@${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} (no-save)"
npm install -D @playwright/test@${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} --no-save
npx playwright install --with-deps
- name: ✅ Finished Playwright setup
shell: bash
run: |
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
echo -e "\033[32m----- setup Playwright finished in ${DURATION}s -----\033[0m"
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

- [ ] Code is linted
- [ ] Tested
- [ ] All new/updated code is covered with tests
- [ ] All new/updated code is covered with tests
Loading
Loading