This commit is contained in:
antelle 2020-11-19 18:43:50 +01:00
parent 5d29b79dab
commit 543a71f6f2
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
7 changed files with 4283 additions and 5177 deletions

View File

@ -50,7 +50,8 @@
"import/first": "error",
"import/no-namespace": "error",
"import/no-default-export": "error",
"babel/no-unused-expressions": "error"
"babel/no-unused-expressions": "error",
"node/no-callback-literal": "off"
},
"parserOptions": {
"sourceType": "module",

View File

@ -246,7 +246,7 @@ module.exports = function (grunt) {
algo: 'sha512',
expected: {
style: 1,
script: 3
script: 2
}
},
app: {

View File

@ -72,7 +72,6 @@
/>
<link rel="manifest" href="manifest.json" />
<link rel="stylesheet" href="css/app.css?__inline=true" />
<script src="js/vendor.js?__inline=true"></script>
<script src="js/app.js?__inline=true"></script>
<script src="js/runtime.js?__inline=true"></script>
</head>

View File

@ -167,9 +167,7 @@ const AutoType = {
} else {
if (!windowInfo.url) {
// try to find a URL in the title
const urlMatcher = new RegExp(
'https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)'
);
const urlMatcher = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\\+.~#?&\/=]*)/;
const urlMatches = urlMatcher.exec(windowInfo.title);
windowInfo.url = urlMatches && urlMatches.length > 0 ? urlMatches[0] : null;
}

View File

@ -3,7 +3,6 @@ const fs = require('fs');
const webpack = require('webpack');
const StringReplacePlugin = require('string-replace-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
@ -24,18 +23,7 @@ function config(options) {
return {
mode,
entry: {
app: ['babel-helpers', 'app', 'main.scss'],
vendor: [
'jquery',
'morphdom',
'kdbxweb',
'baron',
'pikaday',
'jsqrcode',
'argon2-wasm',
'argon2',
'marked'
]
app: ['babel-helpers', 'app', 'main.scss']
},
output: {
path: path.resolve('.', 'tmp'),
@ -75,6 +63,18 @@ function config(options) {
'public-key-new.pem': path.join(rootDir, 'app/resources/public-key-new.pem'),
'demo.kdbx': path.join(rootDir, 'app/resources/Demo.kdbx'),
svg: path.join(rootDir, 'app/resources/svg')
},
fallback: {
console: false,
process: false,
crypto: false,
Buffer: false,
__filename: false,
__dirname: false,
fs: false,
setImmediate: false,
path: false,
moment: false
}
},
module: {
@ -82,12 +82,16 @@ function config(options) {
{
test: /\.hbs$/,
use: [
StringReplacePlugin.replace({
replacements: [{ pattern: /\r?\n\s*/g, replacement: () => '\n' }]
}),
{
loader: 'string-replace-loader',
options: {
search: /\r?\n\s*/g,
replace: '\n'
}
},
{
loader: 'handlebars-loader',
query: {
options: {
knownHelpers: fs
.readdirSync(path.join(rootDir, 'app/scripts/hbs-helpers'))
.map((f) => f.replace('.js', ''))
@ -106,33 +110,36 @@ function config(options) {
},
{
test: /runtime-info\.js$/,
loader: StringReplacePlugin.replace({
replacements: [
loader: 'string-replace-loader',
options: {
multiple: [
{
pattern: /@@VERSION/g,
replacement: () => pkg.version + (options.beta ? '-beta' : '')
search: /@@VERSION/g,
replace: pkg.version + (options.beta ? '-beta' : '')
},
{
pattern: /@@BETA/g,
replacement: () => (options.beta ? '1' : '')
search: /@@BETA/g,
replace: options.beta ? '1' : ''
},
{ pattern: /@@DATE/g, replacement: () => dt },
{ search: /@@DATE/g, replace: dt },
{
pattern: /@@COMMIT/g,
replacement: () => options.sha
search: /@@COMMIT/g,
replace: options.sha
},
{ pattern: /@@DEVMODE/g, replacement: () => (devMode ? '1' : '') }
{ search: /@@DEVMODE/g, replace: devMode ? '1' : '' }
]
})
}
},
{
test: /baron(\.min)?\.js$/,
use: [
StringReplacePlugin.replace({
replacements: [
{ pattern: /\(1,\s*eval\)\('this'\)/g, replacement: () => 'window' }
]
}),
{
loader: 'string-replace-loader',
options: {
search: /\(1,\s*eval\)\('this'\)/g,
replace: 'window'
}
},
{
loader: 'exports-loader',
options: { type: 'module', exports: 'default baron' }
@ -149,7 +156,7 @@ function config(options) {
test: /\.js$/,
exclude: /(node_modules|babel-helpers\.js)/,
loader: 'babel-loader',
query: { cacheDirectory: true }
options: { cacheDirectory: true }
},
{ test: /argon2\.wasm/, type: 'javascript/auto', loader: 'base64-loader' },
{ test: /argon2(\.min)?\.js/, loader: 'raw-loader' },
@ -175,15 +182,6 @@ function config(options) {
optimization: {
runtimeChunk: 'single',
minimize: !devMode,
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all'
}
}
},
minimizer: [
new TerserPlugin({
extractComments: 'never-extract-comments',
@ -221,21 +219,13 @@ function config(options) {
babelHelpers: 'babel-helpers'
}),
new webpack.IgnorePlugin(/^(moment)$/),
new StringReplacePlugin(),
new MiniCssExtractPlugin({
filename: 'css/[name].css'
})
],
node: {
console: false,
process: false,
crypto: false,
Buffer: false,
__filename: false,
__dirname: false,
fs: false,
setImmediate: false,
path: false
__dirname: false
},
externals: {
xmldom: 'null',

9274
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,42 +10,43 @@
"url": "https://github.com/keeweb/keeweb"
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-external-helpers": "^7.10.1",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/core": "^7.12.3",
"@babel/plugin-external-helpers": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@keeweb/keeweb-native-modules": "https://github.com/keeweb/keeweb-native-modules/releases/download/0.4.1/keeweb-native-modules.tgz",
"adm-zip": "^0.4.14",
"argon2-browser": "1.13.0",
"autoprefixer": "^9.8.0",
"adm-zip": "^0.4.16",
"argon2-browser": "1.15.2",
"autoprefixer": "^10.0.2",
"babel-cli": "^6.26.0",
"babel-eslint": "^10.1.0",
"babel-loader": "8.1.0",
"babel-loader": "8.2.1",
"baron": "3.0.3",
"base64-inline-loader": "^1.1.1",
"base64-loader": "1.0.0",
"bourbon": "^7.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"dompurify": "^2.0.15",
"css-loader": "^5.0.1",
"dompurify": "^2.2.2",
"electron": "^11.0.1",
"electron-builder": "^22.7.0",
"electron-builder": "^22.9.1",
"electron-notarize": "^1.0.0",
"electron-osx-sign": "^0.4.17",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.21.2",
"electron-osx-sign": "^0.5.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.1",
"exports-loader": "1.0.0",
"eslint-plugin-standard": "4.1.0",
"exports-loader": "1.1.1",
"font-awesome": "4.7.0",
"fs-extra": "^9.0.1",
"grunt": "1.1.0",
"grunt": "1.3.0",
"grunt-chmod": "^1.1.1",
"grunt-contrib-clean": "2.0.0",
"grunt-contrib-compress": "github:keeweb/grunt-contrib-compress#08966cd",
@ -58,7 +59,7 @@
"grunt-gitinfo": "github:keeweb/grunt-gitinfo#b61aaed",
"grunt-inline-alt": "github:keeweb/grunt-inline-alt#ec9f6ad",
"grunt-string-replace": "1.3.1",
"grunt-webpack": "3.1.3",
"grunt-webpack": "4.0.2",
"handlebars": "^4.7.6",
"handlebars-loader": "1.7.1",
"html-minifier": "4.0.0",
@ -69,36 +70,37 @@
"kdbxweb": "1.10.0",
"load-grunt-tasks": "5.1.0",
"lodash": "^4.17.20",
"marked": "^1.1.1",
"mini-css-extract-plugin": "^0.9.0",
"mocha": "^8.1.3",
"marked": "^1.2.5",
"mini-css-extract-plugin": "^1.3.1",
"mocha": "^8.2.1",
"morphdom": "^2.6.1",
"node-sass": "^4.14.1",
"node-stream-zip": "1.11.3",
"node-sass": "^5.0.0",
"node-stream-zip": "1.12.0",
"normalize.css": "8.0.1",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"pikaday": "1.8.0",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"pikaday": "1.8.2",
"pkcs11-smartcard-sign": "^1.0.1",
"postcss-loader": "^3.0.0",
"prettier": "^2.0.5",
"puppeteer": "^3.3.0",
"raw-loader": "^4.0.1",
"postcss": "^8.1.8",
"postcss-loader": "^4.1.0",
"prettier": "^2.1.2",
"puppeteer": "^5.5.0",
"raw-loader": "^4.0.2",
"run-remote-task": "^0.5.0",
"sass-loader": "^8.0.2",
"sass-loader": "^10.1.0",
"stats-webpack-plugin": "0.7.0",
"string-replace-webpack-plugin": "0.1.3",
"string-replace-loader": "^3.0.1",
"strip-sourcemap-loader": "0.0.1",
"sumchecker": "^3.0.1",
"terser-webpack-plugin": "^3.0.3",
"terser-webpack-plugin": "^5.0.3",
"time-grunt": "2.0.0",
"url-loader": "^4.1.0",
"webpack": "^4.43.0",
"webpack-bundle-analyzer": "^3.8.0",
"url-loader": "^4.1.1",
"webpack": "^5.6.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-dev-server": "^3.11.0"
},
"optionalDependencies": {
"grunt-appdmg": "github:keeweb/grunt-appdmg#874ad83",
"keytar": "^6.0.1"
"keytar": "^7.1.0"
},
"scripts": {
"start": "grunt",