From 63885d10a6174e5a8ab29c2bacd542f39fefc37c Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Mon, 5 Oct 2020 19:16:05 -0700 Subject: [PATCH 1/2] Update for contributors library requirements --- .editorconfig | 13 ++++ .github/ISSUE_TEMPLATE/bug-report.md | 19 ++++++ .github/ISSUE_TEMPLATE/change-request.md | 21 ++++++ .github/ISSUE_TEMPLATE/config.yml | 8 +++ .github/PULL_REQUEST_TEMPLATE.md | 11 ++++ .github/workflows/ci.yml | 34 ++++++++++ .gitignore | 19 ++---- .travis.yml | 23 ------- CHANGELOG.md | 81 ++++++++++++++++++++++++ CONTRIBUTING.md | 5 ++ README.md | 41 ++++++++---- package.json | 13 ---- packages.dhall | 4 ++ spago.dhall | 18 ++++++ 14 files changed, 249 insertions(+), 61 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/change-request.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md delete mode 100644 package.json create mode 100644 packages.dhall create mode 100644 spago.dhall diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7c68b07 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# https://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..b79b995 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,19 @@ +--- +name: Bug report +about: Report an issue +title: "" +labels: bug +assignees: "" +--- + +**Describe the bug** +A clear and concise description of the bug. + +**To Reproduce** +A minimal code example (preferably a runnable example on [Try PureScript](https://try.purescript.org)!) or steps to reproduce the issue. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/change-request.md b/.github/ISSUE_TEMPLATE/change-request.md new file mode 100644 index 0000000..a2ee685 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/change-request.md @@ -0,0 +1,21 @@ +--- +name: Change request +about: Propose an improvement to this library +title: "" +labels: "" +assignees: "" +--- + +**Is your change request related to a problem? Please describe.** +A clear and concise description of the problem. + +Examples: + +- It's frustrating to have to [...] +- I was looking for a function to [...] + +**Describe the solution you'd like** +A clear and concise description of what a good solution to you looks like, including any solutions you've already considered. + +**Additional context** +Add any other context about the change request here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..c47a263 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: PureScript Discourse + url: https://discourse.purescript.org/ + about: Ask and answer questions here. + - name: Functional Programming Slack + url: https://functionalprogramming.slack.com + about: For casual chat and questions (use https://fpchat-invite.herokuapp.com to join). diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d8780f7 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +**Description of the change** +Clearly and concisely describe the purpose of the pull request. If this PR relates to an existing issue or change proposal, please link to it. Include any other background context that would help reviewers understand the motivation for this PR. + +--- + +**Checklist:** + +- [ ] Added the change to the changelog's "Unreleased" section with a link to this PR and your username +- [ ] Linked any existing issues or proposals that this pull request should close +- [ ] Updated or added relevant documentation in the README and/or documentation directory +- [ ] Added a test for the contribution (if applicable) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b0550f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up a PureScript toolchain + uses: purescript-contrib/setup-purescript@main + + - name: Cache PureScript dependencies + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }} + path: | + .spago + output + + - name: Install dependencies + run: spago install + + - name: Build source + run: spago build --no-install --purs-args '--censor-lib --strict' + + - name: Run tests + run: spago test --no-install diff --git a/.gitignore b/.gitignore index 5a89082..7bca306 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,8 @@ -/.* -!/.gitignore -!/.github -!/.travis.yml +.* +!.gitignore +!.github +!.editorconfig -# Dependencies -bower_components -node_modules - -# Generated files output -dce-output generated-docs - -# Lockfiles -package-lock.json -*.lock +bower_components diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6da455e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js -dist: trusty -sudo: required -node_js: stable -env: - - PATH=$HOME/purescript:$PATH -install: - - TAG=$(basename $(curl --location --silent --output /dev/null -w %{url_effective} https://github.com/purescript/purescript/releases/latest)) - - curl --location --output $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz - - tar -xvf $HOME/purescript.tar.gz -C $HOME/ - - chmod a+x $HOME/purescript - - npm install -g bower - - npm install - - bower install --production -script: - - npm run -s build - - bower install - - npm run -s test -after_success: - - >- - test $TRAVIS_TAG && - echo $GITHUB_TOKEN | pulp login && - echo y | pulp publish --no-push diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9b91916 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,81 @@ +# Changelog + +Notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +Breaking changes (😱!!!): + +New features: + +Bugfixes: + +Other improvements: + +## [v7.0.1](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v7.0.1) - 2019-06-04 + +- Updated for PureScript 0.13 compatibility + +## [v7.0.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v7.0.0) - 2019-03-04 + +- Updated dependencies + +## [v6.0.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v6.0.0) - 2018-06-28 + +- Updates for PS@0.12 @therealnicksaunders + +## [v5.0.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v5.0.0) - 2018-03-20 + +- Remove `Sandboxed` slot from `Pathy` type. +- Add better way of Sandboxing. +- Use `NonEmptyString` for segment names. +- Make runtime representation of Pathy simpler. +- And bunch more, see #33 (@safareli, @garyb) + +## [v4.1.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v4.1.0) - 2017-12-21 + +- Add Gen module - @safareli #31 + +## [v4.0.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v4.0.0) - 2017-04-04 + +- Updated for PureScript 0.11 +- Removed deprecated `Data.Generic` instances. + +## [v3.0.2](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v3.0.2) - 2016-12-21 + +- Fixed shadowed name warning +- Fixed license identifier for Pursuit publishing + +## [v3.0.1](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v3.0.1) - 2016-11-14 + +- Fixed `Ord` instance + +## [v3.0.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v3.0.0) - 2016-10-28 + +- Updated dependencies for PureScript 0.10 + +## [v2.0.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v2.0.0) - 2016-07-28 + +- The `Escaper` is no longer ignored when printing paths +- Directories are consistently on the left and files consistently on the right in `Either`s and function arguments now + +## [v0.3.3](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v0.3.3) - 2016-04-21 + +- Fix the exports for v0.3.2 + +## [v0.3.2](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v0.3.2) - 2016-04-21 + +- Added synonyms for where a path is either a directory or file. +- Added `pathName` to extract the name of a directory or file. + +## [v0.3.1](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v0.3.1) - 2016-01-21 + +- Fixed various warnings raised by psc 0.7.6.1 + +## [v0.2.1](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v0.2.1) - 2015-08-14 + +- Functionally identical to v0.2.0, this update is to allow publishing on http://pursuit.purescript.org/ + +## [v0.1.0](https://github.com/purescript-contrib/purescript-pathy/releases/tag/v0.1.0) - 2015-04-29 + +- Initial release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..37dc910 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing to Pathy + +Thanks for your interest in contributing to `pathy`! We welcome new contributions regardless of your level of experience or familiarity with PureScript. + +Every library in the Contributors organization shares a simple handbook that helps new contributors get started. With that in mind, please [read the short contributing guide on purescript-contrib/governance](https://github.com/purescript-contrib/governance/blob/main/contributing.md) before contributing to this library. diff --git a/README.md b/README.md index e1ee944..3864425 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,22 @@ -# purescript-pathy +# Pathy -[![Latest release](http://img.shields.io/github/release/slamdata/purescript-pathy.svg)](https://github.com/slamdata/purescript-pathy/releases) -[![Build status](https://travis-ci.org/slamdata/purescript-pathy.svg?branch=master)](https://travis-ci.org/slamdata/purescript-pathy) +[![CI](https://github.com/purescript-contrib/purescript-pathy/workflows/CI/badge.svg?branch=main)](https://github.com/purescript-contrib/purescript-pathy/actions?query=workflow%3ACI+branch%3Amain) +[![Release](https://img.shields.io/github/release/purescript-contrib/purescript-pathy.svg)](https://github.com/purescript-contrib/purescript-pathy/releases) +[![Pursuit](https://pursuit.purescript.org/packages/purescript-pathy/badge)](https://pursuit.purescript.org/packages/purescript-pathy) +[![Maintainer: garyb](https://img.shields.io/badge/maintainer-garyb-teal.svg)](https://github.com/garyb) +[![Maintainer: thomashoneyman](https://img.shields.io/badge/maintainer-thomashoneyman-teal.svg)](https://github.com/thomashoneyman) A type-safe abstraction for platform-independent file system paths. ## Installation -```bash -bower install purescript-pathy -``` +Install `pathy` with [Spago](https://github.com/purescript/spago): -```purescript -import Pathy +```sh +spago install pathy ``` -## Introduction +## Quick start Applications often have to refer to file system paths in a platform-independent way. @@ -122,6 +123,24 @@ There are many other functions available to you for renaming files, renaming dir These are all documented [on Pursuit](http://pursuit.purescript.org/packages/purescript-pathy), and you can find [test usages](/test/Main.purs) for most of them. -# API Docs +## Documentation + +`pathy` documentation is stored in a few places: + +1. Module documentation is [published on Pursuit](https://pursuit.purescript.org/packages/purescript-pathy). +2. Usage examples can be found in [the test suite](./test). + +If you get stuck, there are several ways to get help: + +- [Open an issue](https://github.com/purescript-contrib/purescript-pathy/issues) if you have encountered a bug or problem. +- [Search or start a thread on the PureScript Discourse](https://discourse.purescript.org) if you have general questions. You can also ask questions in the `#purescript` and `#purescript-beginners` channels on the [Functional Programming Slack](https://functionalprogramming.slack.com) ([invite link](https://fpchat-invite.herokuapp.com/)). + +## Contributing + +You can contribute to `pathy` in several ways: + +1. If you encounter a problem or have a question, please [open an issue](https://github.com/purescript-contrib/purescript-pathy/issues). We'll do our best to work with you to resolve or answer it. + +2. If you would like to contribute code, tests, or documentation, please [read the contributor guide](./CONTRIBUTING.md). It's a short, helpful introduction to contributing to this library, including development instructions. -Documentation for all functions and types is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-pathy). +3. If you have written a library, tutorial, guide, or other resource based on this package, please share it on the [PureScript Discourse](https://discourse.purescript.org)! Writing libraries and learning resources are a great way to help this library succeed. diff --git a/package.json b/package.json deleted file mode 100644 index e085a1e..0000000 --- a/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "private": true, - "scripts": { - "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build -- --censor-lib --strict", - "test": "pulp test" - }, - "devDependencies": { - "pulp": "^14.0.0", - "purescript-psa": "^0.7.3", - "rimraf": "^3.0.2" - } -} diff --git a/packages.dhall b/packages.dhall new file mode 100644 index 0000000..b5baf39 --- /dev/null +++ b/packages.dhall @@ -0,0 +1,4 @@ +let upstream = + https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20200922/packages.dhall sha256:5edc9af74593eab8834d7e324e5868a3d258bbab75c5531d2eb770d4324a2900 + +in upstream diff --git a/spago.dhall b/spago.dhall new file mode 100644 index 0000000..f7adcd2 --- /dev/null +++ b/spago.dhall @@ -0,0 +1,18 @@ +{ name = "pathy" +, dependencies = + [ "console" + , "effect" + , "exceptions" + , "lists" + , "partial" + , "profunctor" + , "psci-support" + , "quickcheck" + , "strings" + , "transformers" + , "typelevel-prelude" + , "unsafe-coerce" + ] +, packages = ./packages.dhall +, sources = [ "src/**/*.purs", "test/**/*.purs" ] +} From f607a22883929583efd55e8022ccc9ff4fddd7c5 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Mon, 5 Oct 2020 19:24:55 -0700 Subject: [PATCH 2/2] Fix warnings --- .github/workflows/ci.yml | 2 +- src/Pathy/Printer.purs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b0550f..7256629 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: run: spago install - name: Build source - run: spago build --no-install --purs-args '--censor-lib --strict' + run: spago build --no-install - name: Run tests run: spago test --no-install diff --git a/src/Pathy/Printer.purs b/src/Pathy/Printer.purs index 423ca2c..2a6b1c5 100644 --- a/src/Pathy/Printer.purs +++ b/src/Pathy/Printer.purs @@ -25,7 +25,7 @@ import Data.String.NonEmpty.CodeUnits (cons, singleton) as NES import Partial.Unsafe (unsafePartial) import Pathy.Name (Name) import Pathy.Path (Path, foldPath, ()) -import Pathy.Phantom (class IsDirOrFile, class IsRelOrAbs, Dir, Rel, foldDirOrFile, foldRelOrAbs, kind DirOrFile, kind RelOrAbs) +import Pathy.Phantom (class IsDirOrFile, class IsRelOrAbs, Dir, Rel, foldDirOrFile, foldRelOrAbs) import Pathy.Sandboxed (SandboxedPath, sandboxRoot, unsandbox) import Prim.TypeError (class Warn, Text)