Upgrade package.json.

pull/406/head
Dessalines 2020-01-06 11:22:51 -05:00
parent 588010ea88
commit 2cb57b833d
11 changed files with 669 additions and 1334 deletions

15
ui/package.json vendored
View File

@ -15,33 +15,32 @@
"@types/autosize": "^3.0.6",
"@types/js-cookie": "^2.2.1",
"@types/jwt-decode": "^2.2.1",
"@types/markdown-it": "^0.0.7",
"@types/markdown-it": "^0.0.9",
"@types/markdown-it-container": "^2.0.2",
"autosize": "^4.0.2",
"bootswatch": "^4.3.1",
"classcat": "^1.1.3",
"dotenv": "^6.1.0",
"dotenv": "^8.2.0",
"emoji-short-name": "^0.1.0",
"husky": "^3.0.9",
"i18next": "^17.0.9",
"i18next": "^19.0.3",
"inferno": "^7.0.1",
"inferno-i18next": "nimbusec-oss/inferno-i18next",
"inferno-router": "^7.0.1",
"js-cookie": "^2.2.0",
"jwt-decode": "^2.2.0",
"markdown-it": "^8.4.2",
"markdown-it": "^10.0.0",
"markdown-it-container": "^2.0.0",
"markdown-it-emoji": "^1.4.0",
"moment": "^2.24.0",
"prettier": "^1.18.2",
"rxjs": "^6.4.0",
"terser": "^3.17.0",
"tributejs": "3.7.2",
"terser": "^4.6.0",
"tributejs": "^4.1.1",
"twemoji": "^12.1.2",
"ws": "^7.0.0"
},
"devDependencies": {
"@types/i18next": "^12.1.0",
"eslint": "^6.5.1",
"eslint-plugin-inferno": "^7.14.3",
"eslint-plugin-jane": "^7.0.0",
@ -58,7 +57,7 @@
"engineStrict": true,
"husky": {
"hooks": {
"pre-commit": "cargo fmt --manifest-path ../server/Cargo.toml && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && lint-staged"
"pre-commit": "cargo fmt --manifest-path ../server/Cargo.toml && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && cargo outdated -R && yarn outdated && lint-staged"
}
},
"lint-staged": {

View File

@ -18,11 +18,11 @@ import {
markdownHelpUrl,
} from '../utils';
import { WebSocketService, UserService } from '../services';
import * as autosize from 'autosize';
import autosize from 'autosize';
import { i18n } from '../i18next';
import { T } from 'inferno-i18next';
import Tribute from 'tributejs/src/Tribute.js';
import * as emojiShortName from 'emoji-short-name';
import emojiShortName from 'emoji-short-name';
interface CommentFormProps {
postId?: number;

View File

@ -25,7 +25,7 @@ import {
pictshareAvatarThumbnail,
showAvatars,
} from '../utils';
import * as moment from 'moment';
import moment from 'moment';
import { MomentTime } from './moment-time';
import { CommentForm } from './comment-form';
import { CommentNodes } from './comment-nodes';

View File

@ -29,7 +29,7 @@ import {
debounce,
isImage,
} from '../utils';
import * as autosize from 'autosize';
import autosize from 'autosize';
import { i18n } from '../i18next';
import { T } from 'inferno-i18next';
@ -107,14 +107,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
}
this.subscription = WebSocketService.Instance.subject
.pipe(
retryWhen(errors =>
errors.pipe(
delay(3000),
take(10)
)
)
)
.pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
.subscribe(
msg => this.parseMessage(msg),
err => console.error(err),

View File

@ -34,7 +34,7 @@ import { PostListings } from './post-listings';
import { Sidebar } from './sidebar';
import { CommentForm } from './comment-form';
import { CommentNodes } from './comment-nodes';
import * as autosize from 'autosize';
import autosize from 'autosize';
import { i18n } from '../i18next';
import { T } from 'inferno-i18next';
@ -76,14 +76,7 @@ export class Post extends Component<any, PostState> {
}
this.subscription = WebSocketService.Instance.subject
.pipe(
retryWhen(errors =>
errors.pipe(
delay(3000),
take(10)
)
)
)
.pipe(retryWhen(errors => errors.pipe(delay(3000), take(10))))
.subscribe(
msg => this.parseMessage(msg),
err => console.error(err),
@ -169,7 +162,6 @@ export class Post extends Component<any, PostState> {
post={this.state.post}
showBody
showCommunity
editable
moderators={this.state.moderators}
admins={this.state.admins}
/>

View File

@ -2,7 +2,7 @@ import { Component, linkEvent } from 'inferno';
import { Site, SiteForm as SiteFormI } from '../interfaces';
import { WebSocketService } from '../services';
import { capitalizeFirstLetter } from '../utils';
import * as autosize from 'autosize';
import autosize from 'autosize';
import { i18n } from '../i18next';
import { T } from 'inferno-i18next';

6
ui/src/i18next.ts vendored
View File

@ -1,4 +1,4 @@
import * as i18n from 'i18next';
import i18next from 'i18next';
import { getLanguage } from './utils';
import { en } from './translations/en';
import { eo } from './translations/eo';
@ -30,7 +30,7 @@ function format(value: any, format: any, lng: any) {
return value;
}
i18n.init({
i18next.init({
debug: false,
// load: 'languageOnly',
@ -43,4 +43,4 @@ i18n.init({
},
});
export { i18n, resources };
export { i18next as i18n, resources };

View File

@ -1,7 +1,7 @@
import * as Cookies from 'js-cookie';
import Cookies from 'js-cookie';
import { User, LoginResponse } from '../interfaces';
import { setTheme } from '../utils';
import * as jwt_decode from 'jwt-decode';
import jwt_decode from 'jwt-decode';
import { Subject } from 'rxjs';
export class UserService {

12
ui/src/utils.ts vendored
View File

@ -17,9 +17,9 @@ import {
SearchType,
} from './interfaces';
import { UserService } from './services/UserService';
import * as markdown_it from 'markdown-it';
import * as markdownitEmoji from 'markdown-it-emoji/light';
import * as markdown_it_container from 'markdown-it-container';
import markdown_it from 'markdown-it';
import markdownitEmoji from 'markdown-it-emoji/light';
import markdown_it_container from 'markdown-it-container';
import * as twemoji from 'twemoji';
import * as emojiShortName from 'emoji-short-name';
@ -58,9 +58,7 @@ export const md = new markdown_it({
if (tokens[idx].nesting === 1) {
// opening tag
return (
'<details><summary>' + md.utils.escapeHtml(m[1]) + '</summary>\n'
);
return `<details><summary> ${md.utils.escapeHtml(m[1])} </summary>\n`;
} else {
// closing tag
return '</details>\n';
@ -266,7 +264,7 @@ export function getLanguage(): string {
}
export function getBrowserLanguage(): string {
return navigator.language || navigator.userLanguage;
return navigator.language;
}
export function getMomentLanguage(): string {

3
ui/tsconfig.json vendored
View File

@ -7,6 +7,7 @@
"jsx": "preserve",
"importHelpers": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"esModuleInterop": true
}
}

1932
ui/yarn.lock vendored

File diff suppressed because it is too large Load Diff