From 2e83bc0ff9cb4cdee44c22a10e1b9a1812efd3de Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 8 Feb 2018 22:29:29 -0800 Subject: [PATCH] use standard --- bin/build-sass.js | 10 +- bin/build-svg.js | 4 +- bin/globalize-css.js | 8 +- bin/svgs.js | 48 +- package-lock.json | 802 ++++++++++++++++++ package.json | 22 + routes/_actions/accounts.js | 8 +- routes/_actions/addInstance.js | 19 +- routes/_actions/instances.js | 18 +- routes/_actions/lists.js | 4 +- routes/_actions/timeline.js | 14 +- routes/_api/StatusStream.js | 10 +- routes/_api/instance.js | 4 +- routes/_api/lists.js | 4 +- routes/_api/oauth.js | 21 +- routes/_api/search.js | 3 +- routes/_api/timelines.js | 6 +- routes/_api/user.js | 8 +- routes/_api/utils.js | 6 +- .../dialog/showConfirmationDialog.js | 4 +- routes/_components/dialog/showImageDialog.js | 4 +- routes/_components/dialog/showVideoDialog.js | 4 +- .../pseudoVirtualListStore.js | 4 +- .../virtualList/virtualListStore.js | 111 ++- routes/_database/accountsAndRelationships.js | 18 +- routes/_database/cache.js | 12 +- routes/_database/clear.js | 4 +- routes/_database/constants.js | 2 +- routes/_database/database.js | 2 +- routes/_database/databaseCore.js | 2 +- routes/_database/databaseLifecycle.js | 34 +- routes/_database/helpers.js | 8 +- routes/_database/meta.js | 32 +- routes/_database/timelines.js | 42 +- routes/_database/utils.js | 2 +- routes/_static/media.js | 2 +- routes/_static/themes.js | 2 +- routes/_static/timelines.js | 2 +- routes/_store/LocalStorageStore.js | 8 +- routes/_store/computations.js | 4 +- routes/_store/instanceComputations.js | 5 +- routes/_store/mixins.js | 6 +- routes/_store/observers.js | 4 +- routes/_store/store.js | 24 +- routes/_store/timelineComputations.js | 4 +- routes/_utils/AsyncLayout.js | 10 +- routes/_utils/RealmStore.js | 18 +- routes/_utils/ajax.js | 14 +- routes/_utils/arrays.js | 4 +- routes/_utils/events.js | 12 +- routes/_utils/fullscreen.js | 18 +- routes/_utils/getRectFromEntry.js | 14 +- routes/_utils/loadPolyfills.js | 7 +- routes/_utils/marks.js | 2 +- routes/_utils/offlineNotification.js | 7 +- routes/_utils/scheduleIdleTask.js | 6 +- routes/_utils/serviceWorkerClient.js | 6 +- routes/_utils/strings.js | 4 +- routes/_utils/sync.js | 4 +- routes/_utils/themeEngine.js | 6 +- routes/_utils/toast.js | 2 +- server.js | 29 +- templates/main.js | 6 +- templates/service-worker.js | 10 +- webpack.client.config.js | 120 +-- webpack.server.config.js | 53 +- 66 files changed, 1269 insertions(+), 448 deletions(-) diff --git a/bin/build-sass.js b/bin/build-sass.js index a4fcb160..731555fc 100755 --- a/bin/build-sass.js +++ b/bin/build-sass.js @@ -21,7 +21,7 @@ const scssDir = path.join(__dirname, '../scss') const themesScssDir = path.join(__dirname, '../scss/themes') const assetsDir = path.join(__dirname, '../assets') -function doWatch() { +function doWatch () { var start = now() chokidar.watch(scssDir).on('change', debounce(() => { console.log('Recompiling SCSS...') @@ -35,7 +35,7 @@ function doWatch() { chokidar.watch() } -async function compileGlobalSass() { +async function compileGlobalSass () { let results = await Promise.all([ render({file: defaultThemeScss, outputStyle: 'compressed'}), render({file: globalScss, outputStyle: 'compressed'}), @@ -51,7 +51,7 @@ async function compileGlobalSass() { await writeFile(html2xxFile, html, 'utf8') } -async function compileThemesSass() { +async function compileThemesSass () { let files = (await readdir(themesScssDir)).filter(file => !path.basename(file).startsWith('_')) await Promise.all(files.map(async file => { let res = await render({file: path.join(themesScssDir, file)}) @@ -60,7 +60,7 @@ async function compileThemesSass() { })) } -async function main() { +async function main () { await Promise.all([compileGlobalSass(), compileThemesSass()]) if (argv.watch) { doWatch() @@ -70,4 +70,4 @@ async function main() { Promise.resolve().then(main).catch(err => { console.error(err) process.exit(1) -}) \ No newline at end of file +}) diff --git a/bin/build-svg.js b/bin/build-svg.js index 11cb5f27..38179787 100755 --- a/bin/build-svg.js +++ b/bin/build-svg.js @@ -11,7 +11,7 @@ const $ = require('cheerio') const readFile = pify(fs.readFile.bind(fs)) const writeFile = pify(fs.writeFile.bind(fs)) -async function main() { +async function main () { let result = (await Promise.all(svgs.map(async svg => { let filepath = path.join(__dirname, '../', svg.src) let content = await readFile(filepath, 'utf8') @@ -40,4 +40,4 @@ async function main() { main().catch(err => { console.error(err) process.exit(1) -}) \ No newline at end of file +}) diff --git a/bin/globalize-css.js b/bin/globalize-css.js index e7218488..081639b0 100755 --- a/bin/globalize-css.js +++ b/bin/globalize-css.js @@ -11,10 +11,10 @@ const readFile = pify(fs.readFile.bind(fs)) const glob = pify(require('glob')) const rimraf = pify(require('rimraf')) -const selectorRegex = /\n[ \t]*([0-9\w\- \t\.:#,]+?)[ \t]*\{/g +const selectorRegex = /\n[ \t]*([0-9\w\- \t.:#,]+?)[ \t]*{/g const styleRegex = /