update: run npm update and reformat code accordingly

This commit is contained in:
Xymorot 2020-04-10 05:02:19 +02:00
parent 052a9c3a34
commit 8fb0b1375e
43 changed files with 794 additions and 862 deletions

View File

@ -1,10 +1,10 @@
const fs = require('fs');
const path = require('path');
const templating = require('./templates');
const webpackConfig = require('./webpack.config');
const { watch } = require('chokidar');
const { debounce } = require('lodash');
const minimist = require('minimist');
const templating = require('./templates');
const webpackConfig = require('./webpack.config');
/** @type {Object} */
const argv = minimist(process.argv);

1516
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -44,53 +44,53 @@
"electron-squirrel-startup": "^1.0.0",
"fs-extra": "^8.1.0",
"inversify": "^5.0.1",
"jsdom": "^16.2.0",
"minimist": "^1.2.0",
"jsdom": "^16.2.2",
"minimist": "^1.2.5",
"node-fetch": "^2.6.0",
"reflect-metadata": "^0.1.13",
"sqlite3": "^4.1.1",
"typeorm": "^0.2.21",
"uuid": "^7.0.1"
"uuid": "^7.0.3"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.50",
"@electron-forge/maker-squirrel": "^6.0.0-beta.50",
"@types/chai": "^4.2.10",
"@types/chai": "^4.2.11",
"@types/fs-extra": "^8.1.0",
"@types/jsdom": "^16.1.0",
"@types/jsdom": "^16.2.0",
"@types/minimist": "^1.2.0",
"@types/mocha": "^7.0.2",
"@types/node": "^12.12.29",
"@types/node": "^12.12.35",
"@types/node-fetch": "^2.5.5",
"@types/sinon": "^7.5.2",
"@types/uuid": "^7.0.0",
"@types/webpack": "^4.41.7",
"@typescript-eslint/eslint-plugin": "^2.22.0",
"@typescript-eslint/parser": "^2.22.0",
"@types/uuid": "^7.0.2",
"@types/webpack": "^4.41.10",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"chai": "^4.2.0",
"chokidar": "^3.3.1",
"concurrently": "^5.1.0",
"electron": "^8.0.3",
"electron-rebuild": "^1.10.0",
"electron": "^8.2.1",
"electron-rebuild": "^1.10.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"fast-check": "^1.23.0",
"handlebars": "^4.7.3",
"husky": "^4.2.3",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.2",
"fast-check": "^1.24.1",
"handlebars": "^4.7.6",
"husky": "^4.2.5",
"lodash": "^4.17.15",
"mocha": "^7.1.0",
"nock": "^12.0.2",
"nyc": "^15.0.0",
"mocha": "^7.1.1",
"nock": "^12.0.3",
"nyc": "^15.0.1",
"prettier": "^1.19.1",
"rewiremock": "^3.13.9",
"sinon": "^9.0.0",
"sinon": "^9.0.2",
"spectron": "^10.0.1",
"svelte": "^3.19.1",
"svelte": "^3.20.1",
"svelte-loader": "^2.13.6",
"ts-loader": "^6.2.1",
"ts-loader": "^6.2.2",
"typescript": "^3.8.3",
"webpack": "^4.42.0",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"
},
"repository": "https://git.fuwafuwa.moe/Xymorot/RenaiApp",

View File

@ -1,10 +1,10 @@
import 'reflect-metadata';
import { Container } from 'inversify';
import { MainAppWindow } from '../modules/app-window/main-app-window';
import { NhentaiApi } from '../modules/nhentai/nhentai-api';
import { NhentaiIpcServer } from '../modules/nhentai/nhentai-ipc-server';
import { Session } from '../modules/session/session';
import { WebCrawler } from '../modules/web-crawler/web-crawler';
import { Container } from 'inversify';
export const container = new Container({ defaultScope: 'Singleton' });

View File

@ -1,7 +1,7 @@
import path from 'path';
import { appPath } from './app-path';
import { Connection, createConnection as ormCreateConnection } from 'typeorm';
import { SqliteConnectionOptions } from 'typeorm/driver/sqlite/SqliteConnectionOptions';
import { appPath } from './app-path';
export enum Databases {
LIBRARY = 'library',

View File

@ -1,5 +1,5 @@
import { Author } from './author';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Author } from './author';
@Entity()
export class AuthorName implements IIdentifiableEntity, INameEntity {

View File

@ -1,5 +1,5 @@
import { AuthorRole } from './author-role';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { AuthorRole } from './author-role';
@Entity()
export class AuthorRoleName implements IIdentifiableEntity, INameEntity {

View File

@ -1,6 +1,6 @@
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { AuthorRoleName } from './author-role-name';
import { WorkAuthor } from './work-author';
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes the role an author has in a work.

View File

@ -1,6 +1,6 @@
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { AuthorName } from './author-name';
import { WorkAuthor } from './work-author';
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity represents a single real-world entity, be it a person or named group of persons.

View File

@ -1,7 +1,7 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { PercentCheck } from '../decorators/percent-check';
import { Tag } from './tag';
import { WorkCharacter } from './work-character';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This tag entity tags a character in a work.

View File

@ -1,5 +1,5 @@
import { Collection } from './collection';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Collection } from './collection';
@Entity()
export class CollectionName implements IIdentifiableEntity, INameEntity {

View File

@ -1,6 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Collection } from './collection';
import { Work } from './work';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity orders works in a collection.

View File

@ -1,6 +1,6 @@
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { CollectionName } from './collection-name';
import { CollectionPart } from './collection-part';
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* A collection is a set of works.

View File

@ -1,6 +1,6 @@
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Source } from './source';
import { Work } from './work';
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* A copy is the digital counterpart of a work.

View File

@ -1,7 +1,7 @@
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { PercentCheck } from '../decorators/percent-check';
import { Tag } from './tag';
import { WorkCharacter } from './work-character';
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This tag entity tags an interaction between two characters.

View File

@ -1,5 +1,5 @@
import { Work } from './work';
import { Entity, ManyToMany, PrimaryColumn } from 'typeorm';
import { Work } from './work';
/**
* This entity is non-user-maintained and describes a language.

View File

@ -1,5 +1,5 @@
import { Site } from './site';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Site } from './site';
@Entity()
export class SiteName implements IIdentifiableEntity, INameEntity {

View File

@ -1,6 +1,6 @@
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { SiteName } from './site-name';
import { Source } from './source';
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This non-user-maintained entity describes an online provider of works which can be scraped.

View File

@ -1,6 +1,6 @@
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Copy } from './copy';
import { Site } from './site';
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes an external source of a copy, in most cases that is a website.

View File

@ -1,5 +1,5 @@
import { Tag } from './tag';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Tag } from './tag';
@Entity()
export class TagName implements IIdentifiableEntity, INameEntity {

View File

@ -1,8 +1,8 @@
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { CharacterTag } from './character-tag';
import { InteractionTag } from './interaction-tag';
import { TagName } from './tag-name';
import { WorkTag } from './work-tag';
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity is the main tag entity.

View File

@ -1,5 +1,5 @@
import { TransformationType } from './transformation-type';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { TransformationType } from './transformation-type';
@Entity()
export class TransformationTypeName implements IIdentifiableEntity, INameEntity {

View File

@ -1,6 +1,6 @@
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { Transformation } from './transformation';
import { TransformationTypeName } from './transformation-type-name';
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes a transformation type.

View File

@ -1,6 +1,6 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { TransformationType } from './transformation-type';
import { Work } from './work';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes how one work is transformed to another.

View File

@ -1,7 +1,7 @@
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Author } from './author';
import { AuthorRole } from './author-role';
import { Work } from './work';
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity connects authors with their work and their role therein.

View File

@ -1,5 +1,5 @@
import { WorkCharacter } from './work-character';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { WorkCharacter } from './work-character';
@Entity()
export class WorkCharacterName implements IIdentifiableEntity, INameEntity {

View File

@ -1,9 +1,9 @@
import { Column, Entity, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { CharacterTag } from './character-tag';
import { InteractionTag } from './interaction-tag';
import { Work } from './work';
import { WorkCharacterName } from './work-character-name';
import { WorldCharacter } from './world-character';
import { Column, Entity, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes a character in a work.

View File

@ -1,5 +1,5 @@
import { Work } from './work';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Work } from './work';
@Entity()
export class WorkName implements IIdentifiableEntity, INameEntity {

View File

@ -1,7 +1,7 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { PercentCheck } from '../decorators/percent-check';
import { Tag } from './tag';
import { Work } from './work';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
/**
* This tag entity tags a work.

View File

@ -1,3 +1,4 @@
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { PercentCheck } from '../decorators/percent-check';
import { CollectionPart } from './collection-part';
import { Copy } from './copy';
@ -8,7 +9,6 @@ import { WorkCharacter } from './work-character';
import { WorkName } from './work-name';
import { WorkTag } from './work-tag';
import { World } from './world';
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This is the main library entity.

View File

@ -1,5 +1,5 @@
import { WorldCharacter } from './world-character';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { WorldCharacter } from './world-character';
@Entity()
export class WorldCharacterName implements IIdentifiableEntity, INameEntity {

View File

@ -1,7 +1,7 @@
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { WorkCharacter } from './work-character';
import { World } from './world';
import { WorldCharacterName } from './world-character-name';
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes a canon character in a fictional world.

View File

@ -1,5 +1,5 @@
import { World } from './world';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { World } from './world';
@Entity()
export class WorldName implements IIdentifiableEntity, INameEntity {

View File

@ -1,7 +1,7 @@
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { Work } from './work';
import { WorldCharacter } from './world-character';
import { WorldName } from './world-name';
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
/**
* This entity describes a fictional world.

View File

@ -1,7 +1,7 @@
import { BrowserWindow } from 'electron';
import os from 'os';
import { IAppWindow } from './i-app-window';
import { injectable } from 'inversify';
import { IAppWindow } from './i-app-window';
import BrowserWindowConstructorOptions = Electron.BrowserWindowConstructorOptions;
let defaultOptions = {

View File

@ -1,5 +1,5 @@
import { AppWindow } from './app-window';
import { injectable } from 'inversify';
import { AppWindow } from './app-window';
@injectable()
export class MainAppWindow extends AppWindow {

View File

@ -1,9 +1,9 @@
import { Errors, RenaiError } from '../../core/error';
import { IWebCrawler } from '../web-crawler/i-web-crawler';
import { INhentaiApi } from './i-nhentai-api';
import { inject, injectable } from 'inversify';
import { JSDOM } from 'jsdom';
import { RequestInit, Response } from 'node-fetch';
import { Errors, RenaiError } from '../../core/error';
import { IWebCrawler } from '../web-crawler/i-web-crawler';
import { INhentaiApi } from './i-nhentai-api';
const domain = 'nhentai.net';
const url = `https://${domain}/`;

View File

@ -1,6 +1,6 @@
import { inject, injectable } from 'inversify';
import { IpcServer } from '../ipc/ipc-server';
import { INhentaiApi } from './i-nhentai-api';
import { inject, injectable } from 'inversify';
@injectable()
export class NhentaiIpcServer extends IpcServer {

View File

@ -1,7 +1,7 @@
import { session } from 'electron';
import { injectable } from 'inversify';
import { isDev } from '../../core/dev';
import { ISession } from './i-session';
import { injectable } from 'inversify';
import OnHeadersReceivedListenerDetails = Electron.OnHeadersReceivedListenerDetails;
@injectable()

View File

@ -1,6 +1,6 @@
import path from 'path';
import { appPath } from '../../core/app-path';
import fs from 'fs-extra';
import { appPath } from '../../core/app-path';
export const enum StoreKeys {
'COOKIES' = 'cookies',

View File

@ -1,9 +1,9 @@
import { Errors, RenaiError } from '../../core/error';
import { load, save, StoreKeys } from '../store/store';
import { IWebCrawler } from './i-web-crawler';
import { injectable } from 'inversify';
import { CookieJar } from 'jsdom';
import nodeFetch, { RequestInit, Response } from 'node-fetch';
import { Errors, RenaiError } from '../../core/error';
import { load, save, StoreKeys } from '../store/store';
import { IWebCrawler } from './i-web-crawler';
@injectable()
export class WebCrawler implements IWebCrawler {

View File

@ -1,5 +1,5 @@
import * as api from './api';
import { writable } from 'svelte/store';
import * as api from './api';
const { subscribe, set } = writable<boolean>(false);

View File

@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');
const packageJson = require('../package');
const handlebars = require('handlebars');
const packageJson = require('../package');
function compile(isDevMode = false) {
const dataPath = path.resolve(__dirname, 'data.json');