Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FredKSchott/rollup-plugin-polyfill-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eb507a21ad82236255988548dea6120d7a277de2
Choose a base ref
...
head repository: FredKSchott/rollup-plugin-polyfill-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 31face71b94b8408a907f04753318dff589adc2f
Choose a head ref
  • 9 commits
  • 8 files changed
  • 4 contributors

Commits on Aug 31, 2023

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Copy the full SHA
    3aac71e View commit details
  2. Copy the full SHA
    14cc726 View commit details
  3. Copy the full SHA
    63eabf0 View commit details

Commits on Oct 11, 2023

  1. chore: support rollup 4.0

    perrin4869 committed Oct 11, 2023
    Copy the full SHA
    77f87cc View commit details

Commits on Nov 20, 2023

  1. Merge pull request #77 from perrin4869/chore/rollup-4.0

    chore: support rollup 4.0
    FredKSchott authored Nov 20, 2023
    Copy the full SHA
    8480dfc View commit details
  2. Merge pull request #73 from jbghoul/chunk-size

    Handle inflate on buffer larger than chunk size
    FredKSchott authored Nov 20, 2023
    Copy the full SHA
    e4a0cfa View commit details
  3. Merge pull request #72 from jbghoul/70-binding-codes

    fix on zlib polyfill: getting error code
    FredKSchott authored Nov 20, 2023
    Copy the full SHA
    3f79398 View commit details

Commits on Nov 21, 2023

  1. rebuild

    FredKSchott committed Nov 21, 2023
    Copy the full SHA
    a77f81c View commit details
  2. 0.13.0

    FredKSchott committed Nov 21, 2023
    Copy the full SHA
    31face7 View commit details
Showing with 4,314 additions and 2,618 deletions.
  1. +4,269 −2,596 package-lock.json
  2. +10 −10 package.json
  3. +22 −1 polyfills/__zlib-lib/binding.js
  4. +2 −0 polyfills/buffer-es6.js
  5. +5 −5 polyfills/constants.js
  6. +1 −1 polyfills/zlib.js
  7. +4 −4 scripts/build-polyfills.js
  8. +1 −1 src/polyfills.ts
6,865 changes: 4,269 additions & 2,596 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-polyfill-node",
"version": "0.12.0",
"version": "0.13.0",
"main": "dist/index.js",
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
@@ -26,26 +26,26 @@
"author": "",
"license": "MIT",
"dependencies": {
"@rollup/plugin-inject": "^5.0.1"
"@rollup/plugin-inject": "^5.0.4"
},
"peerDependencies": {
"rollup": "^1.20.0 || ^2.0.0 || ^3.0.0"
"rollup": "^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.5",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"browserify-fs": "^1.0.0",
"buffer-es6": "^4.9.3",
"crypto-browserify": "^3.11.0",
"debug": "^4.1.1",
"glob": "^7.1.6",
"mocha": "^8.0.0",
"np": "^7.6.2",
"mocha": "^10.2.0",
"np": "^8.0.4",
"process-es6": "^0.11.6",
"rollup": "^3.2.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup": "^4.0.2",
"serve": "^11.3.2",
"typescript": "^4.0.0"
"typescript": "^5.2.2"
},
"repository": {
"type": "git",
23 changes: 22 additions & 1 deletion polyfills/__zlib-lib/binding.js
Original file line number Diff line number Diff line change
@@ -218,14 +218,35 @@ Zlib.prototype._write = function(flush, input, in_off, in_len, out, out_off, out
throw new Error('Unknown mode ' + this.mode);
}

if (status !== Z_STREAM_END && status !== Z_OK) {
if (!this._checkError(status, strm, flush)) {
this._error(status);
}

this.write_in_progress = false;
return [strm.avail_in, strm.avail_out];
};

Zlib.prototype._checkError = function (status, strm, flush) {
// Acceptable error states depend on the type of zlib stream.
switch (status) {
case Z_OK:
case Z_BUF_ERROR:
if (strm.avail_out !== 0 && flush === Z_FINISH) {
return false
}
break
case Z_STREAM_END:
// normal statuses, not fatal
break
case Z_NEED_DICT:
return false
default:
return false
}

return true
}

Zlib.prototype.close = function() {
if (this.write_in_progress) {
this.pending_close = true;
2 changes: 2 additions & 0 deletions polyfills/buffer-es6.js
Original file line number Diff line number Diff line change
@@ -205,6 +205,8 @@ var isArray = Array.isArray || function (arr) {
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */


var INSPECT_MAX_BYTES = 50;

10 changes: 5 additions & 5 deletions polyfills/constants.js
Original file line number Diff line number Diff line change
@@ -173,8 +173,8 @@ export var UV_FS_COPYFILE_FICLONE = 2;
export var COPYFILE_FICLONE = 2;
export var UV_FS_COPYFILE_FICLONE_FORCE = 4;
export var COPYFILE_FICLONE_FORCE = 4;
export var OPENSSL_VERSION_NUMBER = 269488351;
export var SSL_OP_ALL = 2147485780;
export var OPENSSL_VERSION_NUMBER = 805306528;
export var SSL_OP_ALL = 2147485776;
export var SSL_OP_ALLOW_NO_DHE_KEX = 1024;
export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = 262144;
export var SSL_OP_CIPHER_SERVER_PREFERENCE = 4194304;
@@ -230,7 +230,6 @@ export var DH_UNABLE_TO_CHECK_GENERATOR = 4;
export var DH_NOT_SUITABLE_GENERATOR = 8;
export var ALPN_ENABLED = 1;
export var RSA_PKCS1_PADDING = 1;
export var RSA_SSLV23_PADDING = 2;
export var RSA_NO_PADDING = 3;
export var RSA_PKCS1_OAEP_PADDING = 4;
export var RSA_X931_PADDING = 5;
@@ -246,6 +245,7 @@ export var TLS1_3_VERSION = 772;
export var POINT_CONVERSION_COMPRESSED = 2;
export var POINT_CONVERSION_UNCOMPRESSED = 4;
export var POINT_CONVERSION_HYBRID = 6;
export var defaultCipherList = "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA";
export default {
RTLD_LAZY: RTLD_LAZY,
RTLD_NOW: RTLD_NOW,
@@ -479,7 +479,6 @@ export default {
DH_NOT_SUITABLE_GENERATOR: DH_NOT_SUITABLE_GENERATOR,
ALPN_ENABLED: ALPN_ENABLED,
RSA_PKCS1_PADDING: RSA_PKCS1_PADDING,
RSA_SSLV23_PADDING: RSA_SSLV23_PADDING,
RSA_NO_PADDING: RSA_NO_PADDING,
RSA_PKCS1_OAEP_PADDING: RSA_PKCS1_OAEP_PADDING,
RSA_X931_PADDING: RSA_X931_PADDING,
@@ -494,5 +493,6 @@ export default {
TLS1_3_VERSION: TLS1_3_VERSION,
POINT_CONVERSION_COMPRESSED: POINT_CONVERSION_COMPRESSED,
POINT_CONVERSION_UNCOMPRESSED: POINT_CONVERSION_UNCOMPRESSED,
POINT_CONVERSION_HYBRID: POINT_CONVERSION_HYBRID
POINT_CONVERSION_HYBRID: POINT_CONVERSION_HYBRID,
defaultCipherList: defaultCipherList
};
2 changes: 1 addition & 1 deletion polyfills/zlib.js
Original file line number Diff line number Diff line change
@@ -354,7 +354,7 @@ export function Zlib(opts, mode) {

var error = new Error(message);
error.errno = errno;
error.code = binding.codes[errno];
error.code = codes[errno];
self.emit('error', error);
};

8 changes: 4 additions & 4 deletions scripts/build-polyfills.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const rollup = require('rollup');
// const fs = require('fs');
const path = require('path');
const nodeResolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const json = require('rollup-plugin-json');
const nodeResolve = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const json = require('@rollup/plugin-json');

async function main() {
await Promise.all([
@@ -12,7 +12,7 @@ async function main() {
// bundleDependency('browserify-fs'),
// bundleDependency('crypto-browserify'),
])

// quick and dirty find-replace
// const cryptoPolyfillLoc = path.join(__dirname, '../polyfills/crypto-browserify.js');
// let cryptoPolyfill = fs.readFileSync(cryptoPolyfillLoc, 'utf8');
2 changes: 1 addition & 1 deletion src/polyfills.ts

Large diffs are not rendered by default.