Conversation
🦋 Changeset detectedLatest commit: fb9e046 The changes in this PR will be included in the next version bump. 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 |
I could definitely see this in a separate package, I notable can very easily see
No particular thoughts, but I assume we don't want users to confuse it with
Since the dev overlay is stable in like two weeks, maybe we just yolo it? I don't see us relying on this module for othe rthings soon anyway. |
|
If we're bikeshedding on command name/API:
|
36a0a86 to
df098c6
Compare
|
I firmly believe that we shouldn't provide a |
I don't really understand how the global config is related to installing Astro globally, what's the relation? |
|
Thank you for the feedback @FredKSchott! I believe I've addressed all of that now.
|
|
@ematipico I understand where you're coming from, but the ability to set a preference for all Astro projects is one of the explicit goals. I don't think users will confuse a For some additional context: the |
Having a local and a global configuration is a very risky business, because a single change in the configuration, even the addition of a new property, would mean that a previous version wouldn't be able to understand it. If this single change goes into the global configuration, the rest of the projects won't work anymore, unless they are upgraded. It would make DX a living hell. I'm not sure we should allow a global configuration. |
|
I'm still not sure I understand your specific concerns. The intention for this feature is to support global user preferences that impact every Astro project. Telemetry already works this way—if a user opts out of telemetry, every Astro project needs to respect that preference. Semver and backwards-compatibility are a requirement with the global preferences as they are with any feature. |
|
To handle versioning of config file changes I've seen done by having a "version" field in the config file. Since this file is edited by a CLI and not by hand, I think that handles the concern well. @ematipico The UX here of "I want this disabled in all projects" seems perfectly valid as a goal. Would you agree? If so, is there any other way to achieve that goal than something like this? |
sarah11918
left a comment
There was a problem hiding this comment.
Docs look great for the changeset, Nate! We'll just need something added to the CLI reference page in docs itself!
|
I don't know how much we plan to rely on global settings in the future, so please take my takes with a grain of salt.
I am aware of it, but this won't fix our issues. Here's a practical example. You add a global Upon revisiting the file, we discovered the issue and published a patch in Now all projects with version Also, imagine these issues on minor releases or major releases of The way I see it, the only way to land this feature without repercussions, is to make sure that Astro can understand ALL the versions of |
|
To @ematipico's concern, if Nate committed to long-term full backwards compatibility, would that address your concern? Ex: in your scenario above, the "fixed" version of Astro would write to both For context, this is not a module that we should expect a lot of usage and changes in. To look at its history, you could say that we introduced the first preference for telemetry in Astro 1.0, and now the second preference for the dev overlay in 4.0. I don't think there's any reason to think that this will accelerate, and if it did I imagine we could revisit this system in the future without being too blocked. My main point would be that if your concern is with the larger concept of global configuration, that's probably a larger conversation given that we already have the concept of global configuration in Astro today powering the global telemetry opt-out. |
|
Thanks for the elaboration @ematipico and for chiming in @FredKSchott! I understand the concern and agree that backwards-compatibility is essential for this feature. Changes to the configuration options would be handled with the same concern for proper semantic versioning as the rest of |
c42c2ac to
2d5c21b
Compare
7e52830 to
6026a51
Compare
7a8b40a to
9f74d11
Compare
Changes
experimental.devOverlayastro.config.mjsfile manages configuration for a specific project on any machine, user preferences manage configuration for a specific user (machine)..astro/settings.jsonfile..gitignorethe.astro/directory, this is a natural place to put settings for an individual user.astro preferencesCLI command, designed to mirror thepnpm configcommand.Open Questions
astroor a separate package? I could see this module being used in@astrojs/telemetryandcreate-astroto configure certain default behavior.astro config? I can see that being hard to document. I consideredastro prefsorastro settingsbut both felt weird.astro preferencesit is!configwould have been confusing to users because of theastro.config.mjsfile andsettingswould have been confusing for maintainers because there is an existingAstroSettingsthat means something else.astro experimental-config?Testing
Tested manually because I'm not sure how pipe the mocked
fsthrough the system just yetDocs
#5512 and added to the Astro 4.0 breaking changes tracker