Skip to content

Commit

Permalink
chord: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
noe132 committed Dec 23, 2021
1 parent 54bbeda commit befd43e
Show file tree
Hide file tree
Showing 15 changed files with 1,482 additions and 1,421 deletions.
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,66 +27,66 @@
"author": "noe132",
"license": "MIT",
"dependencies": {
"@babel/runtime-corejs3": "^7.16.3",
"@babel/runtime-corejs3": "^7.16.5",
"base64-arraybuffer": "^1.0.1",
"eslint": "^8.2.0",
"eslint": "^8.5.0",
"fp-ts": "^2.11.5",
"io-ts": "^2.2.16",
"md5": "^2.3.0",
"resize-observer-polyfill": "^1.5.1",
"tailwindcss": "^2.2.19",
"typescript": "^4.5.2",
"tailwindcss": "^3.0.7",
"typescript": "^4.5.4",
"uuid": "^8.3.2",
"vue": "^3.2.14"
},
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/plugin-transform-runtime": "^7.16.4",
"@babel/preset-env": "^7.16.4",
"@babel/core": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@noe132/eslint-config-vue": "^0.1.1",
"@types/greasemonkey": "^4.0.2",
"@types/jest": "^27.0.3",
"@types/md5": "^2.3.1",
"@types/node": "^16.11.8",
"@types/node": "^17.0.3",
"@types/rimraf": "^3.0.2",
"@types/tampermonkey": "^4.0.5",
"@types/uuid": "^8.3.3",
"@vue/babel-plugin-jsx": "^1.1.1",
"@vue/compiler-sfc": "^3.2.22",
"@vue/compiler-sfc": "^3.2.26",
"autoprefixer": "^10.4.0",
"babel-loader": "^8.2.3",
"babel-plugin-polyfill-corejs3": "^0.4.0",
"cache-loader": "^4.1.0",
"chalk": "^4.1.2",
"cross-env": "^7.0.3",
"css-loader": "^6.5.1",
"cssnano": "^5.0.11",
"cssnano": "^5.0.14",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"express": "^4.17.1",
"fork-ts-checker-webpack-plugin": "^6.4.0",
"jest": "^27.3.1",
"postcss": "^8.3.11",
"postcss-loader": "^6.2.0",
"postcss-preset-env": "^7.0.0",
"express": "^4.17.2",
"fork-ts-checker-webpack-plugin": "^6.5.0",
"jest": "^27.4.5",
"postcss": "^8.4.5",
"postcss-loader": "^6.2.1",
"postcss-preset-env": "^7.1.0",
"progress-bar-webpack-plugin": "^2.1.0",
"raw-loader": "^4.0.2",
"rimraf": "^3.0.2",
"sass": "^1.43.4",
"sass-loader": "^12.3.0",
"sass": "^1.45.1",
"sass-loader": "^12.4.0",
"speed-measure-webpack-plugin": "^1.5.0",
"stats-webpack-plugin": "^0.7.0",
"string-replace-loader": "^3.0.3",
"string-replace-loader": "^3.1.0",
"thread-loader": "^3.0.4",
"ts-jest": "^27.0.7",
"ts-jest": "^27.1.2",
"ts-loader": "^9.2.6",
"ts-node": "^10.4.0",
"vue-loader": "^16.8.1",
"webpack": "^5.64.1",
"webpack": "^5.65.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-chain": "^6.5.1",
"webpack-cli": "^4.9.1",
"webpack-dev-middleware": "^5.2.2",
"webpack-dev-server": "^4.5.0"
"webpack-dev-middleware": "^5.3.0",
"webpack-dev-server": "^4.7.1"
}
}
1 change: 1 addition & 0 deletions src/assets/styles/tailwind.sass
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@tailwind base
@tailwind utilities
2 changes: 1 addition & 1 deletion src/components/IconRadioGroup/IconRadioGroup.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="icon-radio flex select-none">
<div
class="icon-box flex relative p-2 flex-grow-0"
class="icon-box flex relative p-2 grow-0"
v-for="icon of props.icons"
:key="icon.key"
@click="handleSelect(icon.key)"
Expand Down
2 changes: 1 addition & 1 deletion src/components/radio/radio.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="radio flex justify-center flex-grow-0 select-none cursor-pointer mr-4 mt-1 mb-1"
class="radio flex justify-center grow-0 select-none cursor-pointer mr-4 mt-1 mb-1"
@click="handleClick"
>
<div class="icon relative mr-2" :class="{ checked: checked }">
Expand Down
5 changes: 2 additions & 3 deletions src/provider/BaiduTranslate/playAudio.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { stringify } from 'querystring'
import { isRight } from 'fp-ts/lib/Either'
import { audioCacheService } from '~/service/audioCache'
import { got } from '~/util/gmapi'
Expand All @@ -9,10 +8,10 @@ export const playAudio = async (word: string, tl: string) => {
const query = {
lan: tl,
text: word,
spd: tl === 'zh' ? 5 : 3,
spd: tl === 'zh' ? '5' : '3',
source: 'web',
}
const url = `https://fanyi.baidu.com/gettts?${stringify(query)}`
const url = `https://fanyi.baidu.com/gettts?${new URLSearchParams(query).toString()}`

if (audioCacheService.play(url, volume)) {
return
Expand Down
8 changes: 4 additions & 4 deletions src/provider/BaiduTranslate/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/>

<div class="flex mt-6 pt-1">
<div class="flex-col items-start flex-grow-0 pr-12">
<div class="flex-col items-start grow-0 pr-12">
<div class="text-grey-600 pr-6 mb-2">语言</div>
<div
class="language-option text-16 text-grey-600 mb-2"
Expand All @@ -20,10 +20,10 @@
{{ n.text }}
</div>
</div>
<div class="flex-col items-center flex-grow-0">
<div class="flex-col items-center grow-0">
<div class="text-grey-600 pr-6 mb-1">首选语言</div>
<i-radio-group
class="mt-0 flex-grow-0"
class="mt-0 grow-0"
v-model="form.targetLanguage"
>
<i-radio
Expand All @@ -34,7 +34,7 @@
/>
</i-radio-group>
</div>
<div class="flex-col items-center flex-grow-0">
<div class="flex-col items-center grow-0">
<div class="text-grey-600 pr-6 mb-1">备选语言</div>
<i-radio-group
class="mt-0"
Expand Down
7 changes: 3 additions & 4 deletions src/provider/BaiduTranslate/translate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { stringify } from 'querystring'
import { isRight, left, right } from 'fp-ts/lib/Either'
import { BAIDU_LANGUAGES } from '~/provider/BaiduTranslate/baiduLanguages'
import { got } from '~/util/gmapi'
Expand All @@ -18,7 +17,7 @@ const detectLang = async (word: string): Promise<BAIDU_LANGUAGES> => {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
url: 'https://fanyi.baidu.com/langdetect',
data: stringify(formdata),
data: new URLSearchParams(formdata).toString(),
timeout: 5000,
})
if (isRight(response)) {
Expand All @@ -43,7 +42,7 @@ const fetchTranslation = async ({ word, sl, tl }: { word: string, sl: string, tl
to: tl,
query: word,
transtype: 'translang',
simple_means_flag: 3,
simple_means_flag: '3',
sign: token.sign,
token: token.token,
}
Expand All @@ -56,7 +55,7 @@ const fetchTranslation = async ({ word, sl, tl }: { word: string, sl: string, tl
'User-Agent': window.navigator.userAgent,
},
url: 'https://fanyi.baidu.com/v2transapi',
data: stringify(query),
data: new URLSearchParams(query).toString(),
timeout: 5000,
})

Expand Down
3 changes: 1 addition & 2 deletions src/provider/GoogleDict/translate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { stringify } from 'querystring'
import { isLeft, left, right } from 'fp-ts/lib/Either'
import { got } from '~/util/gmapi'
import { containerData } from './container/data'
Expand All @@ -25,7 +24,7 @@ const fetchGoogleDict = async (word: string, lang: string = 'uk') => {
// key: 'AIzaSyC9PDwo2wgENKuI8DSFOfqFqKP2cKAxxso',
key: 'AIzaSyA6EEtrDCfBkHV8uU2lgGY-N383ZgAOo7Y',
}
const apiUrl = `${apiUrlBase}${stringify(query)}`
const apiUrl = `${apiUrlBase}${new URLSearchParams(query).toString()}`

const response = await got({
method: 'GET',
Expand Down
5 changes: 2 additions & 3 deletions src/provider/GoogleTranslate/playAudio.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { stringify } from 'querystring'
import { isLeft, isRight, left, right } from 'fp-ts/lib/Either'
import { decode } from 'base64-arraybuffer'

Expand Down Expand Up @@ -34,12 +33,12 @@ export const playAudio = async (word: string, tl: string) => {
'Cache-Control': 'max-age=0',
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
},
data: stringify({
data: new URLSearchParams({
'f.req': req,
...getToken ? {} : {
at: GoogleTranslateProvider.store.xsrfToken,
},
}),
}).toString(),
timeout: 5000,
// responseType: '', // force auto json parse
} as any)
Expand Down
8 changes: 4 additions & 4 deletions src/provider/GoogleTranslate/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</p>

<div class="flex mt-6 pt-1">
<div class="flex-col items-start flex-grow-0 pr-12">
<div class="flex-col items-start grow-0 pr-12">
<div class="text-grey-600 pr-6 mb-2">语言</div>
<div
class="language-option text-16 text-grey-600 mb-2"
Expand All @@ -38,10 +38,10 @@
{{ n.text }}
</div>
</div>
<div class="flex-col items-center flex-grow-0">
<div class="flex-col items-center grow-0">
<div class="text-grey-600 pr-6 mb-1">首选语言</div>
<i-radio-group
class="mt-0 flex-grow-0"
class="mt-0 grow-0"
v-model="form.targetLanguage"
>
<i-radio
Expand All @@ -52,7 +52,7 @@
/>
</i-radio-group>
</div>
<div class="flex-col items-center flex-grow-0">
<div class="flex-col items-center grow-0">
<div class="text-grey-600 pr-6 mb-1">备选语言</div>
<i-radio-group
class="mt-0"
Expand Down
5 changes: 2 additions & 3 deletions src/provider/GoogleTranslate/translate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { stringify } from 'querystring'
import { isLeft, left, right } from 'fp-ts/lib/Either'

import { got } from '~/util/gmapi'
Expand Down Expand Up @@ -42,12 +41,12 @@ const getGoogleTranslateResult = async (p: GoogleTranslateParams) => {
'Cache-Control': 'max-age=0',
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
},
data: stringify({
data: new URLSearchParams({
'f.req': req,
...getToken ? {} : {
at: store.data.xsrfToken,
},
}),
}).toString(),
timeout: 5000,
// responseType: '', // force auto json parse
} as any)
Expand Down
3 changes: 1 addition & 2 deletions src/provider/UrbanDictionary/translate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { stringify } from 'querystring'
import { isLeft, left, right } from 'fp-ts/lib/Either'

import { got } from '~/util/gmapi'
Expand All @@ -14,7 +13,7 @@ interface UrbanDictionaryParams {
export const translate = async ({ word }: UrbanDictionaryParams) => {
try {
/* https://api.urbandictionary.com/v0/define?term={word} */
const url = `https://api.urbandictionary.com/v0/define?${stringify({ term: word })}`
const url = `https://api.urbandictionary.com/v0/define?${new URLSearchParams({ term: word }).toString()}`

const response = await got({
method: 'GET',
Expand Down
16 changes: 8 additions & 8 deletions src/view/SettingPage/subpage/coreSetting/coreSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

<foldable :fold="!form.icibaCircleRightClick">
<div class="flex mt-6">
<div class="flex-col flex-grow-0 pr-12">
<div class="flex-col grow-0 pr-12">
<div class="text-grey-600 pr-6 mb-2">接口</div>
<div
class="option-item text-16 text-grey-600 mb-2"
Expand All @@ -63,10 +63,10 @@
{{ n.label }}
</div>
</div>
<div class="flex-col items-center flex-grow-0">
<div class="flex-col items-center grow-0">
<div class="text-grey-600 pr-6 mb-1">默认接口</div>
<i-radio-group
class="mt-0 flex-grow-0"
class="mt-0 grow-0"
v-model="form.defaultProvider"
>
<i-radio
Expand All @@ -77,7 +77,7 @@
/>
</i-radio-group>
</div>
<div class="flex-col items-center flex-grow-0">
<div class="flex-col items-center grow-0">
<div class="text-grey-600 pr-6 mb-1">备选接口</div>
<i-radio-group
class="mt-0"
Expand Down Expand Up @@ -154,7 +154,7 @@
<div class="flex self-stretch items-center mr-1 mt-6">
<div class="mr-4 text-grey-600">{{ form.icibaCircleSize }}px</div>
<i-slider
class="flex-grow"
class="grow"
:min="10"
:max="30"
:step="1"
Expand All @@ -173,15 +173,15 @@
</div>
<div class="flex-col justify-around flex-auto">
<i-slider
class="flex-grow"
class="grow"
:min="0"
:max="30"
v-model="form.icibaCircleOffsetX"
thumb-label
/>

<i-slider
class="flex-grow"
class="grow"
:min="0"
:max="30"
v-model="form.icibaCircleOffsetY"
Expand All @@ -199,7 +199,7 @@
<div class="flex items-center mr-1 mt-6 self-stretch">
<div class="mr-4 text-grey-600">{{ form.icibaMainWidth }}px</div>
<i-slider
class="flex-grow"
class="grow"
:min="200"
:max="500"
:step="10"
Expand Down
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const colors = require('./utils/color-palette')

module.exports = {
mode: 'jit',
purge: {
content: {
layers: ['utilities'],
content: [
'./src/**/*.vue',
Expand All @@ -14,6 +13,7 @@ module.exports = {
textOpacity: false,
backgroundOpacity: false,
borderOpacity: false,
preflight: false,
},
theme: {
screens: false,
Expand Down
Loading

0 comments on commit befd43e

Please sign in to comment.