Skip to content

Commit

Permalink
Upgrade package.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines committed Jan 6, 2020
1 parent 8c4e973 commit 82253f6
Show file tree
Hide file tree
Showing 11 changed files with 666 additions and 1,331 deletions.
15 changes: 7 additions & 8 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/comment-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/comment-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
11 changes: 2 additions & 9 deletions ui/src/components/post-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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),
Expand Down
12 changes: 2 additions & 10 deletions ui/src/components/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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}
/>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/site-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 3 additions & 3 deletions ui/src/i18next.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -30,7 +30,7 @@ function format(value: any, format: any, lng: any) {
return value;
}

i18n.init({
i18next.init({
debug: false,
// load: 'languageOnly',

Expand All @@ -43,4 +43,4 @@ i18n.init({
},
});

export { i18n, resources };
export { i18next as i18n, resources };
4 changes: 2 additions & 2 deletions ui/src/services/UserService.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
12 changes: 5 additions & 7 deletions ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -266,7 +264,7 @@ export function getLanguage(): string {
}

export function getBrowserLanguage(): string {
return navigator.language || navigator.userLanguage;
return navigator.language;
}

export function getMomentLanguage(): string {
Expand Down
3 changes: 2 additions & 1 deletion ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"jsx": "preserve",
"importHelpers": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"esModuleInterop": true
}
}
Loading

0 comments on commit 82253f6

Please sign in to comment.