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

Add Starlight types to defineEcConfig, export StarlightExpressiveCodeOptions #1437

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

hippotastic
Copy link
Contributor

Description

  • Adds Starlight-specific types to the defineEcConfig function and exports StarlightExpressiveCodeOptions. Both can be imported from @astrojs/starlight/expressive-code.

This provides Starlight types and IntelliSense support for your Expressive Code configuration options inside an ec.config.mjs file. See the Expressive Code documentation for more information.

Copy link

changeset-bot bot commented Jan 29, 2024

🦋 Changeset detected

Latest commit: 4598bf4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Jan 29, 2024

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

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Jan 29, 2024 4:55pm

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

This looks good to me @hippotastic!

One question though: shouldn’t this be documented somewhere? Or is the intention people start with the astro.config version and then only use this based on terminal logging?

@hippotastic
Copy link
Contributor Author

hippotastic commented Jan 29, 2024

It is documented on the EC website, including examples that show usage of the function.

Yes, it is my intention that users start with the Astro config, and the majority of users should also be able to keep using the Astro config, as most parts of the EC options are serializable.

Only advanced users who know plugins or advanced configurations (probably through the EC website) will run into the scenario where the Code component tells them that they need to move their EC config to the file.

The EC website contains examples which use the function, and I included the full Code component error message to ensure it pops up when using the search function: https://expressive-code.com/key-features/code-component/#using-an-ecconfigmjs-file

If we think that more guidance is needed, I could add a docs link to the Code component's error message. But I thought I'd wait and see if I receive any reports on this before making the message even longer. :)

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Ok sounds good! Thanks @hippotastic 🙌

@delucis delucis merged commit 655aed4 into withastro:main Jan 29, 2024
10 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 29, 2024
@hippotastic hippotastic deleted the add-define-ec-config branch January 29, 2024 22:56
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.

2 participants