Skip to content

Commit

Permalink
feat: migrate from node-fetch to native fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryAnansky committed Jan 22, 2025
1 parent afcdbb4 commit 308a13c
Show file tree
Hide file tree
Showing 17 changed files with 314 additions and 211 deletions.
6 changes: 6 additions & 0 deletions .changeset/warm-tips-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@redocly/openapi-core": minor
"@redocly/cli": minor
---

Switched to using native `fetch` API instead of `node-fetch` dependency, improving performance and reducing bundle size.
80 changes: 42 additions & 38 deletions .github/workflows/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
node-version: 18
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run"

run-smoke--npm--node-16:
run-smoke--yarn--node-22:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -114,10 +114,10 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run"
node-version: 22
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"

run-smoke--npm--node-16--redoc:
run-smoke--yarn--node-22--redoc:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -127,10 +127,10 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run"
node-version: 22
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"

run-smoke--npm--node-14:
run-smoke--yarn--node-20:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -140,10 +140,10 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 14
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run"
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"

run-smoke--npm--node-14--redoc:
run-smoke--yarn--node-20--redoc:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -153,10 +153,10 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 14
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run"
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"

run-smoke--yarn--node-22:
run-smoke--yarn--node-18:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -166,10 +166,10 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 22
node-version: 18
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"

run-smoke--yarn--node-22--redoc:
run-smoke--yarn--node-18--redoc:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -179,10 +179,10 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 22
node-version: 18
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"

run-smoke--yarn--node-20:
run-smoke--webpack--node-22:
needs: prepare-smoke
runs-on: ubuntu-latest
steps:
Expand All @@ -192,64 +192,68 @@ jobs:
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"
node-version: 22
- run: |
cd __tests__/smoke/
node bundle.js --version
node bundle.js lint openapi.yaml --extends minimal
node bundle.js bundle openapi.yaml
run-smoke--yarn--node-20--redoc:
run-smoke--npm--node-22--windows:
needs: prepare-smoke
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/cache@v3
with:
path: __tests__/smoke/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
enableCrossOsArchive: true
- uses: actions/setup-node@v3
with:
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"
node-version: 22
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run"

run-smoke--yarn--node-18:
run-smoke--yarn--node-22--windows:
needs: prepare-smoke
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/cache@v3
with:
path: __tests__/smoke/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
enableCrossOsArchive: true
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 22
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"

run-smoke--yarn--node-18--redoc:
run-smoke--npm--node-20--windows:
needs: prepare-smoke
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/cache@v3
with:
path: __tests__/smoke/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
enableCrossOsArchive: true
- uses: actions/setup-node@v3
with:
node-version: 18
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add redoc ./redocly-cli.tgz" "yarn"
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redocly-cli.tgz" "npm run"

run-smoke--webpack--node-14:
run-smoke--yarn--node-20--windows:
needs: prepare-smoke
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- uses: actions/cache@v3
with:
path: __tests__/smoke/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
enableCrossOsArchive: true
- uses: actions/setup-node@v3
with:
node-version: 14
- run: |
cd __tests__/smoke/
node bundle.js --version
node bundle.js lint openapi.yaml --extends minimal
node bundle.js bundle openapi.yaml
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli.tgz" "yarn"

run-smoke--npm--node-18--windows:
needs: prepare-smoke
Expand Down
Loading

0 comments on commit 308a13c

Please sign in to comment.