-
Notifications
You must be signed in to change notification settings - Fork 737
Track and invalidate linked partials and typedocs in dev cache #2323
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
Track and invalidate linked partials and typedocs in dev cache #2323
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -12,7 +12,7 @@ | |||
"lint:check-frontmatter": "node ./scripts/check-frontmatter.mjs", | |||
"lint:validation": "npm run build", | |||
"build": "tsx ./scripts/build-docs.ts", | |||
"dev": "tsx ./scripts/build-docs.ts --watch", | |||
"dev": "tsx watch ./scripts/build-docs.ts --watch", |
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 seems weird that it would need both watch flags...
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 first watch
is to tell tsx
to reload and restart the whole script if any of the .ts
files change (eg pulling in main having an updated script). The second --watch
is to run the script in dev mode holding the markdown in memory and all that.
scripts/build-docs.ts
Outdated
@@ -827,5 +881,7 @@ template: wide | |||
await fs.rename(config.distTempPath, config.distFinalPath) | |||
} | |||
|
|||
if (abortSignal?.aborted) throw new Error('Build aborted') |
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 abortsignal thing seems crazy there are so many instances of it and it's so frequent. Is this really the best way?
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.
I've cleaned it up to just abortSignal?.throwIfAborted()
but this is largely just how abort controllers work, just check it throughout execution and exit early if need be.
What does this solve?
<Typedoc />
or<Include />
of a partial is used and editedWhat changed?
Checklist