-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor folder structure for main & cli #57
Conversation
* introduced a new package called `interface` as a single bridge to expose Starport's features to possibly multiple targets e.g. cli, grpc, http. * cmd and main packages are moved under `interface/cli/starport`. * `starport` package name for the `main` program is chosen to enable easy, named installations with `go get github.com/tendermint/starport/...` which should produce the binary with `starport` name by default. * simplifed the `Makefile` regarding to other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome screen (:12345
) no longer works. Possible fix: in interface/cli/starport/cmd/serve.go
replace
devUI := packr.New("ui/dist", "../ui/dist")
with
devUI := packr.New("ui/dist", "../../../../ui/dist")
* change ./scripts/dev as ./scripts/starport
@fadeev could you please check other commands as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new.go
and templates
directory are located in the same parent directory. So, relatively speaking ./templates
should be enough. Otherwise, packr
is pointed to nowhere and nothing gets generated.
templates/app/new.go
Outdated
@@ -12,7 +12,7 @@ import ( | |||
// New ... | |||
func New(opts *Options) (*genny.Generator, error) { | |||
g := genny.New() | |||
if err := g.Box(packr.New("app/templates", "./templates")); err != nil { | |||
if err := g.Box(packr.New("app/templates", "./templates/app/templates")); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err := g.Box(packr.New("app/templates", "./templates/app/templates")); err != nil { | |
if err := g.Box(packr.New("app/templates", "./templates")); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./templates/
wasn't working for me, does it work for you? Can you please kill if any zombie processes are running then run app
and serve
again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked multiple times: unless the path is ./templates
starport app github.com/tendermint/blog
creates an empty directory, because packr doesn't pack anything, so there is nothing to serve. Can you check once again as well? Seem odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted this again (130b43e) but the current behavior is, it only works when starport command is executed outside of the source code of starport. this is fine for developers but needs to fix it in future. Maybe we can replace packr
with something lightweight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Yeah, I agree about packr
.
* refactor folder structure for main & cli (#57) * refactor folder structure for main & cli * introduced a new package called `interface` as a single bridge to expose Starport's features to possibly multiple targets e.g. cli, grpc, http. * cmd and main packages are moved under `interface/cli/starport`. * `starport` package name for the `main` program is chosen to enable easy, named installations with `go get github.com/tendermint/starport/...` which should produce the binary with `starport` name by default. * simplifed the `Makefile` regarding to other changes. * fix ui and app template paths * change ./scripts/dev as ./scripts/starport * fix typed template path * templates: revert template paths for packr * Cosmos SDK v0.39.0 "Launchpad" (#45) * Update go.mod to Cosmos SDK v0.39.0 * Fix issue with pruning options * Fix acc number and seq fetching * interface/cli/starport: made root cmd newable (#58) in order to: * reduce package level globals, * increase configurability of the root command by outside caller where such options can be passed as an argument to `starportcmd.New()`. * interface/cli/starport/cmd: made serve command newable (#64) * reconstructed organization of serve command. * ci: disable linter for PRs (#67) we are in a refactoring period and it is safe to ignore linter errors at this stage since some related code will be changed. * interface/cli/starport/cmd: made app command newable (#65) * reconstructed organization of app command. * interface/cli/starport/cmd: made add command newable (#69) * reconstructed organization of add command. solves a part of #56. * ci: run unit tests for Starport (#68) * ci: run unit tests for Starport resolved #29. * ci: fix unit test * interface/cli/starport/cmd: made type command newable (#70) * interface/cli/starport/cmd: made typed command newable * reconstructed organization of `typed` command. solves a part of #56. * interface/cli/starport/cmd: fix typo on command * interface/cli/starport/cmd: fix typo on command * Update readme.md (#75) * Update readme.md The README needs more beginner level content. I added links to Denis' tutorials (we can replace this with a link to tutorials.cosmos.network later), communication channels, and improved organization a bit. * Update readme.md * Replace me with user1 as in init script Co-authored-by: Denis Fadeev <denis@fadeev.org> * Add codeowners (#79) * Updated readme with CosmWasm (#78) * interface/cli/starport/cmd: refactor serve command (#72) for short-running command executions. * introduced new `pkg/cmdrunner` pkg. (tests will be added later once we have finized its public APIs) * Update to @cosmjs/launchpad (#74) * Update to @cosmjs/launchpad * Use public method getAccounts in frontend store * Update CosmWasm docs link (#83) * starport/cmd: use cmdrunner to start cli servers (#82) * starport/cmd: use cmdrunner to start cli servers * some refactoring related to `pkg/cmdrunner` and `starport/cmd`. * starport/cmd: run cli servers and dev server in parallel * trig ci * cli/starport/cmd: use context for cancellation (#86) and more simplifications on serve. * services/serve: move serve logic from starport/cmd (#87) to the new services/serve package. * reorganize project structure (#89) resolves #88. * services/serve: split dev handler (#90) as a starting point to refactor development server. * services/serve: refactor dev server handler (#91) * services/serve: refactor dev server handler * updated frontend bindings. * added new `pkg/xhttp` helper. * added new `pkg/httpstatuschecker` helper. * services/serve: simplify server status check and add concurrent checks. * services/serve: rework def of dev server's /status enpoint * pkg/xexec: added IsCommandAvailable (#94) * pkg/fswatcher: added and refactored its callers (#95) * services/serve now uses pkg/fswatcher to watch for changes on user's app. * services/serve: use cmdrunner to run npm dev for user's frontend (#98) * services/serve: general refactoring, simplify code (#99) * services/serve: stabilize serve (#102) * add graceful shutdown to dev server * handle all async errors * exclude hidden files from watch list * stabilize cancelation for serve and other async tasks * Create build directory (#103) * Added custom bech32 address prefixes (#104) * Add custom prefix support * Replace --prefix with --address-prefix * Fix custom denom in init * services/serve: drop using make (#110) to init/config user's app. instead execute command via Go or programatically as possible. * Windows is now supported but not stable yet. * services/serve: simplify concurrency (#111) * services/serve: simplify concurrency * cleanup. * fix git version retrieval. * fix app backend watch * Add Contributing section * Make Contributing heading h2 instead of h1 * services/serve: move dev server log to the end (#115) * Added fix to add wasm cmd (fix #114) (#116) * services/serve: introduce config.yml (#118) * services/serve: introduce config.yml for now it only supports account creation with the format below: ```yml accounts: - name: me coins: ["1000token", "100000000stake"] - name: you coins: ["5000token"] ``` * Makefile in the user app's is removed in favor of adding config.yml. * some util packages added under pkg/ needed for this feature. solves a part of #106, #41. * fix tests * fix typo in x/appName/types/key.go.plush (querierer -> querier) (#117) * services/serve: wait for a fix on build error (#119) * services/serve: wait for a fix on build error instead of aborting the serve on an error related to building the app's backend, wait for a fix and try to rebuild. resolves #107. * improve logs * extend the scope of build error handling * improve logs * fix typo in spec (#120) * services/serve: simplify err checks (#122) * services/serve: omit build error on cancellation (#123) * services/serve: omit build error on cancellation previously when user just started to `serve` during the process of building the user's app; and if there is a cancelation made by sending a ^C signal during that period, `serve` was thinking that app failed to build and printing an empty build error log before aborting the serving process. this commit fixes that. before: ``` 📦 Installing dependencies... ^Ccannot build app: waiting for a fix before retrying... aborted ``` after: ``` 📦 Installing dependencies... ^Caborted ``` * open commented out code * update starport to 0.39 (#113) * update starport to 0.39 * make it work * Update starport/templates/app/templates/cmd/{{binaryNamePrefix}}d/main.go.plush Co-authored-by: Denis Fadeev <denis@fadeev.org> * Removed alias from TYPE template Co-authored-by: Denis Fadeev <denis@fadeev.org> * Added readme close #80 (#127) * Added config to readme and go.sum to template (#131) * services/serve: add prefixes to verbose logs (#129) * services/serve: add prefixes to verbose logs * added new pkg/lineprefixer. * added new pkg/prefixgen. * added options builder to pkg/cmdrunner/step. * cosmetics. * fix tests & add missing file * add STARPORT prefix to native logs * add buildLog log type. * reorganize verbose logs. * fix linter * fix verbose logs * Added simple config.yml in the readme * Replace Notion links with tutorials.cosmos.network Co-authored-by: Denis Fadeev <denis@fadeev.org> Co-authored-by: Peng Zhong <172531+nylira@users.noreply.github.com> Co-authored-by: Orkun Külçe <orkunkl@users.noreply.github.com> Co-authored-by: Giancarlos Salas <giansalex@gmail.com> Co-authored-by: loloicci <oxisccl@gmail.com> Co-authored-by: Marko <marbar3778@yahoo.com>
* refactor folder structure for main & cli * introduced a new package called `interface` as a single bridge to expose Starport's features to possibly multiple targets e.g. cli, grpc, http. * cmd and main packages are moved under `interface/cli/starport`. * `starport` package name for the `main` program is chosen to enable easy, named installations with `go get github.com/tendermint/starport/...` which should produce the binary with `starport` name by default. * simplifed the `Makefile` regarding to other changes. * fix ui and app template paths * change ./scripts/dev as ./scripts/starport * fix typed template path * templates: revert template paths for packr
interface
as a single bridge to expose Starport's features to possibly multiple targets e.g. cli, grpc, http.interface/cli/starport
.starport
package name for themain
program is chosen to enable easy, named installations withgo get github.com/tendermint/starport/...
which should produce the binary withstarport
name by default.Makefile
regarding to other changes.a part of #56.