Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

🚀 Add dawn-cli #2

Closed
6 tasks done
kiyonlin opened this issue Sep 28, 2020 · 8 comments
Closed
6 tasks done

🚀 Add dawn-cli #2

kiyonlin opened this issue Sep 28, 2020 · 8 comments
Labels
feature New feature

Comments

@kiyonlin
Copy link
Owner

kiyonlin commented Sep 28, 2020

Describe the solution you'd like
Add dawn command line interface based on cli cobra.

Additional context

@kiyonlin
Copy link
Owner Author

kiyonlin commented Sep 28, 2020

LOGO: dawn on the ocean

       __
   ___/ /__ __    _____
 ~/ _  / _ '/ |/|/ / _ \~
~~\_,_/\_,_/|__,__/_//_/~~
 ~~~  ~~ ~~~~~~~~~ ~~~~~~

Special thanks to patorjk.com.

@kiyonlin
Copy link
Owner Author

kiyonlin commented Sep 28, 2020

dawn-cli v0.0.1

       __
   ___/ /__ __    _____    dawn-cli v0.0.1
 ~/ _  / _ '/ |/|/ / _ \~  For the opinionated lightweight framework dawn
~~\_,_/\_,_/|__,__/_//_/~~ Visit https://github.com/kiyonlin/dawn for detail
 ~~~  ~~ ~~~~~~~~~ ~~~~~~  (c) since 2020 by kiyonlin@163.com

USAGE:
   dawn [global options] command [command options] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print dawn version (default: false)

@kiyonlin
Copy link
Owner Author

kiyonlin commented Sep 29, 2020

Add new command

       __
   ___/ /__ __    _____    dawn-cli v0.0.1
 ~/ _  / _ '/ |/|/ / _ \~  For the opinionated lightweight framework dawn
~~\_,_/\_,_/|__,__/_//_/~~ Visit https://github.com/kiyonlin/dawn for detail
 ~~~  ~~ ~~~~~~~~~ ~~~~~~  (c) since 2020 by kiyonlin@163.com

USAGE:
   dawn [global options] command [command options] [arguments...]

COMMANDS:
   new, n   Generate a new dawn project
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print dawn version (default: false)

dawn new --help

NAME:
   dawn new - Generate a new dawn project

USAGE:
   new [options] project [mod name]

OPTIONS:
   --app       create an application project (default: false)
   --help, -h  show help (default: false)

dawn new dawn-demo

go: creating new go.mod: module dawn-demo
go: finding module for package github.com/kiyonlin/dawn/fiberx
go: finding module for package github.com/gofiber/fiber/v2
go: finding module for package github.com/kiyonlin/dawn
go: found github.com/gofiber/fiber/v2 in github.com/gofiber/fiber/v2 v2.0.4
go: found github.com/kiyonlin/dawn in github.com/kiyonlin/dawn v0.3.0

Scaffolding project in /path/to/pwd/dawn-demo (module dawn-demo)

  Done. Now run:

  cd dawn-demo
  go run .

✨  Done in 3.130166283s.

@kiyonlin
Copy link
Owner Author

dawn -v

dawn version: v0.3.0(latest v0.3.0)
dawn version: open go.mod: no such file or directory(latest v0.3.0)

@kiyonlin
Copy link
Owner Author

kiyonlin commented Sep 30, 2020

v0.0.2 with dawn module

       __
   ___/ /__ __    _____    dawn-cli v0.0.2
 ~/ _  / _ '/ |/|/ / _ \~  For the opinionated lightweight framework dawn
~~\_,_/\_,_/|__,__/_//_/~~ Visit https://github.com/kiyonlin/dawn for detail
 ~~~  ~~ ~~~~~~~~~ ~~~~~~  (c) since 2020 by kiyonlin@163.com

USAGE:
   dawn [global options] command [command options] [arguments...]

COMMANDS:
   new, n     Generate a new dawn project
   module, m  Generate a new dawn module
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print dawn version (default: false)

dawn help module

NAME:
   dawn module - Generate a new dawn module

USAGE:
   dawn module name

dawn module hello

Scaffolding module in /path/to/pwd/dawn-demo/hello

  Done. Now run:

  cd hello
  go test . -cover

🎊  Done in 563.455µs.

@kiyonlin
Copy link
Owner Author

kiyonlin commented Sep 30, 2020

dawn dev is inspired by air.

Use fsnotify to watch files and rerun the dawn project.

Options will be:

  • root: Path to be watched, default value is .
  • path: Dev invokes go build path, default value is .
  • extensions: File extensions to watch, default value is go,tmpl,tpl,html
  • exclude_dir: Ignore these directories, default value is assets,tmp,vendor,node_modules
  • exclude_file: Ignore these files, default is ""
  • delay: It's not necessary to trigger rerun each time file changes if it's too frequent, default value is 1s

@kiyonlin
Copy link
Owner Author

v0.0.3 with dawn dev

       __
   ___/ /__ __    _____    dawn-cli v0.0.3
 ~/ _  / _ '/ |/|/ / _ \~  For the opinionated lightweight framework dawn
~~\_,_/\_,_/|__,__/_//_/~~ Visit https://github.com/kiyonlin/dawn for detail
 ~~~  ~~ ~~~~~~~~~ ~~~~~~  (c) since 2020 by kiyon@gofiber.io

USAGE:
   dawn [global options] command [command options] [arguments...]

COMMANDS:
   new, n     Generate a new dawn project
   module, m  Generate a new dawn module
   dev        Rerun the dawn project if watched files change
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print dawn version (default: false)

dawn help dev

NAME:
   dawn dev - Rerun the dawn project if watched files change

USAGE:
   dawn dev [options]

OPTIONS:
   --root value, -r value             root path for watch, all files must be under root (default: ".")
   --target value, -t value           target path for go build (default: ".")
   --extensions value, --ext value    file extensions to watch (default: "go", "tmpl", "tpl", "html")
   --exclude_dirs value, --ed value   ignore these directories (default: "assets", "tmp", "vendor", "node_modules")
   --exclude_files value, --ef value  ignore these files
   --delay value, -d value            delay to trigger rerun (default: 1s)

dawn dev

2020/10/10 08:37:58 Welcome to dawn dev 👋
2020/10/10 08:38:00 Compile done!
2020/10/10 08:38:00 New pid is 62012

 ┌───────────────────────────────────────────────────┐
 │                    Fiber v2.0.6                   │
 │               http://127.0.0.1:3000               │
 │                                                   │
 │ Handlers ............. 5  Threads ............. 8 │
 │ Prefork ....... Disabled  PID ............. 62012 │
 └───────────────────────────────────────────────────┘

^C2020/10/10 08:38:06 See you next time 👋

@kiyonlin
Copy link
Owner Author

kiyonlin commented Oct 12, 2020

v0.0.7 with cobra and dawn generate

       __
   ___/ /__ __    _____    dawn-cli v0.0.7
 ~/ _  / _ '/ |/|/ / _ \~  For the opinionated lightweight framework dawn
~~\_,_/\_,_/|__,__/_//_/~~ Visit https://github.com/kiyonlin/dawn for detail
 ~~~  ~~ ~~~~~~~~~ ~~~~~~  (c) since 2020 by kiyon@gofiber.io

Usage:
  dawn [flags]
  dawn [command]

Available Commands:
  dev         Rerun the dawn project if watched files changed
  generate    Generate boilerplate code with different commands
  help        Help about any command
  new         Generate a new dawn project
  version     Print the version number of dawn

Flags:
  -h, --help   help for dawn

Use "dawn [command] --help" for more information about a command.

dawn help generate

Generate boilerplate code with different commands

Usage:
  dawn generate [flags]
  dawn generate [command]

Aliases:
  generate, g

Available Commands:
  module      Generate a new dawn module

Flags:
  -h, --help   help for generate

Use "dawn generate [command] --help" for more information about a command.

@kiyonlin kiyonlin pinned this issue Oct 13, 2020
@kiyonlin kiyonlin added the feature New feature label Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

1 participant