Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
docs: Update workflow and instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazeyu committed Dec 1, 2017
1 parent 973f1b9 commit 6ebbdad
Show file tree
Hide file tree
Showing 18 changed files with 142 additions and 80 deletions.
60 changes: 31 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@

## Issues

Most of the time, if this plugin is not working correctly for you it is a simple configuration issue.
- Most of the time, if this plugin is not working correctly for you it is a simple **configuration** issue.

**If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**
- **Search on the internet** and **among closed issues** in advance would do a great help for us.

- Please **keep focus on the topic** of any issue, and use **English** as far as possible so that everyone will understand you.

- **If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**


## Contributing directly to the source code

**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
**Working on your first Pull Request?** You can learn how from this *free* series
[How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

See workflow for more information.
See workflow for more code developing information.


## Submitting Changes
Expand All @@ -23,15 +28,15 @@ your pull request should be accepted quickly.

Some things that will increase the chance that your pull request is accepted:

* ~~[Write tests](./test/README.md)~~
* Follow the existing coding style
* Write a good commit message use `npm run commit`
- Follow the existing coding style
- Write a good commit message use `npm run commit`
- Make sure that your code can work properly.


## Documentation

Hexo-helper-live2d is insanely feature rich and documentation is a huge time sink. We
greatly appreciate any time spent fixing typos or clarifying sections in the
Hexo-helper-live2d's feature is now becoming richer and richer, and documentation is a huge time sink.
We greatly appreciate any time spent fixing typos or clarifying sections in the
documentation.

From opening a bug report to creating a pull request: every contribution is
Expand All @@ -40,44 +45,42 @@ the api please create an issue first. This way we can ensure that your precious
work is not in vain.


## Workflow: modify the code

- We use [EditorConfig](http://editorconfig.org/) to define and maintain consistent coding styles, so have a look first.
## Workflow: modify the code

- It is also recommend to have these documents read:
- We use **[EditorConfig](http://editorconfig.org/)** to define and maintain consistent coding styles, so have a look first.

- [(Chinese) Angular代码规范](http://www.reqianduan.com/1722.html)
- Please use the latest version of Node.js to work with.

### 1. Install environments

- `npm run devenv` to install all the necessery environments.
- Use `npm run inst:dev` to install all the environments.

### 2. Make changes

#### clientJs: modify src/main.js

- `npm run dev` to build client js files **with debug files**.
#### clientJs: modify files in `/src/`

- `npm run devw` to build client js files **with debug files** and **let webpack watch the file**.
- Use `npm run build:dev` to build client js files **with debug files and watchdog.**.

#### serverJs: modify index.js
#### serverJs: modify `/index.js`

- Highly recommended to build a test Hexo environment to test it.

### 3. Make sure you passed all the tests.

- We believe in you, so test yourself. xD
### 3. Debug until you make sure that your code works properly.

### 4. Commit those changes

- **`npm run rel` to build final client js. Important!!! The step must be done!!!**
- **Use `npm run build:prod` to build final client js.**
**Important!!! The step must be done before commit!!!**

- `git add *`, or choose the file you want to commit.
- Use `git add *`, or choose the file you want to commit.

- `npm run commit`, **Never use `git commit`!!!**
- Use `npm run commit` to commit, **Never use `git commit`!!!**

### 5. Push the changes

- `git push` to push the changes to the github server.
- Use `git push` to push the changes to the github server.


## Workflow(author): Release a new version
Expand All @@ -94,17 +97,16 @@ work is not in vain.

### 2. Commit package.json and package-lock.json

- `npm run commit`, **Never use `git commit`!!!**
- Use `npm run commit` to commit, **Never use `git commit`!!!**

### 3. Tag and release a new version

- In the Github page.

### 4. Update changelog

- `npm run changelog`
- Use `npm run changelog`

### 5. Publish the package to npm.

- `npm publish`

- Use `npm publish` to publish it.
8 changes: 7 additions & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
### Steps to reproduce the behavior 复现步骤


- [ ] I have alreday read instructions in [CONTRIBUTING](./CONTRIBUTING.md).
我已仔细阅读[CONTRIBUTING](./CONTRIBUTING.md)中的相关内容。

@EYHN @xiazeyu
> Change the `[ ]` into `[x]` to show your acceptance.
`[ ]` 变为 `[x]` 来表示你接受了这些问题。


@EYHN @xiazeyu
14 changes: 13 additions & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
Fixes # .
Fix # , Re #.

Changes proposed in this pr:

此pr的改变:

-

-

-

- [ ] I have alreday read instructions in [CONTRIBUTING](./CONTRIBUTING.md).
我已仔细阅读[CONTRIBUTING](./CONTRIBUTING.md)中的相关内容。

- [ ] *NOT NECESSARY* I'm sure that this pr works properly in my testing environment.
*非必需* 提交的更改在我的测试环境运行正常

> Change the `[ ]` into `[x]` to show your acceptance.
`[ ]` 变为 `[x]` 来表示你接受了这些问题。


@EYHN @xiazeyu
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

# hexo-helper-live2d

> 3.0 Comming soon!
> 3.0 is comming soon!
> Due by December 31, 2017, hopefully.
[简体中文文档](./readme.zh-CN.md)

Expand Down Expand Up @@ -240,7 +242,7 @@ issues: [https://github.com/EYHN/hexo-helper-live2d/issues](https://github.com/E

## Contribute

Please pay enough attention to this document if you want to commit your changes.
**Please pay enough attention to this document if you want to commit your changes or submit issues.**

[CONTRIBUTING](./CONTRIBUTING.md)

Expand Down
4 changes: 3 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

> 3.0即将来临!
> 希望是2017年12月31日吧~
[English README](./readme.md) by [@gwzz](https://github.com/gwzz) & [@xiazeyu](https://github.com/xiazeyu)

<br>
Expand Down Expand Up @@ -242,7 +244,7 @@ issues: [https://github.com/EYHN/hexo-helper-live2d/issues](https://github.com/E

## Contribute 贡献

如果你想提交代码,请务必仔细阅读
如果你想提交代码或Issue,请务必仔细阅读

[CONTRIBUTING](./CONTRIBUTING.md)

Expand Down
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.js.map

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions dist/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</head>
<body>
<div id="app">
<canvas id="live2dcanvas" width="600" height="800" style="border:dashed 1px #CCC"></canvas>
<canvas id="live2dcanvas" width="1" height="2" style="border:dashed 1px #CCC"></canvas>
</div>
<style>
#live2dcanvas{
width: 600;
height: 800;
width: 3;
height: 4;
position: fixed;
opacity: 1;
z-index: 999;
Expand All @@ -32,6 +32,7 @@

<script language="JAVASCRIPT">
function myfunc (){
// 获取输入数值
var width = document.getElementById("twidth").value;
var height = document.getElementById("theight").value;
var modelName = document.getElementById("tmodelName").value;
Expand All @@ -40,12 +41,28 @@
var opacityDefault = document.getElementById("topacityDefault").value;
var opacityHover = document.getElementById("topacityHover").value;
var modelUrl="../assets/name/name.model.json";
// 初始化canvas
document.getElementById("live2dcanvas").width = width * scaling;
document.getElementById("live2dcanvas").height = height * scaling;
document.getElementById("live2dcanvas").style.width = width + 'px';
document.getElementById("live2dcanvas").style.height = height + 'px';
document.getElementById("live2dcanvas").style.opacity = opacityDefault;
// 初始化绘制
modelUrl = modelUrl.replace(/name/g, modelName);
console.log(modelUrl);
loadlive2d("live2dcanvas", modelUrl, headPos, scaling, opacityDefault, opacityHover);
loadlive2d("live2dcanvas", modelUrl, headPos, opacityDefault, opacityHover);

canvas = document.getElementById('live2dcanvas');
// DEBUG Area Start

var twidth = canvas.width;
var theight = canvas.height;
var tsWidth = parseInt(canvas.style.width);
var tsHeight = parseInt(canvas.style.height);

// DEBUG Area Ends Here

}
</script>
<script type="text/javascript" src="bundle.js?7bcd089c4eae3526afb7"></script></body>
<script type="text/javascript" src="bundle.js?bafff5dcf6654174d79f"></script></body>
</html>
2 changes: 1 addition & 1 deletion dist/insert.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script type="text/javascript" src="bundle.js?f9461a7b508ff25fece5"></script>
<script type="text/javascript" src="bundle.js?b3c86023668e16a09b40"></script>
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const loadScript = function loadScript(c,b){var a=document.createElement("script
return;`}
}else
if (typeof(device) === 'undefined') console.error('Cannot find current-device script.');
loadScript("/live2d/script.js", function(){loadlive2d(${JSON.stringify(config.id)}, ${JSON.stringify(url.resolve("/live2d/assets/", config.model + ".model.json"))}, 0.5);});
loadScript("/live2d/script.js", function(){loadlive2d(${JSON.stringify(config.id)}, ${JSON.stringify(url.resolve("/live2d/assets/", config.model + ".model.json"))}, 0.618, ${config.opacityDefault}, ${config.opacityHover});});
})();
</script>
`
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hexo-helper-live2d",
"version": "2.1.5",
"description": "为你的hexo添加色气满满的live2d吧!",
"description": "Add the Sseexxyyy live2d to your hexo and webpages!",
"main": "./index.js",
"devDependencies": {
"babel-core": "^6.26.0",
Expand All @@ -21,13 +21,12 @@
"path": "^0.12.7"
},
"scripts": {
"devenv": "npm install -g commitizen&&npm install -g cz-conventional-changelog&&npm install -g webpack&&npm install -g conventional-changelog-cli&&npm install",
"dev": "webpack --config webpack.config.dev.js",
"devw": "webpack --config webpack.config.dev.js -w",
"rel": "webpack --config webpack.config.device.js&&webpack",
"test": "echo \"Sayly, there's nothing here. ToT\" && exit 1",
"inst:dev": "npm install -g commitizen&&npm install -g cz-conventional-changelog&&npm install -g webpack&&npm install -g conventional-changelog-cli&&npm install",
"build:dev": "webpack --progress --colors --config webpack.config.device.prod.js&&webpack --progress --colors --watch --config webpack.config.cJs.dev.js",
"build:prod": "webpack --progress --colors --config webpack.config.cJs.prod.js&&webpack --progress --colors --config webpack.config.device.prod.js",
"commit": "git-cz",
"changelog": "git pull&&conventional-changelog -i CHANGELOG.md -r 0 -s -u&&git add CHANGELOG.md&&git commit -m \"docs: update CHANGELOG\"&&git push&&git status",
"test": "echo \"Nothing here, but someday there will be something here. xD\" && exit 1"
"changelog": "git pull&&conventional-changelog -i CHANGELOG.md -r 0 -s -u&&git add CHANGELOG.md&&git commit -m \"docs: update CHANGELOG\"&&git push&&git status"
},
"author": {
"name": "EYHN",
Expand Down
24 changes: 12 additions & 12 deletions src/LAppDefine.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ var LAppDefine = {
// DEBUG_DRAW_ALPHA_MODEL : false,


VIEW_MAX_SCALE : 2,
VIEW_MIN_SCALE : 0.8,
VIEW_MAX_SCALE : 2, // 2
VIEW_MIN_SCALE : 0.8, // 0.8

VIEW_LOGICAL_LEFT : -1,
VIEW_LOGICAL_RIGHT : 1,
VIEW_LOGICAL_LEFT : -1, // -1
VIEW_LOGICAL_RIGHT : 1, // 1

VIEW_LOGICAL_MAX_LEFT : -2,
VIEW_LOGICAL_MAX_RIGHT : 2,
VIEW_LOGICAL_MAX_BOTTOM : -2,
VIEW_LOGICAL_MAX_TOP : 2,
VIEW_LOGICAL_MAX_LEFT : -2, // -2
VIEW_LOGICAL_MAX_RIGHT : 2, // 2
VIEW_LOGICAL_MAX_BOTTOM : -2, // -2
VIEW_LOGICAL_MAX_TOP : 2, // 2


PRIORITY_NONE : 0,
PRIORITY_IDLE : 1,
PRIORITY_NORMAL : 2,
PRIORITY_FORCE : 3,
PRIORITY_NONE : 0, // 0
PRIORITY_IDLE : 1, // 1
PRIORITY_NORMAL : 2, // 2
PRIORITY_FORCE : 3, // 3

MOTION_GROUP_IDLE : "idle",
MOTION_GROUP_TAP_BODY : "tap_body",
Expand Down
25 changes: 21 additions & 4 deletions src/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
</head>
<body>
<div id="app">
<canvas id="live2dcanvas" width="600" height="800" style="border:dashed 1px #CCC"></canvas>
<canvas id="live2dcanvas" width="1" height="2" style="border:dashed 1px #CCC"></canvas>
</div>
<style>
#live2dcanvas{
width: 600;
height: 800;
width: 3;
height: 4;
position: fixed;
opacity: 1;
z-index: 999;
Expand All @@ -32,6 +32,7 @@

<script language="JAVASCRIPT">
function myfunc (){
// 获取输入数值
var width = document.getElementById("twidth").value;
var height = document.getElementById("theight").value;
var modelName = document.getElementById("tmodelName").value;
Expand All @@ -40,11 +41,27 @@
var opacityDefault = document.getElementById("topacityDefault").value;
var opacityHover = document.getElementById("topacityHover").value;
var modelUrl="../assets/name/name.model.json";
// 初始化canvas
document.getElementById("live2dcanvas").width = width * scaling;
document.getElementById("live2dcanvas").height = height * scaling;
document.getElementById("live2dcanvas").style.width = width + 'px';
document.getElementById("live2dcanvas").style.height = height + 'px';
document.getElementById("live2dcanvas").style.opacity = opacityDefault;
// 初始化绘制
modelUrl = modelUrl.replace(/name/g, modelName);
console.log(modelUrl);
loadlive2d("live2dcanvas", modelUrl, headPos, scaling, opacityDefault, opacityHover);
loadlive2d("live2dcanvas", modelUrl, headPos, opacityDefault, opacityHover);

canvas = document.getElementById('live2dcanvas');
// DEBUG Area Start

var twidth = canvas.width;
var theight = canvas.height;
var tsWidth = parseInt(canvas.style.width);
var tsHeight = parseInt(canvas.style.height);

// DEBUG Area Ends Here

}
</script>
</body>
Expand Down
Loading

0 comments on commit 6ebbdad

Please sign in to comment.