Skip to content

Commit f6ab2c4

Browse files
committed
update comment to status
1 parent e1a7d74 commit f6ab2c4

File tree

25 files changed

+709
-382
lines changed

25 files changed

+709
-382
lines changed

.babelrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
10+
],
11+
"plugins": ["transform-vue-jsx", "transform-runtime"],
12+
"env": {
13+
"test": {
14+
"presets": ["env", "stage-2"],
15+
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
16+
}
17+
}
18+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/build/
2+
/config/
3+
/dist/
4+
/*.js
5+
/test/unit/coverage/

.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// https://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
parserOptions: {
6+
parser: 'babel-eslint'
7+
},
8+
env: {
9+
browser: true,
10+
},
11+
extends: [
12+
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
13+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
14+
'plugin:vue/essential',
15+
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
16+
'standard'
17+
],
18+
// required to lint *.vue files
19+
plugins: [
20+
'vue'
21+
],
22+
// add your custom rules here
23+
rules: {
24+
// allow async-await
25+
'generator-star-spacing': 'off',
26+
// allow debugger during development
27+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
28+
"space-before-function-paren": 0
29+
}
30+
}

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.DS_Store
2+
node_modules/
3+
/dist/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
/test/unit/coverage/
8+
/test/e2e/reports/
9+
selenium-debug.log
10+
hade
11+
storage
12+
13+
# Editor directories and files
14+
.idea
15+
.vscode
16+
*.suo
17+
*.ntvs*
18+
*.njsproj
19+
*.sln

.postcssrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
"postcss-import": {},
6+
"postcss-url": {},
7+
// to edit target browsers: use "browserslist" field in package.json
8+
"autoprefixer": {}
9+
}
10+
}

app/console/command/demo/foo.go

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
package command
1+
package foo
22

33
import (
44
"fmt"
55

66
"github.com/gohade/hade/framework/cobra"
77
)
88

9-
var Demo2Command = &cobra.Command{
10-
Use: "demo2",
11-
Short: "demo2",
9+
var FooCommand = &cobra.Command{
10+
Use: "foo",
11+
Short: "foo",
1212
RunE: func(c *cobra.Command, args []string) error {
1313
container := c.GetContainer()
1414
fmt.Println(container)

app/console/kernel.go

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
package console
22

33
import (
4-
"github.com/gohade/hade/app/console/command/demo"
5-
"github.com/gohade/hade/framework"
6-
"github.com/gohade/hade/framework/cobra"
7-
"github.com/gohade/hade/framework/command"
4+
"github.com/gohade/hade/app/console/command/foo"
5+
"github.com/gohade/hade/framework"
6+
"github.com/gohade/hade/framework/cobra"
7+
"github.com/gohade/hade/framework/command"
88
)
99

1010
// RunCommand 初始化根Command并运行
1111
func RunCommand(container framework.Container) error {
12-
// 根Command
13-
var rootCmd = &cobra.Command{
14-
// 定义根命令的关键字
15-
Use: "hade",
16-
// 简短介绍
17-
Short: "hade 命令",
18-
// 根命令的详细介绍
19-
Long: "hade 框架提供的命令行工具,使用这个命令行工具能很方便执行框架自带命令,也能很方便编写业务命令",
20-
// 根命令的执行函数
21-
RunE: func(cmd *cobra.Command, args []string) error {
22-
cmd.InitDefaultHelpFlag()
23-
return cmd.Help()
24-
},
25-
// 不需要出现cobra默认的completion子命令
26-
CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true},
27-
}
12+
// 根Command
13+
var rootCmd = &cobra.Command{
14+
// 定义根命令的关键字
15+
Use: "hade",
16+
// 简短介绍
17+
Short: "hade 命令",
18+
// 根命令的详细介绍
19+
Long: "hade 框架提供的命令行工具,使用这个命令行工具能很方便执行框架自带命令,也能很方便编写业务命令",
20+
// 根命令的执行函数
21+
RunE: func(cmd *cobra.Command, args []string) error {
22+
cmd.InitDefaultHelpFlag()
23+
return cmd.Help()
24+
},
25+
// 不需要出现cobra默认的completion子命令
26+
CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true},
27+
}
2828

29-
// 为根Command设置服务容器
30-
rootCmd.SetContainer(container)
31-
// 绑定框架的命令
32-
command.AddKernelCommands(rootCmd)
33-
// 绑定业务的命令
34-
AddAppCommand(rootCmd)
29+
// 为根Command设置服务容器
30+
rootCmd.SetContainer(container)
31+
// 绑定框架的命令
32+
command.AddKernelCommands(rootCmd)
33+
// 绑定业务的命令
34+
AddAppCommand(rootCmd)
3535

36-
// 执行RootCommand
37-
return rootCmd.Execute()
36+
// 执行RootCommand
37+
return rootCmd.Execute()
3838
}
3939

4040
// 绑定业务的命令
4141
func AddAppCommand(rootCmd *cobra.Command) {
42-
rootCmd.AddCommand(demo.FooCommand)
4342

44-
// 每秒调用一次Foo命令
45-
//rootCmd.AddCronCommand("* * * * * *", demo.FooCommand)
43+
rootCmd.AddCommand(foo.FooCommand)
44+
// 每秒调用一次Foo命令
45+
//rootCmd.AddCronCommand("* * * * * *", demo.FooCommand)
4646

47-
// 启动一个分布式任务调度,调度的服务名称为init_func_for_test,每个节点每5s调用一次Foo命令,抢占到了调度任务的节点将抢占锁持续挂载2s才释放
48-
//rootCmd.AddDistributedCronCommand("foo_func_for_test", "*/5 * * * * *", demo.FooCommand, 2*time.Second)
47+
// 启动一个分布式任务调度,调度的服务名称为init_func_for_test,每个节点每5s调用一次Foo命令,抢占到了调度任务的节点将抢占锁持续挂载2s才释放
48+
//rootCmd.AddDistributedCronCommand("foo_func_for_test", "*/5 * * * * *", demo.FooCommand, 2*time.Second)
4949
}

app/http/middleware/demo2/middleware.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)