Skip to content

Commit fb4de11

Browse files
committed
packaging
1 parent 9b0aaa8 commit fb4de11

File tree

6 files changed

+47
-20
lines changed

6 files changed

+47
-20
lines changed

dist/wp-api-angularjs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* wp-api-angularjs - WordPress WP-API client for AngularJs
3+
* @version v1.0.0-rc1
4+
* @author shprink <[email protected]>
5+
* @link https://github.com/shprink/wp-api-angularjs
6+
* @license MIT
7+
*/
18
/******/ (function(modules) { // webpackBootstrap
29
/******/ // The module cache
310
/******/ var installedModules = {};
@@ -44,7 +51,6 @@
4451
/* 0 */
4552
/***/ function(module, exports, __webpack_require__) {
4653

47-
/** @jsx React.DOM */
4854
module.exports = angular.module('wp-api-angularjs', [
4955
__webpack_require__(1).name,
5056
__webpack_require__(2).name

dist/wp-api-angularjs.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,40 @@
11
var gulp = require('gulp'),
22
gutil = require("gulp-util"),
3+
header = require('gulp-header'),
4+
webpack = require('gulp-webpack'),
35
extend = require('util')._extend,
4-
webpack = require("webpack"),
6+
pkg = require('./package.json'),
7+
// webpack = require("webpack"),
58
webpackDevConfig = require("./webpack.build:dev"),
69
webpackProdConfig = require("./webpack.build:prod");
710

8-
gulp.task('default', ['build:dev', 'build:prod']);
11+
var banner = ['/**',
12+
' * <%= pkg.name %> - <%= pkg.description %>',
13+
' * @version v<%= pkg.version %>',
14+
' * @author <%= pkg.author %>',
15+
' * @link <%= pkg.homepage %>',
16+
' * @license <%= pkg.license %>',
17+
' */',
18+
''
19+
].join('\n');
20+
21+
gulp.task('default', ['build']);
922
gulp.task('build', ['build:dev', 'build:prod']);
1023

1124
gulp.task("build:dev", function(callback) {
12-
return webpack(webpackDevConfig, function(err, stats) {
13-
gutil.log("[webpack:build]", stats.toString({
14-
colors: true
15-
}));
16-
callback();
17-
});
25+
return gulp.src(webpackDevConfig.entry)
26+
.pipe(webpack(webpackDevConfig))
27+
.pipe(header(banner, {
28+
pkg: pkg
29+
}))
30+
.pipe(gulp.dest('dist/'));
1831
});
1932

2033
gulp.task("build:prod", function(callback) {
21-
return webpack(webpackProdConfig, function(err, stats) {
22-
gutil.log("[webpack:build]", stats.toString({
23-
colors: true
24-
}));
25-
callback();
26-
});
34+
return gulp.src(webpackProdConfig.entry)
35+
.pipe(webpack(webpackProdConfig))
36+
.pipe(header(banner, {
37+
pkg: pkg
38+
}))
39+
.pipe(gulp.dest('dist/'));
2740
});

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "wp-api-angularjs",
3-
"version": "0.0.1",
3+
"version": "1.0.0-rc1",
44
"description": "WordPress WP-API client for AngularJs",
5-
"main": "./dist/wp-api-angularjs.js",
5+
"main": "dist/wp-api-angularjs.js",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/shprink/wp-api-angularjs"
@@ -15,7 +15,7 @@
1515
"restfull",
1616
"client"
1717
],
18-
"author": "shprink",
18+
"author": "shprink <[email protected]>",
1919
"license": "MIT",
2020
"bugs": {
2121
"url": "https://github.com/shprink/wp-api-angularjs/issues"
@@ -27,7 +27,9 @@
2727
"exports-loader": "^0.6.2",
2828
"expose-loader": "^0.6.0",
2929
"gulp": "^3.8.10",
30+
"gulp-header": "^1.2.2",
3031
"gulp-util": "^3.0.1",
32+
"gulp-webpack": "^1.1.2",
3133
"html-webpack-plugin": "^1.1.0",
3234
"ng-annotate-webpack-plugin": "^0.1.2",
3335
"path": "^0.4.9",

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require('expose?_!underscore');
33
require('restangular');
44

55
module.exports = angular.module('wp-api-angularjs.test', [
6-
require('../lib/index.js').name, // import the lib
6+
require('../dist/wp-api-angularjs.js').name, // import the lib
77
require('./MainController').name
88
])
99
.config(function(WpApiProvider) {

version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)