1
0
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:
Kyle Spearrin
2018-09-22 15:59:25 -04:00
parent b751f5ff14
commit 360f840240
6 changed files with 236 additions and 662 deletions

0
.nojekyll Normal file
View File

View File

@@ -9,13 +9,12 @@ The Bitwarden help center project is written using Jekyll, which is hosted/deplo
**Requirements**
- Node.js
- Gulp
- [Ruby](https://www.ruby-lang.org/)
- [Jekyll](https://jekyllrb.com/)
Run the following commands:
- `npm install`
- `gulp`
- `npm run build:watch`
You can now access the help center at `http://localhost:4009`.

View File

@@ -14,6 +14,9 @@ exclude:
- gulpfile.js
- README.md
include:
- ".nojekyll"
collections:
categories:
output: true

View File

@@ -1,10 +1,7 @@
var gulp = require('gulp'),
rimraf = require('rimraf'),
runSequence = require('run-sequence'),
ghPages = require('gulp-gh-pages'),
merge = require('merge-stream'),
gulpUtil = require('gulp-util'),
child = require('child_process');
merge = require('merge-stream');
var paths = {};
paths.dist = './_site/';
@@ -68,37 +65,3 @@ gulp.task('lib', ['clean:lib'], function () {
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

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,21 @@
{
"name": "bitwarden",
"name": "bitwarden-help",
"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": {
"gulp": "3.9.1",
"rimraf": "2.6.1",
"run-sequence": "2.1.0",
"merge-stream": "1.0.1",
"gulp-gh-pages": "0.5.4",
"bootstrap-sass": "3.3.7",
"font-awesome": "4.7.0",
"jquery": "2.2.4",
"lunr": "0.7.1",
"fluidbox": "2.0.5",
"gulp-util": "3.0.8",
"child_process": "1.0.2"
"gh-pages": "^1.2.0"
}
}