Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
udamir committed Jan 21, 2024
1 parent e1af5be commit e13f7dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,9 @@ This package provides utils to compute the diff between two Json based API docum

- [OpenApi 3.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md)
- [AsyncApi 2.x](https://v2.asyncapi.com/docs/reference)
- [x] Rules
- [ ] Transformations
- [ ] Annotations
- [ ] Unit Tests
- [ ] E2E Tests
- [JsonSchema](https://json-schema.org/draft/2020-12/json-schema-core.html)
- [Swagger 2.0](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md)
- [ ] Rules
- [ ] Transformations
- [ ] Annotations
- [ ] Unit Tests
- [ ] E2E Tests
- GraphQL via [GraphApi](https://github.com/udamir/graphapi)
- [x] Rules
- [x] Transformations
- [ ] Annotations
- [ ] Unit Tests
- [ ] E2E Tests
- ~~[Swagger 2.0](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md)~~
- ~~[AsyncApi 3.x](https://www.asyncapi.com/docs/specifications/)~~ (Roadmap)
- ~~gRPC~~ (Roadmap)

Expand All @@ -44,12 +29,16 @@ This package provides utils to compute the diff between two Json based API docum
- Supports custom human-readable changes annotation
- Resolves all $ref pointers, including circular
- Typescript syntax support out of the box
- No dependencies, can be used in nodejs or browser
- Can be used in nodejs or browser

## Installation
```SH
npm install api-smart-diff --save
```
or
```SH
yarn add api-smart-diff
```

## Usage

Expand All @@ -75,15 +64,13 @@ const { diffs, merged } = apiCompare(before, after)
// replaced: "value in before",
// }


```

### Browsers

A browser version of `api-smart-diff` is also available via CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/api-smart-diff@latest/browser/api-smart-diff.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/api-smart-diff@latest/browser/api-smart-diff.js"></script>
<script src="https://cdn.jsdelivr.net/npm/api-smart-diff@latest/dist/api-smart-diff.min.js"></script>
```

Reference `api-smart-diff.min.js` in your HTML and use the global variable `ApiSmartDiff`.
Expand Down Expand Up @@ -226,7 +213,7 @@ Please check predefined rules in `/src/rules` folder to get examples
## Contributing
When contributing, keep in mind that it is an objective of `api-smart-diff` to have no additional package dependencies. This may change in the future, but for now, no new dependencies.

Please run the unit tests before submitting your PR: `npm test`. Hopefully your PR includes additional unit tests to illustrate your change/modification!
Please run the unit tests before submitting your PR: `yarn test`. Hopefully your PR includes additional unit tests to illustrate your change/modification!

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Generate the diff between two API specifications (OpenAPI, AsyncAPI, GraphApi, JsonSchema)",
"module": "dist/index.mjs",
"main": "dist/index.cjs",
"browser": "dist/index.iife.js",
"browser": "dist/api-smart-diff.min.js",
"typings": "dist/index.d.ts",
"files": [
"dist"
Expand Down

0 comments on commit e13f7dc

Please sign in to comment.