Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate package to Typescript and new build system #72

Merged
merged 17 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .github/workflows/test-coverage.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/test_ws.yml

This file was deleted.

22 changes: 14 additions & 8 deletions .github/workflows/test_ws_codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@ jobs:
- uses: actions/checkout@v3
with:
repository: biothings/biothings_explorer
ref: ${{ steps.branch-name.outputs.current_branch }}

- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: npm install, generate coverage report
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: pnpm install, generate coverage report
run: |
npm run clone
npm run git checkout ${{ steps.branch-name.outputs.current_branch }}
npm i || true && npm i
npm run test-cov --workspace=@biothings-explorer/call-apis
pnpm run clone
pnpm run git checkout ${{ steps.branch-name.outputs.current_branch }}
pnpm i
pnpm --filter call-apis test-cov
- name: Send coverage report to codecov for visualization
uses: codecov/codecov-action@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ typings/
# TypeScript cache
*.tsbuildinfo

# Turbo cache
.turbo

# Optional npm cache directory
.npm

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A nodejs module to make API calls in batch mode for BioThings Explorer
## Install

```sh
npm i @biothings-explorer/call-apis
pnpm i @biothings-explorer/call-apis
```

## Usage
Expand All @@ -30,7 +30,7 @@ npm i @biothings-explorer/call-apis
## Run tests

```sh
npm run test
pnpm run test
```

## Author
Expand Down
91 changes: 35 additions & 56 deletions __test__/data/cooccurrence_example_edge.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,37 @@
{
"input": "MONDO:0005252",
"query_operation": {
"params": {
"fields": "subject,association",
"q": "object.MONDO:\"{inputs[0]}\" AND subject.type:ChemicalSubstance",
"size": 1000
},
"supportBatch": false,
"method": "get",
"pathParams": [],
"server": "https://biothings.ncats.io/text_mining_co_occurrence_kp",
"path": "/query",
"tags": [
"gene",
"chemical",
"association",
"annotation",
"query",
"translator",
"biothings",
"biothings_graph"
]
"input": "MONDO:0005252",
"query_operation": {
"params": {
"fields": "subject,association",
"q": "object.MONDO:\"{inputs[0]}\" AND subject.type:ChemicalSubstance",
"size": 1000
},
"association": {
"input_id": "MONDO",
"input_type": "Disease",
"output_id": "CHEBI",
"output_type": "ChemicalSubstance",
"predicate": "related_to",
"source": "Text Mining KP",
"api_name": "Text Mining CO-OCCURRENCE API",
"smartapi": {},
"x-translator": {
"component": "KP",
"team": [
"Text Mining Provider",
"Service Provider"
]
}
},
"response_mapping": {
"related_to": {
"CHEBI": "hits.subject.CHEBI",
"ngd": "hits.association.ngd"
}
},
"tags": [
"gene",
"chemical",
"association",
"annotation",
"query",
"translator",
"biothings",
"biothings_graph"
]
}
"supportBatch": false,
"method": "get",
"pathParams": [],
"server": "https://biothings.ncats.io/text_mining_co_occurrence_kp",
"path": "/query",
"tags": ["gene", "chemical", "association", "annotation", "query", "translator", "biothings", "biothings_graph"]
},
"association": {
"input_id": "MONDO",
"input_type": "Disease",
"output_id": "CHEBI",
"output_type": "ChemicalSubstance",
"predicate": "related_to",
"source": "Text Mining KP",
"api_name": "Text Mining CO-OCCURRENCE API",
"smartapi": {},
"x-translator": {
"component": "KP",
"team": ["Text Mining Provider", "Service Provider"]
}
},
"response_mapping": {
"related_to": {
"CHEBI": "hits.subject.CHEBI",
"ngd": "hits.association.ngd"
}
},
"tags": ["gene", "chemical", "association", "annotation", "query", "translator", "biothings", "biothings_graph"]
}
91 changes: 35 additions & 56 deletions __test__/data/fake_error_edge.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,37 @@
{
"input": "MONDO:0005252",
"query_operation": {
"params": {
"fields": "subject,association",
"q": "object.MONDO:\"{inputs[0]}\" AND subject.type:ChemicalSubstance",
"size": 1000
},
"supportBatch": false,
"method": "get",
"pathParams": [],
"server": "https://biothings.ncats.io/text_mining_co_occurrence_kp1",
"path": "/query",
"tags": [
"gene",
"chemical",
"association",
"annotation",
"query",
"translator",
"biothings",
"biothings_graph"
]
"input": "MONDO:0005252",
"query_operation": {
"params": {
"fields": "subject,association",
"q": "object.MONDO:\"{inputs[0]}\" AND subject.type:ChemicalSubstance",
"size": 1000
},
"association": {
"input_id": "MONDO",
"input_type": "Disease",
"output_id": "CHEBI",
"output_type": "SmallMolecule",
"predicate": "related_to",
"source": "Text Mining KP",
"api_name": "Text Mining CO-OCCURRENCE API",
"smartapi": {},
"x-translator": {
"component": "KP",
"team": [
"Text Mining Provider",
"Service Provider"
]
}
},
"response_mapping": {
"related_to": {
"CHEBI": "hits.subject.CHEBI",
"ngd": "hits.association.ngd"
}
},
"tags": [
"gene",
"chemical",
"association",
"annotation",
"query",
"translator",
"biothings",
"biothings_graph"
]
}
"supportBatch": false,
"method": "get",
"pathParams": [],
"server": "https://biothings.ncats.io/text_mining_co_occurrence_kp1",
"path": "/query",
"tags": ["gene", "chemical", "association", "annotation", "query", "translator", "biothings", "biothings_graph"]
},
"association": {
"input_id": "MONDO",
"input_type": "Disease",
"output_id": "CHEBI",
"output_type": "SmallMolecule",
"predicate": "related_to",
"source": "Text Mining KP",
"api_name": "Text Mining CO-OCCURRENCE API",
"smartapi": {},
"x-translator": {
"component": "KP",
"team": ["Text Mining Provider", "Service Provider"]
}
},
"response_mapping": {
"related_to": {
"CHEBI": "hits.subject.CHEBI",
"ngd": "hits.association.ngd"
}
},
"tags": ["gene", "chemical", "association", "annotation", "query", "translator", "biothings", "biothings_graph"]
}
Loading
Loading