puppeteer/package.json

110 lines
3.9 KiB
JSON
Raw Normal View History

2017-05-11 07:06:41 +00:00
{
"name": "puppeteer",
"version": "5.5.0-post",
2017-08-16 05:30:56 +00:00
"description": "A high-level API to control headless Chrome over the DevTools Protocol",
chore(agnostic): ship CJS and ESM builds (#6095) * chore(agnostic): ship CJS and ESM builds For our work to enable Puppeteer in other environments (e.g. a browser) we need to ship an ESM build. This commit changes our config to ship to `lib/cjs` and `lib/esm` accordingly. The majority of our code stays the same, with one small fix for the CJS build to ensure that we ship a version that lets you `require('puppeteer')` rather than have to `require('puppeteer').default`. We do this with the `cjs-entry.js` which is what the `main` field in our `package.json` points to. We also swap to `read-pkg-up` to find the `package.json` file. This is because the folder structure of `lib/` does not match `src/` now we ship to `cjs` and `esm`, so you cannot rely on exact paths. This module works up from the file to find the nearest `package.json` so it will always find Puppeteer's `package.json`. Note that we *do not* point any users to the ESM build. We happen to ship those files so people who know about them can get at them but it's not expected (nor will we actively support) that people will rely on them. The CommonJS build is considered our main build. We may make breaking changes to the structure of the ESM build which we will do without requiring new major versions. For example the ESM build currently ships all files that the CJS build does, but given we are working on the ESM build being able to run in the browser this may change over time. Long term once the Node versions catch up we can ditch CJS and ship exclusively ESM but we are not there yet.
2020-06-25 13:24:46 +00:00
"main": "./cjs-entry.js",
2019-11-26 12:12:25 +00:00
"repository": "github:puppeteer/puppeteer",
2017-06-19 22:01:14 +00:00
"engines": {
"node": ">=10.18.1"
2017-06-19 22:01:14 +00:00
},
2017-05-11 07:06:41 +00:00
"scripts": {
2020-07-22 11:14:35 +00:00
"test-browser": "wtr",
"test-browser-watch": "wtr --watch",
"unit": "npm run tsc-cjs && mocha --config mocha-config/puppeteer-unit-tests.js",
"unit-debug": "npm run tsc-cjs && mocha --inspect-brk --config mocha-config/puppeteer-unit-tests.js",
"unit-with-coverage": "cross-env COVERAGE=1 npm run unit",
"assert-unit-coverage": "cross-env COVERAGE=1 mocha --config mocha-config/coverage-tests.js",
"funit": "PUPPETEER_PRODUCT=firefox npm run unit",
"test": "npm run tsc && npm run lint --silent && npm run unit-with-coverage && npm run test-browser",
chore: fix installing from GitHub URL (#5669) The change to the install script to require TypeScript works fine when installing from npm (because on npm the `lib` directory with the compiled code already exists) but doesn't if you install from a GitHub URL. By default it seems npm uses the `files` list when you install from GitHub which means it's missing a bunch of files that we need to compile. Additionally by default when installing from a GitHub URL npm doesn't install the dependencies which is an issue for us when we need to compile TypeScript. The fix is to create a `prepare` script that runs TypeScript if required. From the npm docs [1]: > `prepare`: Run both BEFORE the package is packed and published, on > local npm install without any arguments, and when installing git > dependencies And from the npm docs on install [2], it confirms that if a package has a `prepare` script it is run when installing from GitHub: > As with regular git dependencies, dependencies and devDependencies > will be installed if the package has a prepare script, before the > package is done installing. Despite having the `prepare` script we still need the TypeScript check in `install.js` to satisfy the 3rd scenario below where we need to force a compile: * If I'm a user installing `puppeteer@X` from npm, the module is published with the `lib/` directory of compiled code, so I'm set. * If I'm a user installing Puppeteer from GitHub, the `prepare` script will run TypeScript for me so I'm set. * If I'm a developer working on Puppeteer, the `prepare` script also runs but _after_ `npm install` which means `install.js` fails as it requires `./lib/helper.js`. So in `install.js` we call `compileTypeScriptIfRequired` to catch this case. [1]: https://docs.npmjs.com/misc/scripts [2]: https://docs.npmjs.com/cli/install Co-authored-by: Mathias Bynens <mathias@qiwi.be> Fixes #5660.
2020-04-17 09:29:40 +00:00
"prepare": "node typescript-if-required.js",
"prepublishOnly": "npm run tsc",
"dev-install": "npm run tsc && node install.js",
2017-06-19 21:43:05 +00:00
"install": "node install.js",
"eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)",
"eslint-fix": "eslint --ext js --ext ts --fix .",
"commitlint": "commitlint --from=HEAD~1",
"lint": "npm run eslint && npm run tsc && npm run doc && npm run commitlint",
"doc": "node utils/doclint/cli.js",
"clean-lib": "rm -rf lib",
"build": "npm run tsc",
chore(agnostic): ship CJS and ESM builds (#6095) * chore(agnostic): ship CJS and ESM builds For our work to enable Puppeteer in other environments (e.g. a browser) we need to ship an ESM build. This commit changes our config to ship to `lib/cjs` and `lib/esm` accordingly. The majority of our code stays the same, with one small fix for the CJS build to ensure that we ship a version that lets you `require('puppeteer')` rather than have to `require('puppeteer').default`. We do this with the `cjs-entry.js` which is what the `main` field in our `package.json` points to. We also swap to `read-pkg-up` to find the `package.json` file. This is because the folder structure of `lib/` does not match `src/` now we ship to `cjs` and `esm`, so you cannot rely on exact paths. This module works up from the file to find the nearest `package.json` so it will always find Puppeteer's `package.json`. Note that we *do not* point any users to the ESM build. We happen to ship those files so people who know about them can get at them but it's not expected (nor will we actively support) that people will rely on them. The CommonJS build is considered our main build. We may make breaking changes to the structure of the ESM build which we will do without requiring new major versions. For example the ESM build currently ships all files that the CJS build does, but given we are working on the ESM build being able to run in the browser this may change over time. Long term once the Node versions catch up we can ditch CJS and ship exclusively ESM but we are not there yet.
2020-06-25 13:24:46 +00:00
"tsc": "npm run clean-lib && tsc --version && npm run tsc-cjs && npm run tsc-esm",
"tsc-cjs": "tsc -b src/tsconfig.cjs.json",
"tsc-esm": "tsc -b src/tsconfig.esm.json",
"apply-next-version": "node utils/apply_next_version.js",
"test-install": "scripts/test-install.sh",
"generate-docs": "npm run tsc && api-extractor run --local --verbose && api-documenter markdown -i temp -o new-docs",
"ensure-correct-devtools-protocol-revision": "ts-node -s scripts/ensure-correct-devtools-protocol-package",
"release": "node utils/remove_version_suffix.js && standard-version"
2017-05-11 07:06:41 +00:00
},
"files": [
"lib/",
"install.js",
chore(agnostic): ship CJS and ESM builds (#6095) * chore(agnostic): ship CJS and ESM builds For our work to enable Puppeteer in other environments (e.g. a browser) we need to ship an ESM build. This commit changes our config to ship to `lib/cjs` and `lib/esm` accordingly. The majority of our code stays the same, with one small fix for the CJS build to ensure that we ship a version that lets you `require('puppeteer')` rather than have to `require('puppeteer').default`. We do this with the `cjs-entry.js` which is what the `main` field in our `package.json` points to. We also swap to `read-pkg-up` to find the `package.json` file. This is because the folder structure of `lib/` does not match `src/` now we ship to `cjs` and `esm`, so you cannot rely on exact paths. This module works up from the file to find the nearest `package.json` so it will always find Puppeteer's `package.json`. Note that we *do not* point any users to the ESM build. We happen to ship those files so people who know about them can get at them but it's not expected (nor will we actively support) that people will rely on them. The CommonJS build is considered our main build. We may make breaking changes to the structure of the ESM build which we will do without requiring new major versions. For example the ESM build currently ships all files that the CJS build does, but given we are working on the ESM build being able to run in the browser this may change over time. Long term once the Node versions catch up we can ditch CJS and ship exclusively ESM but we are not there yet.
2020-06-25 13:24:46 +00:00
"typescript-if-required.js",
"cjs-entry.js",
"cjs-entry-core.js"
],
2017-05-11 07:06:41 +00:00
"author": "The Chromium Authors",
"license": "Apache-2.0",
2017-05-11 07:06:41 +00:00
"dependencies": {
"debug": "^4.1.0",
"devtools-protocol": "0.0.818844",
"extract-zip": "^2.0.0",
"https-proxy-agent": "^4.0.0",
"node-fetch": "^2.6.1",
"pkg-dir": "^4.2.0",
"progress": "^2.0.1",
"proxy-from-env": "^1.0.0",
"rimraf": "^3.0.2",
"tar-fs": "^2.0.0",
"unbzip2-stream": "^1.3.3",
"ws": "^7.2.3"
2017-05-11 07:06:41 +00:00
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@microsoft/api-documenter": "7.9.7",
"@microsoft/api-extractor": "7.10.4",
"@types/debug": "0.0.31",
"@types/mime": "^2.0.0",
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.13",
"@types/proxy-from-env": "^1.0.1",
"@types/rimraf": "^2.0.2",
2020-07-28 08:37:49 +00:00
"@types/sinon": "^9.0.4",
"@types/tar-fs": "^1.16.2",
"@types/ws": "^7.2.4",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"@web/test-runner": "^0.9.2",
"commonmark": "^0.28.1",
"cross-env": "^7.0.2",
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-unicorn": "^22.0.0",
"esprima": "^4.0.0",
"expect": "^25.2.7",
"husky": "^4.3.0",
"jpeg-js": "^0.3.7",
"mime": "^2.0.3",
"minimist": "^1.2.0",
2020-10-22 13:37:28 +00:00
"mocha": "^8.2.0",
"ncp": "^2.0.0",
2017-06-16 22:02:14 +00:00
"pixelmatch": "^4.0.2",
"pngjs": "^5.0.0",
"prettier": "^2.1.2",
"sinon": "^9.0.2",
"standard-version": "^9.0.0",
"text-diff": "^1.0.1",
"ts-node": "^9.0.0",
"typescript": "3.9.5"
},
"husky": {
"hooks": {
"commit-msg": "commitlint --env HUSKY_GIT_PARAMS"
}
2017-05-11 07:06:41 +00:00
}
}