Skip to content

Commit 5536ede

Browse files
Support resolutions in npm package.json
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent ae22b45 commit 5536ede

File tree

4 files changed

+444
-0
lines changed

4 files changed

+444
-0
lines changed

src/packagedcode/npm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,11 @@ def deps_mapper(deps, package, field_name, is_direct=True):
16621662
deps_by_name[npm_name] = d
16631663

16641664
for fqname, requirement in deps.items():
1665+
# Handle cases in ``resolutions`` with ``**``
1666+
# "resolutions": {
1667+
# "**/@typescript-eslint/eslint-plugin": "^4.1.1",
1668+
if fqname.startswith('**'):
1669+
fqname = fqname.replace('**', '')
16651670
ns, name = split_scoped_package_name(fqname)
16661671
if not name:
16671672
continue
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"homepage": "https://jonghwapark.github.io/brawler/",
3+
"name": "client",
4+
"version": "0.1.0",
5+
"private": true,
6+
"dependencies": {
7+
"@testing-library/jest-dom": "^4.2.4",
8+
"@testing-library/react": "^9.3.2",
9+
"@testing-library/user-event": "^7.1.2",
10+
"@types/classnames": "^2.2.11",
11+
"@types/jest": "^26.0.15",
12+
"@types/node": "^14.14.0",
13+
"@types/react": "^16.9.53",
14+
"@types/react-dom": "^16.9.8",
15+
"@types/react-redux": "^7.1.9",
16+
"@types/react-router-dom": "^5.1.6",
17+
"gh-pages": "^3.1.0",
18+
"http-proxy-middleware": "^1.1.0",
19+
"immutable": "^4.0.0-rc.12",
20+
"node-sass": "^4.14.1",
21+
"react": "^16.13.1",
22+
"react-dom": "^16.13.1",
23+
"react-native-web": "^0.16.3",
24+
"react-redux": "^7.2.1",
25+
"react-router-dom": "^5.2.0",
26+
"react-router-redux": "^4.0.8",
27+
"react-scripts": "3.4.3",
28+
"redux-saga": "^1.1.3",
29+
"semantic-ui-css": "^2.4.1",
30+
"semantic-ui-react": "^2.0.0",
31+
"typescript": "^4.1.3"
32+
},
33+
"devDependencies": {
34+
"axios": "^0.20.0",
35+
"classnames": "^2.2.6",
36+
"redux": "^4.0.5",
37+
"redux-devtools-extension": "^2.13.8"
38+
},
39+
"resolutions": {
40+
"**/@typescript-eslint/eslint-plugin": "^4.1.1",
41+
"**/@typescript-eslint/parser": "^4.1.1"
42+
}
43+
}
44+

0 commit comments

Comments
 (0)