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

Check for existence of api directory when running dev and skip api and db tasks if it doesn't exist #483

Closed
cannikin opened this issue Apr 30, 2020 · 5 comments · Fixed by #524

Comments

@cannikin
Copy link
Member

For those that only want to deploy the web site, they should be able to delete /api completely and still be able to run yarn rw dev locally. Right now the api and db tasks raise all kinds of errors.

@ackinc
Copy link
Contributor

ackinc commented May 1, 2020

Hi @cannikin , I've taken a first stab at this issue

@peterp
Copy link
Contributor

peterp commented May 1, 2020

Thanks @ackinc!

The sides PR should deal with this in the long term, but there's no reason why we can't also deal with it in the short term.

@ackinc
Copy link
Contributor

ackinc commented May 7, 2020

Hey guys, is there anything else you'd like me to do before closing this issue?

I guess the issue wasn't auto-closed because I put 'Closes #483' as a PR comment rather than in the PR description

@thedavidprice
Copy link
Contributor

Thanks again @ackinc

A question before we close this --> has anyone locally tested #490 to confirm it works?

Currently, it seems the Prisma Client is always being generated, correct? I can't imagine it doesn't freak out if the API directory doesn't exist:
https://github.com/ackinc/redwood/blob/64826b2a345e98cf66dad5dcdfcc17c9c7f60217/packages/cli/src/commands/dev.js#L24

@thedavidprice
Copy link
Contributor

Heads up here --> Tested locally and Prisma client is throwing errors. Web dev-server is not blocked from running.

$ yarn rw dev
yarn run v1.22.4
$ /Users/price/Repos/xx-delete/node_modules/.bin/rw dev
  ✖ Generating the Prisma client...
    → spawn /bin/sh ENOENT
Command failed with ENOENT: yarn prisma generate
spawn /bin/sh ENOENT
$ /Users/price/Repos/xx-delete/node_modules/.bin/webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.development.js
17:21:35 web | ℹ 「wds」: Project is running at http://localhost:8910/
17:21:35 web | ℹ 「wds」: webpack output is served from /
17:21:35 web | ℹ 「wds」: Content not from webpack is served from /Users/price/Repos/xx-delete/web
17:21:35 web | ℹ 「wds」: 404s will fallback to /index.html

I'll see about getting a PR with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants