Skip to content

Commit

Permalink
Fix punycode import
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Apr 3, 2021
1 parent 038144b commit 0079714
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 21 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@types/parse5": "6.0.0",
"@types/parsimmon": "1.10.6",
"@types/pug": "2.0.4",
"@types/punycode": "2.1.0",
"@types/qrcode": "1.4.0",
"@types/ratelimiter": "3.4.1",
"@types/redis": "2.8.28",
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/admin/views/instance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
import Vue from 'vue';
import i18n from '../../i18n';
import { url, host } from '../../config';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
import { faHeadset, faShieldAlt, faGhost, faUserPlus, faBolt } from '@fortawesome/free-solid-svg-icons';
import { faEnvelope as farEnvelope } from '@fortawesome/free-regular-svg-icons';
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/acct.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script lang="ts">
import Vue from 'vue';
import { host } from '../../../config';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
export default Vue.extend({
props: ['user', 'detail'],
data() {
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/mention.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
import { host as localHost } from '../../../config';
export default Vue.extend({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
import Vue from 'vue';
import i18n from '../../../../i18n';
import { apiUrl, host } from '../../../../config';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
import { unique } from '../../../../../../prelude/array';
import { faDownload, faUpload, faUnlockAlt, faBoxes, faCogs } from '@fortawesome/free-solid-svg-icons';
import { faSave, faEnvelope } from '@fortawesome/free-regular-svg-icons';
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/signin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import { apiUrl, host } from '../../../config';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
export default Vue.extend({
i18n: i18n('common/views/components/signin.vue'),
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import Vue from 'vue';
import i18n from '../../../i18n';
const getPasswordStrength = require('syuilo-password-strength');
import { host, url } from '../../../config';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
export default Vue.extend({
i18n: i18n('common/views/components/signup.vue'),
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/url.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script lang="ts">
import Vue from 'vue';
import { toUnicode as decodePunycode } from 'punycode';
import { toUnicode as decodePunycode } from 'punycode/';
export default Vue.extend({
props: ['url', 'rel', 'target', 'trim'],
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/directives/autocomplete.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as getCaretCoordinates from 'textarea-caret';
import { toASCII } from 'punycode';
import { toASCII } from 'punycode/';

export default {
bind(el, binding, vn) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/desktop/views/components/post-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import MkVisibilityChooser from '../../../common/views/components/visibility-cho
import XPostFormAttaches from '../../../common/views/components/post-form-attaches.vue';
import XVisibilityIcon from '../../../common/views/components/visibility-icon.vue';
import form from '../../../common/scripts/post-form';
import { toASCII } from 'punycode';
import { toASCII } from 'punycode/';
import extractMentions from '../../../../../misc/extract-mentions';
import { parseBasic } from '../../../../../mfm/parse';
import { host } from '../../../config';
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/desktop/views/pages/welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ import Vue from 'vue';
import i18n from '../../../i18n';
import { host, constants } from '../../../config';
import { concat } from '../../../../../prelude/array';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
export default Vue.extend({
i18n: i18n('desktop/views/pages/welcome.vue'),
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/mobile/views/components/post-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import Vue from 'vue';
import i18n from '../../../i18n';
import { parseBasic } from '../../../../../mfm/parse';
import { host } from '../../../config';
import { toASCII } from 'punycode';
import { toASCII } from 'punycode/';
import extractMentions from '../../../../../misc/extract-mentions';
import XPostFormAttaches from '../../../common/views/components/post-form-attaches.vue';
import XVisibilityIcon from '../../../common/views/components/visibility-icon.vue';
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/mobile/views/pages/welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import Vue from 'vue';
import i18n from '../../../i18n';
import { constants, host } from '../../../config';
import { concat } from '../../../../../prelude/array';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
export default Vue.extend({
i18n: i18n('mobile/views/pages/welcome.vue'),
Expand Down
2 changes: 1 addition & 1 deletion src/mfm/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as P from 'parsimmon';
import { createLeaf, createTree, urlRegex } from './prelude';
import { Predicate } from '../prelude/relation';
import parseAcct from '../misc/acct/parse';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
import { emojiRegex, vendorEmojiRegex, localEmojiRegex } from '../misc/emoji-regex';

export function removeOrphanedBrackets(s: string): string {
Expand Down
2 changes: 1 addition & 1 deletion src/misc/convert-host.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import config from '../config';
import { toUnicode, toASCII } from 'punycode';
import { toUnicode, toASCII } from 'punycode/';
import { URL } from 'url';

export function getFullApAccount(username: string, host: string | null) {
Expand Down
2 changes: 1 addition & 1 deletion src/misc/pack-emojis.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import User from '../models/user';
import Emoji from '../models/emoji';
import { toUnicode, toASCII } from 'punycode';
import { toUnicode, toASCII } from 'punycode/';
import config from '../config';
import { isSelfHost } from './convert-host';
import getDriveFileUrl from './get-drive-file-url';
Expand Down
2 changes: 1 addition & 1 deletion src/queue/processors/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as httpSignature from 'http-signature';
import { IRemoteUser } from '../../models/user';
import perform from '../../remote/activitypub/perform';
import { resolvePerson } from '../../remote/activitypub/models/person';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
import { URL } from 'url';
import Logger from '../../services/logger';
import { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-instance-doc';
Expand Down
2 changes: 1 addition & 1 deletion src/remote/activitypub/models/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { htmlToMfm } from '../misc/html-to-mfm';
import Emoji, { IEmoji } from '../../../models/emoji';
import { extractApMentions } from './mention';
import { extractApHashtags } from './tag';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';
import { unique, toArray, toSingle } from '../../../prelude/array';
import { extractPollFromQuestion } from './question';
import vote from '../../../services/note/polls/vote';
Expand Down
2 changes: 1 addition & 1 deletion src/remote/activitypub/models/person.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as mongo from 'mongodb';
import * as promiseLimit from 'promise-limit';
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';

import config from '../../../config';
import User, { validateUsername, IUser, IRemoteUser, isRemoteUser } from '../../../models/user';
Expand Down
2 changes: 1 addition & 1 deletion src/remote/resolve-user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toUnicode, toASCII } from 'punycode';
import { toUnicode, toASCII } from 'punycode/';
import User, { IUser, IRemoteUser } from '../models/user';
import webFinger from './webfinger';
import config from '../config';
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/common/get-host-lower.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toUnicode } from 'punycode';
import { toUnicode } from 'punycode/';

export default (host: string) => {
if (host == null) return null;
Expand Down
2 changes: 1 addition & 1 deletion src/services/note/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { erase, concat, unique } from '../../prelude/array';
import insertNoteUnread from './unread';
import { registerOrFetchInstanceDoc } from '../register-or-fetch-instance-doc';
import Instance from '../../models/instance';
import { toASCII } from 'punycode';
import { toASCII } from 'punycode/';
import extractMentions from '../../misc/extract-mentions';
import extractEmojis from '../../misc/extract-emojis';
import extractHashtags from '../../misc/extract-hashtags';
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@
resolved "https://registry.yarnpkg.com/@types/pug/-/pug-2.0.4.tgz#8772fcd0418e3cd2cc171555d73007415051f4b2"
integrity sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI=

"@types/punycode@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/punycode/-/punycode-2.1.0.tgz#89e4f3d09b3f92e87a80505af19be7e0c31d4e83"
integrity sha512-PG5aLpW6PJOeV2fHRslP4IOMWn+G+Uq8CfnyJ+PDS8ndCbU+soO+fB3NKCKo0p/Jh2Y4aPaiQZsrOXFdzpcA6g==

"@types/q@^1.5.1":
version "1.5.2"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8"
Expand Down

0 comments on commit 0079714

Please sign in to comment.