Upgrade package.json.

This commit is contained in:
Dessalines 2020-01-06 11:22:51 -05:00
parent 8c4e973409
commit 82253f625b
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/autosize": "^3.0.6",
"@types/js-cookie": "^2.2.1", "@types/js-cookie": "^2.2.1",
"@types/jwt-decode": "^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", "@types/markdown-it-container": "^2.0.2",
"autosize": "^4.0.2", "autosize": "^4.0.2",
"bootswatch": "^4.3.1", "bootswatch": "^4.3.1",
"classcat": "^1.1.3", "classcat": "^1.1.3",
"dotenv": "^6.1.0", "dotenv": "^8.2.0",
"emoji-short-name": "^0.1.0", "emoji-short-name": "^0.1.0",
"husky": "^3.0.9", "husky": "^3.0.9",
"i18next": "^17.0.9", "i18next": "^19.0.3",
"inferno": "^7.0.1", "inferno": "^7.0.1",
"inferno-i18next": "nimbusec-oss/inferno-i18next", "inferno-i18next": "nimbusec-oss/inferno-i18next",
"inferno-router": "^7.0.1", "inferno-router": "^7.0.1",
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"jwt-decode": "^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-container": "^2.0.0",
"markdown-it-emoji": "^1.4.0", "markdown-it-emoji": "^1.4.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"prettier": "^1.18.2", "prettier": "^1.18.2",
"rxjs": "^6.4.0", "rxjs": "^6.4.0",
"terser": "^3.17.0", "terser": "^4.6.0",
"tributejs": "3.7.2", "tributejs": "^4.1.1",
"twemoji": "^12.1.2", "twemoji": "^12.1.2",
"ws": "^7.0.0" "ws": "^7.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/i18next": "^12.1.0",
"eslint": "^6.5.1", "eslint": "^6.5.1",
"eslint-plugin-inferno": "^7.14.3", "eslint-plugin-inferno": "^7.14.3",
"eslint-plugin-jane": "^7.0.0", "eslint-plugin-jane": "^7.0.0",
@ -58,7 +57,7 @@
"engineStrict": true, "engineStrict": true,
"husky": { "husky": {
"hooks": { "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": { "lint-staged": {

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@ import { Component, linkEvent } from 'inferno';
import { Site, SiteForm as SiteFormI } from '../interfaces'; import { Site, SiteForm as SiteFormI } from '../interfaces';
import { WebSocketService } from '../services'; import { WebSocketService } from '../services';
import { capitalizeFirstLetter } from '../utils'; import { capitalizeFirstLetter } from '../utils';
import * as autosize from 'autosize'; import autosize from 'autosize';
import { i18n } from '../i18next'; import { i18n } from '../i18next';
import { T } from 'inferno-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 { getLanguage } from './utils';
import { en } from './translations/en'; import { en } from './translations/en';
import { eo } from './translations/eo'; import { eo } from './translations/eo';
@ -30,7 +30,7 @@ function format(value: any, format: any, lng: any) {
return value; return value;
} }
i18n.init({ i18next.init({
debug: false, debug: false,
// load: 'languageOnly', // 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 { User, LoginResponse } from '../interfaces';
import { setTheme } from '../utils'; import { setTheme } from '../utils';
import * as jwt_decode from 'jwt-decode'; import jwt_decode from 'jwt-decode';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
export class UserService { export class UserService {

12
ui/src/utils.ts vendored
View File

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

3
ui/tsconfig.json vendored
View File

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

1932
ui/yarn.lock vendored

File diff suppressed because it is too large Load Diff