diff --git a/package.json b/package.json index b604c75f9..954a8cc62 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "@types/parsimmon": "1.10.6", "@types/portscanner": "2.1.0", "@types/pug": "2.0.4", + "@types/punycode": "2.1.0", "@types/qrcode": "1.4.0", "@types/random-seed": "0.3.3", "@types/ratelimiter": "3.4.1", diff --git a/src/client/components/global/acct.vue b/src/client/components/global/acct.vue index a969636a7..e3601ff79 100644 --- a/src/client/components/global/acct.vue +++ b/src/client/components/global/acct.vue @@ -7,7 +7,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import { host } from '@client/config'; export default defineComponent({ diff --git a/src/client/components/global/url.vue b/src/client/components/global/url.vue index c89536ebd..f68a3c00b 100644 --- a/src/client/components/global/url.vue +++ b/src/client/components/global/url.vue @@ -22,7 +22,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; import { faExternalLinkSquareAlt } from '@fortawesome/free-solid-svg-icons'; -import { toUnicode as decodePunycode } from 'punycode'; +import { toUnicode as decodePunycode } from 'punycode/'; import { url as local } from '@client/config'; import { isDeviceTouch } from '@client/scripts/is-device-touch'; import * as os from '@client/os'; diff --git a/src/client/components/mention.vue b/src/client/components/mention.vue index 322e56d95..b9bd6b320 100644 --- a/src/client/components/mention.vue +++ b/src/client/components/mention.vue @@ -16,7 +16,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import { host as localHost } from '@client/config'; import { wellKnownServices } from '../../well-known-services'; import * as os from '@client/os'; diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index 13e5c0f43..765824b2a 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -56,7 +56,7 @@ import { faReply, faQuoteRight, faPaperPlane, faTimes, faUpload, faPollH, faGlob import { faEyeSlash, faLaughSquint } from '@fortawesome/free-regular-svg-icons'; import insertTextAtCursor from 'insert-text-at-cursor'; import { length } from 'stringz'; -import { toASCII } from 'punycode'; +import { toASCII } from 'punycode/'; import XNotePreview from './note-preview.vue'; import * as mfm from 'mfm-js'; import { host, url } from '@client/config'; diff --git a/src/client/components/signin.vue b/src/client/components/signin.vue index 120da63f3..b9d8fe6a7 100755 --- a/src/client/components/signin.vue +++ b/src/client/components/signin.vue @@ -48,7 +48,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import { faLock, faGavel } from '@fortawesome/free-solid-svg-icons'; import { faTwitter, faDiscord, faGithub } from '@fortawesome/free-brands-svg-icons'; import MkButton from './ui/button.vue'; diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue index 1ce9fc278..66d01213b 100644 --- a/src/client/components/signup.vue +++ b/src/client/components/signup.vue @@ -55,7 +55,7 @@ import { defineComponent, defineAsyncComponent } from 'vue'; import { faLock, faExclamationTriangle, faSpinner, faCheck, faKey } from '@fortawesome/free-solid-svg-icons'; const getPasswordStrength = require('syuilo-password-strength'); -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import { host, url } from '@client/config'; import MkButton from './ui/button.vue'; import MkInput from './ui/input.vue'; diff --git a/src/client/pages/advanced-theme-editor.vue b/src/client/pages/advanced-theme-editor.vue index fb00c8c8a..e1bd0ebc0 100644 --- a/src/client/pages/advanced-theme-editor.vue +++ b/src/client/pages/advanced-theme-editor.vue @@ -94,7 +94,7 @@ import { defineComponent } from 'vue'; import { faPalette, faChevronDown, faKeyboard } from '@fortawesome/free-solid-svg-icons'; import * as JSON5 from 'json5'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import MkRadio from '@client/components/ui/radio.vue'; import MkButton from '@client/components/ui/button.vue'; diff --git a/src/client/pages/theme-editor.vue b/src/client/pages/theme-editor.vue index 5ee0a704b..a28510dcd 100644 --- a/src/client/pages/theme-editor.vue +++ b/src/client/pages/theme-editor.vue @@ -52,7 +52,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; import { faPalette, faSave, faEye, faCode } from '@fortawesome/free-solid-svg-icons'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import * as tinycolor from 'tinycolor2'; import { v4 as uuid} from 'uuid'; import * as JSON5 from 'json5'; diff --git a/src/client/pages/welcome.entrance.a.vue b/src/client/pages/welcome.entrance.a.vue index 9a24f868b..01b303831 100644 --- a/src/client/pages/welcome.entrance.a.vue +++ b/src/client/pages/welcome.entrance.a.vue @@ -53,7 +53,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; import { faEllipsisH, faInfoCircle, faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import XSigninDialog from '@client/components/signin-dialog.vue'; import XSignupDialog from '@client/components/signup-dialog.vue'; import MkButton from '@client/components/ui/button.vue'; diff --git a/src/client/pages/welcome.entrance.b.vue b/src/client/pages/welcome.entrance.b.vue index 6e93f1740..d8622e4d8 100644 --- a/src/client/pages/welcome.entrance.b.vue +++ b/src/client/pages/welcome.entrance.b.vue @@ -37,7 +37,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; import { faEllipsisH, faInfoCircle, faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import XSigninDialog from '@client/components/signin-dialog.vue'; import XSignupDialog from '@client/components/signup-dialog.vue'; import MkButton from '@client/components/ui/button.vue'; diff --git a/src/client/pages/welcome.entrance.c.vue b/src/client/pages/welcome.entrance.c.vue index cefe239da..4e4c0ed21 100644 --- a/src/client/pages/welcome.entrance.c.vue +++ b/src/client/pages/welcome.entrance.c.vue @@ -57,7 +57,7 @@ <script lang="ts"> import { defineComponent } from 'vue'; import { faEllipsisH, faInfoCircle, faQuestionCircle } from '@fortawesome/free-solid-svg-icons'; -import { toUnicode } from 'punycode'; +import { toUnicode } from 'punycode/'; import XSigninDialog from '@client/components/signin-dialog.vue'; import XSignupDialog from '@client/components/signup-dialog.vue'; import MkButton from '@client/components/ui/button.vue'; diff --git a/src/client/scripts/autocomplete.ts b/src/client/scripts/autocomplete.ts index eab893a38..99c54c69c 100644 --- a/src/client/scripts/autocomplete.ts +++ b/src/client/scripts/autocomplete.ts @@ -1,6 +1,6 @@ import { Ref, ref } from 'vue'; import * as getCaretCoordinates from 'textarea-caret'; -import { toASCII } from 'punycode'; +import { toASCII } from 'punycode/'; import { popup } from '@client/os'; export class Autocomplete { diff --git a/src/client/ui/chat/post-form.vue b/src/client/ui/chat/post-form.vue index e5f4132c4..9dd87edac 100644 --- a/src/client/ui/chat/post-form.vue +++ b/src/client/ui/chat/post-form.vue @@ -52,7 +52,7 @@ import { faReply, faQuoteRight, faPaperPlane, faTimes, faUpload, faPollH, faGlob import { faEyeSlash, faLaughSquint } from '@fortawesome/free-regular-svg-icons'; import insertTextAtCursor from 'insert-text-at-cursor'; import { length } from 'stringz'; -import { toASCII } from 'punycode'; +import { toASCII } from 'punycode/'; import * as mfm from 'mfm-js'; import { host, url } from '@client/config'; import { erase, unique } from '../../../prelude/array'; diff --git a/src/misc/convert-host.ts b/src/misc/convert-host.ts index f8957a64a..7b0b0acf1 100644 --- a/src/misc/convert-host.ts +++ b/src/misc/convert-host.ts @@ -1,6 +1,6 @@ import { URL } from 'url'; import config from '@/config'; -import { toASCII } from 'punycode'; +import { toASCII } from 'punycode/'; export function getFullApAccount(username: string, host: string | null) { return host ? `${username}@${toPuny(host)}` : `${username}@${toPuny(config.host)}`; diff --git a/yarn.lock b/yarn.lock index 02fcf960d..5c27f8ce0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -917,6 +917,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"