Replace the bower dependencies with NPM dependencies

Signed-off-by: Tao Wang <twang2218@gmail.com>
pull/946/head
Tao Wang 2018-06-21 00:53:57 +10:00
parent b121958686
commit 48fcdd7a6c
11 changed files with 7216 additions and 3143 deletions

View File

@ -45,8 +45,8 @@ module.exports = function(grunt) {
const webpackConfig = {
entry: {
app: 'app',
vendor: ['jquery', 'underscore', 'backbone', 'kdbxweb', 'baron', 'pikaday', 'filesaver', 'qrcode',
'argon2-wasm', 'argon2']
vendor: ['jquery', 'underscore', 'backbone', 'kdbxweb', 'baron', 'pikaday', 'file-saver', 'jsqrcode',
'argon2-wasm', 'argon2-browser']
},
output: {
path: path.resolve('.', 'tmp/js'),
@ -60,20 +60,10 @@ module.exports = function(grunt) {
progress: false,
failOnError: true,
resolve: {
modules: [path.join(__dirname, 'app/scripts'), path.join(__dirname, 'bower_components')],
modules: [path.join(__dirname, 'app/scripts'), path.join(__dirname, 'node_modules')],
alias: {
backbone: 'backbone/backbone-min.js',
underscore: 'underscore/underscore-min.js',
_: 'underscore/underscore-min.js',
jquery: 'jquery/dist/jquery.min.js',
hbs: path.resolve(__dirname, 'node_modules', 'handlebars/runtime.js'),
kdbxweb: 'kdbxweb/dist/kdbxweb.js',
baron: 'baron/baron.min.js',
pikaday: 'pikaday/pikaday.js',
filesaver: 'FileSaver.js/FileSaver.min.js',
qrcode: 'jsqrcode/dist/qrcode.min.js',
'argon2-wasm': 'argon2-browser/docs/dist/argon2.wasm',
'argon2': 'argon2-browser/docs/dist/argon2.min.js',
hbs: 'handlebars/runtime.js',
'argon2-wasm': 'argon2-browser/dist/argon2.wasm',
templates: path.join(__dirname, 'app/templates')
}
},
@ -95,7 +85,7 @@ module.exports = function(grunt) {
{ test: /baron(\.min)?\.js$/, loader: 'exports-loader?baron; delete window.baron;' },
{ test: /pikaday\.js$/, loader: 'uglify-loader' },
{ test: /handlebars/, loader: 'strip-sourcemap-loader' },
{ test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel-loader',
{ test: /\.js$/, exclude: /(node_modules)/, loader: 'babel-loader',
query: { presets: ['es2015'], cacheDirectory: true }
},
{ test: /\.json$/, loader: 'json-loader' },
@ -143,10 +133,6 @@ module.exports = function(grunt) {
}
}
},
'bower-install-simple': {
install: {
}
},
clean: {
dist: ['dist', 'tmp'],
desktop: ['tmp/desktop', 'dist/desktop'],
@ -192,7 +178,7 @@ module.exports = function(grunt) {
nonull: true
},
fonts: {
src: 'bower_components/font-awesome/fonts/fontawesome-webfont.*',
src: 'node_modules/font-awesome/fonts/fontawesome-webfont.*',
dest: 'tmp/fonts/',
nonull: true,
expand: true,
@ -260,7 +246,7 @@ module.exports = function(grunt) {
sass: {
options: {
sourceMap: false,
includePaths: ['./bower_components']
includePaths: ['./node_modules']
},
dist: {
files: {
@ -685,7 +671,6 @@ module.exports = function(grunt) {
grunt.registerTask('build-web-app', [
'gitinfo',
'bower-install-simple',
'clean',
'eslint',
'copy:html',

View File

@ -4,7 +4,7 @@ const Locale = require('../util/locale');
const Logger = require('../util/logger');
const FeatureDetector = require('../util/feature-detector');
const Otp = require('../util/otp');
const QrCode = require('qrcode');
const QrCode = require('jsqrcode');
const logger = new Logger('otp-qr-reader');

View File

@ -7,8 +7,8 @@ const Libs = {
kdbxweb: require('kdbxweb'),
hbs: require('hbs'),
pikaday: require('pikaday'),
filesaver: require('filesaver'),
qrcode: require('qrcode')
filesaver: require('file-saver'),
qrcode: require('jsqrcode')
};
const PluginApi = {

View File

@ -30,7 +30,7 @@ const KdbxwebInit = {
const loadTimeout = setTimeout(() => reject('timeout'), 5000);
try {
const ts = logger.ts();
const argon2LoaderCode = require('argon2');
const argon2LoaderCode = require('argon2-browser');
const wasmBinaryBase64 = require('argon2-wasm');
const KB = 1024 * 1024;

View File

@ -29,7 +29,7 @@ const Format = require('../../util/format');
const Locale = require('../../util/locale');
const Tip = require('../../util/tip');
const Timeouts = require('../../const/timeouts');
const FileSaver = require('filesaver');
const FileSaver = require('file-saver');
const DetailsView = Backbone.View.extend({
template: require('templates/details/details.hbs'),

View File

@ -10,7 +10,7 @@ const Format = require('../../util/format');
const Locale = require('../../util/locale');
const UrlUtil = require('../../util/url-util');
const kdbxweb = require('kdbxweb');
const FileSaver = require('filesaver');
const FileSaver = require('file-saver');
const DefaultBackupPath = 'Backups/{name}.{date}.bak';
const DefaultBackupSchedule = '1w';

View File

@ -1,7 +1,7 @@
@import "../bower_components/normalize.css/normalize";
@import "../bower_components/font-awesome/scss/font-awesome";
@import "../bower_components/pikaday/scss/pikaday";
@import "../bower_components/bourbon/app/assets/stylesheets/bourbon";
@import "../node_modules/normalize.css/normalize";
@import "../node_modules/font-awesome/scss/font-awesome";
@import "../node_modules/pikaday/scss/pikaday";
@import "../node_modules/bourbon/app/assets/stylesheets/bourbon";
@import "themes/all-themes";

View File

@ -1,37 +0,0 @@
{
"name": "keeweb",
"authors": [
"Antelle <antelle.net@gmail.com>"
],
"description": "Free cross-platform password manager compatible with KeePass",
"main": "app/index.html",
"moduleType": [
"amd"
],
"keywords": [
"keepass"
],
"license": "MIT",
"homepage": "https://github.com/keeweb/keeweb",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"private": true,
"dependencies": {
"backbone": "1.3.3",
"baron": "2.2.2",
"bourbon": "4.2.7",
"font-awesome": "4.7.0",
"kdbxweb": "1.2.2",
"normalize.css": "5.0.0",
"pikaday": "1.5.1",
"FileSaver.js": "eligrey/FileSaver.js#1.3.3",
"jquery": "3.1.1",
"jsqrcode": "antelle/jsqrcode#0.1.3",
"argon2-browser": "1.2.0"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "1.6.0",
"version": "1.6.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

10257
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,14 @@
},
"dependencies": {},
"devDependencies": {
"argon2-browser": "1.3.0",
"babel-core": "6.25.0",
"babel-loader": "7.0.0",
"babel-preset-es2015": "6.24.1",
"backbone": "1.3.3",
"baron": "2.2.2",
"base64-loader": "1.0.0",
"bourbon": "4.2.7",
"cssnano": "3.10.0",
"electron": "^1.7.9",
"eslint": "^3.19.0",
@ -24,9 +28,10 @@
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "3.0.1",
"exports-loader": "0.6.4",
"file-saver": "1.3.3",
"font-awesome": "4.7.0",
"get-folder-size": "1.0.0",
"grunt": "1.0.1",
"grunt-bower-install-simple": "1.2.4",
"grunt-concurrent": "2.3.1",
"grunt-contrib-clean": "1.1.0",
"grunt-contrib-compress": "1.4.3",
@ -46,10 +51,15 @@
"handlebars": "4.0.10",
"handlebars-loader": "1.5.0",
"html-minifier": "3.5.2",
"jquery": "3.1.1",
"json-loader": "^0.5.4",
"jsqrcode": "github:antelle/jsqrcode#0.1.3",
"kdbxweb": "1.2.2",
"load-grunt-tasks": "3.5.2",
"node-sass": "^4.5.3",
"node-stream-zip": "1.3.7",
"normalize.css": "5.0.0",
"pikaday": "1.5.1",
"pkcs15-smartcard-sign": "^1.0.0",
"raw-loader": "0.5.1",
"stats-webpack-plugin": "0.6.0",