Skip to content

Commit b2aa207

Browse files
Portugal, Marcelomportuga
Portugal, Marcelo
authored andcommitted
docs(ngdocs): replace grunt-ngdocs with grunt-uidocs-generator
This will allow us to keep better track of security issues and provides us an easier paths for upgrades in the future. fix #6797
1 parent 9e65084 commit b2aa207

File tree

9 files changed

+1652
-5148
lines changed

9 files changed

+1652
-5148
lines changed

FIRST_TIMER.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pull request.
2727

2828
In order to contribute an update your basic process is:
2929

30-
- Fork the ui-grid repository in github, giving you your own copy in which you
30+
- Fork the ui-grid repository in github, giving you your own copy in which you
3131
can work, and over which you have access permissions
3232
- Clone that repository
3333
- Setup the toolset on your local machine
@@ -39,7 +39,7 @@ can work, and over which you have access permissions
3939
We'll go through each step in turn.
4040

4141
### Fork the ui-grid repository ###
42-
This is the easiest step. Get yourself a github logon, and navigate to the
42+
This is the easiest step. Get yourself a github logon, and navigate to the
4343
[ui-grid github page](https://github.com/angular-ui/ui-grid). Click the
4444
fork button in the top left. This should navigate you to your list of
4545
projects in github, with a new fork of ui-grid.
@@ -63,7 +63,7 @@ Links to try might include:
6363
In your github repository, on the right hand side underneath settings you'll see
6464
a box with "clone url" written in it. Copy this clone url.
6565

66-
Using the command line (terminal in OSX or linux, cmd in windows)
66+
Using the command line (terminal in OSX or linux, cmd in windows)
6767
go to the directory in which you store your projects. Type:
6868
`git clone <url you copied>`
6969

@@ -86,7 +86,7 @@ This allows you to get the latest code from upstream by:
8686
We'll discuss these steps later, for now we just want the setup done.
8787

8888
## Setup the toolset ###
89-
Before we do anything else we'll check that we can compile the code and run all
89+
Before we do anything else we'll check that we can compile the code and run all
9090
the tests - if there are problems here then we want to know it's something wrong
9191
in the install rather than a change that you've made.
9292

@@ -98,7 +98,7 @@ tells the node package manager (npm) what to install, bower.json tells bower wha
9898

9999
The installation process is to first install the global packages:
100100
` npm install -g grunt-cli`
101-
If you're on a unix derived machine (OSX, Linux) you may need elevated privileges to do
101+
If you're on a unix derived machine (OSX, Linux) you may need elevated privileges to do
102102
this install:
103103
` sudo npm install -g grunt-cli`
104104

@@ -112,7 +112,7 @@ Next, run the build process to verify that it builds successfully and all the un
112112
pass. The build process is driven by a tool called grunt - think of this as being similar
113113
to make (for c++), rake (for ruby on rails), ant, cake, or any other build tool.
114114

115-
The core grunt configuration lives in `Gruntfile.js`, in general you shouldn't need to
115+
The core grunt configuration lives in `Gruntfile.js`, in general you shouldn't need to
116116
change this, but if you get difficulties this is where you'd trouble shoot.
117117

118118
To run a basic build, including unit tests, we can run the grunt default task:
@@ -125,7 +125,7 @@ something has gone wrong. Tell us about it, and help to improve this guide by a
125125
common errors and resolutions here:
126126

127127
- So far, no common errors.
128-
128+
129129
Next, we want to run the end to end tests. This may require installing protractor
130130
and selenium. Start by running the grunt install task:
131131
` grunt install`
@@ -155,7 +155,7 @@ and add `ddescribe` in there. `iit` has a similar effect. Remember to take thi
155155
again before submitting a pull request.
156156

157157
### Make documentation changes ###
158-
Before making any changes, create a feature branch. This means that you branch the code
158+
Before making any changes, create a feature branch. This means that you branch the code
159159
base before you commit anything, and this branch is what you'll do a pull request against.
160160
` git fetch upstream`
161161
` git checkout upstream/master`
@@ -166,25 +166,25 @@ The documentation for ui-grid comes in three components:
166166

167167
1. The .md files within the root directory of the project. These are visible only
168168
on github, through clicking on them. They generally deal with information for a contributor,
169-
such as this guide. These can be edited directly, then submitted. They are authored in
169+
such as this guide. These can be edited directly, then submitted. They are authored in
170170
markdown format, and can only be viewed in their rendered format on github - so you edit them
171171
then push to your fork, and look at them on github.
172-
2. The tutorial files. These are in misc/tutorial/*.ngdoc, and are built by the grunt-ngdocs
172+
2. The tutorial files. These are in misc/tutorial/*.ngdoc, and are built by the grunt-uidocs-generator
173173
processor into the dist/docs/partials directory. You can preview your changes through running
174174
`grunt dev` and looking at http://localhost:9003. These are again in markdown, but in a special
175175
ngdoc version of markdown. They can include end-to-end tests, and examples that are exportable
176176
to plunkr. The biggest gotcha is being careful with where you put the ":" in the name
177177
3. The api documentation. This is extracted from the comment blocks in the javascript (`src/` folder).
178-
It uses ngdoc format and is processed by the grunt-ngdocs tool. Edits to this are done within
178+
It uses ngdoc format and is processed by the grunt-uidocs-generator tool. Edits to this are done within
179179
the comment blocks in the code.
180180

181181
All of this content can be edited with a text editor.
182182

183-
The ngdoc generator has some tricks and tips. It is somewhat fussy about integrity - if you declare
183+
The uidocs generator has some tricks and tips. It is somewhat fussy about integrity - if you declare
184184
a method to be `@methodOf` something, then that something must exist. If it doesn't then you'll get
185-
an obscure error from grunt-ngdocs. The best advice is to save often and keep checking that it's
185+
an obscure error from grunt-uidocs-generator. The best advice is to save often and keep checking that it's
186186
extracting and rendering properly - then if something gives an error you'll have a good idea of what
187-
you changed. If you make bulk changes then run grunt-ngdocs, and you get an error, you'll have very
187+
you changed. If you make bulk changes then run grunt-uidocs-generator, and you get an error, you'll have very
188188
poor information about where the error is within the documentation set.
189189

190190
### Run the unit and e2e tests ###
@@ -204,8 +204,8 @@ To commit to git, you can:
204204
In your commit message, follow the guidelines from [CONTRIBUTING.md](https://github.com/angular-ui/ui-grid/blob/master/CONTRIBUTING.md):
205205

206206
- Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
207-
or your code is unlikely be merged into the main project.
208-
207+
or your code is unlikely be merged into the main project.
208+
209209
If you've made multiple commits to the code, you need to squash them into a single commit so that
210210
we don't end up with lots of small/junk commits in the overall project history. To do this you
211211
use the interactive rebase function of git:
@@ -242,9 +242,7 @@ license your work under the the terms of the [MIT License](LICENSE.md).
242242

243243
Remember that this is a volunteer only open source project. Most of the developers are working on their
244244
own areas of the functionality, and usually doing that in stolen moments of time. They generally prefer to
245-
spend time coding their own stuff rather than reviewing the pull requests of others. Typically it'll take a
245+
spend time coding their own stuff rather than reviewing the pull requests of others. Typically it'll take a
246246
couple of days for someone to find the time to review and comment on your pull request. Most people will
247247
have a few updates they're requested to make on the first couple, whilst they learn the ropes, so be prepared
248248
for that.
249-
250-

README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
77
[![npm](https://img.shields.io/npm/dm/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
88
[![devDependencies Status](https://david-dm.org/angular-ui/ui-grid/dev-status.svg)](https://david-dm.org/angular-ui/ui-grid?type=dev)
9-
[![OpenCollective](https://opencollective.com/ui-grid/backers/badge.svg)](#backers)
9+
[![OpenCollective](https://opencollective.com/ui-grid/backers/badge.svg)](#backers)
1010
[![OpenCollective](https://opencollective.com/ui-grid/sponsors/badge.svg)](#sponsors)
1111

1212
[![Selenium Test Status](https://saucelabs.com/browser-matrix/nggrid.svg)](https://saucelabs.com/u/nggrid)
@@ -88,14 +88,14 @@ like your plugin added to that list, please [edit the tutorial page](misc/tutori
8888
8989
# Building
9090
91-
The first step is to install dependencies. `git` is required and must be available from the command line. If you don't have it, install git and ensure that the executable is in your path. If you are new to git, the easiest way to install is by installing the github client.
91+
The first step is to install dependencies. `git` is required and must be available from the command line. If you don't have it, install git and ensure that the executable is in your path. If you are new to git, the easiest way to install is by installing the github client.
9292
9393
The `grunt` command line utility is also required.
9494
9595
# If you don't already have the grunt-cli installed:
9696
> npm install -g grunt-cli
9797
98-
With `git` and `grunt-cli` installed you simply run the following commands to install all dependencies.
98+
With `git` and `grunt-cli` installed you simply run the following commands to install all dependencies.
9999
100100
> npm install
101101
> grunt install
@@ -109,7 +109,7 @@ The default grunt task will test and build files into `dist/`
109109
Development "watch" task. This will automatically rebuild from source on changes, reload Gruntfile.js if you change it, and rebuild the docs.
110110
111111
1. A server on localhost:9002 serving whichever directory you checked out, with livereload. Navigate to http://localhost:9002/misc/demo to see the [demo files](http://localhost:9002/misc/demo/grid-directive.html).
112-
2. A server on localhost:9003 serving the ./docs directory. These are the docs built from source with a custom grunt-ngdocs that should work with Angular 1.6.x.
112+
2. A server on localhost:9003 serving the ./docs directory. These are the docs built from source with grunt-uidocs-generator.
113113
114114
115115
@@ -252,5 +252,3 @@ Become a sponsor and get your logo on our website and on our README on Github wi
252252
<a href="https://opencollective.com/ui-grid/sponsor/27/website" target="_blank"><img src="https://opencollective.com/ui-grid/sponsor/27/avatar.svg"></a>
253253
<a href="https://opencollective.com/ui-grid/sponsor/28/website" target="_blank"><img src="https://opencollective.com/ui-grid/sponsor/28/avatar.svg"></a>
254254
<a href="https://opencollective.com/ui-grid/sponsor/29/website" target="_blank"><img src="https://opencollective.com/ui-grid/sponsor/29/avatar.svg"></a>
255-
256-

grunt/aliases.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (grunt, options) {
1010
'default': ['before-test', 'test:single', 'after-test'],
1111

1212
// Build with no testing
13-
'build': ['ngtemplates', 'concat', 'uglify', 'less', 'ngdocs', 'copy:font_dist', 'copy:site', 'copy:less_customizer',],
13+
'build': ['ngtemplates', 'concat', 'uglify', 'less', 'uidocs-generator', 'copy:font_dist', 'copy:site', 'copy:less_customizer',],
1414

1515
// Auto-test tasks for development
1616
'autotest:unit': ['karmangular:start'],
@@ -51,7 +51,7 @@ module.exports = function (grunt, options) {
5151
baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'copy:less_dist', 'cut-release', 'gh-pages:ui-grid-site', 'update-bower-json', 'gh-pages:bower', 'npm-publish'];
5252
}
5353
else {
54-
baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'copy:less_dist', 'cut-release', 'gh-pages:ui-grid-site'];
54+
baseTasks['release'] = ['clean', 'ngtemplates', 'build', 'copy:less_dist', 'cut-release'];
5555
}
5656

5757
return baseTasks;

grunt/ngdocs.js grunt/uidocs-generator.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
'//ajax.googleapis.com/ajax/libs/angularjs/<%= latestAngular %>/angular.js',
2222
'//ajax.googleapis.com/ajax/libs/angularjs/<%= latestAngular %>/angular-touch.js',
2323
'//ajax.googleapis.com/ajax/libs/angularjs/<%= latestAngular %>/angular-animate.js',
24+
'//ajax.googleapis.com/ajax/libs/angularjs/<%= latestAngular %>/angular-aria.js',
2425
'bower_components/csv-js/csv.js',
2526
'bower_components/pdfmake/build/pdfmake.js',
2627
'bower_components/pdfmake/build/vfs_fonts.js',
@@ -29,8 +30,6 @@ module.exports = {
2930
'bower_components/excel-builder-js/dist/excel-builder.dist.js'
3031
],
3132
hiddenScripts: [
32-
'//ajax.googleapis.com/ajax/libs/angularjs/<%= latestAngular %>/angular-animate.js',
33-
'//ajax.googleapis.com/ajax/libs/angularjs/<%= latestAngular %>/angular-aria.js',
3433
'bower_components/google-code-prettify/src/prettify.js',
3534
'node_modules/marked/lib/marked.js'
3635
],
@@ -45,13 +44,18 @@ module.exports = {
4544
// process.env.TRAVIS ? '<%= dist %>/release/<%= pkg.name %>.unstable.css' : '<%= dist %>/release/<%= pkg.name %>.css'
4645
// '<%= dist %>/release/<%= pkg.name %>.css'
4746
],
47+
baseCSSPath: 'misc/doc/css/bootstrap-flatly.min.css',
4848
title: 'UI Grid',
4949
titleLink: '/',
5050
html5Mode: false,
5151
analytics: {
5252
account: 'UA-46391685-1',
5353
domainName: 'ui-grid.info'
5454
},
55+
adsConfig: {
56+
client: 'ca-pub-6177019177103290',
57+
slot: '3609320072'
58+
},
5559
navTemplate: 'misc/doc/templates/nav.html'
5660
},
5761
api: {

grunt/watch.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function( grunt, options ){
66

77
gruntfile: {
88
files: ['<%= jshint.gruntfile.src %>', 'grunt/*.js'],
9-
tasks: ['jshint:gruntfile', 'ngdocs']
9+
tasks: ['jshint:gruntfile', 'uidocs-generator']
1010
},
1111

1212
ngtemplates: {
@@ -17,7 +17,7 @@ module.exports = function( grunt, options ){
1717

1818
rebuild: {
1919
files: util.testFiles.unit,
20-
tasks: ['jshint:src_test', 'jscs', 'karmangular:run', 'concat', 'uglify', 'ngdocs'],
20+
tasks: ['jshint:src_test', 'jscs', 'karmangular:run', 'concat', 'uglify', 'uidocs-generator'],
2121
},
2222

2323
protractor: {
@@ -27,12 +27,12 @@ module.exports = function( grunt, options ){
2727

2828
less: {
2929
files: 'src/**/*.less',
30-
tasks: ['less', 'ngdocs', 'concat:customizer_less']
30+
tasks: ['less', 'uidocs', 'concat:customizer_less']
3131
},
3232

3333
docs: {
3434
files: ['misc/tutorial/**/*.ngdoc', 'misc/api/**/*.ngdoc', 'misc/doc/**'],
35-
tasks: 'ngdocs'
35+
tasks: 'uidocs-generator'
3636
},
3737

3838
copy: {

lib/grunt/plugins.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ var util = require('./utils.js');
44
var semver = require('semver');
55
var shell = require('shelljs');
66

7-
var ngdoc = require('../../node_modules/grunt-ngdocs/src/ngdoc.js');
8-
var reader = require('../../node_modules/grunt-ngdocs/src/reader.js');
7+
var uidoc = require('../../node_modules/grunt-uidocs-generator/tasks/lib/uidoc.js');
8+
var reader = require('../../node_modules/grunt-uidocs-generator/tasks/lib/reader.js');
99

1010
var projectPath = path.resolve(__dirname, '../..');
1111
var pkg = require(path.resolve(projectPath, 'package.json'));
@@ -172,7 +172,7 @@ module.exports = function(grunt) {
172172
});
173173

174174
grunt.registerMultiTask('cut-release', 'Release the built code', function() {
175-
// Require the build and ngdocs tassk to be run first
175+
// Require the build and uidocs task to be run first
176176
grunt.task.requires(['build']);
177177

178178
var options = this.options({
@@ -370,10 +370,6 @@ module.exports = function(grunt) {
370370

371371
var contents = fs.readFileSync(abspath, 'utf8');
372372

373-
// var d = new ngdoc.Doc(contents);
374-
// d.parse();
375-
// console.log(d);
376-
377373
reader.process(contents, abspath);
378374
});
379375

misc/doc/templates/nav.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
<ul class="nav navbar-nav navbar-right">
2-
<li><a href="https://github.com/angular-ui/ng-grid/">Github</a></li>
3-
</ul>
2+
<li>
3+
<a href="https://github.com/angular-ui/ui-grid/" title="View on Github">
4+
<span class="icon-github" aria-hidden="true"></span> View on Github
5+
</a>
6+
</li>
7+
</ul>

0 commit comments

Comments
 (0)