Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Dec 2, 2023
1 parent 98436dd commit 8d64709
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 78 deletions.
2 changes: 1 addition & 1 deletion cli/upload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ const run = async () => {
}
}

run()
await run()
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"deep-keys": "^0.5.0",
"execa": "^6.1.0",
"ora": "^6.1.2",
"xo": "^0.52.3"
"xo": "^0.56.0"
},
"xo": {
"prettier": true,
Expand All @@ -40,6 +40,7 @@
],
"rules": {
"unicorn/prefer-module": 0,
"unicorn/prefer-node-protocol": 0,
"import/extensions": 0,
"ava/no-ignored-test-files": 0,
"camelcase": 0,
Expand Down
68 changes: 31 additions & 37 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
{
"description": "项目配置文件。",
"setting": {
"urlCheck": true,
"es6": true,
"postcss": false,
"minified": false,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.10.4",
"appid": "wx6158518b2441ab8d",
"projectname": "%E5%B0%8F%E9%A5%ADPro",
"miniprogramRoot": "src/",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
"description": "项目配置文件。",
"setting": {
"urlCheck": true,
"es6": true,
"postcss": false,
"minified": false,
"newFeature": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.10.4",
"appid": "wx6158518b2441ab8d",
"projectname": "%E5%B0%8F%E9%A5%ADPro",
"miniprogramRoot": "src/",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {},
"srcMiniprogramRoot": "src/",
"packOptions": {
"ignore": [],
"include": []
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}
19 changes: 12 additions & 7 deletions src/components/feeds-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const audio = require('../utils/audio')
const vibrate = require('../utils/vibrate')

function loadMore(page, url, para) {
// eslint-disable-next-line unicorn/prefer-at
const maxId = page.data.feeds_arr.slice(-1)[0].slice(-1)[0].id
if (
page.data.noMore ||
Expand Down Expand Up @@ -148,10 +149,13 @@ function isTimeline(url) {
case '/users/friends':
case '/users/followers':
case '/direct_messages/conversation_list':
case '/direct_messages/conversation':
case '/direct_messages/conversation': {
return true
default:
}

default: {
return false
}
}
}

Expand Down Expand Up @@ -202,8 +206,9 @@ function blockFilter(url, result) {
return result
}

default:
default: {
return result
}
}
}

Expand Down Expand Up @@ -380,13 +385,13 @@ function _postText(page, parameter, success) {
const image = parameter.repost_status_id
? '/assets/toast_repost.png'
: parameter.in_reply_to_status_id
? '/assets/toast_reply.png'
: '/assets/toast_post.png'
? '/assets/toast_reply.png'
: '/assets/toast_post.png'
const title = parameter.repost_status_id
? i18n.feed.reposted
: parameter.in_reply_to_status_id
? i18n.feed.replied
: i18n.feed.published
? i18n.feed.replied
: i18n.feed.published
ff.postPromise('/statuses/update', parameter)
.then((result) => {
page.setData({posting: false})
Expand Down
1 change: 0 additions & 1 deletion src/components/tab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const ff = require('../utils/fanfou')

const {CONSUMER_KEY} = require('../config/fanfou')

function render() {
Expand Down
23 changes: 17 additions & 6 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,34 @@ const DEFAULT_LANG = enUS
let lang = DEFAULT_LANG

switch (langCode) {
case 'en':
case 'en': {
lang = enUS
break
case 'zh_CN':
}

case 'zh_CN': {
lang = zhCN
break
case 'zh_HK':
}

case 'zh_HK': {
lang = zhHK
break
case 'zh_TW':
}

case 'zh_TW': {
lang = zhTW
break
case 'es':
}

case 'es': {
lang = esES
break
default:
}

default: {
break
}
}

module.exports = lang
3 changes: 2 additions & 1 deletion src/mixins/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ module.exports = {
break
}

default:
default: {
break
}
}
},
})
Expand Down
11 changes: 8 additions & 3 deletions src/mixins/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ module.exports = {

const txt = event.currentTarget.dataset.value
switch (txt.type) {
case 'at':
case 'at': {
fm.showUser(null, txt.id)
break
case 'tag':
}

case 'tag': {
fm.navigateTo(`../feeds/feeds?q=${txt.query}`)
break
default:
}

default: {
// Link
this.handleLink(txt.link)
}
}
},
tapID(event) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about/about.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<import src="/components/templates.wxml" />
<view style="padding-top: {{statusBarHeight}}px;">
<view style="padding-top: {{statusBarHeight}}px;"/>
<view class="section" style="padding: 18px;margin-top: 0;background: #fff;">
<view>小饭是一款微信小程序饭否客户端。</view>
<view style="margin-top: 18px;">
Expand Down
18 changes: 13 additions & 5 deletions src/pages/userprofile/userprofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,37 @@ const getShisTimeline = (page, user) => {
let shisTimelineArray = null
let shisTimeline = null
switch (i18n.lang) {
case 'zhCN':
case 'zhCN': {
shisTimelineArray = [she, he, she_he]
break
default:
}

default: {
shisTimelineArray = [her, his, her_his]
break
}
}

let [h0, h1, h2] = shisTimelineArray
switch (user.gender) {
case '女':
case '女': {
shisTimeline = h0 + timeline
break
case '男':
}

case '男': {
shisTimeline = h1 + timeline
break
default:
}

default: {
if (h2 === 'TA') {
h2 += ' '
}

shisTimeline = h2 + timeline
break
}
}

page.setData({shisTimeline})
Expand Down
45 changes: 31 additions & 14 deletions src/utils/fanfou-sdk-node/src/fanfou.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const {OAUTH_DOMAIN, API_DOMAIN} = require('../../../config/fanfou')

const qs = require('../modules/querystring/index')
const oauthSignature = require('../modules/oauth-signature/index')
const OAuth = require('./oauth')
Expand Down Expand Up @@ -121,7 +120,7 @@ class Fanfou {
}
const signature = oauthSignature.generate(
method,
url.replace(/https/, 'http').replace(/fanfou\.pro/, 'fanfou.com'),
url.replace('https', 'http'),
parameters_,
this.consumer_secret,
tokens.oauth_token_secret,
Expand All @@ -136,8 +135,8 @@ class Fanfou {
uri === '/photos/upload'
? 'photo'
: uri === '/account/update_profile_image'
? 'image'
: 'file'
? 'image'
: 'file'
wx.uploadFile({
url,
filePath: filePaths[0],
Expand Down Expand Up @@ -213,21 +212,30 @@ class Fanfou {
for (const i in data) {
if (data[i]) {
switch (type) {
case 'timeline':
case 'timeline': {
array.push(new Status(data[i]))
break
case 'users':
}

case 'users': {
array.push(new User(data[i]))
break
case 'conversation':
}

case 'conversation': {
array.push(new DirectMessage(data[i]))
break
case 'conversation-list':
}

case 'conversation-list': {
data[i].dm = new DirectMessage(data[i].dm)
array.push(data[i])
break
default:
}

default: {
break
}
}
}
}
Expand All @@ -240,16 +248,25 @@ class Fanfou {
case 'timeline':
case 'users':
case 'conversation':
case 'conversation-list':
case 'conversation-list': {
return Fanfou._parseList(data, type)
case 'status':
}

case 'status': {
return new Status(data)
case 'user':
}

case 'user': {
return new User(data)
case 'dm':
}

case 'dm': {
return new DirectMessage(data)
default:
}

default: {
return data
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/fanfou-sdk-node/src/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Photo {
this.imageurl = photo.imageurl
this.thumburl = photo.thumburl
this.largeurl = photo.largeurl
// eslint-disable-next-line unicorn/prefer-string-replace-all
this.originurl = photo.largeurl.replace(/@.+\..+$/g, '')
this.type = this.originurl.match(/^.+\.(.+)$/)[1].toLowerCase()
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/fanfou-sdk-node/src/status.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint unicorn/prefer-string-replace-all: off */
const he = require('../modules/he/he')
const timeago = require('../../timeago')
const dateFormat = require('../modules/date-format/index')
Expand Down
1 change: 0 additions & 1 deletion src/utils/fanfou.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const {CONSUMER_KEY, CONSUMER_SECRET} = require('../config/fanfou')

const FanfouSDK = require('./fanfou-sdk-node/index')

class Error {
Expand Down

0 comments on commit 8d64709

Please sign in to comment.