mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
Use new flarum-gulp package.
This commit is contained in:
parent
0b12752be3
commit
1abc0e2a75
|
@ -1,44 +1,5 @@
|
||||||
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 streamqueue = require('streamqueue');
|
|
||||||
|
|
||||||
var staticFiles = [
|
gulp({
|
||||||
'bootstrap.js'
|
modulePrefix: 'flarum-categories'
|
||||||
];
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
20
extensions/tags/js/bootstrap.js
vendored
20
extensions/tags/js/bootstrap.js
vendored
|
@ -14,17 +14,17 @@ import PostedActivity from 'flarum/components/posted-activity';
|
||||||
import icon from 'flarum/helpers/icon';
|
import icon from 'flarum/helpers/icon';
|
||||||
import app from 'flarum/app';
|
import app from 'flarum/app';
|
||||||
|
|
||||||
import Category from 'categories/models/category';
|
import Category from 'flarum-categories/models/category';
|
||||||
import CategoriesPage from 'categories/components/categories-page';
|
import CategoriesPage from 'flarum-categories/components/categories-page';
|
||||||
import CategoryHero from 'categories/components/category-hero';
|
import CategoryHero from 'flarum-categories/components/category-hero';
|
||||||
import CategoryNavItem from 'categories/components/category-nav-item';
|
import CategoryNavItem from 'flarum-categories/components/category-nav-item';
|
||||||
import MoveDiscussionModal from 'categories/components/move-discussion-modal';
|
import MoveDiscussionModal from 'flarum-categories/components/move-discussion-modal';
|
||||||
import DiscussionMovedNotification from 'categories/components/discussion-moved-notification';
|
import DiscussionMovedNotification from 'flarum-categories/components/discussion-moved-notification';
|
||||||
import DiscussionMovedPost from 'categories/components/discussion-moved-post';
|
import DiscussionMovedPost from 'flarum-categories/components/discussion-moved-post';
|
||||||
import categoryLabel from 'categories/helpers/category-label';
|
import categoryLabel from 'flarum-categories/helpers/category-label';
|
||||||
import categoryIcon from 'categories/helpers/category-icon';
|
import categoryIcon from 'flarum-categories/helpers/category-icon';
|
||||||
|
|
||||||
app.initializers.add('categories', function() {
|
app.initializers.add('flarum-categories', function() {
|
||||||
// Register routes.
|
// Register routes.
|
||||||
app.routes['categories'] = ['/categories', CategoriesPage.component()];
|
app.routes['categories'] = ['/categories', CategoriesPage.component()];
|
||||||
app.routes['category'] = ['/c/:categories', IndexPage.component()];
|
app.routes['category'] = ['/c/:categories', IndexPage.component()];
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "flarum-categories",
|
"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",
|
|
||||||
"yargs": "^3.7.2",
|
|
||||||
"streamqueue": "^0.1.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import NavItem from 'flarum/components/nav-item';
|
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 {
|
export default class CategoryNavItem extends NavItem {
|
||||||
view() {
|
view() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Notification from 'flarum/components/notification';
|
import Notification from 'flarum/components/notification';
|
||||||
import username from 'flarum/helpers/username';
|
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 {
|
export default class DiscussionMovedNotification extends Notification {
|
||||||
view() {
|
view() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import EventPost from 'flarum/components/event-post';
|
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 {
|
export default class DiscussionMovedPost extends EventPost {
|
||||||
view() {
|
view() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Component from 'flarum/component';
|
import Component from 'flarum/component';
|
||||||
import DiscussionPage from 'flarum/components/discussion-page';
|
import DiscussionPage from 'flarum/components/discussion-page';
|
||||||
import icon from 'flarum/helpers/icon';
|
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 {
|
export default class MoveDiscussionModal extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user