From 73630140817ebcfb6b9b350d2b536d315122e48c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 14 Jan 2017 01:16:30 +0900 Subject: [PATCH] Clean up --- gulpfile.ts | 23 -------------------- package.json | 1 - src/web/app/boot.js | 4 ++-- src/web/app/common/mixins.ls | 6 ++--- src/web/app/common/scripts/loading.ls | 2 +- src/web/app/desktop/mixins.ls | 2 +- src/web/app/desktop/scripts/autocomplete.ls | 2 +- src/web/app/desktop/scripts/fuck-ad-block.ls | 2 +- 8 files changed, 9 insertions(+), 33 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index 1f6299e40..91cb00ce8 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -18,7 +18,6 @@ import stylus = require('gulp-stylus'); import cssnano = require('gulp-cssnano'); import * as uglify from 'gulp-uglify'; import ls = require('browserify-livescript'); -import aliasify = require('aliasify'); import riotify = require('riotify'); import transformify = require('syuilo-transformify'); import pug = require('gulp-pug'); @@ -142,27 +141,6 @@ gulp.task('cleanall', ['clean'], cb => gulp.task('default', ['build']); -const aliasifyConfig = { - aliases: { - 'fetch': './node_modules/whatwg-fetch/fetch.js', - 'page': './node_modules/page/page.js', - 'NProgress': './node_modules/nprogress/nprogress.js', - 'velocity': './node_modules/velocity-animate/velocity.js', - 'chart.js': './node_modules/chart.js/src/chart.js', - 'textarea-caret-position': './node_modules/textarea-caret/index.js', - 'misskey-text': './src/common/text/index.js', - 'nyaize': './node_modules/nyaize/built/index.js', - 'strength.js': './node_modules/syuilo-password-strength/strength.js', - 'cropper': './node_modules/cropperjs/dist/cropper.js', - 'Sortable': './node_modules/sortablejs/Sortable.js', - 'fuck-adblock': './node_modules/fuckadblock/fuckadblock.js', - 'reconnecting-websocket': './node_modules/reconnecting-websocket/dist/index.js' - }, - appliesTo: { - 'includeExtensions': ['.js', '.ls'] - } -}; - gulp.task('build:client', [ 'build:ts', 'build:js', 'build:client:scripts', @@ -193,7 +171,6 @@ gulp.task('build:client:scripts', async (done) => { entries: [entry] }) .transform(ls) - .transform(aliasify, aliasifyConfig) .transform(transformify((source, file) => { return source .replace(/VERSION/g, `'${commit ? commit.hash : 'null'}'`) diff --git a/package.json b/package.json index 6a56f67a6..c9a0b506d 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "@types/vinyl-source-stream": "0.0.28", "@types/websocket": "0.0.32", "accesses": "1.2.0", - "aliasify": "2.1.0", "argv": "0.0.2", "babel-core": "6.21.0", "babel-polyfill": "6.20.0", diff --git a/src/web/app/boot.js b/src/web/app/boot.js index e8e504c2b..5f4dc79af 100644 --- a/src/web/app/boot.js +++ b/src/web/app/boot.js @@ -3,7 +3,7 @@ */ const riot = require('riot'); -require('velocity'); +require('velocity-animate'); const api = require('./common/scripts/api.ls'); const signout = require('./common/scripts/signout.ls'); const generateDefaultUserdata = require('./common/scripts/generate-default-userdata.ls'); @@ -18,7 +18,7 @@ require('./common/tags.ls'); document.domain = CONFIG.host; // ↓ iOS待ちPolyfill (SEE: http://caniuse.com/#feat=fetch) -require('fetch'); +require('whatwg-fetch'); // ↓ NodeList、HTMLCollectionで forEach を使えるようにする if (NodeList.prototype.forEach === undefined) { diff --git a/src/web/app/common/mixins.ls b/src/web/app/common/mixins.ls index 1320cacd1..50918c68c 100644 --- a/src/web/app/common/mixins.ls +++ b/src/web/app/common/mixins.ls @@ -9,7 +9,7 @@ module.exports = (me) ~> api: (require './scripts/api.ls').bind null i riot.mixin \cropper do - Cropper: require \cropper + Cropper: require \cropperjs riot.mixin \signout do signout: require './scripts/signout.ls' @@ -27,11 +27,11 @@ module.exports = (me) ~> date-stringify: require './scripts/date-stringify.ls' riot.mixin \text do - analyze: require 'misskey-text' + analyze: require '../../../common/text/index.js' compile: require './scripts/text-compiler.js' riot.mixin \get-password-strength do - get-password-strength: require 'strength.js' + get-password-strength: require 'syuilo-password-strength' riot.mixin \ui-progress do Progress: require './scripts/loading.ls' diff --git a/src/web/app/common/scripts/loading.ls b/src/web/app/common/scripts/loading.ls index ed791b21a..8ebede6db 100644 --- a/src/web/app/common/scripts/loading.ls +++ b/src/web/app/common/scripts/loading.ls @@ -1,4 +1,4 @@ -NProgress = require 'NProgress' +NProgress = require \nprogress NProgress.configure do trickle-speed: 500ms show-spinner: false diff --git a/src/web/app/desktop/mixins.ls b/src/web/app/desktop/mixins.ls index debd89fbd..0bafe8098 100644 --- a/src/web/app/desktop/mixins.ls +++ b/src/web/app/desktop/mixins.ls @@ -2,7 +2,7 @@ riot = require \riot module.exports = (me) ~> riot.mixin \sortable do - Sortable: require \Sortable + Sortable: require \sortablejs if me? (require './scripts/stream.ls') me diff --git a/src/web/app/desktop/scripts/autocomplete.ls b/src/web/app/desktop/scripts/autocomplete.ls index 636bb7f27..391fb312e 100644 --- a/src/web/app/desktop/scripts/autocomplete.ls +++ b/src/web/app/desktop/scripts/autocomplete.ls @@ -1,7 +1,7 @@ # Autocomplete #================================ -get-caret-coordinates = require 'textarea-caret-position' +get-caret-coordinates = require 'textarea-caret' riot = require 'riot' # オートコンプリートを管理するクラスです。 diff --git a/src/web/app/desktop/scripts/fuck-ad-block.ls b/src/web/app/desktop/scripts/fuck-ad-block.ls index 55431fcd0..7990f58f1 100644 --- a/src/web/app/desktop/scripts/fuck-ad-block.ls +++ b/src/web/app/desktop/scripts/fuck-ad-block.ls @@ -1,7 +1,7 @@ # FUCK AD BLOCK #================================ -require 'fuck-adblock' +require \fuckadblock dialog = require './dialog.ls' module.exports = ~>