diff --git a/extensions/tags/js/Gulpfile.js b/extensions/tags/js/Gulpfile.js index cf805541a..b84d6a97d 100644 --- a/extensions/tags/js/Gulpfile.js +++ b/extensions/tags/js/Gulpfile.js @@ -1,44 +1,5 @@ -var gulp = require('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 streamqueue = require('streamqueue'); +var gulp = require('flarum-gulp'); -var staticFiles = [ - 'bootstrap.js' -]; -var moduleFiles = [ - 'src/**/*.js' -]; -var modulePrefix = 'categories'; - -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); - } - }); +gulp({ + modulePrefix: 'flarum-categories' }); diff --git a/extensions/tags/js/bootstrap.js b/extensions/tags/js/bootstrap.js index 474954cc8..f8aa94a8c 100644 --- a/extensions/tags/js/bootstrap.js +++ b/extensions/tags/js/bootstrap.js @@ -14,17 +14,17 @@ import PostedActivity from 'flarum/components/posted-activity'; import icon from 'flarum/helpers/icon'; import app from 'flarum/app'; -import Category from 'categories/models/category'; -import CategoriesPage from 'categories/components/categories-page'; -import CategoryHero from 'categories/components/category-hero'; -import CategoryNavItem from 'categories/components/category-nav-item'; -import MoveDiscussionModal from 'categories/components/move-discussion-modal'; -import DiscussionMovedNotification from 'categories/components/discussion-moved-notification'; -import DiscussionMovedPost from 'categories/components/discussion-moved-post'; -import categoryLabel from 'categories/helpers/category-label'; -import categoryIcon from 'categories/helpers/category-icon'; +import Category from 'flarum-categories/models/category'; +import CategoriesPage from 'flarum-categories/components/categories-page'; +import CategoryHero from 'flarum-categories/components/category-hero'; +import CategoryNavItem from 'flarum-categories/components/category-nav-item'; +import MoveDiscussionModal from 'flarum-categories/components/move-discussion-modal'; +import DiscussionMovedNotification from 'flarum-categories/components/discussion-moved-notification'; +import DiscussionMovedPost from 'flarum-categories/components/discussion-moved-post'; +import categoryLabel from 'flarum-categories/helpers/category-label'; +import categoryIcon from 'flarum-categories/helpers/category-icon'; -app.initializers.add('categories', function() { +app.initializers.add('flarum-categories', function() { // Register routes. app.routes['categories'] = ['/categories', CategoriesPage.component()]; app.routes['category'] = ['/c/:categories', IndexPage.component()]; diff --git a/extensions/tags/js/package.json b/extensions/tags/js/package.json index c9193ee46..3e0ef919d 100644 --- a/extensions/tags/js/package.json +++ b/extensions/tags/js/package.json @@ -1,15 +1,7 @@ { - "name": "flarum-categories", + "private": true, "devDependencies": { "gulp": "^3.8.11", - "gulp-babel": "^5.1.0", - "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", - "yargs": "^3.7.2", - "streamqueue": "^0.1.3" + "flarum-gulp": "git+https://github.com/flarum/gulp.git" } } diff --git a/extensions/tags/js/src/components/category-nav-item.js b/extensions/tags/js/src/components/category-nav-item.js index 632daca96..7d985db4f 100644 --- a/extensions/tags/js/src/components/category-nav-item.js +++ b/extensions/tags/js/src/components/category-nav-item.js @@ -1,5 +1,5 @@ import NavItem from 'flarum/components/nav-item'; -import categoryIcon from 'categories/helpers/category-icon'; +import categoryIcon from 'flarum-categories/helpers/category-icon'; export default class CategoryNavItem extends NavItem { view() { diff --git a/extensions/tags/js/src/components/discussion-moved-notification.js b/extensions/tags/js/src/components/discussion-moved-notification.js index 4e622a4eb..fc77d7bcb 100644 --- a/extensions/tags/js/src/components/discussion-moved-notification.js +++ b/extensions/tags/js/src/components/discussion-moved-notification.js @@ -1,6 +1,6 @@ import Notification from 'flarum/components/notification'; import username from 'flarum/helpers/username'; -import categoryLabel from 'categories/helpers/category-label'; +import categoryLabel from 'flarum-categories/helpers/category-label'; export default class DiscussionMovedNotification extends Notification { view() { diff --git a/extensions/tags/js/src/components/discussion-moved-post.js b/extensions/tags/js/src/components/discussion-moved-post.js index 72373b8ff..54870f5e1 100644 --- a/extensions/tags/js/src/components/discussion-moved-post.js +++ b/extensions/tags/js/src/components/discussion-moved-post.js @@ -1,5 +1,5 @@ import EventPost from 'flarum/components/event-post'; -import categoryLabel from 'categories/helpers/category-label'; +import categoryLabel from 'flarum-categories/helpers/category-label'; export default class DiscussionMovedPost extends EventPost { view() { diff --git a/extensions/tags/js/src/components/move-discussion-modal.js b/extensions/tags/js/src/components/move-discussion-modal.js index 90bc9359a..cf8a8722f 100644 --- a/extensions/tags/js/src/components/move-discussion-modal.js +++ b/extensions/tags/js/src/components/move-discussion-modal.js @@ -1,7 +1,7 @@ import Component from 'flarum/component'; import DiscussionPage from 'flarum/components/discussion-page'; import icon from 'flarum/helpers/icon'; -import categoryLabel from 'categories/helpers/category-label'; +import categoryLabel from 'flarum-categories/helpers/category-label'; export default class MoveDiscussionModal extends Component { constructor(props) {