Skip to content

Commit 24740fc

Browse files
committed
build: migrate to pnpm+turbo
1 parent 8c68e3a commit 24740fc

File tree

5 files changed

+27
-15
lines changed

5 files changed

+27
-15
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ typings/
4747
# TypeScript cache
4848
*.tsbuildinfo
4949

50+
# Turbo cache
51+
.turbo
52+
5053
# Optional npm cache directory
5154
.npm
5255

@@ -104,4 +107,4 @@ dist
104107
.tern-port
105108

106109
# Javascript build folder
107-
built/
110+
built/

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"version": "1.18.0",
44
"description": "A nodejs module to query TRAPI Query Graph",
55
"main": "built/index.js",
6+
"types": "built/index.d.ts",
67
"scripts": {
78
"test": "jest --env=node",
89
"test-cov": "jest --coverage --env=node",
9-
"build": "tsc",
10+
"build": "tsc -b",
1011
"coveralls": "jest --coverage --env=node && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
1112
"format": "prettier --write \"src/**/*.*s\" \"built/**/*.js\"",
1213
"lint": "eslint './src/**/*.ts'",
1314
"prepare": "npm run build",
14-
"prepublishOnly": "npm test",
1515
"version": "npm run format && git add -A src",
1616
"postversion": "git push && git push --tags",
1717
"release": "npm run format && standard-version",
@@ -35,23 +35,27 @@
3535
},
3636
"homepage": "https://github.com/biothings/bte_trapi_query_graph_handler#readme",
3737
"devDependencies": {
38+
"@types/debug": "^4.1.10",
39+
"@types/jest": "^29.5.6",
40+
"@types/lodash": "^4.14.200",
3841
"coveralls": "^3.1.0",
3942
"ioredis-mock": "^8.2.2",
4043
"jest": "^26.6.3",
4144
"jest-util": "^26.6.2",
4245
"prettier": "^2.2.1",
4346
"standard-version": "^9.1.1",
44-
"ts-jest": "^26.5.4",
45-
"typescript": "^4.2.3"
47+
"ts-jest": "^26.5.6",
48+
"typescript": "^5.2.2"
4649
},
4750
"dependencies": {
51+
"@biothings-explorer/api-response-transform": "file:../api-response-transform",
4852
"@biothings-explorer/call-apis": "file:../call-apis",
4953
"@biothings-explorer/node-expansion": "file:../node-expansion",
5054
"@biothings-explorer/smartapi-kg": "file:../smartapi-kg",
5155
"@sentry/node": "^7.72.0",
5256
"async": "^3.2.1",
53-
"biolink-model": "file:../../biolink-model",
54-
"biomedical_id_resolver": "file:../../biomedical_id_resolver",
57+
"biolink-model": "file:../biolink-model",
58+
"biomedical_id_resolver": "file:../biomedical_id_resolver",
5559
"chi-square-p-value": "^1.0.5",
5660
"debug": "^4.3.1",
5761
"ioredis": "^5.0.6",

src/query_node.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as utils from './utils';
44
import biolink from './biolink';
55
import Debug from 'debug';
66
import InvalidQueryGraphError from './exceptions/invalid_query_graph_error';
7-
import { SRIBioEntity } from '../../../biomedical_id_resolver/built/common/types';
7+
import { SRIBioEntity } from 'biomedical_id_resolver';
88
const debug = Debug('bte:biothings-explorer-trapi:QNode');
99

1010
export interface QNodeInfo {
@@ -31,7 +31,7 @@ export interface ExpandedCuries {
3131
export default class QNode {
3232
id: string;
3333
categories: string[];
34-
equivalentIDs: SRIResolvedSet;
34+
equivalentIDs?: SRIResolvedSet;
3535
expandedCategories: string[];
3636
equivalentIDsUpdated: boolean;
3737
curie: string[];
@@ -285,7 +285,7 @@ export default class QNode {
285285
}
286286

287287
hasEquivalentIDs(): boolean {
288-
return !(typeof this.equivalentIDs === 'undefined' || this.equivalentIDs === {});
288+
return !(typeof this.equivalentIDs === 'undefined');
289289
}
290290

291291
getEntityCount(): number {

src/update_nodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolveSRI } from 'biomedical_id_resolver';
22
import Debug from 'debug';
3-
import { ResolverInput, SRIResolverOutput } from '../../../biomedical_id_resolver/built/common/types';
3+
import { ResolverInput, SRIResolverOutput } from 'biomedical_id_resolver';
44
import { Record } from '@biothings-explorer/api-response-transform';
55
import QEdge from './query_edge';
66
import { NodeNormalizerResultObj } from '../../api-response-transform/built';

tsconfig.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
"resolveJsonModule": true,
1313
"strict": false,
1414
"noImplicitAny": false,
15-
"skipLibCheck": true
15+
"skipLibCheck": true,
16+
"paths": {
17+
"@biothings-explorer/call-apis": ["../call-apis"],
18+
"biolink-model": ["../biolink-model"],
19+
"biomedical_id_resolver": ["../biomedical_id_resolver"],
20+
"@biothings-explorer/smartapi-kg": ["../smartapi-kg"]
21+
}
1622
},
1723
"include": ["./src/**/*", "./src/biolink.json", "./src/smartapi_specs.json", "./src/predicates.json"],
1824
"exclude": ["node_modules", "__tests__/"],
@@ -21,14 +27,13 @@
2127
"path": "../call-apis"
2228
},
2329
{
24-
"path": "../../biomedical_id_resolver"
30+
"path": "../biomedical_id_resolver"
2531
},
2632
{
2733
"path": "../smartapi-kg"
2834
},
2935
{
30-
"path": "../../biolink-model"
36+
"path": "../biolink-model"
3137
}
32-
3338
]
3439
}

0 commit comments

Comments
 (0)