-
-
Notifications
You must be signed in to change notification settings - Fork 539
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
chore(website): upgrade Docusaurus, format files, add shiki-twoslash #1645
Conversation
@@ -139,4 +153,38 @@ module.exports = { | |||
}, | |||
], | |||
], | |||
// Misleading API, probably will be refactored in Docusaurus, but this is | |||
// simply a list of <link> tags |
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.
That's more like a note to myself. I have this comment on multiple websites I helped set up now, but I still can't think of a better API. We'll probably have an htmlTags
API that allows you to inject arbitrary HTML tags, not just <link>
?
}, | ||
blog: false, |
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.
blog: undefined
would still initialize the blog plugin, which would create some default routes like /blog/archive
, even if there aren't any posts.
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.
Thanks, a couple questions for review:
Upgrades Docusaurus to beta.15 (includes some cool new features, not sure if they will be used in the future)
What new features do we get? Will the appearance of the website change, and should I do a visual review of the results?
Do you have any plans for cool documentation features? I'm here if you need help with Docusaurus APIs and we may even implement new ones for your convenience.
Unfortunately not, though I'm open to ideas. For me, the benefits of docusaurus are that I don't need to spend time building the website. I can focus on library and CLI features, and write docs as simple markdown, and docusaurus makes it look great. Docusaurus is a great fit, but it also means I'm not using any advanced features.
Having said that, I suppose I'm open to suggestions if you have ideas. I don't know about any of docusaurus's new features.
name: 'theme-color', | ||
content: '#ffffff', | ||
}, | ||
], |
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 looks new, what does it do? Do we need to make these colors match something else in our config?
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.
It's a replacement for the <Head>
tags you had in index.js
before.
rel: 'shortcut icon', | ||
href: '/ts-node/img/favicon/favicon.ico', | ||
}, | ||
], |
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 looks new, what does it do?
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.
Same as above, just a replacement for the head tags so they show up on every page.
website/package.json
Outdated
"@docusaurus/theme-search-algolia": "^2.0.0-alpha.75", | ||
"@docusaurus/core": "2.0.0-beta.15", | ||
"@docusaurus/preset-classic": "2.0.0-beta.15", | ||
"@docusaurus/theme-search-algolia": "2.0.0-beta.15", |
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 forgot we were on an alpha version, I guess alpha->beta is an improvement in stability.
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 semantic difference between alpha and beta is not super big since we still ship breaking changes. The beta bump was mostly because we finally reached feature parity with v1 after the i18n release, so we are almost there for a stable release
Yes, you should preview the results locally since there are a few changes. For example, now the navbar items get an external link icon: But thanks to the simplicity of the website, not much has changed beyond that.
The big one is category index pages, which means you can tuck the "General > Overview" page into the "General" category label itself instead of as a dropdown item, if you think that makes more sense.
That's fair, and it's also what Docusaurus is built for :) I also think the ts-node website is good enough in its current form. |
I think we can temporarily hold this off until later this week when we release beta.16, which would contain a few bug fixes that may affect some downstream website visitors. |
Oh cool, that would also be nice for describing the "Recipes" section. I'm getting this error when I run
It looks like I might be hitting facebook/docusaurus#5778? I'm running node 17.3.1. Is the fix to upgrade webpack? You may have already done this in the PR; I make a habit of defensively reverting any lockfile changes and instead allowing my local |
I see that docusaurus's own website is somehow able to suppress the external link icon, for example, for this link to github: How is that possible? I see they're setting a |
Yes, you need to upgrade Webpack. We have fixed it ourselves, and the lockfile update is needed :) |
That's because we have set a custom |
Thanks, yeah can we try seeing what it looks like without those icons?
I tried yarn why webpack
|
Nevermind, I got the upgrade to work by removing docusaurus, |
Any luck excluding those external link icons from the navbar? I couldn't figure out how to do it. |
@cspotcode Going back to this, I noticed you don't have an |
Found it:
|
Sounds good, the breadcrumbs are nice. Does "more accessible" mean it's colorblind-friendly? |
No, just that it blends more nicely with the page... A dark code block on a light-themed page may not be accessible to visually challenged people who have to use a light background. It's also just more aesthetically appealing. |
Wow, now that you point this out, I can't believe I didn't notice it. This is a big improvement, thanks. |
build-readme.mjs to strip twoslash prefixes, fix a couple typos and docs mistakes found due to the above (yay), pin yarn version
This is looking good. Since I ended up adding shiki and discovered bug shikijs/twoslash#141, and since you said beta.17 is right around the corner, I figure I'll hold off on merging till both of those are resolved. |
Codecov Report
|
This PR is getting busy... 😄 |
/me slaps roof of PR |
… and it also adds erroneous links to ts-node sub-config
* build(docs): update package-lock to v2 The new package-lock version contains more details and is more explicit. Before updating packages with npm it makes sense to update this. * deps(docs): bump docusaurus to 2.0.1 * fix(docs): move hideableSidebar config This fixes the following error at startup: > [ERROR] ValidationError: themeConfig.hideableSidebar has been moved to > themeConfig.docs.sidebar.hideable. * fix(docs): use new algolia appId This was a new requirement from DocSearch. See https://docusaurus.io/blog/2021/11/21/algolia-docsearch-migration for more details. * fix(docs): align new css urls It seems the urls are resolved differently now. The previous urls caused compilation errors during `npm start`. Removing the `feel-scala` prefix fixed these errors. * ci(docs): update to node v18 * deps(docs): update to fix webpack See: - facebook/docusaurus#5778 - TypeStrong/ts-node#1645
* build(docs): update package-lock to v2 The new package-lock version contains more details and is more explicit. Before updating packages with npm it makes sense to update this. * deps(docs): bump docusaurus to 2.0.1 * deps(docs): update to fix webpack See: - facebook/docusaurus#5778 - TypeStrong/ts-node#1645 * deps(docs): install axios for http requests With almost 100k GH stars, this is one of the most commonly used HTTP libraries for nodejs. * deps(docs): install use-editable This library allows us to build an editable React component. * feat(docs): add tutorial-test page Adds a test page (MDX) called `tutorial-test.mdx` to develop the LiveFeel and Editor components. * docs: add tutorial test page to sidebar * make it easy to play around with the new editor Co-authored-by: Philipp Ossler <[email protected]>
This PR:
Do you have any plans for cool documentation features? I'm here if you need help with Docusaurus APIs and we may even implement new ones for your convenience.