-
Notifications
You must be signed in to change notification settings - Fork 19
/
package.json
117 lines (117 loc) · 10.6 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"name": "@wikipathways/pvjs",
"version": "5.0.1",
"main": "es5/index.js",
"module": "esnext/index.js",
"jsnext:main": "esnext/index.js",
"typings": "esnext/index",
"engines": {
"node": ">=10.0.0"
},
"bin": {
"pvjs": "./bin/pvjs"
},
"files": [
"bin/",
"es5/",
"esnext/",
"dist/",
"test/expected"
],
"scripts": {
"build": "rm -rf dist/ es5/ esnext/ && npm-run-all -s build:css -p build:assets build:bundle -s build:ts build:dist",
"build:assets": "npm-run-all -p build:assets:*",
"build:assets:es5": "rsync -a --delete --include='*.json' --include='*.svg' --include='*.css' --include='*.css.d.ts' --include='*/' --exclude='*' src/ es5/",
"build:assets:esnext": "rsync -a --delete --include='*.json' --include='*.svg' --include='*.css' --include='*.css.d.ts' --include='*/' --exclude='*' src/ esnext/",
"build:bundle": "npm run bundle",
"build:css": "tcm src",
"build:dist": "webpack --config webpack.dist.config.js",
"build:ts": "npm-run-all -p build:ts:*",
"build:ts:es5": "tsc --project tsconfig.es5.json",
"build:ts:esnext": "tsc --project tsconfig.esnext.json",
"bundle": "npm-run-all -p bundle:*",
"bundle:dark": "kaavio_dir=$(node -p 'path.dirname(require.resolve(\"kaavio/package.json\"))') && \"$kaavio_dir\"/bin/kaavio bundle ./src/themes/dark.json",
"bundle:experimental": "kaavio_dir=$(node -p 'path.dirname(require.resolve(\"kaavio/package.json\"))') && \"$kaavio_dir\"/bin/kaavio bundle ./src/themes/experimental.json",
"bundle:plain": "kaavio_dir=$(node -p 'path.dirname(require.resolve(\"kaavio/package.json\"))') && \"$kaavio_dir\"/bin/kaavio bundle ./src/themes/plain.json",
"convert": "npm-run-all -p convert:*",
"convert:WP1818_73650": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && cat \"$gpml2pvjson_dir\"/test/expected/WP1818_73650.json | ./bin/pvjs --theme dark > WP528_92047.dark.svg",
"convert:playground": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && cat ./test/playground.gpml | gpml2pvjson | tee test/playground.json | ./bin/pvjs --theme dark > ./test/playground.dark.svg",
"deploy": "npm run build && host=dev.wikipathways.org && rsync dist/pvjs.js \"$host\":/var/www/\"$host\"/wpi/js/pvjs/",
"expected": "echo 'Setting expected values for tests' && npm-run-all expected:* || break",
"expected:checksums": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && echo \"Converting JSON (from GPML test files) to SVG and generating checksums:\" && source_dirname=\"$gpml2pvjson_dir\"/test/expected && for source_file in \"$source_dirname\"/*.json; do output_file=`echo \"$source_file\" | sed s#\"$source_dirname\"#test/expected# | sed 's/\\.json//'`\".svg\" && echo \"$source_file -> $output_file and $output_file.sha1sum\" && cat \"$source_file\" | bin/pvjs --react | xmllint --pretty 2 - | tee \"$output_file\" | sha1sum > \"$output_file.sha1sum\" || break; done",
"prepare": "ALLE_DIR='../../../../' && if [ ! -d ./node_modules ] && [ -d \"$ALLE_DIR\"/node_modules ]; then echo 'Alle configuration detected. Testing from the top-level alle directory...' && (cd \"$ALLE_DIR\" && npm run '@wikipathways/pvjs:build'); else npm run build; fi && npm run prepare:svgs && npm run prepare:symlink-gpml2pvjson",
"prepare:svgs": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && echo \"\\nBuilding expected SVGs for testing purposes...:\" && input_dir=\"$gpml2pvjson_dir/test/expected\" && echo \"# Converting $input_dir from JSON to SVG and verifying checksums...\" && for f in \"$input_dir\"/*.json; do pathway_name=`basename \"$f\" | sed s/.json//` && base_path=`echo \"./test/expected/$pathway_name\"` && echo \"\\n## Processing $pathway_name...\" && sed -i 's/\\?\\-/\\ \\-/g' \"$base_path.svg.sha1sum\" && cat \"$f\" | bin/pvjs --react | xmllint --pretty 2 - | tee \"$base_path.svg\" | sha1sum -c \"$base_path.svg.sha1sum\" || break; done",
"prepare:symlink-gpml2pvjson": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && rm -f test/gpml2pvjson && ln -s \"$gpml2pvjson_dir\" ./test/gpml2pvjson",
"prepublishOnly": "npm i --package-lock-only && ALLE_DIR='../../../../' && if [ ! -d ./node_modules ] && [ -d \"$ALLE_DIR\"/node_modules ]; then echo 'Alle configuration detected. Testing from the top-level alle directory...' && (cd \"$ALLE_DIR\" && npm run '@wikipathways/pvjs:test'); else npm run test; fi",
"postpublish": "TAG=\"$(jq -r .version package.json)\" && git commit -am \"Bump to version $TAG\" && git tag -a $TAG -m \"Published version $TAG\" && git push origin $TAG",
"test": "npm-run-all test:browser test:quick test:checksums",
"test:browser": "echo 'get browser tests working'",
"test:checksums": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input_dir=\"$gpml2pvjson_dir/test/expected\" && echo \"# Converting $input_dir from JSON to SVG and verifying checksums...\" && for f in \"$input_dir\"/*.json; do pathway_name=`basename \"$f\" | sed s/.json//` && base_path=`echo \"./test/expected/$pathway_name\"` && echo \"\\n## Processing $pathway_name...\" && cat \"$f\" | bin/pvjs --react | xmllint --pretty 2 - | sha1sum -c \"$base_path.svg.sha1sum\" || exit 1; done",
"test:convert": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input_dir=\"$gpml2pvjson_dir/test/expected\" && echo \"# Converting $input_dir from JSON to SVG...\" && for f in \"$input_dir\"/*.json; do pathway_name=`basename \"$f\" | sed s/.json//` && base_path=`echo \"./test/expected/$pathway_name\"` && echo \"\\n## Processing $pathway_name...\" && cat \"$f\" | bin/pvjs --react | xmllint --pretty 2 - >/dev/null || break; done",
"compare": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input_dir=\"$gpml2pvjson_dir/test/expected\" && echo \"# Converting $input_dir from JSON to SVG...\" && for f in \"$input_dir\"/*.json; do pathway_name=`basename \"$f\" | sed s/.json//` && base_path=`echo \"./test/expected/$pathway_name\"` && mkdir -p ./test/actual && echo \"\\n## Processing $pathway_name...\" && cat \"$f\" | bin/pvjs --react | xmllint --pretty 2 - > `echo \"./test/actual/$pathway_name.svg\"` || break; done && npm-run-all -s compare:*",
"compare:text": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input_dir=\"$gpml2pvjson_dir/test/expected\" && ./bin/compare-texts \"$(pwd)/test\"",
"compare:visual": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input_dir=\"$gpml2pvjson_dir/test/expected\" && ./bin/compare-images \"$(pwd)/test\"",
"test:quick": "npm-run-all -p test:quick:*",
"test:quick:Icon": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input=\"$gpml2pvjson_dir\"/test/expected/WP1243_69897.json && echo \"# Converting $input from JSON to SVG...\" && pathway_name=`basename \"$input\" | sed s/.json//` && base_path=`echo \"./test/expected/$pathway_name\"` && result=$(cat \"$input\" | bin/pvjs --react | xmllint --xpath \"count(//*[contains(concat(' ',normalize-space(@class),' '),' Icon ')])\" -) && if [[ ! $result -eq 72 ]]; then echo \"test:quick failed: expected 72 Icons for WP1243_69897 but got $result\" && exit 1; fi && echo 'OK' || echo 'FAIL'",
"test:quick:Edge": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && input=\"$gpml2pvjson_dir/test/expected/WP481_94171.json\" && echo \"# Converting $input from JSON to SVG...\" && pathway_name=`basename \"$input\" | sed s/.json//` && base_path=`echo \"./test/expected/$pathway_name\"` && result=$(cat \"$input\" | bin/pvjs | xmllint --xpath \"count(//*[contains(concat(' ',normalize-space(@class),' '),' Edge ')])\" -) && if [[ ! $result -eq 19 ]]; then echo \"test:quick failed: expected 19 Edges for WP481_94171 but got $result\" && exit 1; fi && echo 'OK' || echo 'FAIL'",
"watch-max-build": "npm-run-all -s build -p watch:*",
"watch": "rm -rf es5/ esnext/ && npm-run-all -s build:css -p build:assets build:bundle -s build:ts -p watch:*",
"watch:browser": "webpack-dev-server --config webpack.dev.config.js --open --progress --inline",
"watchremote:browser": "port=5983 && echo -e \"\nTo access dev server:\n 1. Create tunnel: ssh -N -L $port:localhost:$port $(hostname)\n 2. Visit http://localhost:$port/\n\" && webpack-dev-server --config webpack.dev.config.js --port $port --progress --inline",
"watch:css": "tcm src --watch",
"watch:assets": "onchange 'src/**' -- npm-run-all build:assets",
"watch:es5": "tsc --project tsconfig.es5.json --watch",
"watch:esnext": "tsc --project tsconfig.esnext.json --watch",
"watch:playground": "onchange 'test/playground.gpml' -- npm run convert:playground",
"watch-broken:playground": "gpml2pvjson_dir=$(node -p 'path.dirname(require.resolve(\"gpml2pvjson/package.json\"))') && onchange 'test/playground.gpml' -- gpml2pvjson < ./test/playground.gpml > ./test/playground.json",
"watch-broken:test": "onchange 'src/**' -- npm run test:quick",
"watch:themes": "onchange 'src/themes/**/.json' 'src/themes/**/*.svg' -- npm run bundle"
},
"author": "WikiPathways team",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/wikipathways/pvjs.git"
},
"description": "Biological pathway diagram viewer for WikiPathways.org",
"dependencies": {
"bridgedb": "6.2.5",
"kaavio": "5.0.0",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"rxjs-stream": "^1.3.0"
},
"devDependencies": {
"@types/node": "^10.17.0",
"@types/react": "^16.9.3",
"@types/react-dom": "^16.9.3",
"@wikipathways/gpml": "1.0.6",
"autoprefixer": "^9.7.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2016": "^6.24.1",
"expose-loader": "^0.7.5",
"mini-css-extract-plugin": "^0.8.0",
"gpml2pvjson": "4.1.12",
"npm-run-all": "^4.1.5",
"onchange": "^6.1.0",
"postcss-loader": "^3.0.0",
"precss": "^4.0.0",
"react-test-renderer": "^16.11.0",
"source-map-loader": "^0.2.4",
"source-map-support": "^0.5.16",
"string-replace-webpack-plugin": "^0.1.3",
"to-string-loader": "^1.1.5",
"ts-loader": "^6.2.2",
"typescript": "^3.8.3",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.9.0",
"webpack-hot-middleware": "^2.25.0"
}
}