update and pin all deps (#164)

This commit is contained in:
Nolan Lawson 2018-04-18 20:43:13 -07:00 committed by GitHub
parent 2e6e743ff5
commit e431c29efa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 2047 additions and 2033 deletions

3800
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -32,61 +32,60 @@
"backup-mastodon-data": "pg_dump -Fc mastodon_development > fixtures/dump.sql && cd mastodon/public/system && tar -czf ../../../fixtures/system.tgz ."
},
"dependencies": {
"@gamestdio/websocket": "^0.2.2",
"a11y-dialog": "^4.0.1",
"cheerio": "^1.0.0-rc.2",
"child-process-promise": "^2.2.1",
"chokidar": "^2.0.0",
"compression": "^1.7.1",
"cross-env": "^5.1.3",
"css-loader": "^0.28.7",
"escape-html": "^1.0.3",
"esm": "^3.0.12",
"events": "^2.0.0",
"express": "^4.16.2",
"fg-loadcss": "^2.0.1",
"file-api": "^0.10.4",
"font-awesome-svg-png": "^1.2.2",
"form-data": "^2.3.2",
"glob": "^7.1.2",
"helmet": "^3.12.0",
"indexeddb-getall-shim": "^1.3.1",
"intersection-observer": "^0.5.0",
"lodash": "^4.17.5",
"lodash-es": "^4.17.8",
"lodash-webpack-plugin": "^0.11.4",
"mini-css-extract-plugin": "^0.4.0",
"mkdirp": "^0.5.1",
"node-fetch": "^2.1.2",
"node-sass": "^4.7.2",
"npm-run-all": "^4.1.2",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"p-any": "^1.1.0",
"performance-now": "^2.1.0",
"pify": "^3.0.0",
"quick-lru": "^1.1.0",
"requestidlecallback": "^0.3.0",
"@gamestdio/websocket": "0.2.5",
"a11y-dialog": "4.0.1",
"cheerio": "1.0.0-rc.2",
"child-process-promise": "2.2.1",
"chokidar": "2.0.3",
"compression": "1.7.2",
"cross-env": "5.1.4",
"css-loader": "0.28.11",
"escape-html": "1.0.3",
"esm": "3.0.19",
"events": "2.0.0",
"express": "4.16.3",
"fg-loadcss": "2.0.1",
"file-api": "0.10.4",
"font-awesome-svg-png": "1.2.2",
"form-data": "2.3.2",
"glob": "7.1.2",
"helmet": "3.12.0",
"indexeddb-getall-shim": "1.3.3",
"intersection-observer": "0.5.0",
"lodash-es": "4.17.8",
"lodash-webpack-plugin": "0.11.5",
"mini-css-extract-plugin": "0.4.0",
"mkdirp": "0.5.1",
"node-fetch": "2.1.2",
"node-sass": "4.7.2",
"npm-run-all": "4.1.2",
"optimize-css-assets-webpack-plugin": "4.0.0",
"p-any": "1.1.0",
"performance-now": "2.1.0",
"pify": "3.0.0",
"quick-lru": "1.1.0",
"requestidlecallback": "0.3.0",
"sapper": "github:nolanlawson/sapper#for-pinafore-3",
"serve-static": "^1.13.1",
"stringz": "^1.0.0",
"style-loader": "^0.21.0",
"svelte": "^1.57.4",
"svelte-extras": "^2.0.0",
"svelte-loader": "^2.3.3",
"svelte-transitions": "^1.1.1",
"svgo": "^1.0.3",
"timeago.js": "^3.0.2",
"tiny-queue": "^0.2.1",
"uglifyjs-webpack-plugin": "^1.2.4",
"web-animations-js": "^2.3.1",
"webpack": "^4.5.0",
"webpack-bundle-analyzer": "^2.11.1",
"yargs": "^11.0.0"
"serve-static": "1.13.2",
"stringz": "1.0.0",
"style-loader": "0.21.0",
"svelte": "1.64.1",
"svelte-extras": "2.0.0",
"svelte-loader": "2.8.1",
"svelte-transitions": "1.1.1",
"svgo": "1.0.5",
"timeago.js": "3.0.2",
"tiny-queue": "0.2.1",
"uglifyjs-webpack-plugin": "1.2.5",
"web-animations-js": "2.3.1",
"webpack": "4.6.0",
"webpack-bundle-analyzer": "2.11.1",
"yargs": "11.0.0"
},
"devDependencies": {
"now": "^11.1.4",
"standard": "^10.0.3",
"testcafe": "^0.19.0"
"now": "11.1.7",
"standard": "11.0.1",
"testcafe": "0.19.1"
},
"engines": {
"node": ">= 8"
@ -151,8 +150,7 @@
},
"greenkeeper": {
"ignore": [
"sapper",
"standard"
"sapper"
]
}
}

View file

@ -21,8 +21,8 @@ export async function insertHandleForReply (statusId) {
}
export async function postStatus (realm, text, inReplyToId, mediaIds,
sensitive, spoilerText, visibility,
mediaDescriptions = [], inReplyToUuid) {
sensitive, spoilerText, visibility,
mediaDescriptions = [], inReplyToUuid) {
let instanceName = store.get('currentInstance')
let accessToken = store.get('accessToken')
let online = store.get('online')

View file

@ -21,7 +21,7 @@ function processMessage (instanceName, timelineName, message) {
}
export function createStream (streamingApi, instanceName, accessToken,
timelineName, onOpenStream) {
timelineName, onOpenStream) {
return new TimelineStream(streamingApi, accessToken, timelineName, {
onMessage (msg) {
if (msg.event !== 'update' && msg.event !== 'delete' && msg.event !== 'notification') {

View file

@ -2,7 +2,7 @@ import { auth, basename } from './utils'
import { postWithTimeout } from '../_utils/ajax'
export async function postStatus (instanceName, accessToken, text, inReplyToId, mediaIds,
sensitive, spoilerText, visibility) {
sensitive, spoilerText, visibility) {
let url = `${basename(instanceName)}/api/v1/statuses`
let body = {

View file

@ -24,82 +24,82 @@ virtualListStore.computeForRealm('listOffset', 0)
virtualListStore.computeForRealm('itemHeights', {})
virtualListStore.compute('rawVisibleItems',
['items', 'scrollTop', 'itemHeights', 'offsetHeight', 'showHeader', 'headerHeight', 'listOffset'],
(items, scrollTop, itemHeights, offsetHeight, showHeader, headerHeight, listOffset) => {
window.rawVisibleItemsComputed = (window.rawVisibleItemsComputed || 0) + 1
mark('compute visibleItems')
if (!items) {
return null
}
let effectiveScrollTop = scrollTop - listOffset
let renderBuffer = RENDER_BUFFER_FACTOR * offsetHeight
let visibleItems = []
let totalOffset = showHeader ? headerHeight : 0
let len = items.length
let i = -1
while (++i < len) {
let key = items[i]
let height = itemHeights[key] || 0
let currentOffset = totalOffset
totalOffset += height
let isAboveViewport = (currentOffset < effectiveScrollTop)
if (isAboveViewport) {
if ((effectiveScrollTop - height - renderBuffer) > currentOffset) {
continue // above the area we want to render
}
} else {
if (currentOffset > (effectiveScrollTop + offsetHeight + renderBuffer)) {
break // below the area we want to render
}
['items', 'scrollTop', 'itemHeights', 'offsetHeight', 'showHeader', 'headerHeight', 'listOffset'],
(items, scrollTop, itemHeights, offsetHeight, showHeader, headerHeight, listOffset) => {
window.rawVisibleItemsComputed = (window.rawVisibleItemsComputed || 0) + 1
mark('compute visibleItems')
if (!items) {
return null
}
let effectiveScrollTop = scrollTop - listOffset
let renderBuffer = RENDER_BUFFER_FACTOR * offsetHeight
let visibleItems = []
let totalOffset = showHeader ? headerHeight : 0
let len = items.length
let i = -1
while (++i < len) {
let key = items[i]
let height = itemHeights[key] || 0
let currentOffset = totalOffset
totalOffset += height
let isAboveViewport = (currentOffset < effectiveScrollTop)
if (isAboveViewport) {
if ((effectiveScrollTop - height - renderBuffer) > currentOffset) {
continue // above the area we want to render
}
} else {
if (currentOffset > (effectiveScrollTop + offsetHeight + renderBuffer)) {
break // below the area we want to render
}
visibleItems.push({
offset: currentOffset,
key: key,
index: i
})
}
stop('compute visibleItems')
return visibleItems
})
visibleItems.push({
offset: currentOffset,
key: key,
index: i
})
}
stop('compute visibleItems')
return visibleItems
})
reselect(virtualListStore, 'visibleItems', 'rawVisibleItems')
virtualListStore.compute('heightWithoutFooter',
['items', 'itemHeights', 'showHeader', 'headerHeight'],
(items, itemHeights, showHeader, headerHeight) => {
if (!items) {
return 0
}
let sum = showHeader ? headerHeight : 0
let i = -1
let len = items.length
while (++i < len) {
sum += itemHeights[items[i]] || 0
}
return sum
})
['items', 'itemHeights', 'showHeader', 'headerHeight'],
(items, itemHeights, showHeader, headerHeight) => {
if (!items) {
return 0
}
let sum = showHeader ? headerHeight : 0
let i = -1
let len = items.length
while (++i < len) {
sum += itemHeights[items[i]] || 0
}
return sum
})
virtualListStore.compute('height',
['heightWithoutFooter', 'showFooter', 'footerHeight'],
(heightWithoutFooter, showFooter, footerHeight) => {
return showFooter ? (heightWithoutFooter + footerHeight) : heightWithoutFooter
})
['heightWithoutFooter', 'showFooter', 'footerHeight'],
(heightWithoutFooter, showFooter, footerHeight) => {
return showFooter ? (heightWithoutFooter + footerHeight) : heightWithoutFooter
})
virtualListStore.compute('length', ['items'], (items) => items ? items.length : 0)
virtualListStore.compute('allVisibleItemsHaveHeight',
['visibleItems', 'itemHeights'],
(visibleItems, itemHeights) => {
if (!visibleItems) {
['visibleItems', 'itemHeights'],
(visibleItems, itemHeights) => {
if (!visibleItems) {
return false
}
for (let visibleItem of visibleItems) {
if (!itemHeights[visibleItem.key]) {
return false
}
for (let visibleItem of visibleItems) {
if (!itemHeights[visibleItem.key]) {
return false
}
}
return true
})
}
return true
})
if (process.browser && process.env.NODE_ENV !== 'production') {
window.virtualListStore = virtualListStore

View file

@ -19,7 +19,7 @@ import { createPinnedStatusKeyRange, createThreadKeyRange } from './keys'
const BATCH_SIZE = 20
const TIME_AGO = 14 * 24 * 60 * 60 * 1000 // two weeks ago
const DELAY = 5 * 60 * 1000 // five minutes
const DELAY = 5 * 60 * 1000 // five minutes
function batchedGetAll (callGetAll, callback) {
function nextBatch () {

View file

@ -21,11 +21,11 @@ export function timelineObservers (store) {
function shouldObserveTimeline (timeline) {
return timeline &&
!(
timeline !== 'local' &&
timeline !== 'local' &&
timeline !== 'federated' &&
!timeline.startsWith('list/') &&
!timeline.startsWith('tag/')
)
)
}
store.observe('currentTimeline', async (currentTimeline) => {

View file

@ -25,11 +25,11 @@ export class RealmStore extends Store {
computeForRealm (key, defaultValue) {
this.compute(key,
['realms', 'currentRealm'],
(realms, currentRealm) => {
let realmData = realms.get(currentRealm)
return (realmData && realmData[key]) || defaultValue
})
['realms', 'currentRealm'],
(realms, currentRealm) => {
let realmData = realms.get(currentRealm)
return (realmData && realmData[key]) || defaultValue
})
}
/*

View file

@ -1,4 +1,4 @@
import times from 'lodash/times'
import { times } from './utils'
export const homeTimeline = [
{content: 'pinned toot 1'},

View file

@ -29,5 +29,5 @@ test('navigates to settings/instances', async t => {
.click($('a').withText('Instances'))
.expect(getUrl()).contains('/settings/instances')
.expect($('.container').innerText)
.contains("You're not logged in to any instances")
.contains("You're not logged in to any instances")
})

View file

@ -9,17 +9,17 @@ test('shows direct vs followers-only vs regular', async t => {
.expect(getNthStatus(1).getAttribute('aria-label')).eql('Status by admin')
.expect(getNthStatus(1).find('.status-content').innerText).contains('notification of unlisted message')
.expect(getNthStatus(1).find('.status-toolbar button:nth-child(2)').getAttribute('aria-label'))
.eql('Boost')
.eql('Boost')
.expect(getNthStatus(1).find('.status-toolbar button:nth-child(2)').hasAttribute('disabled')).notOk()
.expect(getNthStatus(2).getAttribute('aria-label')).eql('Status by admin')
.expect(getNthStatus(2).find('.status-content').innerText).contains('notification of followers-only message')
.expect(getNthStatus(2).find('.status-toolbar button:nth-child(2)').getAttribute('aria-label'))
.eql('Cannot be boosted because this is followers-only')
.eql('Cannot be boosted because this is followers-only')
.expect(getNthStatus(2).find('.status-toolbar button:nth-child(2)').hasAttribute('disabled')).ok()
.expect(getNthStatus(3).getAttribute('aria-label')).eql('Direct message by admin')
.expect(getNthStatus(3).find('.status-content').innerText).contains('notification of direct message')
.expect(getNthStatus(3).find('.status-toolbar button:nth-child(2)').getAttribute('aria-label'))
.eql('Cannot be boosted because this is a direct message')
.eql('Cannot be boosted because this is a direct message')
.expect(getNthStatus(3).find('.status-toolbar button:nth-child(2)').hasAttribute('disabled')).ok()
})

View file

@ -36,7 +36,7 @@ test('Scrolls to proper point in thread', async t => {
.expect(getUrl()).contains('/statuses/')
.expect(getNthStatus(16).innerText).contains('unlisted thread 17')
.expect(Math.round(getNthStatus(16).boundingClientRect.top))
.eql(Math.round($('.container').boundingClientRect.top))
.eql(Math.round($('.container').boundingClientRect.top))
})
async function navigateToBazAccount (t) {

View file

@ -2,10 +2,10 @@ import { Selector as $ } from 'testcafe'
import {
composeButton, composeInput, composeLengthIndicator, emojiButton, getComposeSelectionStart, getUrl,
homeNavButton,
notificationsNavButton
notificationsNavButton,
times
} from '../utils'
import { foobarRole } from '../roles'
import times from 'lodash/times'
fixture`012-compose.js`
.page`http://localhost:4002`

View file

@ -290,3 +290,13 @@ export async function clickToNotificationsAndBackHome (t) {
.click(homeNavButton)
.expect(getUrl()).eql('http://localhost:4002/')
}
// like lodash.times but I don't want to try to figure out esm
// just to import lodash-es
export function times (n, cb) {
let arr = []
for (let i = 0; i < n; i++) {
arr.push(cb(i))
}
return arr
}