Skip to content

Commit

Permalink
Update all packages to the most recent version
Browse files Browse the repository at this point in the history
To support this, the following changes have to be made as well:

- Ignore `package-lock.json` since NPM creates it, but we should not
  have it in the repository.
- Switch from `babel-preset-es2015` to `babel-preset-env` to resolve
  the deprecation warning in the test logs. The latter is more recent
  and flexible, but should be the same functionality-wise.
- `transform` now needs to have the `utf-8` encoding option provided.
  If not given, it will call the callback with a `Buffer` object,
  which results in an unhandled promise rejection since what is
  returned from the callback is a string, not a `Buffer`.
  • Loading branch information
timvandermeij committed Sep 30, 2017
1 parent 3717757 commit 0733b54
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Makefile
node_modules/
examples/node/svgdump/
examples/node/pdf2png/*.png
package-lock.json
8 changes: 4 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function createWebpackConfig(defines, output) {
loader: 'babel-loader',
exclude: /src\/core\/(glyphlist|unicode)/, // babel is too slow
options: {
presets: pdfjsNext ? undefined : ['es2015'],
presets: pdfjsNext ? undefined : ['env'],
plugins: ['transform-es2015-modules-commonjs'],
},
},
Expand Down Expand Up @@ -999,7 +999,7 @@ gulp.task('lib', ['buildnumber'], function () {
content = preprocessor2.preprocessPDFJSCode(ctx, content);
content = babel.transform(content, {
sourceType: 'module',
presets: noPreset ? undefined : ['es2015'],
presets: noPreset ? undefined : ['env'],
plugins: [
'transform-es2015-modules-commonjs',
babelPluginReplaceNonWebPackRequire,
Expand Down Expand Up @@ -1043,7 +1043,7 @@ gulp.task('lib', ['buildnumber'], function () {
'!web/compatibility.js',
], { base: '.', }),
gulp.src('test/unit/*.js', { base: '.', }),
]).pipe(transform(preprocess))
]).pipe(transform('utf8', preprocess))
.pipe(gulp.dest('build/lib/'));
return merge([
buildLib,
Expand Down Expand Up @@ -1316,7 +1316,7 @@ gulp.task('dist-pre',
license: DIST_LICENSE,
dependencies: {
'node-ensure': '^0.0.0', // shim for node for require.ensure
'worker-loader': '^0.8.0', // used in external/dist/webpack.json
'worker-loader': '^1.0.0', // used in external/dist/webpack.json
},
browser: {
'fs': false,
Expand Down
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@
"name": "pdf.js",
"version": "1.0.0",
"devDependencies": {
"acorn": "^4.0.11",
"babel-core": "^6.23.1",
"babel-loader": "^6.4.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"core-js": "^2.5.0",
"escodegen": "^1.8.0",
"eslint": "^4.5.0",
"eslint-plugin-mozilla": "^0.4.3",
"acorn": "^5.1.2",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-preset-env": "^1.6.0",
"core-js": "^2.5.1",
"escodegen": "^1.9.0",
"eslint": "^4.8.0",
"eslint-plugin-mozilla": "^0.4.4",
"gulp": "^3.9.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-transform": "^1.1.0",
"gulp-util": "^3.0.7",
"gulp-zip": "^3.2.0",
"jasmine": "^2.5.2",
"jasmine-core": "^2.5.2",
"jsdoc": "^3.3.0-alpha9",
"gulp-replace": "^0.6.1",
"gulp-transform": "^3.0.5",
"gulp-util": "^3.0.8",
"gulp-zip": "^4.0.0",
"jasmine": "^2.8.0",
"jasmine-core": "^2.8.0",
"jsdoc": "^3.5.5",
"merge-stream": "^1.0.1",
"mkdirp": "^0.5.1",
"node-ensure": "^0.0.0",
"rimraf": "^2.4.1",
"rimraf": "^2.6.2",
"streamqueue": "^1.1.1",
"systemjs": "^0.20.7",
"systemjs-plugin-babel": "0.0.21",
"systemjs": "^0.20.19",
"systemjs-plugin-babel": "^0.0.25",
"ttest": "^1.1.0",
"typogr": "^0.6.6",
"uglify-es": "^3.0.28",
"typogr": "^0.6.7",
"uglify-es": "^3.1.2",
"vinyl-fs": "^2.4.4",
"webpack": "^3.5.5",
"webpack": "^3.6.0",
"webpack-stream": "^4.0.0",
"wintersmith": "^2.0.0",
"yargs": "^3.14.0"
"wintersmith": "^2.4.1",
"yargs": "^9.0.1"
},
"scripts": {
"test": "gulp lint unittestcli externaltest"
Expand Down
2 changes: 1 addition & 1 deletion systemjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
scriptLoad: false,
esModule: true,
babelOptions: {
es2015: false,
env: false,
plugins: [babelPluginReplaceNonWebPackRequire],
},
},
Expand Down

0 comments on commit 0733b54

Please sign in to comment.