update dependencies

This commit is contained in:
daniel-j 2019-10-08 11:26:15 +02:00
parent 6cbc71e17b
commit cda5d0c1b3
6 changed files with 10253 additions and 301 deletions

10210
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "fimfic2epub",
"version": "1.7.37",
"version": "1.7.38",
"description": "Tool to generate improved EPUB ebooks from Fimfiction stories",
"author": "djazz",
"license": "MIT",
@ -22,63 +22,63 @@
"LICENSE"
],
"dependencies": {
"canvas": "^2.4.1",
"commander": "^2.20.0",
"canvas": "^2.6.0",
"commander": "^3.0.2",
"crc-32": "^1.2.0",
"detect-node": "^2.0.4",
"elementtree": "^0.1.7",
"escape-string-regexp": "^1.0.5",
"file-type": "^10.10.0",
"escape-string-regexp": "^2.0.0",
"file-type": "^12.3.0",
"fonteditor-core": "^1.0.5",
"html-entities": "^1.2.1",
"html-to-text": "^5.1.1",
"image-size": "^0.7.3",
"is-svg": "^4.1.0",
"jszip": "^3.2.1",
"image-size": "^0.8.3",
"is-svg": "^4.2.0",
"jszip": "^3.2.2",
"match-words": "^1.0.0",
"mithril": "^1.1.6",
"mithril": "^2.0.4",
"mithril-node-render": "^2.3.2",
"node-png": "^0.4.3",
"pretty-data": "^0.40.0",
"request": "^2.88.0",
"sanitize-filename": "^1.6.1",
"syllable": "^3.5.0",
"twemoji": "^12.0.0",
"sanitize-filename": "^1.6.3",
"syllable": "^4.0.0",
"twemoji": "^12.1.3",
"typogr": "^0.6.8",
"url-regex": "^4.1.1",
"url-regex": "^5.0.0",
"zero-fill": "^2.2.3"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@babel/register": "^7.4.0",
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@babel/register": "^7.6.2",
"autosize": "^4.0.2",
"babel-loader": "^8.0.5",
"babel-loader": "^8.0.6",
"binary-loader": "0.0.1",
"del": "^4.1.0",
"eslint": "^5.16.0",
"eslint-plugin-standard": "^4.0.0",
"del": "^5.1.0",
"eslint": "^6.5.1",
"eslint-plugin-standard": "^4.0.1",
"exports-loader": "^0.7.0",
"file-saver": "^2.0.1",
"file-saver": "^2.0.2",
"font-awesome": "4.7.0",
"gulp": "^4.0.0",
"gulp": "^4.0.2",
"gulp-banner": "^0.1.3",
"gulp-change": "^1.0.2",
"gulp-chmod": "^2.0.0",
"gulp-filter": "^5.1.0",
"gulp-json-editor": "^2.5.1",
"gulp-chmod": "^3.0.0",
"gulp-filter": "^6.0.0",
"gulp-json-editor": "^2.5.3",
"gulp-rename": "^1.4.0",
"gulp-standard": "^12.0.0",
"gulp-standard": "^14.0.0",
"gulp-util": "^3.0.8",
"gulp-watch": "^5.0.1",
"gulp-zip": "^4.2.0",
"raw-loader": "^2.0.0",
"regenerator-runtime": "^0.13.2",
"removeNPMAbsolutePaths": "^1.0.4",
"standard": "^12.0.1",
"stylus": "^0.54.5",
"gulp-zip": "^5.0.1",
"raw-loader": "^3.1.0",
"regenerator-runtime": "^0.13.3",
"removeNPMAbsolutePaths": "^2.0.0",
"standard": "^14.3.1",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"webpack": "^4.29.6",
"webpack": "^4.41.0",
"webpack-node-externals": "^1.7.2"
},
"standard": {

View file

@ -31,7 +31,7 @@ const trimWhitespace = /^\s*(<br\s*\/?\s*>)+|(<br\s*\/?\s*>)+\s*$/ig
class FimFic2Epub extends EventEmitter {
static getStoryId (id) {
if (isNaN(id)) {
let url = URL.parse(id, false, true)
let url = URL(id)
if (url.hostname === 'www.fimfiction.net' || url.hostname === 'fimfiction.net') {
let m = url.pathname.match(/^\/story\/(\d+)/)
if (m) {

View file

@ -36,7 +36,9 @@ if (outputStdout) {
}
// use a mock DOM so we can run mithril in nodejs
require('mithril/test-utils/browserMock')(global)
const mock = require('mithril/test-utils/browserMock')(global)
global.requestAnimationFrame = mock.requestAnimationFrame
const htmlToText = require('./utils').htmlToText
const FimFic2Epub = require('./FimFic2Epub').default

View file

@ -8,6 +8,12 @@ import { saveAs } from 'file-saver'
import autosize from 'autosize'
import { htmlToText } from './utils'
m.withAttr = function(attrName, callback, context) {
return function(e) {
callback.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))
}
}
function blobToDataURL (blob) {
return new Promise((resolve, reject) => {
let fr = new FileReader()
@ -172,7 +178,6 @@ let dialog = {
this.coverUrl('')
}
this.coverFile(el.files ? el.files[0] : null)
console.log('files:', el.files)
}
this.setSubjects = function () {

View file

@ -1,265 +0,0 @@
import path from 'path'
import nodeExternals from 'webpack-node-externals'
let inProduction = process.env.NODE_ENV === 'production' || process.argv.indexOf('-p') !== -1
const bundleExtensionConfig = {
entry: {
eventPage: ['./src/eventPage'],
fimfic2epub: ['regenerator-runtime/runtime', './src/main']
},
output: {
path: path.join(__dirname, '/'),
filename: './extension/build/[name].js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/env', {
targets: {
browsers: ['chrome 50', 'firefox 47']
},
modules: false
}]]
}
}
},
{
test: /\.styl$/,
use: ['raw-loader', 'stylus-loader']
},
{
test: /\.ttf$/,
use: 'binary-loader'
}
]
},
resolve: {
extensions: ['.js', '.json', '.styl'],
modules: [
path.resolve('./src'),
'node_modules'
]
},
node: {
fs: 'empty'
},
externals: ['request'],
plugins: [
// new (require('webpack-bundle-analyzer').BundleAnalyzerPlugin)()
],
performance: {
hints: false
},
optimization: {
concatenateModules: inProduction,
minimize: inProduction
},
devtool: 'source-map',
mode: inProduction ? 'production' : 'development'
}
const bundleNpmModuleConfig = {
entry: './src/FimFic2Epub',
output: {
path: path.join(__dirname, '/'),
filename: './dist/fimfic2epub.js',
libraryTarget: 'commonjs2'
},
target: 'node',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
sourceMaps: !inProduction,
presets: [['@babel/env', {
targets: {
node: '8.0.0'
}
}]]
}
}
},
{
test: /\.styl$/,
use: ['raw-loader', 'stylus-loader']
},
{
test: /\.ttf$/,
use: 'binary-loader'
}
]
},
resolve: {
extensions: ['.js', '.json', '.styl', '.node'],
modules: [
path.resolve('./src'),
'node_modules'
]
},
node: {
__dirname: false
},
externals: [nodeExternals({ whitelist: [/^babel-runtime/, /fontawesome-webfont\.ttf/] })],
plugins: [],
performance: {
hints: false
},
optimization: {
concatenateModules: inProduction,
minimize: inProduction
},
devtool: 'nosources-source-map',
mode: inProduction ? 'production' : 'development'
}
const bundleNpmBinaryConfig = {
entry: './src/cli',
output: {
path: path.join(__dirname, '/'),
filename: './build/fimfic2epub.js'
},
target: 'node',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
sourceMaps: !inProduction,
presets: [['@babel/env', {
targets: {
node: '8.0.0'
}
}]]
}
}
}
]
},
resolve: {
extensions: ['.js', '.json', '.node'],
modules: [
path.resolve('./src'),
'node_modules'
]
},
node: {
__dirname: false
},
externals: [nodeExternals(), {
'./FimFic2Epub': 'require(\'../dist/fimfic2epub\')',
'../package.json': 'require(\'../package.json\')'
}],
plugins: [],
performance: {
hints: false
},
optimization: {
concatenateModules: inProduction,
minimize: inProduction
},
devtool: false,
mode: inProduction ? 'production' : 'development'
}
const bundleStaticNpmModuleConfig = {
entry: './src/cli',
output: {
path: path.join(__dirname, '/'),
filename: './build/fimfic2epub-static.js'
},
target: 'node',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
sourceMaps: !inProduction,
presets: [['@babel/env', {
targets: {
node: 'current'
}
}]]
}
}
},
{
test: /\.styl$/,
use: ['raw-loader', 'stylus-loader']
},
{
test: /\.ttf$/,
use: 'binary-loader'
}
]
},
resolve: {
extensions: ['.js', '.json', '.styl', '.node'],
modules: [
path.resolve('./bin'),
'node_modules'
]
},
node: {
__dirname: false
},
plugins: [],
performance: {
hints: false
},
optimization: {
concatenateModules: inProduction,
minimize: inProduction
},
devtool: false,
mode: inProduction ? 'production' : 'development'
}
export default [
bundleExtensionConfig,
bundleNpmModuleConfig,
bundleNpmBinaryConfig,
bundleStaticNpmModuleConfig
]