Skip to content

Commit 90ea8c1

Browse files
authored
(#8649) - fix build and test warnings
updates rollup-plugin-node-resolve config fields "jsnext" and "main" to "mainFields". replace package.json's field "jsnext:main" to modern standard "module". replace deprecated Buffer() constructor call with equivalent Buffer.from()/Buffer.alloc(). replace module "buffer-from" with Buffer.from (obsolete, since node versions below 14 aren't supported by PouchDB).
1 parent 5f59f24 commit 90ea8c1

File tree

41 files changed

+43
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+43
-50
lines changed

bin/build-module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function buildModule(filepath) {
7474
input: path.resolve(filepath, './src/index.js'),
7575
external: depsToSkip,
7676
plugins: rollupPlugins({
77-
jsnext: true,
77+
mainFields: ['module', 'main'],
7878
browser: isBrowser || forceBrowser
7979
})
8080
}).then(function (bundle) {

bin/build-pouchdb.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ function doRollup(input, browser, formatsToFiles) {
7676
input: addPath('pouchdb', input),
7777
external: external,
7878
plugins: rollupPlugins({
79-
jsnext: true,
80-
browser: browser,
81-
main: false // don't use "main"s that are CJS
79+
mainFields: ["module"],
80+
browser: browser
8281
})
8382
}).then(function (bundle) {
8483
return Promise.all(Object.keys(formatsToFiles).map(function (format) {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
},
4040
"dependencies": {
4141
"abort-controller": "3.0.0",
42-
"buffer-from": "1.1.2",
4342
"clone-buffer": "1.0.0",
4443
"double-ended-queue": "2.1.0-0",
4544
"fetch-cookie": "0.11.0",

packages/node_modules/pouchdb-abstract-mapreduce/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"url": "https://github.com/pouchdb/pouchdb.git",
1212
"directory": "packages/node_modules/pouchdb-abstract-mapreduce"
1313
},
14-
"jsnext:main": "./src/index.js"
14+
"module": "./src/index.js"
1515
}

packages/node_modules/pouchdb-adapter-http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"url": "https://github.com/pouchdb/pouchdb.git",
1212
"directory": "packages/node_modules/pouchdb-adapter-http"
1313
},
14-
"jsnext:main": "./src/index.js"
14+
"module": "./src/index.js"
1515
}

packages/node_modules/pouchdb-adapter-idb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"url": "https://github.com/pouchdb/pouchdb.git",
1212
"directory": "packages/node_modules/pouchdb-adapter-idb"
1313
},
14-
"jsnext:main": "./src/index.js"
14+
"module": "./src/index.js"
1515
}

packages/node_modules/pouchdb-adapter-indexeddb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"url": "https://github.com/pouchdb/pouchdb.git",
1212
"directory": "packages/node_modules/pouchdb-adapter-indexeddb"
1313
},
14-
"jsnext:main": "./src/index.js"
14+
"module": "./src/index.js"
1515
}

packages/node_modules/pouchdb-adapter-leveldb-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"url": "https://github.com/pouchdb/pouchdb.git",
1212
"directory": "packages/node_modules/pouchdb-adapter-leveldb-core"
1313
},
14-
"jsnext:main": "./src/index.js",
14+
"module": "./src/index.js",
1515
"browser": {
1616
"./lib/index.js": "./lib/index-browser.js",
1717
"./src/createEmptyBlobOrBuffer.js": "./src/createEmptyBlobOrBuffer-browser.js",

packages/node_modules/pouchdb-adapter-leveldb-core/src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import levelup from 'levelup';
22
import sublevel from 'sublevel-pouchdb';
33
import { obj as through } from 'through2';
44
import Deque from 'double-ended-queue';
5-
import bufferFrom from 'buffer-from'; // ponyfill for Node <6
65
import PouchDB from 'pouchdb-core';
76
import {
87
clone,
@@ -785,7 +784,7 @@ function LevelPouch(opts, callback) {
785784
type: 'put',
786785
prefix: stores.binaryStore,
787786
key: digest,
788-
value: bufferFrom(data, 'binary')
787+
value: Buffer.from(data, 'binary')
789788
}]);
790789
callback();
791790
});

packages/node_modules/pouchdb-adapter-leveldb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
"url": "https://github.com/pouchdb/pouchdb.git",
1515
"directory": "packages/node_modules/pouchdb-adapter-leveldb"
1616
},
17-
"jsnext:main": "./src/index.js"
17+
"module": "./src/index.js"
1818
}

0 commit comments

Comments
 (0)