-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 package.json hint #6186
add package.json hint #6186
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
Hi @nadar! I'm glad that you found a solution that worked for you, and that you want to help others who have the same issue! Thank you for coming to add extra information to the docs. We really try not to add "notes" and "tips" unless they fit certain criteria. These should be things that are almost not a part of docs at all, but extra, external or tangential things. If the information is truly important, then it should be properly documented as a part of the instructions or explanation. For example, if it is necessary to also update another file, then we should properly show that file being updated as part of the complete instructions. This does not go in a "note" if it's key information. Would you be willing to revise this to include it at the appropriate step, not using a "note" for things that should have been done in the first place? |
Thank you @sarah11918 for guiding me in the right direction. I've revised the sentence and eliminated the note syntax. Hopefully, it's better now. Since English is not my first language, I don't want to mess up the quality of the Astro documentation. 🙂 |
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.
Thank you @sarah11918 for guiding me in the right direction. I've revised the sentence and eliminated the note syntax. Hopefully, it's better now. Since English is not my first language, I don't want to mess up the quality of the Astro documentation. 🙂
Hello! Thank you for taking on the task of ensuring no one makes this mistake in the future!
I have taken a stab at revising this in a way that is more consistent with the Astro docs at the moment.
I would also like to request someone in core
to confirm that this is the correct solution, before moving forward!
I have a question about this, as I have never written an integration. Would
{
"exports": "./dashboard.astro"
}
be the same as
{
"exports": { "./dashboard.astro": "./dashboard.astro" }
}
?
Those are not the same @VoxelMC
import Dashboard from '@some/integration'; It is equivalent to this: "exports": {
".": "./dashboard.astro"
} To import from a subpath like this import Dashboard from '@some/integration/dashboard.astro'; Is what requires this export: "exports": {
"./dashboard.astro": "./dashboard.astro"
} The same applied for entrypoints passed to More information here: https://nodejs.org/api/packages.html#subpath-exports It's not an Astro requirement, Node won't even try to resolve the import if it is not declared in the package, so Vite's module loader won't be called, and neither is Astro's Vite plugin. |
Ohhhh, that makes a lot more sense. You explained it much better than the npm and nodejs docs, imo! Thanks Fryuni :) |
Co-authored-by: voxel!() <[email protected]>
I think it is a pretty niche case. However, I can see it being a very annoying bug to research if it happens to someone. I agree with shortening the suggestion. I say keep it! What do you say to it being a |
I think the shortened version is enough, no need to get in the details of how it fails otherwise. Users will see that on their terminal if they don't follow. I'm a bit biased on whether the text is clear or not because I already know the context, answers and reasoning behind it. I'd feel better with an opinion from someone who never wrote an integration to see what they would do after reading that line. But besides that LGTM |
Alright, I'm going to take this all as NWTWWHB! (PS: Not a "note" because it's actually a required step. All the asides are for things outside of "normal procedure") |
Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Luiz Ferraz <[email protected]> Co-authored-by: voxel!() <[email protected]>
For non-super-duper experts, it can be helpful to have a hint that those files must be exported, see my struggle and the helpful answer of @Fryuni
withastro/astro#7721 (comment)