Skip to content

Conversation

@justinwoo
Copy link
Collaborator

This introduces allowing for local package sets to be used by path.

This is a breaking change for users who have been creating .psc-package/{setname}/.set/packages.json files manually, of which there are a small number who do use this in their actual work projects. However, getting these users to upgrade should not prove to be a big problem, and they can simply change "source" in their psc-package.json to the full path where they have been writing package sets.

@justinwoo
Copy link
Collaborator Author

Is anyone interested in reviewing this code? @hdgarrood @paf31

else Local txt

instance Aeson.FromJSON UrlOrLocal where
parseJSON value = mkUrlOrLocal <$> Aeson.parseJSON value

Choose a reason for hiding this comment

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

This will interpret http:// as a local path. It should probably fail and tell the user to use https:// instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the url check is quite lazy, so i'm willing to change it with almost anything else. just need to know where to pull a better definition from

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in reality another lazy solution i guess would be to check if :// is an infix, which accurately reflects the faces of pedants reading this comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

third, i guess mots people will use git@github.com:purescript/package-sets.git as a git url, so the prefix is wrong in any case

Choose a reason for hiding this comment

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

Alternatively you could require that local paths begin with file://. E.g. file://../foo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i hate file urls, especially considering that this should work with relative paths easily

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

when i glance over docs i see that anything ending in .git is basically fair game for git https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols

@justinwoo
Copy link
Collaborator Author

Going to merge this now after going through this with some others

@justinwoo justinwoo merged commit bfbb320 into purescript:master Jan 19, 2020
@justinwoo justinwoo deleted the use-local-set branch January 19, 2020 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants