mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 02:59:40 +08:00
Use new flarum-gulp package.
This commit is contained in:
parent
70a2bcc002
commit
b2557e2ae9
@ -1,46 +1,8 @@
|
|||||||
var gulp = require('gulp');
|
var gulp = require('flarum-gulp');
|
||||||
var livereload = require('gulp-livereload');
|
|
||||||
var concat = require('gulp-concat');
|
|
||||||
var argv = require('yargs').argv;
|
|
||||||
var uglify = require('gulp-uglify');
|
|
||||||
var gulpif = require('gulp-if');
|
|
||||||
var babel = require('gulp-babel');
|
|
||||||
var cached = require('gulp-cached');
|
|
||||||
var remember = require('gulp-remember');
|
|
||||||
var merge = require('merge-stream');
|
|
||||||
var streamqueue = require('streamqueue');
|
|
||||||
|
|
||||||
var staticFiles = [
|
gulp({
|
||||||
'bootstrap.js',
|
modulePrefix: 'flarum-mentions',
|
||||||
'bower_components/textarea-caret-position/index.js'
|
files: [
|
||||||
];
|
'bower_components/textarea-caret-position/index.js'
|
||||||
var moduleFiles = [
|
]
|
||||||
'src/**/*.js'
|
|
||||||
];
|
|
||||||
var modulePrefix = 'mentions';
|
|
||||||
|
|
||||||
gulp.task('default', function() {
|
|
||||||
return streamqueue({objectMode: true},
|
|
||||||
gulp.src(moduleFiles)
|
|
||||||
.pipe(cached('scripts'))
|
|
||||||
.pipe(babel({ modules: 'amd', moduleIds: true, moduleRoot: modulePrefix }))
|
|
||||||
.pipe(remember('scripts')),
|
|
||||||
gulp.src(staticFiles)
|
|
||||||
.pipe(babel())
|
|
||||||
)
|
|
||||||
.pipe(concat('extension.js'))
|
|
||||||
.pipe(gulpif(argv.production, uglify()))
|
|
||||||
.pipe(gulp.dest('dist'))
|
|
||||||
.pipe(livereload());
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch', ['default'], function () {
|
|
||||||
livereload.listen();
|
|
||||||
var watcher = gulp.watch(moduleFiles.concat(staticFiles), ['default']);
|
|
||||||
watcher.on('change', function (event) {
|
|
||||||
if (event.type === 'deleted') {
|
|
||||||
delete cached.caches.scripts[event.path];
|
|
||||||
remember.forget('scripts', event.path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
12
extensions/mentions/js/bootstrap.js
vendored
12
extensions/mentions/js/bootstrap.js
vendored
@ -3,12 +3,12 @@ import SettingsPage from 'flarum/components/settings-page';
|
|||||||
import { extend } from 'flarum/extension-utils';
|
import { extend } from 'flarum/extension-utils';
|
||||||
import icon from 'flarum/helpers/icon';
|
import icon from 'flarum/helpers/icon';
|
||||||
|
|
||||||
import postMentionPreviews from 'mentions/post-mention-previews';
|
import postMentionPreviews from 'flarum-mentions/post-mention-previews';
|
||||||
import mentionedByList from 'mentions/mentioned-by-list';
|
import mentionedByList from 'flarum-mentions/mentioned-by-list';
|
||||||
import postReplyAction from 'mentions/post-reply-action';
|
import postReplyAction from 'flarum-mentions/post-reply-action';
|
||||||
import composerAutocomplete from 'mentions/composer-autocomplete';
|
import composerAutocomplete from 'flarum-mentions/composer-autocomplete';
|
||||||
import PostMentionedNotification from 'mentions/components/post-mentioned-notification';
|
import PostMentionedNotification from 'flarum-mentions/components/post-mentioned-notification';
|
||||||
import UserMentionedNotification from 'mentions/components/user-mentioned-notification';
|
import UserMentionedNotification from 'flarum-mentions/components/user-mentioned-notification';
|
||||||
|
|
||||||
app.initializers.add('mentions', function() {
|
app.initializers.add('mentions', function() {
|
||||||
// For every mention of a post inside a post's content, set up a hover handler
|
// For every mention of a post inside a post's content, set up a hover handler
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "flarum-replies",
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "^3.8.11",
|
"gulp": "^3.8.11",
|
||||||
"gulp-babel": "^5.1.0",
|
"flarum-gulp": "git+https://github.com/flarum/gulp.git"
|
||||||
"gulp-cached": "^1.0.4",
|
|
||||||
"gulp-concat": "^2.5.2",
|
|
||||||
"gulp-if": "^1.2.5",
|
|
||||||
"gulp-livereload": "^3.8.0",
|
|
||||||
"gulp-remember": "^0.3.0",
|
|
||||||
"gulp-uglify": "^1.2.0",
|
|
||||||
"merge-stream": "^0.1.7",
|
|
||||||
"yargs": "^3.7.2",
|
|
||||||
"streamqueue": "^0.1.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import avatar from 'flarum/helpers/avatar';
|
|||||||
import username from 'flarum/helpers/username';
|
import username from 'flarum/helpers/username';
|
||||||
import highlight from 'flarum/helpers/highlight';
|
import highlight from 'flarum/helpers/highlight';
|
||||||
|
|
||||||
import AutocompleteDropdown from 'mentions/components/autocomplete-dropdown';
|
import AutocompleteDropdown from 'flarum-mentions/components/autocomplete-dropdown';
|
||||||
|
|
||||||
export default function() {
|
export default function() {
|
||||||
extend(ComposerBody.prototype, 'onload', function(original, element, isInitialized, context) {
|
extend(ComposerBody.prototype, 'onload', function(original, element, isInitialized, context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user