Skip to content

Commit

Permalink
doc script and npmignore
Browse files Browse the repository at this point in the history
  • Loading branch information
yeojz committed Apr 5, 2017
1 parent b2c77f5 commit 86fae2b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ coverage
.npm
.node_repl_history

/docs
/site/public/otplib.*
/site/public/docs/*
/dist
Expand Down
17 changes: 10 additions & 7 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
.DS_Store
src
docs
stories
examples
coverage
tests
site
esdoc.json

/docs
/buildtools
.babelrc
.eslintignore
.eslintrc
.nycrc
.travis.yml
circle.yml
jsdoc.json
public
archive
dist/docs
webpack.config.js
17 changes: 17 additions & 0 deletions buildtools/moveDocs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable no-console */

let ncp = require('ncp').ncp;
let pkg = require('../package.json');
let path = require('path');

const ROOT_DIR = path.resolve(__dirname, '..');
const SOURCE_DIR = path.resolve(ROOT_DIR, 'docs', pkg.name, pkg.version);
const DEST_DIR = path.resolve(ROOT_DIR, 'site', 'public', 'docs')

ncp(SOURCE_DIR, DEST_DIR, function (err) {
if (err) {
console.error(err);
return;
}
console.log('[docs] moved to public');
});
2 changes: 1 addition & 1 deletion jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"useLongnameInNav": false
},
"opts": {
"destination": "./site/public/docs/",
"destination": "./docs/",
"encoding": "utf8",
"private": true,
"recurse": true,
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"coverage": "cross-env NODE_ENV=test nyc report --reporter=lcov",
"coveralls": "cross-env NODE_ENV=test nyc report --reporter=text-lcov | coveralls",
"lint": "eslint --ext js src tests",
"move:docs": "node ./buildtools/moveDocs",
"test": "cross-env NODE_ENV=test NODE_PATH=. npm run test:run",
"test:run": "nyc --reporter=text-summary mocha 'tests/**/*.spec.js'",
"test:watch": "npm run test -- -- --watch"
Expand Down Expand Up @@ -61,6 +62,7 @@
"babel-loader": "^6.4.1",
"jsdoc": "^3.4.3",
"minami": "^1.1.1",
"ncp": "^2.0.0",
"sinon": "^2.1.0",
"thirty-two": "1.0.2"
}
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,10 @@ natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"

ncp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"

node-libs-browser@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.0.0.tgz#a3a59ec97024985b46e958379646f96c4b616646"
Expand Down

0 comments on commit 86fae2b

Please sign in to comment.