Skip to content

Commit 66cda07

Browse files
committed
feat: sec avoid vulnerable version of react
1 parent 7b19b3d commit 66cda07

File tree

8 files changed

+392
-350
lines changed

8 files changed

+392
-350
lines changed

.changeset/kind-suits-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@redocly/cli": patch
3+
---
4+
5+
Updated React dependency to avoid vulnerable React version (19.0.0) affected by CVE-2025-55182.

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,24 @@ To update snapshots, run `npm run e2e -- -u`.
196196

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

199+
### Smoke tests
200+
201+
Smokes are for testing the CLI in different environments.
202+
203+
To run them locally, please follow the steps described in the smoke GitHub actions: [smoke-basic](.github/workflows/smoke.yaml), [smoke-plugins](.github/workflows/smoke-plugins.yaml), [smoke-rebilly](.github/workflows/smoke-rebilly.yaml).
204+
205+
To update smoke tests for the `build-docs` command (which sometimes fails due to external package updates), please follow the steps below:
206+
207+
```sh
208+
# Build and install the current CLI build locally
209+
npm run compile
210+
npm run pack:prepare
211+
npm i -g redocly-cli.tgz
212+
213+
# Re-build the docs
214+
(cd __tests__/smoke/ && redocly build-docs openapi.yaml -o pre-built/redoc.html)
215+
```
216+
199217
### Performance benchmark
200218

201219
To run the performance benchmark locally, you should have `hyperfine` (v1.16.1+) installed on your machine.

__tests__/miscellaneous/apply-per-api-decorators/nested/redocly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apis:
55
test/version: on
66
remove-unused-components: on
77
test@external-url:
8-
root: https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml
8+
root: https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/v1/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml
99
rules:
1010
info-contact: error
1111
plugins:

__tests__/miscellaneous/apply-per-api-decorators/snapshot.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ components:
3737
3838
bundling nested/openapi/main.yaml...
3939
📦 Created a bundle for nested/openapi/main.yaml at stdout <test>ms.
40-
bundling https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml...
41-
📦 Created a bundle for https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml at stdout <test>ms.
40+
bundling https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/v1/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml...
41+
📦 Created a bundle for https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/v1/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml at stdout <test>ms.
4242
4343
`;
4444

4545
exports[`E2E miscellaneous lint a specific api (when the api is specified as an alias and it points to an external URL) 1`] = `
4646
47-
validating https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml...
48-
[1] https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml:2:1 at #/info/contact
47+
validating https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/v1/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml...
48+
[1] https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/v1/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml:2:1 at #/info/contact
4949
5050
Info object should contain \`contact\` field.
5151
@@ -58,7 +58,7 @@ Info object should contain \`contact\` field.
5858
Error was generated by the info-contact rule.
5959
6060
61-
https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/main/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml: validated in <test>ms
61+
https://raw.githubusercontent.com/Redocly/redocly-cli/refs/heads/v1/__tests__/miscellaneous/apply-per-api-decorators/nested/openapi/main.yaml: validated in <test>ms
6262
6363
❌ Validation failed with 1 error.
6464
run \`redocly lint --generate-ignore-file\` to add all problems to the ignore file.

__tests__/smoke/pre-built/redoc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>OK</p>
312312
</div></button></div><div><button class="sc-jIDBmd ifAHvq"><svg class="sc-dntSTA jKYZgc" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-eJvlPh fBhAXU">400<!-- --> </strong><div html="&lt;p&gt;Bad request.&lt;/p&gt;
313313
" class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG"><p>Bad request.</p>
314-
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="get" class="sc-fQLpxn dynMBc http-verb get">get</span><span class="sc-jvKoal kZcHWP">/hello</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"></div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://redocly-example.com</span>/hello</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab«R9pq»0" aria-selected="true" aria-disabled="false" aria-controls="panel«R9pq»0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab«R9pq»1" aria-selected="false" aria-disabled="false" aria-controls="panel«R9pq»1" data-rttab="true">400</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel«R9pq»0" aria-labelledby="tab«R9pq»0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel«R9pq»1" aria-labelledby="tab«R9pq»1"></div></div></div></div></div></div></div><div class="sc-evkzZa iZqpqg"></div></div></div>
314+
</div></button></div></div></div><div class="sc-jwTyAe sc-hjsuWn bDYKKx FFPsr"><div class="sc-eZSpzM jjnszm"><button class="sc-buTqWO iPCVMX"><span type="get" class="sc-fQLpxn dynMBc http-verb get">get</span><span class="sc-jvKoal kZcHWP">/hello</span><svg class="sc-dntSTA iuNpUs" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-ecJghI ga-DQLq"><div class="sc-iyBeIh icOxsG"><div html="" class="sc-eVqvcJ sc-fszimp kIppRw drqpJr"></div><div tabindex="0" role="button"><div class="sc-xKhEK okJpy"><span>http://redocly-example.com</span>/hello</div></div></div></div></div><div><h3 class="sc-lgpSej drJHMo"> <!-- -->Response samples<!-- --> </h3><div class="sc-cOpnSz fyxuKi" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="tab_R_9pq_0" aria-selected="true" aria-disabled="false" aria-controls="panel_R_9pq_0" tabindex="0" data-rttab="true">200</li><li class="tab-error" role="tab" id="tab_R_9pq_1" aria-selected="false" aria-disabled="false" aria-controls="panel_R_9pq_1" data-rttab="true">400</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="panel_R_9pq_0" aria-labelledby="tab_R_9pq_0"><div><div class="sc-bSFBcf iLdyBp"><span class="sc-gahYZc cXitJ">Content type</span><div class="sc-bAehkN iNRAJK">application/json</div></div><div class="sc-blIAwI eKKwxo"><div class="sc-dClGHI fdRrNy"><div class="sc-bbbBoY bBWkcI"><button><div class="sc-fYmhhH iNCOCX">Copy</div></button></div><div tabindex="0" class="sc-eVqvcJ kIppRw sc-fhfEft dFvLDb"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"message"</span>: <span class="token string">&quot;string&quot;</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div><div class="react-tabs__tab-panel" role="tabpanel" id="panel_R_9pq_1" aria-labelledby="tab_R_9pq_1"></div></div></div></div></div></div></div><div class="sc-evkzZa iZqpqg"></div></div></div>
315315
<script>
316316
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.1.0","servers":[{"url":"http://redocly-example.com"}],"info":{"title":"Sample API","version":"1.0.0"},"paths":{"/hello":{"get":{"operationId":"getMessage","security":[],"summary":"Get a greeting message","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/message-schema"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"message-schema":{"type":"object","properties":{"message":{"type":"string"}}},"Error":{"type":"object","properties":{"type":{"type":"string","example":"object"},"title":{"type":"string","example":"Validation failed"}}}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"searchIndex":{"store":["operation/getMessage"],"index":{"version":"2.3.9","fields":["title","description"],"fieldVectors":[["title/0",[0,0.288,1,0.288]],["description/0",[2,0.288]]],"invertedIndex":[["greet",{"_index":0,"title":{"0":{}},"description":{}}],["hello",{"_index":2,"title":{},"description":{"0":{}}}],["messag",{"_index":1,"title":{"0":{}},"description":{}}]],"pipeline":[]}},"options":{}};
317317

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
restoreMocks: true,
44
preset: 'ts-jest',
55
testEnvironment: 'node',
6+
transformIgnorePatterns: ['packages/.*/lib/.*'],
67
collectCoverageFrom: [
78
'packages/*/src/**/*.ts',
89
'!packages/**/__tests__/**/*',

0 commit comments

Comments
 (0)