UNPKG

8.19 kBJSONView Raw
1{
2 "name": "@wikipathways/pvjs",
3 "version": "4.0.1",
4 "main": "es5/index.js",
5 "module": "esnext/index.js",
6 "jsnext:main": "esnext/index.js",
7 "typings": "esnext/index",
8 "engines": {
9 "node": ">=6.11.4"
10 },
11 "bin": {
12 "pvjs": "./bin/pvjs"
13 },
14 "files": [
15 "bin/",
16 "es5/",
17 "esnext/",
18 "dist/",
19 "test/expected"
20 ],
21 "scripts": {
22 "build": "rm -rf dist/ es5/ esnext/; npm-run-all -r -s build:css -p build:assets build:bundle -s build:ts build:dist",
23 "build:assets": "npm-run-all -p build:assets:*",
24 "build:assets:es5": "rsync -a --delete --include='*.json' --include='*.svg' --include='*.css' --include='*.css.d.ts' --include='*/' --exclude='*' src/ es5/",
25 "build:assets:esnext": "rsync -a --delete --include='*.json' --include='*.svg' --include='*.css' --include='*.css.d.ts' --include='*/' --exclude='*' src/ esnext/",
26 "build:bundle": "npm run bundle",
27 "build:css": "tcm src",
28 "build:dist": "webpack --config webpack.dist.config.js",
29 "build:ts": "npm-run-all -p build:ts:*",
30 "build:ts:es5": "tsc --project tsconfig.es5.json",
31 "build:ts:esnext": "tsc --project tsconfig.esnext.json",
32 "bundle": "npm-run-all -p bundle:*",
33 "bundle:dark": "kaavio bundle ./src/themes/dark.json",
34 "bundle:experimental": "kaavio bundle ./src/themes/experimental.json",
35 "bundle:plain": "kaavio bundle ./src/themes/plain.json",
36 "convert": "npm-run-all -p convert:*",
37 "convert:WP1818_73650": "cat node_modules/gpml2pvjson/test/expected/WP1818_73650.json | ./bin/pvjs --theme dark > WP528_92047.dark.svg",
38 "convert:playground": "cat ./test/playground.gpml | gpml2pvjson | tee test/playground.json | ./bin/pvjs --theme dark > ./test/playground.dark.svg",
39 "deleteUnconvertables": "echo 'TODO gpml2pvjson fails to convert \"xmllint-pretty2.gpml\", \"xmllint-c14n.gpml\" and \"xmllint-c14n11.gpml\". Need to fix issue at source, but deleting the resulting json files for now...'; rm -f ./node_modules/gpml2pvjson/test/expected/xmllint-c14n* ./node_modules/gpml2pvjson/test/expected/xmllint-exc-c14n.json ./node_modules/gpml2pvjson/test/expected/xmllint-pretty2.json",
40 "deploy": "npm run build && host=dev.wikipathways.org && rsync dist/pvjs.js $host:/var/www/$host/wpi/js/pvjs/",
41 "expected": "echo 'Setting expected values for tests'; npm-run-all expected:* || break",
42 "expected:checksums": "echo \"Converting JSON (from GPML test files) to SVG and generating checksums:\"; npm run deleteUnconvertables; source_dirname=./node_modules/gpml2pvjson/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 | tee \"$output_file\" | shasum -p -a 1 > \"$output_file.sha1sum\" || break; done",
43 "postinstall": "npm-run-all bundle; echo \"\\nBuilding expected SVGs for testing purposes...:\"; npm run deleteUnconvertables; inputs=\"./node_modules/gpml2pvjson/test/expected/*.json\"; echo \"# Converting $inputs from JSON to SVG and verifying checksums...\"; for f in $inputs; 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 | tee \"$base_path.svg\" | shasum -p -a 1 -c \"$base_path.svg.sha1sum\" || break; done",
44 "prepublishOnly": "npm-run-all build test expected",
45 "test": "npm-run-all test:browser test:quick test:checksums",
46 "test:browser": "echo 'get browser tests working'",
47 "test:checksums": "npm run deleteUnconvertables; inputs=\"./node_modules/gpml2pvjson/test/expected/*.json\"; echo \"# Converting $inputs from JSON to SVG and verifying checksums...\"; for f in $inputs; 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 | shasum -p -a 1 -c \"$base_path.svg.sha1sum\" || break; done",
48 "test:convert": "npm run deleteUnconvertables; inputs=\"./node_modules/gpml2pvjson/test/expected/*.json\"; echo \"# Converting $inputs from JSON to SVG...\"; for f in $inputs; 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 - > /dev/null || break; done",
49 "test:quick": "npm-run-all -p test:quick:*",
50 "test:quick:Icon": "input=\"./node_modules/gpml2pvjson/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'",
51 "test:quick:Edge": "input=\"./node_modules/gpml2pvjson/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'",
52 "watch-max-build": "npm-run-all -s build -p watch:*",
53 "watch": "rm -rf es5/ esnext/; npm-run-all -r -s build:css -p build:assets build:bundle -s build:ts -p watch:*",
54 "watch:browser": "webpack-dev-server --config webpack.dev.config.js --open --progress --inline",
55 "watch:css": "tcm src --watch",
56 "watch:assets": "onchange 'src/**' -- npm-run-all build:assets",
57 "watch:es5": "tsc --project tsconfig.es5.json --watch",
58 "watch:esnext": "tsc --project tsconfig.esnext.json --watch",
59 "watch:playground": "onchange 'test/playground.gpml' -- npm run convert:playground",
60 "watch-broken:playground": "onchange 'test/playground.gpml' -- gpml2pvjson < ./test/playground.gpml > ./test/playground.json",
61 "watch-broken:test": "onchange 'src/**' -- npm run test:quick",
62 "watch:themes": "onchange 'src/themes/**/.json' 'src/themes/**/*.svg' -- npm run bundle"
63 },
64 "author": "WikiPathways team",
65 "license": "Apache-2.0",
66 "repository": {
67 "type": "git",
68 "url": "https://github.com/wikipathways/pvjs.git"
69 },
70 "description": "Biological pathway diagram viewer for WikiPathways.org",
71 "dependencies": {
72 "bridgedb": "^6.0.2",
73 "kaavio": "^4.0.3",
74 "react": "^16.2.0",
75 "react-addons-css-transition-group": "^15.6.2",
76 "react-addons-shallow-compare": "^15.6.2",
77 "react-dom": "^16.2.0",
78 "react-selectize": "^3.0.1",
79 "react-spinkit": "^3.0.0",
80 "rxjs-stream": "^1.1.0"
81 },
82 "devDependencies": {
83 "@types/js-base64": "^2.3.1",
84 "@types/node": "^8.9.0",
85 "@types/react": "github:ariutta/types-react-v15#50edb5d",
86 "@types/react-dom": "^15.5.6",
87 "@wikipathways/gpml": "^1.0.4",
88 "JSONStream": "^1.3.2",
89 "autoprefixer": "^7.2.5",
90 "babel-core": "^6.26.0",
91 "babel-loader": "^7.1.2",
92 "babel-polyfill": "^6.26.0",
93 "babel-preset-env": "^1.6.0",
94 "babel-preset-es2015": "^6.24.1",
95 "babel-preset-es2016": "^6.24.1",
96 "babel-preset-react": "^6.24.1",
97 "expose-loader": "^0.7.4",
98 "extract-text-webpack-plugin": "^3.0.2",
99 "gpml2pvjson": "^4.1.1",
100 "npm-run-all": "^4.1.2",
101 "onchange": "^3.3.0",
102 "postcss-loader": "^2.1.0",
103 "precss": "^2.0.0",
104 "react-test-renderer": "^16.2.0",
105 "source-map-loader": "^0.2.3",
106 "source-map-support": "^0.5.3",
107 "string-replace-webpack-plugin": "^0.1.3",
108 "to-string-loader": "^1.1.5",
109 "ts-loader": "^2.3.7",
110 "typed-css-modules": "^0.3.1",
111 "typescript": "^2.7.1",
112 "uglifyjs-webpack-plugin": "^0.4.6",
113 "webpack": "^3.10.0",
114 "webpack-dev-server": "^2.11.1",
115 "webpack-hot-middleware": "^2.21.0"
116 }
117}