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

fix(cli): Update build and serve to handle the absence of the api side #10265

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

Josh-Walker-GM
Copy link
Collaborator

Problem
This PR address the issue raised in #10264 which highlighted that yarn rw build would fail for projects that have removed the api directory.

Changes

  1. The yarn rw build command now checks for the existence of the prisma schema file. It will not generate the prisma client if the file does not exist and it will not trigger prerendering if the schema file does not exist.
  2. Updates the checks performed by yarn rw serve to handle the case when there is not API side a little nicer. It will offer more specific error messages when you run yarn rw serve api without an API side and it will tell you to run yarn rw serve web instead of yarn rw serve if you have no API side.

Concerns

  1. I'm not sure about adding checks for "does the API side even exist" anywhere we previously assumed it did. For now these checks only needed to happen in 2 places so I'm not that bothered about them but I can see how it could spiral out of control.

@Josh-Walker-GM Josh-Walker-GM added the release:fix This PR is a fix label Mar 19, 2024
@Josh-Walker-GM Josh-Walker-GM added this to the next-release-patch milestone Mar 19, 2024
@Josh-Walker-GM Josh-Walker-GM self-assigned this Mar 19, 2024
@Josh-Walker-GM Josh-Walker-GM force-pushed the jgmw-fix/build-and-serve-without-api-side branch from 4c6c59e to 33b068d Compare March 20, 2024 19:39
@Josh-Walker-GM Josh-Walker-GM force-pushed the jgmw-fix/build-and-serve-without-api-side branch from 33b068d to d9fa691 Compare March 20, 2024 19:39
@Josh-Walker-GM Josh-Walker-GM marked this pull request as ready for review March 20, 2024 19:40
@Josh-Walker-GM Josh-Walker-GM merged commit 5c594d3 into main Mar 21, 2024
44 checks passed
@Josh-Walker-GM Josh-Walker-GM deleted the jgmw-fix/build-and-serve-without-api-side branch March 21, 2024 23:33
thedavidprice pushed a commit that referenced this pull request Mar 27, 2024
#10265)

**Problem**
This PR address the issue raised in #10264 which highlighted that `yarn
rw build` would fail for projects that have removed the `api` directory.

**Changes**
1. The `yarn rw build` command now checks for the existence of the
prisma schema file. It will not generate the prisma client if the file
does not exist and it will not trigger prerendering if the schema file
does not exist.
2. Updates the checks performed by `yarn rw serve` to handle the case
when there is not API side a little nicer. It will offer more specific
error messages when you run `yarn rw serve api` without an API side and
it will tell you to run `yarn rw serve web` instead of `yarn rw serve`
if you have no API side.

**Concerns**
1. I'm not sure about adding checks for "does the API side even exist"
anywhere we previously assumed it did. For now these checks only needed
to happen in 2 places so I'm not that bothered about them but I can see
how it could spiral out of control.
@jtoar jtoar modified the milestones: next-release, v7.2.0 Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants