mirror of
https://github.com/jlfwong/speedscope.git
synced 2024-11-27 01:53:17 +03:00
3172e61f05
This PR add a CLI speedscope which load file given as an argument in your default browser. Expected usage looks like: ``` speedscope /path/to/profile ``` Note that since we're using base64 encoded strings as a transport for this, this won't work with multi-file profiles, like the Instruments .trace files. This could be augmented to support that by archiving the contents, but that can be handled in a different PR. This PR also set up a viable model for integrating speedscope into other projects. By replicating the contents of `cli.js` in other languages, integration should be possible in other languages with no dependency upon node in any way. Distribution should consist of just HTML, JS, and CSS assets to be loaded in browser. Test Plan: - Ran the following to simulate a publish & subsequent installation: ``` $ npm pack $ mv speedscope-0.1.0.tgz /tmp/ $ cd /tmp $ tar -xvvf speedscope-0.1.0.tgz $ cd package $ npm install --only=production $ ./cli.js Opening file:///private/tmp/package/dist/release/index.html in your default browser $ ./cli.js ~/code/speedscope/sample/profiles/Chrome/65/timeline.json Creating temp file /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.js Creating temp file /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.html Opening file:///var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.html in your default browser ``` Fixes #24
58 lines
1.6 KiB
JSON
58 lines
1.6 KiB
JSON
{
|
|
"name": "speedscope",
|
|
"version": "0.1.0",
|
|
"description": "",
|
|
"main": "index.js",
|
|
"bin": {
|
|
"speedscope": "./cli.js"
|
|
},
|
|
"scripts": {
|
|
"deploy": "./deploy.sh",
|
|
"prepack": "./build-release.sh",
|
|
"prettier": "prettier --write './**/*.ts' './**/*.tsx'",
|
|
"lint": "eslint './**/*.ts' './**/*.tsx'",
|
|
"jest": "jest",
|
|
"coverage": "npm run jest -- --coverage && coveralls < coverage/lcov.info",
|
|
"test": "tsc --noEmit && npm run lint && npm run coverage",
|
|
"serve": "parcel index.html --open --no-autoinstall"
|
|
},
|
|
"files": ["cli.js", "dist/release/**", "!*.map"],
|
|
"browserslist": ["last 2 Chrome versions", "last 2 Firefox versions"],
|
|
"author": "",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"@types/jest": "22.2.3",
|
|
"@types/jszip": "3.1.4",
|
|
"@types/node": "10.1.4",
|
|
"@types/pako": "1.0.0",
|
|
"aphrodite": "2.1.0",
|
|
"coveralls": "3.0.1",
|
|
"eslint": "4.19.1",
|
|
"eslint-plugin-prettier": "2.6.0",
|
|
"jest": "23.0.1",
|
|
"jsverify": "0.8.3",
|
|
"jszip": "3.1.5",
|
|
"pako": "1.0.6",
|
|
"parcel-bundler": "1.9.2",
|
|
"preact": "8.2.7",
|
|
"prettier": "1.12.0",
|
|
"quicktype": "15.0.45",
|
|
"regl": "1.3.1",
|
|
"ts-jest": "22.4.6",
|
|
"typescript": "2.8.1",
|
|
"typescript-eslint-parser": "14.0.0",
|
|
"uglify-es": "3.2.2"
|
|
},
|
|
"jest": {
|
|
"transform": {
|
|
"^.+\\.tsx?$": "ts-jest"
|
|
},
|
|
"testRegex": "\\.test\\.tsx?$",
|
|
"collectCoverageFrom": ["**/*.{ts,tsx}", "!**/*.d.{ts,tsx}"],
|
|
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"]
|
|
},
|
|
"dependencies": {
|
|
"opn": "5.3.0"
|
|
}
|
|
}
|