File tree Expand file tree Collapse file tree 6 files changed +19
-19
lines changed Expand file tree Collapse file tree 6 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const jsonschemaFile = "schema.json"
12
12
//go:generate sh -c "cd ../../ && go run cmd/jsonschema/main.go"
13
13
func main () {
14
14
schema := jsonschema .Reflect (& model.Config {})
15
- schema .ID = "https://github.com/DanielLiu1123/gencoder/tree /main/pkg/model/table .go"
15
+ schema .ID = "https://github.com/DanielLiu1123/gencoder/blob /main/pkg/model/config .go"
16
16
17
17
err := util .WriteFile (jsonschemaFile , []byte (util .ToJson (schema )))
18
18
if err != nil {
Original file line number Diff line number Diff line change @@ -35,18 +35,15 @@ func NewCmdGenerate(globalOptions *model.GlobalOptions) *cobra.Command {
35
35
Use : "generate" ,
36
36
Short : "Generate code from database configuration" ,
37
37
Aliases : []string {"gen" , "g" },
38
- Example : ` # Generate code from default config file (gencoder.yaml)
39
- $ gencoder generate
40
-
41
- # Generate code from a specific config file
42
- $ gencoder generate -f myconfig.yaml
43
-
44
- # Generate code with custom import helper JavaScript file
45
- $ gencoder generate -f myconfig.yaml --import-helper helpers.js
46
-
47
- # Generate boilerplate code from URL with custom properties
48
- $ gencoder generate --templates "https://github.com/user/template-project" --properties="package=com.example,author=Freeman"
49
- ` ,
38
+ Example : `
39
+ # Generate code from config file (default: gencoder.yaml), config json schema: https://raw.githubusercontent.com/DanielLiu1123/gencoder/refs/heads/main/schema.json
40
+ $ gencoder generate -f gencoder.yaml
41
+
42
+ # Generate code from a template project with custom properties
43
+ $ gencoder generate --templates "https://github.com/user/template-project" --properties "package=com.example,author=Freeman" --include-non-tpl
44
+
45
+ # Generate code using custom helpers, build-in helpers: https://github.com/DanielLiu1123/gencoder/blob/main/pkg/jsruntime/helper.js
46
+ $ gencoder generate --import-helper helpers.js` ,
50
47
PreRun : func (cmd * cobra.Command , args []string ) {
51
48
validateArgs (args )
52
49
opt .Properties = parseProperties (props )
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ func NewCmdInit(globalOptions *model.GlobalOptions) *cobra.Command {
20
20
c := & cobra.Command {
21
21
Use : "init" ,
22
22
Short : "Init basic configuration for gencoder" ,
23
- Example : ` # Init basic configuration for gencoder
23
+ Example : `
24
+ # Init basic configuration for gencoder
24
25
$ gencoder init
25
26
26
27
# Init basic configuration in a specific directory
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ func NewCmdIntrospect(globalOptions *model.GlobalOptions) *cobra.Command {
22
22
Use : "introspect" ,
23
23
Short : "introspect command is used to output the table metadata information for the given configuration." ,
24
24
Aliases : []string {"intro" , "i" },
25
- Example : ` # Print metadata of database tables from default config file (gencoder.yaml)
25
+ Example : `
26
+ # Print metadata of database tables from default config file (gencoder.yaml)
26
27
$ gencoder introspect
27
28
28
29
# Print metadata of database tables from a specific config file
Original file line number Diff line number Diff line change @@ -17,13 +17,14 @@ func NewCmdRoot(buildInfo *model.BuildInfo) *cobra.Command {
17
17
Version : buildInfo .Version ,
18
18
Short : "The ultimate code generator" ,
19
19
Long : "gencoder is a code generator that generates code from templates/databases, for any languages/frameworks." ,
20
- Example : ` # Generate code from config file (default: gencoder.yaml)
20
+ Example : `
21
+ # Generate code from config file (default: gencoder.yaml), config json schema: https://raw.githubusercontent.com/DanielLiu1123/gencoder/refs/heads/main/schema.json
21
22
$ gencoder generate -f gencoder.yaml
22
23
23
24
# Generate code from a template project with custom properties
24
25
$ gencoder generate --templates "https://github.com/user/template-project" --properties "package=com.example,author=Freeman" --include-non-tpl
25
-
26
- # Generate code using custom helpers, read from local file or URL
26
+
27
+ # Generate code using custom helpers, build-in helpers: https://github.com/DanielLiu1123/gencoder/blob/main/pkg/jsruntime/helper.js
27
28
$ gencoder generate --import-helper helpers.js
28
29
29
30
# Init basic config for quick start
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " https://json-schema.org/draft/2020-12/schema" ,
3
- "$id" : " https://github.com/DanielLiu1123/gencoder/tree /main/pkg/model/table .go" ,
3
+ "$id" : " https://github.com/DanielLiu1123/gencoder/blob /main/pkg/model/config .go" ,
4
4
"$ref" : " #/$defs/Config" ,
5
5
"$defs" : {
6
6
"BlockMarker" : {
You can’t perform that action at this time.
0 commit comments