Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Merge develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed Apr 3, 2017
2 parents d3dae1c + 26533d6 commit e753034
Show file tree
Hide file tree
Showing 23 changed files with 7,178 additions and 545 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
language: node_js
node_js:
- "0.11"
- "0.10"
before_script:
- npm install -g grunt-cli
- "6.10"
59 changes: 56 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
var fs = require("fs");
var tsfmt = require("typescript-formatter");

// This file defines grunt tasks used by [Grunt.js](http://gruntjs.com/sample-gruntfile)
module.exports = function ( grunt ) {

Expand Down Expand Up @@ -25,6 +28,8 @@ module.exports = function ( grunt ) {
options: {force: true},
dist: [ "dist/" ],
jsdoc: [ "dist/jsdoc/" ],
jsdocjson: [ "dist/doc.json" ],
tsd: [ "dist/gitgraph.d.ts" ],
release: [ "build/", "docs/" ]
},

Expand All @@ -41,6 +46,10 @@ module.exports = function ( grunt ) {
release: {
src: [ "src/gitgraph.js" ],
dest: "build/gitgraph.js"
},
tsd: {
src: [ "dist/gitgraph.d.ts" ],
dest: "dist/gitgraph.d.ts"
}
},

Expand Down Expand Up @@ -91,6 +100,14 @@ module.exports = function ( grunt ) {
destination: "dist/docs"
}
},
json: {
src: [ "dist/jsdoc/src/*.js", "README.md" ],
options: {
configure: ".jsdocrc",
destination: "dist/doc.json",
template: "./node_modules/jsdoc-json"
}
},
release: {
src: [ "dist/jsdoc/src/*.js", "README.md" ],
options: {
Expand Down Expand Up @@ -190,21 +207,56 @@ module.exports = function ( grunt ) {
// `grunt lint` will check code by running JSHint and unit tests over it.
grunt.registerTask( "test", [ "jshint", "jasmine" ] );

// `grunt docs` will create non-versioned documentation for development use.
// `grunt doc` will create non-versioned documentation for development use.
grunt.registerTask( "doc", [
"string-replace:jsdoc",
"jsdoc:dist",
"clean:jsdoc"
] );

// `grunt doc:json` will create non-versioned documentation for development use.
grunt.registerTask( "doc:json", [
"string-replace:jsdoc",
"jsdoc:json",
"clean:jsdoc"
] );

// `grunt parse:tsd` will parse /dist/doc.json to /dist/gitgraph.d.ts
grunt.registerTask( "parse:tsd", function (dest) {
const done = this.async();
const data = JSON.parse(fs.readFileSync("./dist/doc.json"));
const fileContent = require("./scripts/json2tsd")(data).generate();
fs.writeFile(`./${dest}/gitgraph.d.ts`, fileContent, () => {
tsfmt.processFiles([`./${dest}/gitgraph.d.ts`],{
replace: true
}).then(done);
});
});

// `grunt tsd` will generate /dist/gitgraph.d.ts
grunt.registerTask( "tsd", [
"doc:json",
"parse:tsd:dist",
"concat:tsd",
"clean:jsdocjson"
]);

// `grunt tsd:release` will generate /build/gitgraph.d.ts
grunt.registerTask( "tsd:release", [
"doc:json",
"parse:tsd:build",
"clean:jsdocjson"
]);

// `grunt dist` will create a non-versioned new release for development use.
grunt.registerTask( "dist", [
"test",
"clean:dist",
"copy:dist",
"concat:dist",
"uglify:dist",
"doc"
"doc",
"tsd"
] );

// `grunt release` will create a new release of the source code.
Expand All @@ -216,7 +268,8 @@ module.exports = function ( grunt ) {
"uglify:release",
"string-replace:jsdoc",
"jsdoc:release",
"clean:jsdoc"
"clean:jsdoc",
"tsd:release"
] );

// `grunt server` will open a live reload server in your favorite browser.
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Grunt commands.

From the command line:

- Install `grunt-cli` globally with `npm install -g grunt-cli`.
- Install [the necessary local dependencies][] with `npm install`.
[the necessary local dependencies]: https://github.com/nicoespeon/gitgraph.js/blob/master/package.json

Expand All @@ -57,30 +56,34 @@ the command line.

[> Need more information about how to get started with Grunt?](http://gruntjs.com/getting-started)

### Available Grunt commands
### Available commands

#### test code - `grunt test`
#### test code - `npm test`

Check source code against [JSHint][] then runs unit tests with [Jasmine][].
[JSHint]: http://www.jshint.com/
[Jasmine]: https://jasmine.github.io/

#### generate documentation - `grunt doc`
#### generate documentation - `npm run doc`

Generate source code documentation into `dist/docs/` (not versioned) with
[JSDoc](http://usejsdoc.org/).

#### compile a non-versioned release - `grunt dist`
#### generate TypeScript Definition - `npm run tsd`

Generate TypeScript Definition into `dist/gitgraph.d.ts` (not versioned).

#### compile a non-versioned release - `npm run dist`

Clean `dist/` directory, lint code, output the minified release into
`dist/gitgraph.min.js` and generate the documentation into `dist/docs/`.

#### compile a new release - `grunt release`
#### compile a new release - `npm run release`

Lint code, output the source and minified releases into `build/` and generate
the official documentation into `docs/`.

#### open a live reload server - `grunt server`
#### open a live reload server - `npm start`

For a better code experience, this grunt task opens a live server in your
favorite browser. This server is automatically reloaded when you save a project
Expand Down
7 changes: 5 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "gitgraph.js",
"version": "1.9.0",
"main": ["./build/gitgraph.js", "./build/gitgraph.css"],
"version": "1.10.0",
"main": [
"./build/gitgraph.js",
"./build/gitgraph.css"
],
"ignore": [
"**/.*"
]
Expand Down
Loading

0 comments on commit e753034

Please sign in to comment.