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

Expand testing #1045

Merged
merged 5 commits into from
Nov 16, 2023
Merged

Expand testing #1045

merged 5 commits into from
Nov 16, 2023

Conversation

delucis
Copy link
Member

@delucis delucis commented Nov 6, 2023

What kind of changes does this PR include?

  • Something else!

Description

  • Adds tests for some areas of the code base that aren’t currently covered:
    • The rehype code used inside the <Tabs> component
    • The remark plugin used to render asides (:::note, :::tip etc.)
    • The wrapper we use to configure @astrojs/sitemap for people based on their i18n config
  • While working on this I also explored some ways to test our Zod error map and found some areas where we could probably improve the error messages, so will move that to a follow-up PR (probably for after Initial Starlight Plugins support #942 given that also is making some changes to config parsing)

Copy link

changeset-bot bot commented Nov 6, 2023

⚠️ No Changeset found

Latest commit: 8c64304

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Nov 6, 2023

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 9e735b2
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/654a1019786d060008720a67
😎 Deploy Preview https://deploy-preview-1045--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Nov 6, 2023
@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Nov 6, 2023

size-limit report 📦

Path Size
/index.html 5.13 KB (0%)
/_astro/*.js 19.27 KB (0%)
/_astro/*.css 9.72 KB (0%)

@@ -164,6 +164,7 @@
"astro": "^3.2.0"
},
"devDependencies": {
"@astrojs/markdown-remark": "^3.2.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this mean we could drop the dependency on unified and use the RemarkPlugin and RehypePlugin types exported from @astrojs/markdown-remark for our remark and rehype plugins?

Maybe also the RemarkPlugins constructed type in packages/starlight/src/integrations/asides.ts considering RemarkPlugins is also exported from @astrojs/markdown-remark?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this as a dev dependency for testing only as I’d be a bit concerned about ending up accidentally depending on two different versions (one, the subdependency of a user’s astro version, the other a subdependency of Starlight).

I was looking at the asides typings the other day in relation to #517. Maybe there’s another way to get those types without unified? I might leave figuring that out to until the Astro v4 release as that’s planning to upgrade the whole unified/remark/rehype/MDX ecosystem, and lots of the types shifted in the most recent releases of those packages.

Copy link
Member

@HiDeoo HiDeoo Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we're all looking at these types ^^

I was looking at them too for #983 (which is definitely not as fun as I would have hoped ^^) where I am down to 4 TS errors which are all related to remark/rehype and after that it should get easier (js generation, "assets" copy and .d.ts generation are in place).

Maybe there’s another way to get those types without unified?

Yeah, that's something I need to explore a bit more, it's not the easiest eco-system to deal with type-wise imo ^^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not the easiest eco-system to deal with type-wise imo

Absolutely not 😅 In general I think the types are good, but with the landscape of many, many small packages, it’s really easy to end up with conflicts between versions. Hopefully should be easier with Astro v4 because we should at that point be able to simply upgrade EVERYTHING to latest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully should be easier with Astro v4 because we should at that point be able to simply upgrade EVERYTHING to latest.

That would be so awesome indeed 🤞

I'm starting to think that #983 will need to wait for that change too. I'm down to 3 errors now all related to rehype/remark that I don't know how to properly fix due to the conflicting versions of @types/unist that we have.

Copy link

vercel bot commented Nov 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Nov 16, 2023 9:19pm

@delucis delucis merged commit 0af5050 into main Nov 16, 2023
6 checks passed
@delucis delucis deleted the chris/testing branch November 16, 2023 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants