create-go-app / cli

✨ A complete and self-contained solution for developers of any qualification to create a production-ready project with backend (Go), frontend (JavaScript, TypeScript) and deploy automation (Ansible, Docker) by running only one CLI command.
https://github.com/create-go-app/cli/wiki
Apache License 2.0
2.62k stars 262 forks source link

Makefile generated is wrong #156

Closed suntong closed 1 year ago

suntong commented 1 year ago

Required check list:

My environment:

Describe the bug: A clear and concise description of what the bug is.

The depency rule of the generated Makefile is wrong:

test:
        @if [ -d "$(FRONTEND_PATH)" ]; then cd $(FRONTEND_PATH) && npm run test; fi
        @if [ -d "$(BACKEND_PATH)" ]; then cd $(BACKEND_PATH) && go test ./...; fi

run: test
        @if [ -d "$(FRONTEND_PATH)" ]; then cd $(FRONTEND_PATH) && npm run dev; fi
        @if [ -d "$(BACKEND_PATH)" ]; then cd $(BACKEND_PATH) && $(MAKE) run; fi

build: test
...

Expected behavior: A clear and concise description of what you expected to happen.

See for e.g. https://github.com/suntong/go-app-demos/blob/master/0A1-hello/makefile

run: build

This means run depends on build, whereas the generated Makefile means run depends on test, which is reversed.

suntong commented 1 year ago

Hmm... Having closed it, I think I was still correct as both npm run test and go test are normally done after build and run.

koddr commented 1 year ago

Hi,

I don't really understand what problem you are having with the Makefile? There are quite minimalistic instructions there for testing and starting backend and frontend.

Yes, it is shipped "AS IS". But you can change them as you see fit, there are no restrictions here.

If you think something is wrong, you can send a PR showing how you'd like it to be right.