mirror of
https://github.com/bitwarden/help
synced 2025-12-06 00:03:30 +00:00
move to npm scripts
This commit is contained in:
@@ -9,13 +9,12 @@ The Bitwarden help center project is written using Jekyll, which is hosted/deplo
|
|||||||
**Requirements**
|
**Requirements**
|
||||||
|
|
||||||
- Node.js
|
- Node.js
|
||||||
- Gulp
|
|
||||||
- [Ruby](https://www.ruby-lang.org/)
|
- [Ruby](https://www.ruby-lang.org/)
|
||||||
- [Jekyll](https://jekyllrb.com/)
|
- [Jekyll](https://jekyllrb.com/)
|
||||||
|
|
||||||
Run the following commands:
|
Run the following commands:
|
||||||
- `npm install`
|
- `npm install`
|
||||||
- `gulp`
|
- `npm run build:watch`
|
||||||
|
|
||||||
You can now access the help center at `http://localhost:4009`.
|
You can now access the help center at `http://localhost:4009`.
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ exclude:
|
|||||||
- gulpfile.js
|
- gulpfile.js
|
||||||
- README.md
|
- README.md
|
||||||
|
|
||||||
|
include:
|
||||||
|
- ".nojekyll"
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
categories:
|
categories:
|
||||||
output: true
|
output: true
|
||||||
|
|||||||
39
gulpfile.js
39
gulpfile.js
@@ -1,10 +1,7 @@
|
|||||||
var gulp = require('gulp'),
|
var gulp = require('gulp'),
|
||||||
rimraf = require('rimraf'),
|
rimraf = require('rimraf'),
|
||||||
runSequence = require('run-sequence'),
|
runSequence = require('run-sequence'),
|
||||||
ghPages = require('gulp-gh-pages'),
|
merge = require('merge-stream');
|
||||||
merge = require('merge-stream'),
|
|
||||||
gulpUtil = require('gulp-util'),
|
|
||||||
child = require('child_process');
|
|
||||||
|
|
||||||
var paths = {};
|
var paths = {};
|
||||||
paths.dist = './_site/';
|
paths.dist = './_site/';
|
||||||
@@ -68,37 +65,3 @@ gulp.task('lib', ['clean:lib'], function () {
|
|||||||
|
|
||||||
return merge(tasks);
|
return merge(tasks);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('deploy', [], function () {
|
|
||||||
return gulp.src(paths.dist + '**/*')
|
|
||||||
.pipe(ghPages({ cacheDir: '../.publish_cache/help' }));
|
|
||||||
});
|
|
||||||
|
|
||||||
function jekyll(commands, cb) {
|
|
||||||
var jekyllLogger = (buffer) => {
|
|
||||||
buffer.toString()
|
|
||||||
.split(/\n/)
|
|
||||||
.forEach((message) => gulpUtil.log(message));
|
|
||||||
};
|
|
||||||
var jekyllCommand = process.platform === "win32" ? "jekyll.bat" : "jekyll";
|
|
||||||
var jekyll = child.spawn(jekyllCommand, commands);
|
|
||||||
jekyll.stdout.on('data', jekyllLogger);
|
|
||||||
jekyll.stderr.on('data', jekyllLogger);
|
|
||||||
jekyll.stderr.on('close', cb);
|
|
||||||
return jekyll;
|
|
||||||
}
|
|
||||||
|
|
||||||
gulp.task('jekyll:build', function (cb) {
|
|
||||||
return jekyll(['build', '--watch'], cb);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('jekyll:serve', function (cb) {
|
|
||||||
return jekyll(['serve', '--watch', '--host=0.0.0.0'], cb);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('default', function (cb) {
|
|
||||||
return runSequence(
|
|
||||||
'build',
|
|
||||||
'jekyll:serve',
|
|
||||||
cb);
|
|
||||||
});
|
|
||||||
842
package-lock.json
generated
842
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@@ -1,18 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "bitwarden",
|
"name": "bitwarden-help",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"build": "gulp build && jekyll build",
|
||||||
|
"build:watch": "gulp build && jekyll serve --watch --host=0.0.0.0",
|
||||||
|
"deploy": "npm run build && gh-pages --dotfiles --dist _site"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"rimraf": "2.6.1",
|
"rimraf": "2.6.1",
|
||||||
"run-sequence": "2.1.0",
|
"run-sequence": "2.1.0",
|
||||||
"merge-stream": "1.0.1",
|
"merge-stream": "1.0.1",
|
||||||
"gulp-gh-pages": "0.5.4",
|
|
||||||
"bootstrap-sass": "3.3.7",
|
"bootstrap-sass": "3.3.7",
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"jquery": "2.2.4",
|
"jquery": "2.2.4",
|
||||||
"lunr": "0.7.1",
|
"lunr": "0.7.1",
|
||||||
"fluidbox": "2.0.5",
|
"fluidbox": "2.0.5",
|
||||||
"gulp-util": "3.0.8",
|
"gh-pages": "^1.2.0"
|
||||||
"child_process": "1.0.2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user