swagger-editor 5.0.0-alpha.85 → 5.0.0-alpha.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -2
- package/dist/esm/editor.worker.js +1 -1
- package/dist/esm/editor.worker.js.map +1 -1
- package/dist/esm/plugins/editor-preview-swagger-ui/index.js.map +1 -1
- package/dist/esm/plugins/splash-screen/index.js +1 -1
- package/dist/esm/plugins/versions/index.js +1 -1
- package/dist/esm/plugins/versions/index.js.map +1 -1
- package/dist/swagger-editor.css +1 -1
- package/dist/umd/apidom.worker.js +1 -1
- package/dist/umd/editor.worker.js +1 -1
- package/dist/umd/swagger-editor.js +5 -5
- package/dist/umd/swagger-editor.js.LICENSE.txt +5 -28
- package/package.json +31 -31
- package/sbom.spdx +0 -6142
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ SwaggerEditor is using [**forked** Create React App](https://github.com/swagger-
|
|
|
17
17
|
- [Documentation](#documentation)
|
|
18
18
|
- [Docker](#docker)
|
|
19
19
|
- [License](#license)
|
|
20
|
+
- [Software Bill Of Materials (SBOM)](#software-bill-of-materials-sbom)
|
|
20
21
|
|
|
21
22
|
## Getting started
|
|
22
23
|
|
|
@@ -347,8 +348,8 @@ It's bundled with React defined as external. This allows consumer to use his own
|
|
|
347
348
|
</head>
|
|
348
349
|
<body>
|
|
349
350
|
<div id="swagger-editor"></div>
|
|
350
|
-
<script src="https://unpkg.com/react@
|
|
351
|
-
<script src="https://unpkg.com/react-dom@
|
|
351
|
+
<script src="https://unpkg.com/react@18/umd/react.production.min.js" crossorigin></script>
|
|
352
|
+
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" crossorigin></script>
|
|
352
353
|
<script src="./dist/umd/swagger-editor.js"></script>
|
|
353
354
|
<script>
|
|
354
355
|
const props = {
|
|
@@ -409,6 +410,62 @@ or to [Node.js Modules: Packages documentation](https://nodejs.org/docs/latest-v
|
|
|
409
410
|
|
|
410
411
|
## Documentation
|
|
411
412
|
|
|
413
|
+
### Using older version of React
|
|
414
|
+
|
|
415
|
+
> [!IMPORTANT]
|
|
416
|
+
> By older versions we specifically refer to `React >=17 <18`.
|
|
417
|
+
|
|
418
|
+
By default [swagger-editor@5](https://www.npmjs.com/package/swagger-editor) npm package comes with latest version of [React@18](https://react.dev/blog/2022/03/29/react-v18).
|
|
419
|
+
It's possible to use _swagger-editor@5_ npm package with older version of React.
|
|
420
|
+
|
|
421
|
+
Let's say my application integrates with _swagger-editor@5_ npm package and uses [React@17.0.2](https://www.npmjs.com/package/react/v/17.0.2).
|
|
422
|
+
|
|
423
|
+
### npm
|
|
424
|
+
|
|
425
|
+
In order to inform `swagger-editor@5` npm package that I require it to use my React version, I need to use [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides).
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"dependencies": {
|
|
430
|
+
"react": "=17.0.2",
|
|
431
|
+
"react-dom": "=17.0.2"
|
|
432
|
+
},
|
|
433
|
+
"overrides": {
|
|
434
|
+
"swagger-editor": {
|
|
435
|
+
"react": "$react",
|
|
436
|
+
"react": "$react-dom",
|
|
437
|
+
"react-redux": "^8"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
> [!NOTE]
|
|
444
|
+
> The React and ReactDOM override are defined as a reference to the dependency. Since _react-redux@9_ only supports `React >= 18`, we need to use _react-redux@8_.
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
### yarn
|
|
448
|
+
|
|
449
|
+
In order to inform `swagger-editor@5` npm package that I require it to use my specific React version, I need to use [yarm resolutions](https://yarnpkg.com/cli/set/resolution).
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
```json
|
|
453
|
+
{
|
|
454
|
+
"dependencies": {
|
|
455
|
+
"react": "17.0.2",
|
|
456
|
+
"react-dom": "17.0.2"
|
|
457
|
+
},
|
|
458
|
+
"resolutions": {
|
|
459
|
+
"swagger-editor/react": "17.0.2",
|
|
460
|
+
"swagger-editor/react-dom": "17.0.2",
|
|
461
|
+
"swagger-editor/react-redux": "^8"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
> [!NOTE]
|
|
467
|
+
> The React and ReactDOM resolution cannot be defined as a reference to the dependency. Unfortunately *yarn* does not support aliasing like `$react` or `$react-dom` as *npm* does. You'll need to specify the exact versions.
|
|
468
|
+
|
|
412
469
|
### Customization
|
|
413
470
|
|
|
414
471
|
- [Plug points](./docs/customization/plug-points/README.md)
|
|
@@ -724,3 +781,8 @@ containing additional legal notifications and information.
|
|
|
724
781
|
|
|
725
782
|
This project uses [REUSE specification](https://reuse.software/spec/) that defines a standardized method
|
|
726
783
|
for declaring copyright and licensing for software projects.
|
|
784
|
+
|
|
785
|
+
## Software Bill Of Materials (SBOM)
|
|
786
|
+
|
|
787
|
+
Software Bill Of materials is available in this repository [dependency graph](https://github.com/swagger-api/swagger-editor/network/dependencies).
|
|
788
|
+
Click on `Export SBOM` button to download the SBOM in [SPDX format](https://spdx.dev/).
|