-
Notifications
You must be signed in to change notification settings - Fork 2
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: Improve Static Server Reliability #11
base: main
Are you sure you want to change the base?
Conversation
@@ -106,3 +127,44 @@ function handler( | |||
}); | |||
}; | |||
} | |||
|
|||
async function getStaticAssets(clientDir: string) { |
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.
async function getStaticAssets(clientDir: string) { | |
async function getStaticAssets(clientDir: string): Promise<Set<string>> { |
return client; | ||
} | ||
|
||
function prependForwardSlash(pth: string) { |
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.
function prependForwardSlash(pth: string) { | |
function prependForwardSlash(pth: string): string { |
return pth.startsWith('/') ? pth : '/' + pth; | ||
} | ||
|
||
function appendForwardSlash(pth: string) { |
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.
function appendForwardSlash(pth: string) { | |
function appendForwardSlash(pth: string): string { |
* | ||
* Copyright of withastro/adapters contributors, Reproduced under MIT License | ||
*/ | ||
function resolveClientDir(options: InternalOptions) { |
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.
function resolveClientDir(options: InternalOptions) { | |
function resolveClientDir(options: InternalOptions): string { |
const serverURLRaw = new URL(options.server); | ||
const rel = path.relative(url.fileURLToPath(serverURLRaw), url.fileURLToPath(clientURLRaw)); | ||
|
||
// walk up the parent folders until you find the one that is the root of the server entry folder. This is how we find the client folder relatively. |
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.
// walk up the parent folders until you find the one that is the root of the server entry folder. This is how we find the client folder relatively. | |
// Walk up the parent folders until you find the one that is the root of the server entry folder. This is how we find the client folder relatively. |
It also seems you have based this branch off of your branch used for #10 so the 2 you've put 2 PR's into 1. |
Marking as draft because it depends on types being corrected in #10. |
Changes
.webp
image inmdx
#4