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

Update according to Contributors library guidelines #121

Merged
merged 2 commits into from
Oct 9, 2020

Conversation

maxdeviant
Copy link
Member

This pull request is part of an effort to update and standardize the Contributors libraries according to the Library Guidelines. Specifically, it:

  1. Adjusts the files and repository structure according to the repository structure section of the guidelines, which includes standard pr templates, issue templates, CI in GitHub Actions, automatic stale issue management, ensures the project uses Spago, and so on.
  2. Updates the README and documentation according to the documentation section of the guidelines. This is a first step towards ensuring Contributors libraries have adequate module documentation, READMEs, a docs directory, and tests (even if just usage examples) in a test directory.
  3. Updates labels where relevant to help folks better sift through issues on this library and get started contributing.

This PR is the groundwork for followup efforts to ensure contributor libraries are kept up-to-date, documented, tested, and accessible to users and new contributors.

@maxdeviant
Copy link
Member Author

Verified that spago build and spago test work as expected:

λ spago build
[info] Installation complete.
[info] Build succeeded.
λ spago test
[info] Installation complete.
[info] Build succeeded.
"Hello World"
(Tuple "bar" "foo")
(Just 2)
[1.0,2.0,3.0]
2
(Tuple 0 1)
(Tuple 4 "FooBar")
(Tuple 1 (Tuple 0 2))
(Tuple 4 6)
(Just 1)
[info] Tests succeeded.

@maxdeviant
Copy link
Member Author

I wasn't sure what to do about the examples directory. I tried including it in the sources in spago.dhall:

- , sources = [ "src/**/*.purs", "test/**/*.purs" ]
+ , sources = [ "src/**/*.purs", "test/**/*.purs", "examples/**/*.purs ]

but doing so causes spago build to fail with the following:

λ spago build
[info] Installation complete.
Error 1 of 6:

  in module PrismsForSumTypes
  at examples/src/PrismsForSumTypes.purs:34:1 - 34:21 (line 34, column 1 - line 34, column 21)

    Module Color was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 2 of 6:

  in module PrismsForSumTypes
  at examples/src/PrismsForSumTypes.purs:35:1 - 35:22 (line 35, column 1 - line 35, column 22)

    Module Color was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 3 of 6:

  in module PrismsForSumTypes
  at examples/src/PrismsForSumTypes.purs:37:1 - 37:40 (line 37, column 1 - line 37, column 40)

    Module Data.Generic.Rep was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 4 of 6:

  in module PrismsForSumTypes
  at examples/src/PrismsForSumTypes.purs:38:1 - 38:34 (line 38, column 1 - line 38, column 34)

    Module Data.Generic.Rep.Eq was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 5 of 6:

  in module PrismsForSumTypes
  at examples/src/PrismsForSumTypes.purs:39:1 - 39:38 (line 39, column 1 - line 39, column 38)

    Module Data.Generic.Rep.Show was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.

Error 6 of 6:

  in module PrismsForSumTypes
  at examples/src/PrismsForSumTypes.purs:40:1 - 40:43 (line 40, column 1 - line 40, column 43)

    Module Data.Record.ShowRecord was not found.
    Make sure the source file exists, and that it has been provided as an input to the compiler.


  See https://github.com/purescript/documentation/blob/master/errors/ModuleNotFound.md for more information,
  or to contribute content related to this error.


[error] Failed to build.

@JordanMartinez
Copy link
Contributor

The examples/**/*.purs glob shouldn't be included in the normal spago.dhall file. Rather, that should be added in a separate examples.dhall file that adds in these additional dependencies. Something like:

let config = ./spago.dhall
in config
  with dependencies = config.dependencies # [ newDependency ]
  with sources = config.sources # [ "examples/**/*.purs" ]

@maxdeviant
Copy link
Member Author

The examples are now functional and I added a note in the quick start about how to run them.

@thomashoneyman thomashoneyman merged commit e7037b8 into purescript-contrib:master Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants