Commit Graph

115 Commits

Author SHA1 Message Date
Jonas Jenwald
94dfb46091 Update npm packages 2020-12-27 11:11:18 +01:00
Jonas Jenwald
e09f2a462d Update npm packages 2020-12-13 11:38:37 +01:00
dependabot[bot]
7a0d89b3c0
Bump ini from 1.3.5 to 1.3.7
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-10 20:48:56 +00:00
Jonas Jenwald
1f29d27474 Change how we're passing pdf.sandbox.js-specific options to createWebpackConfig in gulpfile.js
Given the somewhat "specialized" nature of the `pdf.sandbox.js` building, it ought to be possible to re-factor how some of the options are handled.
Note in particular that the `gulp-strip-comments` dependency seems somewhat unncessary, since the *main* source of comments are just the default license header. Hence I seems much more reasonable to simply not include that to begin with, rather than removing it after the fact (the few remaining Webpack-related should be few/small enough to not really matter much in practice).

This way we're able to further reduce the special-casing related to the `pdf.sandbox.js`-building, which will make future changes/maintenance easier by bringing this code more in-line with existing patterns in `gulpfile.js`.

(If we really want to reduce the filesize, we might want to consider always minifying the `GENERIC`-build of the `pdf.sandbox.js` file.)
2020-12-05 22:44:48 +01:00
Jonas Jenwald
58f865404c Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2020-11-29 09:47:33 +01:00
Jonas Jenwald
e15c63abc7 Update npm packages 2020-11-29 09:43:20 +01:00
dependabot[bot]
b6fdade6c6
Bump highlight.js from 9.13.1 to 9.18.5
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.13.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.13.1...9.18.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-24 23:29:33 +00:00
Tim van der Meij
a936f1f70c
Update Puppeteer to version 5.5.0 2020-11-22 14:26:49 +01:00
Calixte Denizet
c7974e9996 JS -- Add a sandbox based on quickjs
* quickjs-eval.js has been generated using https://github.com/mozilla/pdf.js.quickjs/
 * lazy load of sandbox code
 * Rewrite tests to use the sandbox
 * Add a task `watch-sandbox` which update bundle pdf.sandbox.js on change in the sandbox code
2020-11-19 13:40:46 +01:00
Jonas Jenwald
e1f43907d2 Update npm packages 2020-11-15 13:57:28 +01:00
Jonas Jenwald
75af932b79 Update npm packages 2020-11-01 10:04:57 +01:00
Jonas Jenwald
641ad1c3a0 Update npm packages 2020-10-18 10:57:52 +02:00
Jonas Jenwald
666dd73ce8 Upgrade webpack to version 5
The only noticeable changes are that the built files are now *slightly* smaller, and that Webpack now supports optional chaining and nullish coalescing without the need for Babel plugins.
2020-10-11 10:23:38 +02:00
Jonas Jenwald
3461eac7b8 Upgrade terser to version 5
The only significant change is that the `minify` command is now asynchronous, which we can handle easily by simply making the containing functions `async`.
Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#Browser_compatibility, using `async`/`await` in the gulpfile should no longer be an issue as far as I can tell.
2020-10-07 14:38:17 +02:00
Jonas Jenwald
bc036c05bd Upgrade acorn to version 8
I've run `gulp mozcentral`, `gulp generic`, and `gulp generic-es5` with `master` respectively this patch and then diffed the build output. With the (obvious) exception of increased version/build numbers, there were no actual changes from the updated Acorn version.
2020-10-06 13:53:08 +02:00
Tim van der Meij
505f14e816
Upgrade minor/major versions of dependencies that don't require code changes
The changelogs of those dependencies showed no breaking changes for us.
Most of the time the major version bump was done to remove compatibility
with very outdated Node.js versions.

Only for `autoprefixer` and `gulp-postcss` a change was required, which
is including `postcss` in our `package.json` explicitly since it's now
a peer dependency of those packages.

Now only `acorn`,`systemjs`, `terser` and `yargs` are not the latest
versions because they require more work.
2020-10-04 20:26:59 +02:00
Jonas Jenwald
082e7b5200 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2020-10-04 15:30:24 +02:00
Jonas Jenwald
522c93b916 Update npm packages 2020-10-04 15:30:23 +02:00
Tim van der Meij
c10aac9a1d
Upgrade Puppeteer to version 5.3.1 2020-10-03 23:06:31 +02:00
Jonas Jenwald
5107259176 Update escodegen to version 2.0
This release contains support for additional modern ECMAScript features, such as e.g. the nullish coalescing operator `??` and the optional chaining operator `?.`.
2020-09-29 15:56:24 +02:00
Jonas Jenwald
3e9c489b8b Update the webpack-stream dependency (issue 11996)
Given that the long-standing `webpack-stream` issue 201 was recently fixed in PR 207, and a new version released, we should now finally be able to update the dependency.
However, depending on if/when `webpack-stream` gets support for Webpack 5 (which is currently in beta) we may still want remove our `webpack-stream` dependency.
2020-09-20 15:35:56 +02:00
Jonas Jenwald
4dcedeb98e Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2020-09-20 11:40:20 +02:00
Jonas Jenwald
36b8d5e72d Update npm packages 2020-09-20 11:34:24 +02:00
Jonas Jenwald
0aef40f897 Update npm packages 2020-09-06 11:49:49 +02:00
Jonas Jenwald
7b5a540a52 Add (basic) support for Stylelint, to allow linting of CSS files
This is *similar* to the existing linting for JavaScript files, but covers CSS files instead.
While there's a lot of rules that could potentially be used, the main advantage of using Stylelint is that it has Prettier integration which means that we can automatically enforce a *consistent* style for our CSS files as well.

As a proof of concept, this patch is purposely limited to:
 - Adding a simple rule, here `block-no-empty` is chosen; see https://stylelint.io/user-guide/rules/block-no-empty
 - Adding Prettier integration, to unify the style of our CSS files.

Please find additional information at https://stylelint.io/
2020-08-30 21:48:35 +02:00
Jonas Jenwald
cb27999681 Update npm packages 2020-08-23 10:08:45 +02:00
Jonas Jenwald
c1253fd2d9 Update npm packages 2020-08-09 11:03:07 +02:00
Tim van der Meij
00a8b42e67
Merge pull request #12102 from ineiti/add_types_annotations
Add types annotations
2020-08-02 16:45:37 +02:00
Tim van der Meij
c53e403049
Update Jasmine to version 3.6.1
This is possible now that most intermittent unit test failures have been
resolved by other patches. There is only one remaining, but it's very
rare and doesn't have to block this update anymore.
2020-08-01 21:12:26 +02:00
Linus Gasser
f1bbfdc16d Add typescript definitions
This PR adds typescript definitions from the JSDoc already present.
It adds a new gulp-target 'types' that calls 'tsc', the typescript
compiler, to create the definitions.

To use the definitions, users can simply do the following:

```
import {getDocument, GlobalWorkerOptions} from "pdfjs-dist";
import pdfjsWorker from "pdfjs-dist/build/pdf.worker.entry";
GlobalWorkerOptions.workerSrc = pdfjsWorker;

const pdf = await getDocument("file:///some.pdf").promise;
```

Co-authored-by: @oBusk
Co-authored-by: @tamuratak
2020-07-30 11:10:37 +02:00
Tim van der Meij
c7c6c90062
Limit the allowed versions for Jasmine and Puppeteer
Jasmine >= 3.6.0 causes intermittent test failures because of random
task abortions.

Puppeteer >= 4.0.0 causes ENOTEMPTY/EBUSY errors during shutdown on the
Windows bot.

Moreover, `jasmine-core` is a dependency of `jasmine` so it doesn't have
to be required separately.
2020-07-26 20:40:55 +02:00
Jonas Jenwald
47ab676225 Update npm packages 2020-07-26 11:18:41 +02:00
Jonas Jenwald
20ad4337ac Fix *most* vulnerabilities reported by npm audit
This was automatically, by using the `npm audit fix` command.
2020-07-13 11:06:47 +02:00
Jonas Jenwald
fac5b5ff0c Update npm packages 2020-07-13 11:05:50 +02:00
dependabot[bot]
82b1930452
Bump npm from 6.14.5 to 6.14.6
Bumps [npm](https://github.com/npm/cli) from 6.14.5 to 6.14.6.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.14.5...v6.14.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-07 19:25:19 +00:00
Jonas Jenwald
ff3fbb91b9 Fix *most* vulnerabilities reported by npm audit
This was automatically, by using the `npm audit fix` command.
2020-06-27 11:32:51 +02:00
Jonas Jenwald
1d6d1c78ae Update npm packages 2020-06-27 11:30:30 +02:00
Dylan Lacey
f2b295882f Update Needle to 2.5.0 or greater.
Versions of `needle` prior to `2.5.0` cannot cope with redirects (as documented: https://github.com/tomas/needle/issues/312).

This prevents prebuilt `canvas` binaries from being downloaded on MacOS,
requiring the global install of its dependencies.

Updating Needle restores it to functionality, addressing this.  It also avoids
the need to add `request` to `package.json`; it also obsoletes https://github.com/mozilla/pdf.js/pull/12018.
2020-06-25 13:54:54 +10:00
Jonas Jenwald
603a9e3ea3 Update npm packages 2020-06-13 10:36:11 +02:00
Jonas Jenwald
da482310ee Update npm packages 2020-05-30 10:58:10 +02:00
Jonas Jenwald
6a1490faa7 Update Acorn to version 7
By updating to the new major version of Acorn, we'll get support for newer ECMAScript features as they become available (although some features are currently also blocked by ESLint support and/or SystemJS usage).

Please see https://github.com/acornjs/acorn/releases/tag/7.2.0 for details.
2020-05-27 11:54:27 +02:00
Jonas Jenwald
8d56a69e74 Reduce usage of SystemJS, in the development viewer, even further
With these changes SystemJS is now only used, during development, on the worker-thread and in the unit/font-tests, since Firefox is currently missing support for worker modules; please see https://bugzilla.mozilla.org/show_bug.cgi?id=1247687

Hence all the JavaScript files in the `web/` and `src/display/` folders are now loaded *natively* by the browser (during development) using standard `import` statements/calls, thanks to a nice `import-maps` polyfill.

*Please note:* As soon as https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 is fixed in Firefox, we should be able to remove all traces of SystemJS and thus finally be able to use every possible modern JavaScript feature.
2020-05-20 13:36:52 +02:00
Jonas Jenwald
4f6664f3f5 Update npm packages 2020-05-16 11:44:41 +02:00
Jonas Jenwald
887d2f2948 Update the eslint-plugin-unicorn package 2020-05-16 11:43:21 +02:00
Jonas Jenwald
f8bff283f3 Update ESLint to version 7
Please see https://eslint.org/blog/2020/05/eslint-v7.0.0-released for a list of notable changes.
2020-05-10 11:32:46 +02:00
Jonas Jenwald
8fac59de96 Update npm packages 2020-05-02 13:23:41 +02:00
Tim van der Meij
4834a276fd
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-27 13:03:12 +02:00
Jonas Jenwald
d67c1899b5 Update npm packages 2020-04-18 11:08:46 +02:00
Jonas Jenwald
426945b480 Update Prettier to version 2.0
Please note that these changes were done automatically, using `gulp lint --fix`.

Given that the major version number was increased, there's a fair number of (primarily whitespace) changes; please see https://prettier.io/blog/2020/03/21/2.0.0.html
In order to reduce the size of these changes somewhat, this patch maintains the old "arrowParens" style for now (once mozilla-central updates Prettier we can simply choose the same formatting, assuming it will differ here).
2020-04-14 12:28:14 +02:00
Jonas Jenwald
7b7fe60210 Update the mkdirp package, since its major version was increased 2020-04-02 12:22:13 +02:00