Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
build: update build config
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazeyu committed Aug 26, 2018
1 parent cd53b2b commit 0c09af4
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 139 deletions.
38 changes: 25 additions & 13 deletions .esdoc.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
{
"source": "./src",
"destination": "./ghpages/docs",
"excludes": ["\\.nodoc\\.js$"],
"excludes": [
"\\.nodoc\\.js$"
],
"plugins": [
{
"name": "esdoc-standard-plugin",
"option": {
"lint": {"enable": true},
"coverage": {"enable": true},
"undocumentIdentifier": {"enable": true},
"unexportedIdentifier": {"enable": false},
"typeInference": {"enable": true},
"lint": {
"enable": true
},
"coverage": {
"enable": true
},
"undocumentIdentifier": {
"enable": true
},
"unexportedIdentifier": {
"enable": false
},
"typeInference": {
"enable": true
},
"brand": {
"title": "live2d-widget.js",
"description": "Add the Sseexxyyy live2d to webpages.",
"repository": "https://github.com/xiazeyu/live2d-widget.js",
"site": "https://l2dwidget.js.org/"
},
"manual": {
"index": "./README.md",
"globalIndex": true,
"asset": "./ghpages/assets/",
"files": [
"./README.md",
"./CHANGELOG.md"
]
"index": "./README.md",
"globalIndex": true,
"asset": "./ghpages/assets/",
"files": [
"./README.md",
"./CHANGELOG.md"
]
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module.exports = {
'commonjs': true,
'es6': true,
},
'extends': 'eslint:all',
// 'extends': 'eslint:recommended',
// 'extends': 'eslint:all',
'extends': 'eslint:recommended',
'parserOptions': {
'sourceType': 'module',
},
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ cache:
directories:
- node_modules
before_install:
- git submodule update --init --recursive
- 'git submodule update --init --recursive'
install:
- npm install
- 'npm install'
script:
- npm run build:prod
- npm run lint
- 'npm run build:prod'
- 'npm run lint'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./build/deployDocs; fi'
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"eslint.enable": true
}
"eslint.enable": true
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Docs: [Click me!](https://l2dwidget.js.org/docs/index.html)

## Browser requirements

We use config below as our supported browsers.
We use config below as our [babel-preset-env](https://babeljs.io/docs/plugins/preset-env/)'s config.

```json

Expand Down Expand Up @@ -131,7 +131,7 @@ eg.

```

### Bookmark (any pages)
### Bookmarks

```url

Expand Down
24 changes: 1 addition & 23 deletions build/afterBuild.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
/* global __dirname */

const fs = require('fs');
const path = require('path');

/**
* TO find the nearest path which contains package.json
* @param {Function} callback A function which receives current project path.
* @param {String} lastSearch Last path of searching.
* @return {String} Path of current project.
*/
function getProjPath (callback, lastSearch = __dirname) {

fs.stat(path.resolve(lastSearch, 'package.json'), (err) => {

if (err) {

getProjPath(path.resolve(lastSearch, '../'), callback);

}
callback(lastSearch);

});

}
const getProjPath = require('./getProjPath');

// Copy defaultConfig.json
getProjPath((projPath) => {
Expand Down
24 changes: 1 addition & 23 deletions build/afterCIBuild.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
/* global __dirname */

const fs = require('fs');
const path = require('path');

/**
* TO find the nearest path which contains package.json
* @param {Function} callback A function which receives current project path.
* @param {String} lastSearch Last path of searching.
* @return {String} Path of current project.
*/
function getProjPath (callback, lastSearch = __dirname) {

fs.stat(path.resolve(lastSearch, 'package.json'), (err) => {

if (err) {

getProjPath(path.resolve(lastSearch, '../'), callback);

}
callback(lastSearch);

});

}
const getProjPath = require('./getProjPath');

// Copy playground.html
getProjPath((projPath) => {
Expand Down
1 change: 1 addition & 0 deletions build/generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
<h1>Working in progess.</h1>
</body>
</html>
w
34 changes: 34 additions & 0 deletions build/getProjPath.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* global __dirname */

const fs = require('fs');
const path = require('path');

/**
* To find the nearest path which contains package.json.
* @param {Function} callback A function which receives current project path.
* @param {String} lastSearch Last path of searching.
* @return {String} Path of current project.
*/
function getProjPath (callback, lastSearch = __dirname) {

fs.stat(path.resolve(lastSearch, 'package.json'), (err) => {

if (err) {

const nextSearch = path.resolve(lastSearch, '../');
if (nextSearch === lastSearch) {

// Reach the root path, but still cannot find package.json
throw new Error('Unable to locate current project path.');

}
getProjPath(callback, nextSearch);

}
callback(lastSearch);

});

}

module.exports = getProjPath;
18 changes: 9 additions & 9 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"target": "es6"
},
"checkJs": true,
"exclude": [
"node_modules",
"dist",
"ghpages"
]
"compilerOptions": {
"target": "es6"
},
"checkJs": true,
"exclude": [
"node_modules",
"dist",
"ghpages"
]
}
Loading

0 comments on commit 0c09af4

Please sign in to comment.