Skip to content

Commit

Permalink
chore: add gulp npm task for npm publish & npm publish v1.0.2, close #59
Browse files Browse the repository at this point in the history
  • Loading branch information
06wj committed Dec 6, 2016
1 parent 174a01d commit d5383d9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ test/screenshot/
.idea/
*.sw*
*.un~

build/commonjs/.npmignore
build/commonjs/LICENSE
build/commonjs/README.md
build/commonjs/package.json
build/commonjs/hilo-standalone.js
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.min.js
*.zip
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hilo - HTML5 Game Framework [![Build Status][travis-image]][travis-url] [![gitter.im][gitter-image]][gitter-url]
# Hilo - HTML5 Game Framework [![npm][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![gitter.im][gitter-image]][gitter-url]

[中文版](./README_ZH.md)

Expand Down Expand Up @@ -89,5 +89,7 @@ Get started by reading [docs/api-en/index.html](http://hiloteam.github.io/Hilo/d
[travis-url]: https://travis-ci.org/hiloteam/Hilo
[gitter-image]: https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square
[gitter-url]: https://gitter.im/hiloteam/Hilo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[npm-image]: https://img.shields.io/npm/v/hilojs.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/hilojs
[example-image]: https://img.alicdn.com/tps/TB1vDlBLVXXXXcDXVXXXXXXXXXX-850-806.png
[example-url]: http://hiloteam.github.io/examples/index.html
6 changes: 4 additions & 2 deletions README_ZH.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hilo - HTML5 互动游戏引擎 [![Build Status][travis-image]][travis-url] [![gitter.im][gitter-image]][gitter-url]
# Hilo - HTML5 互动游戏引擎 [![npm][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![gitter.im][gitter-image]][gitter-url]

[English Version](./README.md)

Expand Down Expand Up @@ -89,5 +89,7 @@ Hilo 是阿里巴巴集团开发的一款HTML5跨终端游戏解决方案,ta
[travis-url]: https://travis-ci.org/hiloteam/Hilo
[gitter-image]: https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square
[gitter-url]: https://gitter.im/hiloteam/Hilo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[npm-image]: https://img.shields.io/npm/v/hilojs.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/hilojs
[example-image]: https://img.alicdn.com/tps/TB1vDlBLVXXXXcDXVXXXXXXXXXX-850-806.png
[example-url]: http://hiloteam.github.io/examples/index.html
[example-url]: http://hiloteam.github.io/examples/index.html
16 changes: 16 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,22 @@ gulp.task('watch', ['setIsWatch', 'standalone', 'flash', 'extensions'], function
gulp.watch('src/extensions/**/*.js', ['extensions']);
});

gulp.task('npm', ['commonjs-format', 'standalone-format'], function(){
var standaloneStream = gulp.src('build/standalone/hilo-standalone.js')
.pipe(footer(`
if(typeof module !== 'undefined' && module.exports){
module.exports = Hilo;
}
`))
.pipe(gulp.dest('build/commonjs'));

var packageStream = gulp.src(['package.json', '.npmignore', 'LICENSE', 'README.md'])
.pipe(replace('"name": "Hilo"', '"name": "hilojs"'))
.pipe(gulp.dest('build/commonjs'));

return merge(standaloneStream, packageStream);
});

//test
gulp.task('test', ['setIsWatch', 'standalone', 'flash'], function () {
return gulp
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Hilo",
"version": "1.0.1",
"version": "1.0.2",
"description": "Hilo Game Framework",
"author": "Hilo Dev Team",
"license": "MIT",
"main": "gulpfile.js",
"main": "hilo-standalone.js",
"repository": {
"type": "git",
"url": "[email protected]:hiloteam/hilo.git"
Expand Down

0 comments on commit d5383d9

Please sign in to comment.