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

View file

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

View file

@ -21,7 +21,7 @@ function processMessage (instanceName, timelineName, message) {
} }
export function createStream (streamingApi, instanceName, accessToken, export function createStream (streamingApi, instanceName, accessToken,
timelineName, onOpenStream) { timelineName, onOpenStream) {
return new TimelineStream(streamingApi, accessToken, timelineName, { return new TimelineStream(streamingApi, accessToken, timelineName, {
onMessage (msg) { onMessage (msg) {
if (msg.event !== 'update' && msg.event !== 'delete' && msg.event !== 'notification') { 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' import { postWithTimeout } from '../_utils/ajax'
export async function postStatus (instanceName, accessToken, text, inReplyToId, mediaIds, export async function postStatus (instanceName, accessToken, text, inReplyToId, mediaIds,
sensitive, spoilerText, visibility) { sensitive, spoilerText, visibility) {
let url = `${basename(instanceName)}/api/v1/statuses` let url = `${basename(instanceName)}/api/v1/statuses`
let body = { let body = {

View file

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

View file

@ -19,7 +19,7 @@ import { createPinnedStatusKeyRange, createThreadKeyRange } from './keys'
const BATCH_SIZE = 20 const BATCH_SIZE = 20
const TIME_AGO = 14 * 24 * 60 * 60 * 1000 // two weeks ago 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 batchedGetAll (callGetAll, callback) {
function nextBatch () { function nextBatch () {

View file

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

View file

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

View file

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

View file

@ -29,5 +29,5 @@ test('navigates to settings/instances', async t => {
.click($('a').withText('Instances')) .click($('a').withText('Instances'))
.expect(getUrl()).contains('/settings/instances') .expect(getUrl()).contains('/settings/instances')
.expect($('.container').innerText) .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).getAttribute('aria-label')).eql('Status by admin')
.expect(getNthStatus(1).find('.status-content').innerText).contains('notification of unlisted message') .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')) .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(1).find('.status-toolbar button:nth-child(2)').hasAttribute('disabled')).notOk()
.expect(getNthStatus(2).getAttribute('aria-label')).eql('Status by admin') .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-content').innerText).contains('notification of followers-only message')
.expect(getNthStatus(2).find('.status-toolbar button:nth-child(2)').getAttribute('aria-label')) .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(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).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-content').innerText).contains('notification of direct message')
.expect(getNthStatus(3).find('.status-toolbar button:nth-child(2)').getAttribute('aria-label')) .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() .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(getUrl()).contains('/statuses/')
.expect(getNthStatus(16).innerText).contains('unlisted thread 17') .expect(getNthStatus(16).innerText).contains('unlisted thread 17')
.expect(Math.round(getNthStatus(16).boundingClientRect.top)) .expect(Math.round(getNthStatus(16).boundingClientRect.top))
.eql(Math.round($('.container').boundingClientRect.top)) .eql(Math.round($('.container').boundingClientRect.top))
}) })
async function navigateToBazAccount (t) { async function navigateToBazAccount (t) {

View file

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

View file

@ -290,3 +290,13 @@ export async function clickToNotificationsAndBackHome (t) {
.click(homeNavButton) .click(homeNavButton)
.expect(getUrl()).eql('http://localhost:4002/') .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
}