|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | 3 | var gulp = require("gulp"); |
4 | | -var jshint = require("gulp-jshint"); |
5 | | -var jscs = require("gulp-jscs"); |
6 | 4 | var contribs = require("gulp-contribs"); |
7 | | -var rubySass = require("gulp-ruby-sass"); |
8 | | -var filter = require("gulp-filter"); |
9 | | -var browserSync = require("./"); |
10 | 5 | var conventionalChangelog = require("gulp-conventional-changelog"); |
11 | 6 |
|
12 | | -gulp.task("lint", function () { |
13 | | - gulp.src([ |
14 | | - "{,{bin,lib,examples,test/{protractor,specs}}/**/}*.js", |
15 | | - "!example.*.js", |
16 | | - "!lib/{cli/cli-template,public/socket.io}.js" |
17 | | - ]) |
18 | | - .pipe(jscs(".jscs.json")) |
19 | | - .pipe(jshint()) |
20 | | - .pipe(jshint.reporter("default")) |
21 | | - .pipe(jshint.reporter("fail")); |
22 | | -}); |
23 | | - |
24 | 7 | gulp.task("contribs", function () { |
25 | 8 | gulp.src("README.md") |
26 | 9 | .pipe(contribs()) |
27 | 10 | .pipe(gulp.dest("")); |
28 | 11 | }); |
29 | 12 |
|
30 | | -gulp.task("default", ["lint"]); |
31 | | - |
32 | | -var paths = { |
33 | | - scss: "test/fixtures/scss/*.scss", |
34 | | - css: "test/fixtures/css", |
35 | | - cssGlob: "test/fixtures/assets/*.css", |
36 | | - html: "test/fixtures/*.html" |
37 | | -}; |
38 | | - |
39 | | -gulp.task("sass", function () { |
40 | | - browserSync.notify("Compiling SCSS files... Please Wait"); |
41 | | - return gulp.src(paths.scss) |
42 | | - .pipe(rubySass({sourcemap: true})) |
43 | | - .pipe(gulp.dest(paths.css)) |
44 | | - .pipe(filter("**/*.css")) |
45 | | - .pipe(browserSync.reload({stream: true})); |
46 | | -}); |
47 | | - |
48 | | -/** |
49 | | - * Start BrowserSync |
50 | | - */ |
51 | | -gulp.task("browser-sync", function () { |
52 | | - |
53 | | - browserSync({ |
54 | | - server: "test/fixtures", |
55 | | - startPath: "sass.html" |
56 | | - }); |
57 | | -}); |
58 | | - |
59 | | -/** |
60 | | - * Start BrowserSync |
61 | | - */ |
62 | | -gulp.task("browser-sync-css", function () { |
63 | | - browserSync({ |
64 | | - server: { |
65 | | - baseDir: "test/fixtures" |
66 | | - } |
67 | | - }); |
68 | | -}); |
69 | | - |
70 | | -/** |
71 | | - * Watch stuff |
72 | | - */ |
73 | | -gulp.task("watch", ["browser-sync"], function () { |
74 | | - gulp.watch(paths.scss, ["sass"]); |
75 | | - gulp.watch(paths.html, browserSync.reload); |
76 | | -}); |
77 | | - |
78 | | -/** |
79 | | - * Watch stuff |
80 | | - */ |
81 | | -gulp.task("watch-css", ["browser-sync-css"], function () { |
82 | | - gulp.watch(paths.cssGlob, function (file) { |
83 | | - browserSync.reload(file.path); |
84 | | - }); |
85 | | - gulp.watch(paths.html, browserSync.reload); |
86 | | -}); |
87 | | - |
88 | | -gulp.task("docs", function () { |
89 | | - |
90 | | - var yuidoc = require("gulp-yuidoc"); |
91 | | - |
92 | | - gulp.src(["./index.js", "./lib/default-config.js"]) |
93 | | - .pipe(yuidoc.parser({spaces: 4})) |
94 | | - .pipe(gulp.dest("./doc")); |
95 | | -}); |
96 | | - |
97 | 13 | gulp.task("changelog", function () { |
98 | 14 | return gulp.src("CHANGELOG.md", { |
99 | 15 | buffer: false |
|
0 commit comments