Skip to content

Commit 13ff6fc

Browse files
committed
Install Grunt locally, rather than globally.
This is considered best practice, see https://github.com/gruntjs/grunt-cli#installing-grunt-cli-locally.
1 parent 8944bb3 commit 13ff6fc

6 files changed

Lines changed: 16 additions & 42 deletions

File tree

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ language: node_js
22

33
node_js:
44
- "0.10"
5-
6-
before_install:
7-
- npm install grunt-cli -g

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Look at the [Change Log](https://github.com/wenzhixin/bootstrap-table/blob/maste
100100
To build bootstrap-table locally please run:
101101

102102
```
103-
grunt build
103+
npm run grunt
104104
```
105105

106106
Result will appear in `dist` directory.

docs/_i18n/en/getting-started/grunt.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,20 @@ To install Grunt, you must **first** [download and install node.js](http://nodej
1010

1111
Then, from the command line:
1212

13-
1. Install `grunt-cli` globally with `npm install -g grunt-cli`.
14-
2. Navigate to the root `/bootstrap-table/` directory, then run `npm install`. npm will look at the `package.json` file and automatically install the necessary local dependencies listed there.
13+
1. Navigate to the root `/bootstrap-table/` directory, then run `npm install`. npm will look at the `package.json` file and automatically install the necessary local dependencies listed there.
1514

1615
When completed, you'll be able to run the various Grunt commands provided from the command line.
1716

1817
## Available Grunt commands
1918

20-
### `grunt dist` (Just compile CSS and JavaScript)
21-
22-
Regenerates the `/dist/` directory with compiled and minified CSS and JavaScript files. As a Bootstrap user, this is normally the command you want.
23-
24-
### `grunt test` (Run tests)
25-
26-
Runs [JSHint](http://jshint.com/) to test our code.
27-
28-
### `grunt docs` (Build & test the docs assets)
19+
### `npm run grunt docs` (Build & test the docs assets)
2920

3021
Builds and tests CSS, JavaScript, and other assets which are used when running the documentation locally via `jekyll serve`.
3122

32-
### `grunt` (Build absolutely everything and run tests)
23+
### `npm run grunt` (Build absolutely everything and run tests)
3324

3425
Compiles and minifies CSS and JavaScript, builds the documentation website, runs the HTML5 validator against the docs, regenerates the Customizer assets, and more. Requires [Jekyll](http://jekyllrb.com/docs/installation/).
3526

3627
## Troubleshooting
3728

38-
Should you encounter problems with installing dependencies or running Grunt commands, first delete the `/node_modules/` directory generated by npm. Then, rerun `npm install`.
29+
Should you encounter problems with installing dependencies or running Grunt commands, first delete the `/node_modules/` directory generated by npm. Then, rerun `npm install`.

docs/_i18n/es/getting-started/grunt.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,20 @@ Para instalar Grunt, se debe **primero** [descargar e instalar node.js](http://n
1010

1111
Entonces, en la linea de comandos:
1212

13-
1. Instalar `grunt-cli` globalmente con `npm install -g grunt-cli`.
14-
2. Navegue hasta la ruta del folder `/bootstrap-table/`, entonces ejecute `npm install`. npm buscará el archivo `package.json` y automaticamente instalará las dependencias locales necesarias listadas aquí.
13+
1. Navegue hasta la ruta del folder `/bootstrap-table/`, entonces ejecute `npm install`. npm buscará el archivo `package.json` y automaticamente instalará las dependencias locales necesarias listadas aquí.
1514

1615
Cuando esté completo, ya se podrá ejecutar varios comandos de Grunt en la linea de comandos.
1716

1817
## Available Grunt commands
1918

20-
### `grunt dist` (Just compile CSS and JavaScript)
21-
22-
Regenerando el folder `/dist/` con el CSS y JavaScript compilado. Como un usuario de Bootstrap, este es el comando.
23-
24-
### `grunt test` (Run tests)
25-
26-
Ejecute [JSHint](http://jshint.com/) para probar nuestras pruebas.
27-
28-
### `grunt docs` (Compila y prueba la documentación)
19+
### `npm run grunt docs` (Compila y prueba la documentación)
2920

3021
Compila y purueba el CSS, JavaScript, y otros artchivos cuando se esta ejecutando la documentación localmente con `jekyll serve`.
3122

32-
### `grunt` (Compila absolutamente todo y ejecuta pruebas)
23+
### `npm run grunt` (Compila absolutamente todo y ejecuta pruebas)
3324

3425
Compila y minifica el CSS y JavaScript, compila la documentación, ejecuta el validador de HTML5 contra la documentación, regenera los archivos customizables, y más. Se requiere [Jekyll](http://jekyllrb.com/docs/installation/).
3526

3627
## Troubleshooting
3728

38-
Si se encuentran problemas instalando las dependencias o ejecutando los comandos de Grunt, primero elimine el folder `/node_modules/` generado por npm. Entonces, vuelva a ejecutar `npm install`.
29+
Si se encuentran problemas instalando las dependencias o ejecutando los comandos de Grunt, primero elimine el folder `/node_modules/` generado por npm. Entonces, vuelva a ejecutar `npm install`.

docs/_i18n/zh-cn/getting-started/grunt.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,17 @@ Bootstrap table 使用 [Grunt](http://gruntjs.com/) 来作为编译系统,可
1010

1111
然后,我们使用命令行:
1212

13-
1. 安装全局的 `grunt-cli`,使用 `npm install -g grunt-cli` 命令即可。
14-
2. 进入到 `/bootstrap-table/` 的根目录,然后运行 `npm install`。npm 将通过查找 `package.json` 文件并自动安装这里所需要的依赖。
13+
1. 进入到 `/bootstrap-table/` 的根目录,然后运行 `npm install`。npm 将通过查找 `package.json` 文件并自动安装这里所需要的依赖。
1514

1615
完成之后,你就可以运行一下的命令来编译的代码了。
1716

1817
## 可以用的 Grunt 命令
1918

20-
### `grunt dist` (编译 CSS 和 JavaScript)
21-
22-
这里我们会生成 `/dist/` 文件夹。 As a Bootstrap user, this is normally the command you want.
23-
24-
### `grunt test` (运行 tests)
25-
26-
运行 [JSHint](http://jshint.com/) 来测试我们的代码。
27-
28-
### `grunt docs` (编译和测试文档)
19+
### `npm run grunt docs` (编译和测试文档)
2920

3021
编译和测试 CSS,JavaScript,本地我们可以通过 `jekyll serve` 来运行我们的文档。
3122

32-
### `grunt` (编译所有并运行测试)
23+
### `npm run grunt` (编译所有并运行测试)
3324

3425
压缩和扰乱 CSS 和 JavaScript,测试,编译文档等等。依赖 [Jekyll](http://jekyllrb.com/docs/installation/)
3526

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"devDependencies": {
1010
"cz-conventional-changelog": "^1.1.5",
1111
"grunt": "^0.4.5",
12+
"grunt-cli": "^1.2.0",
1213
"grunt-contrib-clean": "^0.6.0",
1314
"grunt-contrib-concat": "^0.5.1",
1415
"grunt-contrib-copy": "^0.8.0",
@@ -17,6 +18,9 @@
1718
"grunt-contrib-uglify": "^0.8.0",
1819
"grunt-release": "^0.13.0"
1920
},
21+
"scripts": {
22+
"grunt": "grunt"
23+
},
2024
"repository": {
2125
"type": "git",
2226
"url": "https://github.com/wenzhixin/bootstrap-table.git"

0 commit comments

Comments
 (0)