-
Notifications
You must be signed in to change notification settings - Fork 80
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
Import from Bower PoC, the Package
type and Package Sets
#4
Conversation
This is so awesome! I know a non-goal of this project is making a usable frontend. Does that include the format of the data, or is it possible to also store the JSON representation of the data here? I can explain more if you'd like, but don't need to if the answer is "we're only going to store Dhall." |
@joneshf what use-case do you have in mind for versioning the JSON too? We are doing this (i.e. versioning both the Dhall and JSON render) in |
Nice! Are there really over 10,000 package versions??? Can I request that we keep the registry data separate from everything else, (i.e. the readme, the dhall type definitions)? Perhaps by putting it into a separate branch or something? I was looking for the Dhall type definition for
I am not totally convinced 😅 I think some prose is probably needed somewhere to help first-time authors understand the meanings of all of the fields. Also, can Dhall implement the package name constraints I mentioned in #3? |
Okay, found it. https://github.com/purescript/registry/blob/f582adf2167b6fb6f898a27b3292c646d657c9b1/v1/Package.dhall#L1-L13 Some thoughts:
|
Sorry for delay on this, I'm currently working on improvements following the feedback from @hdgarrood, will post updates soon |
@hdgarrood thanks for the thorough review! Since the last activity here we had a pretty good iteration on the design with @reactormonk. In the meanwhile I also realized that I didn't really manage to communicate why the I also removed the vast majority of the package manifests and only kept some of them, for ease of review. I shuffled around something in the config based on the feedback, and I basically rewrote the README to clarify lots of aspects of the overall design and inner workings. Also most importantly this iteration properly brings into the picture Package Sets and how they would fit into the overall design. I feel like I took care of most of the things you mentioned in the new sections/examples, so I'd like to ask you to take a look at the PR again (mostly the README and the types in
I think this request came from being overwhelmed at the amount of generated package manifests, so it should not be a problem anymore. Let me know if it still is, and if so I'd be curious to know why. Anyways, I'll expand a bit more on this: I was thinking about moving the As a note, migrating between versions of different schemas is usually possible in pure Dhall. Then we could write a migration function in Dhall: let v1tov2 = \(pkg : ./v1/Package.dhall) -> pkg // { name = [ pkg.name ] }
in v1tov2 ..and if you'd like to migrate some old definition of a package, then it would just be a matter of applying the function to it: ./v1tov2.dhall ./some_v1_package_definition.dhall This is nice because consumers can choose which version of the schema they want to work with, and migrate the data according to their needs, while at the same time we don't need to duplicate data here at all.
Oh yeah sorry, I meant to add documentation to all the types before opening the PR, but it slipped. You should find the
You are aware of the fact that Dhall doesn't allow Text manipulation for now, but that's being discussed as not everything can be done without it (personal feeling: I think we'll get some amount of text manipulation, but it will not be rushed) However, we can enforce basic checks just in CI: since all packages have to pass However, since this design keeps package names in record labels, package names have to satisfy Dhall's constraints for labels, which is the reason why in #3 I asked if we could forbid the From Dhall's grammar: simple-label-first-char = ALPHA / "_"
simple-label-next-char = ALPHANUM / "-" / "/" / "_"
simple-label = simple-label-first-char *simple-label-next-char
Before I get to the specific points, I'll note that I included in there some of the configuration options that you have in Spago config files - documentation for the format here.
You can think of this in the same way of
Moreover, note that packages do not need to specify all fields. All of them except
See the Spago docs linked above: the At first I thought about a more structured form to encompass all the use cases, e.g.: backend : { cmd : Text, compatibile : List Text } In this way users could specify the default command to compile their projects with ( ..but then I got inspired by @JordanMartinez in purescript/spago#416 (comment) and added the
Yes. This is another Spago option (that is not implemented yet, but I intend to), so we file this under the "project build" aspect of the If we move towards a shared schema for registry, build tools, and the compiler, then This has been moved into a
Context for other readers: purescript/spago#288 cc @joneshf I put I think the main thing that was preventing us from doing that was the equivalence "1 package = 1 repo", which is going away here since packages will not be fetched from repos anymore, but from tarballs uploaded here. If the worry is about build systems or users catching up with this, I don't think that's an issue at all:
I think a statement like "risks significantly complicating" is fairly strong, so I'd love a detailed example/explanation of what these complications could be in practice? |
@hdgarrood I though about this PR a bit and it seems like the range of things we're discussing is getting very broad, so it might be hard to cook a response to the whole thing (e.g. it took me a while and I imagine getting back in detail to all of this might take a while too). I was wondering about ways to streamline this process (my goal here: avoid getting stuck), and I'd like to propose that if there are no objections of the kind "this design is not viable at all because.." then we just merge to How does this sound? |
Package
type and Package Sets
That sounds good to me. I'll try to take another look as soon as I can and I'll approve if I have no major objections like that. |
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 really nice, thanks! There's nothing showstopping here so I'll approve merging.
I wasn't aware of the context re wanting to unify the spago config and the registry, but I agree that this makes sense. The issue I'm worried about with sources
is basically for setups which don't use Spago; I want to avoid making life difficult for people who are still using other things like psc-package or pulp/bower. Yes, it's probably not too much effort to switch a build script of just a few lines in most cases, especially with spago init
, but it's harder if the assumption is built into more complex tooling, such as, say, editor plugins. This assumption is built into purs publish
right now too. It becomes significantly more complicated if these build scripts or tooling can't/don't want to assume the presence of Spago on the machine in use, or don't want to add Dhall as a dependency.
I would be happy if we could have the curator require that the sources
for the lib
target for any published package are just ["src/**/*.purs"]
, at least to start with; I could see us relaxing that later once most of the ecosystem is using this registry.
- ..as well as **overriding the package manifest by trustees**, so that e.g. version bounds | ||
can be updated without having to ask authors to cut a new release. | ||
- **ease of publishing a release** is optimized for and entirely automated. | ||
- package manifests are **declarative**: authors need not to concern themselves with |
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 think package manifests are just declarative by nature, so I'm not sure if this really counts as a feature of this design. Can you give an example of a package manifest which isn't declarative?
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.
NPM's preinstall
/postinstall
hooks - they allow package maintainers to decide how their package is installed. I don't think they are a good idea, even though we use them to easily distribute spago
and purs
Thanks for the review @hdgarrood! I'll merge now, and open issues to track all the unresolved threads 😊 |
Package
type and Package SetsPackage
type and Package Sets
This PR shows a PoC of importing all of Bower packages into this repo as sketched in the design document.
Some notes:
bower-json
refuses to parse them)purescript-
prefix, as it's lots of chars and we don't really need it if we're not on the Bower registryPackage
type in such a way that it could be used to replace thespago.dhall
and maybe to be the universal format that it's needed to make the compiler package awarecc @hdgarrood