Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
UPDATE: 移除Grunt和Makefile,添加Gulp和npm scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlq committed Aug 17, 2016
1 parent 97fa50e commit 159e357
Show file tree
Hide file tree
Showing 37 changed files with 152 additions and 276 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["stage-0", "es2015", "react"],
"plugins": ["react-hot-loader/babel", "transform-runtime", "transform-class-properties", "transform-decorators-legacy"]
"plugins": ["transform-runtime", "transform-class-properties", "transform-decorators-legacy"]

}
}
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
/site/node_modules
/site/.sass-cache
/site/Makefile
/site/scripts/components/base/components
/bower_components
/local
/site/scripts/components/base
/site/styles/*.scss
/site/styles/mixins
/site/styles/modules
/site/styles/utilities
/build
/cache
/app
*.log
/.idea
/.sass-cache
/bower_components
Makefile
scss-lint-report.xml
/lib
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"description": "An enterprise-class UI design language and React-based implementation.",
"main": "./lib/index.js",
"license": "MIT",
"repository": "https://github.com/shenlq/impression.git",
"repository": {
"type": "git",
"url": "git://github.com/shenlq/impression.git"
},
"scripts": {
"eslint": "eslint ./src/scripts/",
"scsslint": "scss-lint src/styles/**/*.scss",
Expand All @@ -16,22 +19,18 @@
"compileminscss": "sass --style compressed src/styles/index.scss lib/index.min.css",
"deploy": "npm run eslint && npm run scsslint && npm run clean && npm run compilejs && npm run compilescss && npm run compileminscss && npm run copy && npm publish"
},
"repository": {
"type": "git",
"url": "git://github.com/shenlq/impression.git"
},
"homepage": "https://github.com/shenlq/impression",
"dependencies": {
"classnames": ">=2.2.0",
"moment": ">=2.0.0",
"react-addons-css-transition-group": ">=15.0.0"
"classnames": "^2.2.0",
"moment": "^2.14.1"
},
"devDependencies": {
"babel": "^6.5.2",
"babel-cli": "^6.10.1",
"babel-core": "^6.7.7",
"babel-eslint": "^6.0.4",
"babel-plugin-transform-class-properties": "^6.8.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
Expand All @@ -42,3 +41,4 @@
"eslint-plugin-react": "^5.0.1"
}
}

2 changes: 1 addition & 1 deletion site/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"presets": ["stage-0", "es2015", "react"],
"plugins": ["react-hot-loader/babel", "transform-runtime", "transform-class-properties", "transform-decorators-legacy"]

}
}
38 changes: 36 additions & 2 deletions site/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,40 @@ module.exports = {
],
"no-mixed-spaces-and-tabs": [
"off"
]
],
"no-console": 2,
"no-alert": 2,
"no-array-constructor": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-constant-condition": 2,
"no-delete-var": 2,
"eqeqeq": 1,
"use-isnan": 2,
"space-in-parens": 0,
"space-before-function-paren": 0,
"space-before-blocks": 0,
"padded-blocks": 0,
"one-var": 1,
"newline-after-var": 2,
"curly": [2, "all"],
"camelcase": 2,
"block-scoped-var": 0,
"arrow-spacing": 0,
"no-with": 2,
"no-unused-expressions": 0,
"no-unreachable": 2,
"no-unneeded-ternary": 2,
"no-trailing-spaces": 1,
"no-sparse-arrays": 2,
"no-spaced-func": 2,
"no-multi-spaces": 1,
"no-fallthrough": 1,
"no-empty": 2,
"no-else-return": 2,
"no-duplicate-case": 2,
"no-dupe-keys": 2,
"no-dupe-args": 2,
"no-delete-var": 2
}
};
};
166 changes: 0 additions & 166 deletions site/Gruntfile.js

This file was deleted.

63 changes: 63 additions & 0 deletions site/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
var gulp = require('gulp'),
clean = require('gulp-clean'),
sass = require('gulp-sass'),
watch = require('gulp-watch'),
imagemin = require('gulp-imagemin'),
cssmin = require('gulp-minify-css'),
sequence = require('gulp-run-sequence'),
autoprefixer = require('gulp-autoprefixer');


//清空
gulp.task('clean', function(){
return gulp.src('build', {read: false})
.pipe(clean({force: true}));
});

//复制图片
gulp.task('copy-image', function(){
return gulp.src('images/*.*')
.pipe(imagemin({verbose: true}))
.pipe(gulp.dest('build/images'));
});

//复制字体
gulp.task('copy-font', function(){
return gulp.src('styles/font-awesome/fonts/**')
.pipe(gulp.dest('build/styles/fonts'));
});

//复制HTML
gulp.task('copy-html', function(){
return gulp.src('index.html')
.pipe(gulp.dest('build'));
});

//编译impress
gulp.task('sass-index', function(){
return gulp.src('styles/index.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({browsers: ['last 30 version', '> 90%']}))
.pipe(cssmin())
.pipe(gulp.dest('build/styles'));
});

//编译font-awesome
gulp.task('sass-fontawesome', function(){
return gulp.src('styles/font-awesome/index.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({browsers: ['last 30 version', '> 90%']}))
.pipe(cssmin())
.pipe(gulp.dest('build/styles/font-awesome'));
});

//监听
gulp.task('watch', function(){
gulp.watch('styles/**/*.scss', ['sass-index']);
});


//本地启动
gulp.task('build', function(cb) {
sequence('clean', ['copy-html', 'copy-image', 'copy-font'], ['sass-index', 'sass-fontawesome'], cb);
});
Loading

0 comments on commit 159e357

Please sign in to comment.