pdf.js/package.json

70 lines
2.0 KiB
JSON
Raw Normal View History

2013-02-02 01:36:58 +09:00
{
"name": "pdf.js",
2017-10-28 02:51:15 +09:00
"version": "2.0.0",
"devDependencies": {
2020-05-02 20:23:41 +09:00
"@babel/core": "^7.9.6",
"@babel/plugin-transform-modules-commonjs": "^7.9.6",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@babel/runtime": "^7.9.6",
"acorn": "^7.2.0",
2020-04-18 18:08:46 +09:00
"autoprefixer": "^9.7.6",
2020-04-02 19:13:14 +09:00
"babel-loader": "^8.1.0",
2019-12-29 03:57:25 +09:00
"canvas": "^2.6.1",
2020-04-18 18:08:46 +09:00
"core-js": "^3.6.5",
Introduce Puppeteer for handling browsers during tests This commit replaces our own infrastructure for handling browsers during tests with Puppeteer. Using our own infrastructure for this had a few downsides: - It has proven to not always be reliable, especially when closing the browser, causing failures on the bots because browsers were still running even though they should have been stopped. Puppeteer should do a better job with this because it uses the browser's test built-in instrumentation tools for this (the devtools protocol) which our code didn't. This also means that we don't have to pass parameters/preferences to tweak browser behavior anymore. - It requires the browsers under test to be installed on the system, whereas Puppeteer downloads the browsers before the test. This means that setup is much easier (no more manual installations and browser manifest files) as well as testing with different browser versions (since they can be provisioned on demand). Moreover, this ensures that contributors always run the tests in both Firefox and Chrome, regardless of which browsers they have installed locally. - It's all code we have to maintain, so Puppeteer abstracts away how the browsers start/stop for us so we don't have to keep that code. By default, Puppeteer only installs one browser during installation, hence the need for a post-install script to install the second browser. This requires `cross-env` to make passing the environment variable work on both Linux and Windows.
2020-04-19 00:46:58 +09:00
"cross-env": "^7.0.2",
2020-02-22 01:38:22 +09:00
"escodegen": "^1.14.1",
"eslint": "^7.0.0",
2020-05-02 20:23:41 +09:00
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-fetch-options": "^0.0.5",
2020-04-18 18:08:46 +09:00
"eslint-plugin-html": "^6.0.2",
2020-04-02 19:13:14 +09:00
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-mozilla": "^2.4.0",
"eslint-plugin-no-unsanitized": "^3.1.1",
2020-04-18 18:08:46 +09:00
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-unicorn": "^20.0.0",
"es-module-shims": "^0.4.6",
2018-12-23 00:00:53 +09:00
"fancy-log": "^1.3.3",
"globals": "^11.12.0",
"gulp": "^4.0.2",
2018-12-23 00:00:53 +09:00
"gulp-postcss": "^8.0.0",
2018-08-06 04:20:37 +09:00
"gulp-rename": "^1.4.0",
2018-05-20 21:21:08 +09:00
"gulp-replace": "^1.0.0",
2018-08-06 04:20:37 +09:00
"gulp-zip": "^4.2.0",
2019-09-21 20:41:59 +09:00
"jasmine": "^3.5.0",
"jasmine-core": "^3.5.0",
2020-04-18 18:08:46 +09:00
"jsdoc": "^3.6.4",
"jstransformer-markdown-it": "^2.1.0",
"merge-stream": "^1.0.1",
2020-04-18 18:08:46 +09:00
"mkdirp": "^1.0.4",
2020-02-22 01:38:22 +09:00
"postcss-calc": "^7.0.2",
Add support for CSS variables using the `PostCSS CSS Variables` package (issue 11462) Having thought *briefly* about using `css-vars-ponyfill`, I'm no longer convinced that it'd be a good idea. The reason is that if we actually want to properly support CSS variables, then that functionality should be available in *all* of our CSS files. Note in particular the `pdf_viewer.css` file that's built as part of the `COMPONENTS` target, in which case I really cannot see how a rewrite-at-the-client solution would ever be guaranteed to always work correctly and without accidentally touching other CSS in the surrounding application. All-in-all, simply re-writing the CSS variables at build-time seems much easier and is thus the approach taken in this patch; courtesy of https://github.com/MadLittleMods/postcss-css-variables By using its `preserve` option, the built files will thus include *both* a fallback and a modern `var(...)` format[1]. As a proof-of-concept this patch removes a couple of manually added fallback values, and converts an additional sidebar related property to use a CSS variable. --- [1] Comparing the `master` branch with this patch, when using `gulp generic`, produces the following diff for the built `web/viewer.css` file: ```diff @@ -408,6 +408,7 @@ :root { --sidebar-width: 200px; + --sidebar-transition-duration: 200ms; } * { @@ -550,27 +551,28 @@ position: absolute; top: 32px; bottom: 0; - width: 200px; /* Here, and elsewhere below, keep the constant value for compatibility - with older browsers that lack support for CSS variables. */ + width: 200px; width: var(--sidebar-width); visibility: hidden; z-index: 100; border-top: 1px solid rgba(51, 51, 51, 1); -webkit-transition-duration: 200ms; transition-duration: 200ms; + -webkit-transition-duration: var(--sidebar-transition-duration); + transition-duration: var(--sidebar-transition-duration); -webkit-transition-timing-function: ease; transition-timing-function: ease; } html[dir='ltr'] #sidebarContainer { -webkit-transition-property: left; transition-property: left; - left: -200px; + left: calc(-1 * 200px); left: calc(-1 * var(--sidebar-width)); } html[dir='rtl'] #sidebarContainer { -webkit-transition-property: right; transition-property: right; - right: -200px; + right: calc(-1 * 200px); right: calc(-1 * var(--sidebar-width)); } @@ -640,6 +642,8 @@ #viewerContainer:not(.pdfPresentationMode) { -webkit-transition-duration: 200ms; transition-duration: 200ms; + -webkit-transition-duration: var(--sidebar-transition-duration); + transition-duration: var(--sidebar-transition-duration); -webkit-transition-timing-function: ease; transition-timing-function: ease; } ```
2020-02-05 06:28:38 +09:00
"postcss-css-variables": "^0.14.0",
2020-05-02 20:23:41 +09:00
"prettier": "^2.0.5",
2020-05-16 18:44:41 +09:00
"puppeteer": "^3.0.4",
2019-08-25 03:08:09 +09:00
"rimraf": "^2.7.1",
"streamqueue": "^1.1.2",
2019-01-21 00:34:24 +09:00
"systemjs": "^0.21.6",
"systemjs-plugin-babel": "^0.0.25",
2020-05-02 20:23:41 +09:00
"terser": "^4.6.13",
"through2": "^3.0.1",
2019-12-29 03:57:25 +09:00
"ttest": "^2.1.1",
2018-07-01 03:39:31 +09:00
"typogr": "^0.6.8",
"vinyl": "^2.2.0",
2018-05-20 21:21:08 +09:00
"vinyl-fs": "^3.0.3",
2020-04-18 18:08:46 +09:00
"web-streams-polyfill": "^2.1.1",
2020-05-02 20:23:41 +09:00
"webpack": "^4.43.0",
"webpack-stream": "~5.0.0",
2018-11-25 05:00:22 +09:00
"wintersmith": "^2.5.0",
2019-10-18 23:42:02 +09:00
"yargs": "^11.1.1"
},
2013-02-02 01:36:58 +09:00
"scripts": {
Introduce Puppeteer for handling browsers during tests This commit replaces our own infrastructure for handling browsers during tests with Puppeteer. Using our own infrastructure for this had a few downsides: - It has proven to not always be reliable, especially when closing the browser, causing failures on the bots because browsers were still running even though they should have been stopped. Puppeteer should do a better job with this because it uses the browser's test built-in instrumentation tools for this (the devtools protocol) which our code didn't. This also means that we don't have to pass parameters/preferences to tweak browser behavior anymore. - It requires the browsers under test to be installed on the system, whereas Puppeteer downloads the browsers before the test. This means that setup is much easier (no more manual installations and browser manifest files) as well as testing with different browser versions (since they can be provisioned on demand). Moreover, this ensures that contributors always run the tests in both Firefox and Chrome, regardless of which browsers they have installed locally. - It's all code we have to maintain, so Puppeteer abstracts away how the browsers start/stop for us so we don't have to keep that code. By default, Puppeteer only installs one browser during installation, hence the need for a post-install script to install the second browser. This requires `cross-env` to make passing the environment variable work on both Linux and Windows.
2020-04-19 00:46:58 +09:00
"postinstall": "node -e \"require('child_process').execSync('cross-env PUPPETEER_PRODUCT=firefox node node_modules/puppeteer/install.js');\"",
"test": "gulp npm-test"
2013-02-02 01:36:58 +09:00
},
"repository": {
"type": "git",
"url": "git://github.com/mozilla/pdf.js.git"
2013-03-27 17:16:40 +09:00
},
"license": "Apache-2.0"
2013-02-02 01:36:58 +09:00
}