Skip to content

Commit

Permalink
feat(package): move to ES6 with rollup build
Browse files Browse the repository at this point in the history
Also the utility function getUsersUrl(db) has been made available as
part of the plugin API as db.getUsersDatabaseUrl() as it is used in tests.
  • Loading branch information
ptitjes committed Nov 14, 2017
1 parent 3e6ce19 commit b420ad4
Show file tree
Hide file tree
Showing 16 changed files with 181 additions and 4,031 deletions.
45 changes: 45 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{

"extends": "eslint:recommended",

"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},

"env": {
"browser": true,
"node": true,
"mocha": true
},

"globals": {
"Map": true,
"Set": true,
"chrome": true,
"Promise": true,
"Uint8Array": true,
"ArrayBuffer": true,
"FileReaderSync": true,
"sqlitePlugin": true,
"emit": true,
"PouchDB": true,
"should": true,
"assert": true,
"testUtils": true,
"importScripts": true,
"testCases": true
},

"rules": {
"no-empty": 0,
"no-console": 0,
"semi": ["error", "always"],
"curly": ["error", "all"],
"space-unary-ops": ["error", {"words": true}],
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}],
"max-len": ["error", 100, {"ignoreComments": true, "ignoreStrings": true, "ignoreRegExpLiterals": true}],
"keyword-spacing": ["error"],
"space-before-blocks": ["error"]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ coverage
npm-debug.log
test/test-bundle.js
dist
lib
.idea
29 changes: 0 additions & 29 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sudo: false
before_script:
- "npm install add-cors-to-couchdb"
- "./node_modules/.bin/add-cors-to-couchdb"
- "npm run jshint"
- "npm run lint"

script: npm test

Expand Down
7 changes: 7 additions & 0 deletions config/rollup.config.browser.cjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import config from './rollup.config';

export default config({
format: 'cjs',
dest: 'lib/index.browser.js',
browser: true
});
7 changes: 7 additions & 0 deletions config/rollup.config.browser.es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import config from './rollup.config';

export default config({
format: 'es',
dest: 'lib/index.browser.es.js',
browser: true
});
7 changes: 7 additions & 0 deletions config/rollup.config.cjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import config from './rollup.config';

export default config({
format: 'cjs',
dest: 'lib/index.js',
browser: false
});
7 changes: 7 additions & 0 deletions config/rollup.config.es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import config from './rollup.config';

export default config({
format: 'es',
dest: 'lib/index.es.js',
browser: false
});
7 changes: 7 additions & 0 deletions config/rollup.config.iife.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import config from './rollup.config';

export default config({
format: 'iife',
dest: 'dist/pouchdb.authentication.js',
browser: true
});
15 changes: 15 additions & 0 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import buble from 'rollup-plugin-buble';
import replace from 'rollup-plugin-replace';

export default config => {
return {
entry: 'src/index.js',
format: config.format,
moduleName: 'pouchdb_authentication',
dest: config.dest,
plugins: [
buble(),
replace({'process.browser': JSON.stringify(!!config.browser)})
]
};
};
Loading

0 comments on commit b420ad4

Please sign in to comment.