Skip to content

Commit

Permalink
Merge pull request #1 from leeluolee/master
Browse files Browse the repository at this point in the history
update from master repo
  • Loading branch information
Offirmo authored Aug 6, 2018
2 parents e48840a + 7e6d045 commit 16b8d72
Show file tree
Hide file tree
Showing 84 changed files with 9,595 additions and 7,117 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ node_modules/
src2
test/tmp/
*.mcss
*tmp/

npm-debug.log

37 changes: 0 additions & 37 deletions Cakefile

This file was deleted.

1 change: 0 additions & 1 deletion LICENSE

This file was deleted.

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

> __Puer - more than a live-reload server , built for efficient frontend development__
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/leeluolee/puer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/leeluolee/puer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[中文指南](http://leeluolee.github.io/2014/10/24/use-puer-helpus-developer-frontend/)


##Features
## Features


1. __create static server__ at target dir (default in current dir)
Expand All @@ -20,13 +20,13 @@
6. __connect-middleware__ support


##install
## Install
`npm -g install puer`


##Usage
## Usage

###Command line
### Command line

in most cases

Expand Down Expand Up @@ -63,7 +63,7 @@ Options:
```


###__mock request__
### __mock request__

During development,you may need to mock a request . use `-a <addon>` to help you mock a dynamic api

Expand Down Expand Up @@ -148,7 +148,7 @@ __Object | Array__: will respone a json format.
```


###__proxy support__
### __proxy support__

you can use `-t` or `--target` to use puer with an exsiting server. For example, say you already have a server running at port 8020.

Expand All @@ -175,7 +175,7 @@ puer -i
```
__[【check the usage record 】](http://leeluolee.github.io/attach/2014-10/puer-step-5.gif)__

###use as [connect|express]-middleware
### use as [connect|express]-middleware


```javascript
Expand Down Expand Up @@ -231,5 +231,5 @@ Example above means that: if js file is changed, reloading won't be actived.



###LICENSE
### LICENSE
MIT
5 changes: 3 additions & 2 deletions bin/puer
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
var path = require('path');
var fs = require('fs');

var cli = path.join(path.dirname(fs.realpathSync(__filename)), '..', 'lib',"cli");
var cli = path.join(path.dirname(fs.realpathSync(__filename)), '..', 'src',"cli");

var args = process.argv.slice(2);

require(cli).run(args);

require(cli);
186 changes: 0 additions & 186 deletions docs/docco.css

This file was deleted.

76 changes: 76 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
var gulp = require('gulp');
var webpack = require('gulp-webpack');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var mocha = require('gulp-mocha');
var source = require('vinyl-source-stream');
var regularify = require('regularify');
var browserify = require('browserify');
var pkg = require("./package.json");



var wpConfig = {
output: {
filename: "client.bundle.js",
library: "puer",
libraryTarget: "umd"
},
module: {
loaders: [
{ test: /\.html$/, loader: "text" }
]
}
}


gulp.task('client', function() {
browserify(['./src/client/client.js'], {})
.transform(regularify({
END: '}',
BEGIN: '{',
rglExt: ['html'],
rglcExt: ['rglc']
}))
.bundle()
.on('error', function(err){
console.log('!!!!!!!!!!!!' + err)
// kao....
done(null)
this.end();
})
.pipe(source('bundle.js'))
.pipe(gulp.dest('src/client'))

// gulp.src("client/client.js")
// .pipe(webpack(wpConfig))
// .pipe(gulp.dest('./client'))
// .on("error", function(err) {
// throw err
// })
});

gulp.task('jshint', function(){
// jshint
gulp.src(['libs/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'))

})



gulp.task('watch', ["client", 'jshint'], function() {
gulp.watch(['libs/**/*.js'], ['jshint']);
gulp.watch(['client/*.js'], ['client']);
})

gulp.task('default', ['watch']);

gulp.task('mocha', function() {
return gulp.src(['test/spec/*.js'])
.pipe(mocha({ reporter: 'spec' }))
.on('error', function() {
console.log('\u0007');
})
});
Loading

0 comments on commit 16b8d72

Please sign in to comment.