Skip to content

Commit

Permalink
Merge 2fb0148 into 23e211a
Browse files Browse the repository at this point in the history
  • Loading branch information
pull[bot] committed May 23, 2021
2 parents 23e211a + 2fb0148 commit b215583
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.8.1](https://github.com/kevinxin90/smartapi-kg.js/compare/v3.8.0...v3.8.1) (2021-05-22)


### Bug Fixes

* :bug: check "x-bte-kgs-operations" as an array ([ceb001f](https://github.com/kevinxin90/smartapi-kg.js/commit/ceb001fce23046ae0e6aabc999c450085c5815b0))
* :bug: fix issue when predicates is not found ([c504cd1](https://github.com/kevinxin90/smartapi-kg.js/commit/c504cd1c2c0fb36314fa1f3b1b6d784036f7010f))

## [3.8.0](https://github.com/kevinxin90/smartapi-kg.js/compare/v3.7.0...v3.8.0) (2021-05-10)

## [3.7.0](https://github.com/kevinxin90/smartapi-kg.js/compare/v3.6.0...v3.7.0) (2021-04-02)
Expand Down
47 changes: 47 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### NPM package release procedure

#### Before the release

1. Work on a bug fix or a new feature at a separate branch

2. Follow commitlint commit msg convention

* the msg pattern: <type>[optional scope]: <description>
```
feat: add a new helper function
fix: add a type check
```
* More details and examples [here](https://www.conventionalcommits.org/en/v1.0.0/#summary)
* This commit msg pattern will be auto-checked by husky commit hooks
* If using VSCode, it's recommended to use this vscode plugin: **Conventional Commits**
* This will help auto-generate CHANGELOGS.md file upon a new release

Note: by default, only bugfix and feature commit logs will be put in CHANGELOGS.md automatically

2. When ready, merge your code to the master branch

3. Test to make sure all test pass


#### Make a release

1. When ready, run one of these commands to make a new release:

```bash
npm run release:patch

(use "release:patch", "release:minor" or "release:major" based on the release types)
```

This will do the version tagging (follow semver pattern) and auto-update CHANGELOGS.md

2. Push changes to GitHub:

```bash
git push --follow-tags origin master
```

3. GitHub Actions will take care the rest of release steps

Double check to make sure everything works as expected:
https://github.com/biothings/smartapi-kg.js/actions
2 changes: 1 addition & 1 deletion bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biothings-explorer/smartapi-kg",
"version": "3.8.0",
"version": "3.8.1",
"description": "create a knowledge graph based on SmartAPI Specifications",
"main": "built/index.js",
"scripts": {
Expand All @@ -16,9 +16,9 @@
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"release": "npm run format && standard-version",
"release:minor": "npm run format && standard-version --release-as minor",
"release:patch": "npm run format && standard-version --release-as patch",
"release:major": "npm run format && standard-version --release-as major"
"release:minor": "npm run format && npm run bundle && standard-version --release-as minor",
"release:patch": "npm run format && npm run bundle && standard-version --release-as patch",
"release:major": "npm run format && npm run bundle && standard-version --release-as major"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default class SyncOperationsBuilderWithReasoner extends BaseOperationsBui
metadata: PredicatesMetadata
): SmartAPIKGOperationObject[] {
let ops = [] as SmartAPIKGOperationObject[];
if (!("predicates" in metadata)) {
return ops;
}
Object.keys(metadata.predicates).map((sbj) => {
Object.keys(metadata.predicates[sbj]).map((obj) => {
if (Array.isArray(metadata.predicates[sbj][obj])) {
Expand Down Expand Up @@ -64,7 +67,9 @@ export default class SyncOperationsBuilderWithReasoner extends BaseOperationsBui
});
});
if (!(typeof this._options.apiNames === "undefined")) {
return ops.filter(op => this._options.apiNames.includes(op.association.api_name))
return ops.filter((op) =>
this._options.apiNames.includes(op.association.api_name)
);
}
return ops;
}
Expand Down
5 changes: 4 additions & 1 deletion src/parser/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ export default class Endpoint {
["get", "post"].map((method) => {
if (method in this.pathItemObject) {
const pathParams = this.fetchPathParams(this.pathItemObject[method]);
if ("x-bte-kgs-operations" in this.pathItemObject[method]) {
if (
"x-bte-kgs-operations" in this.pathItemObject[method] &&
Array.isArray(this.pathItemObject[method]["x-bte-kgs-operations"])
) {
let operation;
let op;
for (const rec of this.pathItemObject[method][
Expand Down

0 comments on commit b215583

Please sign in to comment.