Skip to content
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

pkg/fswatcher: added and refactored its callers #95

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

ilgooz
Copy link
Member

@ilgooz ilgooz commented Jul 31, 2020

  • services/serve now uses pkg/fswatcher to watch for changes on user's app.

a part of #81.

* services/serve now uses pkg/fswatcher to watch for changes on user's app.
@fadeev
Copy link
Contributor

fadeev commented Jul 31, 2020

I've noticed that make no longer works (probably just missing the build directory):

go build: cannot write multiple packages to non-directory build/
make: *** [build] Error 1

@ilgooz
Copy link
Member Author

ilgooz commented Jul 31, 2020

Yes, that happened to me before as well. I had to manually create that dir. But I guess it is not related to this PR.

@ilgooz ilgooz merged commit d5ae4b7 into develop Jul 31, 2020
@ilgooz ilgooz deleted the refactor/fswatcher branch July 31, 2020 08:38
ilgooz added a commit that referenced this pull request Aug 7, 2020
* 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>
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
* services/serve now uses pkg/fswatcher to watch for changes on user's app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Starport
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants