-
Notifications
You must be signed in to change notification settings - Fork 993
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(deploy): handle server file #10061
Conversation
6fbfed3
to
cff7745
Compare
cff7745
to
e2eac7f
Compare
@@ -38,7 +38,7 @@ services: | |||
plan: free | |||
env: node | |||
region: oregon | |||
buildCommand: corepack enable && yarn && yarn rw build api | |||
buildCommand: corepack enable && yarn install && yarn rw build api |
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.
This is just stylistic to be consistent with the web build command above
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.
Tested locally
const apiProdCommand = ['yarn', 'rw', 'build', 'api', '&&'] | ||
if (!hasServerFile) { | ||
if (serverFileExists()) { |
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.
The logic was flipped here and was a bug
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.
Tested locally
export const isServerFileSetup = () => { | ||
if (!serverFileExists) { | ||
if (!serverFileExists()) { |
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.
Seems to have been a bug here where we were just checking the truthiness of a function
const serverFilePath = path.join(rwjsPaths.api.dist, 'server.js') | ||
const hasServerFile = fs.pathExistsSync(serverFilePath) |
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.
Still checking dist specifically here because this command is called after build
extendEnv: true, | ||
cleanup: true, |
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.
These default to true
At first this PR was similar to #10055 but for Flightcontrol. But in the process of testing that and updating deploy target CI, I noticed a few other things were off: - coherence logic for the server file was flipped. fixed here - in general, a few duplicate ways of checking for the server file. tried to dedupe them the best i could without making massive changes - stylistic change to render - the flightcontrol setup wasn't handing corepack Test as much as I could locally. Going to get this one into next so I can test in deploy target CI.
At first this PR was similar to #10055 but for Flightcontrol. But in the process of testing that and updating deploy target CI, I noticed a few other things were off: - coherence logic for the server file was flipped. fixed here - in general, a few duplicate ways of checking for the server file. tried to dedupe them the best i could without making massive changes - stylistic change to render - the flightcontrol setup wasn't handing corepack Test as much as I could locally. Going to get this one into next so I can test in deploy target CI.
* 'main' of github.com:redwoodjs/redwood: RSC: Fix server build root (redwoodjs#10076) chore(release): update changelog RSC: Add build step debug logs (redwoodjs#10078) fix(deploy): handle server file (redwoodjs#10061) RSC: Fix node-loader message typo (redwoodjs#10077) chore(release): update changelog chore(docs): Add link to SuperTokens auth (redwoodjs#10067) chore(release): update changelog RSC: chore - upgrade @tobbe.dev/rsc-test to v0.0.5 (redwoodjs#10073) chore(.vscode): Enable find inside root __fixtures__ (redwoodjs#10072) chore(deps): bump es5-ext from 0.10.62 to 0.10.64 (redwoodjs#10071) fix(coherence): update setup command to detect server file (redwoodjs#10060)
At first this PR was similar to #10055 but for Flightcontrol. But in the process of testing that and updating deploy target CI, I noticed a few other things were off:
Test as much as I could locally. Going to get this one into next so I can test in deploy target CI.