begin removing extras
diff --git a/bin/build-pouchdb.js b/bin/build-pouchdb.js index 584bf6e..2705a11 100644 --- a/bin/build-pouchdb.js +++ b/bin/build-pouchdb.js
@@ -3,7 +3,7 @@ 'use strict'; // build just the "pouchdb" package. This build script is different -// from the others due to legacy support (dist/, extras/, etc.). +// from the others due to legacy support (dist/, etc.). var DEV_MODE = process.env.CLIENT === 'dev'; @@ -34,20 +34,6 @@ // these modules should be treated as external by Rollup var external = require('./external-deps'); -var plugins = ['fruitdown', 'localstorage', 'memory']; -var browserExtras = { - 'src/extras/ajax.js': 'ajax-browser.js', - 'src/extras/checkpointer.js': 'checkpointer-browser.js', - 'src/extras/generateReplicationId.js': 'generateReplicationId-browser.js' -}; -var nodeExtras = { - 'src/extras/promise.js': 'promise.js', - 'src/extras/checkpointer.js': 'checkpointer.js', - 'src/extras/generateReplicationId.js': 'generateReplicationId.js', - 'src/extras/ajax.js': 'ajax.js', - 'src/extras/websql.js': 'websql.js' -}; - var currentYear = new Date().getFullYear(); var comments = { @@ -57,33 +43,6 @@ '\n// PouchDB may be freely distributed under the Apache license, ' + 'version 2.0.' + '\n// For all details and documentation:' + - '\n// http://pouchdb.com\n', - - 'memory': '// PouchDB in-memory plugin ' + version + - '\n// Based on MemDOWN: https://github.com/rvagg/memdown' + - '\n// ' + - '\n// (c) 2012-' + currentYear + ' Dale Harvey and the PouchDB team' + - '\n// PouchDB may be freely distributed under the Apache license, ' + - 'version 2.0.' + - '\n// For all details and documentation:' + - '\n// http://pouchdb.com\n', - - 'localstorage': '// PouchDB localStorage plugin ' + version + - '\n// Based on localstorage-down: https://github.com/No9/localstorage-down' + - '\n// ' + - '\n// (c) 2012-' + currentYear + ' Dale Harvey and the PouchDB team' + - '\n// PouchDB may be freely distributed under the Apache license, ' + - 'version 2.0.' + - '\n// For all details and documentation:' + - '\n// http://pouchdb.com\n', - - 'fruitdown': '// PouchDB fruitdown plugin ' + version + - '\n// Based on FruitDOWN: https://github.com/nolanlawson/fruitdown' + - '\n// ' + - '\n// (c) 2012-' + currentYear + ' Dale Harvey and the PouchDB team' + - '\n// PouchDB may be freely distributed under the Apache license, ' + - 'version 2.0.' + - '\n// For all details and documentation:' + '\n// http://pouchdb.com\n' }; @@ -205,40 +164,6 @@ }); } -function buildPluginsForBrowserify() { - return all(plugins.map(function (plugin) { - return doRollup('src/extras/' + plugin + '.js', - 'lib/extras/' + plugin + '.js', true); - })); -} - -function buildNodeExtras() { - return all(Object.keys(nodeExtras).map(function (entry) { - var target = nodeExtras[entry]; - return doRollup(entry, 'lib/extras/' + target); - })); -} - -function buildBrowserExtras() { - return all(Object.keys(browserExtras).map(function (entry) { - var target = browserExtras[entry]; - return doRollup(entry, 'lib/extras/' + target, true); - })); -} - -function buildPluginsForBrowser() { - return all(plugins.map(function (plugin) { - var source = 'lib/extras/' + plugin + '.js'; - return doBrowserify(source, {}, 'pouchdb').then(function (code) { - code = comments[plugin] + code; - return all([ - writeFile('packages/node_modules/pouchdb/dist/pouchdb.' + plugin + '.js', code), - doUglify(code, comments[plugin], 'dist/pouchdb.' + plugin + '.min.js') - ]); - }); - })); -} - function buildPouchDBNext() { return doBrowserify('src/next.js', {standalone: 'PouchDB'}).then(function (code) { return writeFile('packages/node_modules/pouchdb/dist/pouchdb-next.js', code); @@ -264,22 +189,19 @@ }); function doBuildNode() { - return mkdirp('lib/extras') - .then(buildForNode) - .then(buildNodeExtras); + return mkdirp('lib') + .then(buildForNode); } function doBuildDev() { return doAll(buildForNode, buildForBrowserify)() - .then(doAll(buildForBrowser, buildPluginsForBrowserify, buildPouchDBNext)) - .then(buildPluginsForBrowser); + .then(doAll(buildForBrowser, buildPouchDBNext)); } function doBuildAll() { - return rimrafMkdirp('lib', 'dist', 'lib/extras') + return rimrafMkdirp('lib', 'dist') .then(doAll(buildForNode, buildForBrowserify)) - .then(doAll(buildForBrowser, buildPluginsForBrowserify, buildPouchDBNext)) - .then(doAll(buildPluginsForBrowser, buildNodeExtras, buildBrowserExtras)); + .then(doAll(buildForBrowser, buildPouchDBNext)); } function doBuild() {
diff --git a/tests/extras/test.extras.js b/tests/extras/test.extras.js deleted file mode 100644 index 7ce1479..0000000 --- a/tests/extras/test.extras.js +++ /dev/null
@@ -1,42 +0,0 @@ -'use strict'; - -var should = require('chai').should(); - -describe('test.extras.js', function () { - - it('extras/ajax should exist', function () { - var ajax = require('../../packages/node_modules/pouchdb/extras/ajax'); - should.exist(ajax); - ajax.should.be.a('function'); - ajax.name.should.equal('ajax'); - }); - - it('extras/checkpointer should exist', function () { - var checkpointer = require('../../packages/node_modules/pouchdb/extras/checkpointer'); - should.exist(checkpointer); - checkpointer.should.be.a('function'); - checkpointer.name.should.equal('Checkpointer'); - }); - - it('extras/promise should exist', function () { - var promise = require('../../packages/node_modules/pouchdb/extras/promise'); - should.exist(promise); - promise.should.be.a('function'); - promise.name.should.equal('Promise'); - }); - - it('extras/generateReplicationId should exist', function () { - var genReplicationId = require( - '../../packages/node_modules/pouchdb/extras/generateReplicationId'); - should.exist(genReplicationId); - genReplicationId.should.be.a('function'); - genReplicationId.name.should.equal('generateReplicationId'); - }); - - it('plugin extras should exist', function () { - require('../../packages/node_modules/pouchdb/extras/memory').should.be.a('object'); - require('../../packages/node_modules/pouchdb/extras/localstorage').should.be.a('object'); - require('../../packages/node_modules/pouchdb/extras/fruitdown').should.be.a('object'); - }); - -}); \ No newline at end of file
diff --git a/tests/integration/utils.js b/tests/integration/utils.js index 1a3107e..c19f8fd 100644 --- a/tests/integration/utils.js +++ b/tests/integration/utils.js
@@ -354,7 +354,8 @@ // test WebSQL in Node // (the two strings are just to fool Browserify because sqlite3 fails // in Node 0.11-0.12) - require('../../packages/node_modules/' + 'pouchdb/extras/websql'); + global.PouchDB.plugin(require('../../packages/node_modules/' + + 'pouchdb-adapter-node-websql')) global.PouchDB.preferredAdapters = ['websql', 'leveldb']; global.PouchDB = global.PouchDB.defaults({ prefix: path.resolve('./tmp/_pouch_')
diff --git a/tests/performance/index.js b/tests/performance/index.js index 6dfbeec..d9c8799 100644 --- a/tests/performance/index.js +++ b/tests/performance/index.js
@@ -56,7 +56,8 @@ if (!process.browser) { // the two strings are to fool Browserify, because this test // fails in Node 0.11-0.12 due to sqlite3 being incompatible - require('../../packages/node_modules/' + 'pouchdb/extras/websql'); + global.PouchDB.plugin(require('../../packages/node_modules/' + + 'pouchdb-adapter-node-websql')) } runTestSuites(PouchDB); }