Skip to content

Update according to Contributors library guidelines #21

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

Merged
merged 3 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
47 changes: 24 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
{
"parserOptions": {
"ecmaVersion": 5
},
"env": { "browser": true, "commonjs": true },
"extends": "eslint:recommended",
"env": {
"commonjs": true
},
"parserOptions": { "ecmaVersion": 5 },
"rules": {
"strict": [2, "global"],
"block-scoped-var": 2,
"consistent-return": 2,
"eqeqeq": [2, "smart"],
"guard-for-in": 2,
"no-caller": 2,
"no-extend-native": 2,
"no-loop-func": 2,
"no-new": 2,
"no-param-reassign": 2,
"no-return-assign": 2,
"no-unused-expressions": 2,
"no-use-before-define": 2,
"radix": [2, "always"],
"indent": [2, 2],
"quotes": [2, "double"],
"semi": [2, "always"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familar wit eslintrc.json's configuration file, but I'm assuming 2 is a short-hand way of referring to error, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right.

"block-scoped-var": "error",
"consistent-return": "error",
"eqeqeq": "error",
"guard-for-in": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-extra-parens": "off",
"no-extend-native": "error",
"no-loop-func": "error",
"no-new": "error",
"no-param-reassign": "error",
"no-return-assign": "error",
"no-sequences": "error",
"no-unused-expressions": "error",
"no-use-before-define": "error",
"no-undef": "error",
"no-eq-null": "error",
"radix": ["error", "always"],
"indent": ["error", 2, { "SwitchCase": 1 }],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"strict": ["error", "global"]
}
}
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/change-request.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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).
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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)
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up 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: Set up Node toolchain
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Cache NPM dependencies
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install NPM dependencies
run: npm install

- name: Build the project
run: npm run build

- name: Run tests
run: npm run test
20 changes: 12 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/.*
!/.gitignore
!/.jshintrc
!/.jscsrc
!/.travis.yml
/bower_components/
/node_modules/
/output/
.*
!.gitignore
!.github
!.editorconfig
!.eslintrc.json

output
generated-docs
bower_components

node_modules
package-lock.json
*.lock
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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:

## [v3.0.0](https://github.com/purescript-contrib/purescript-avar/releases/tag/v3.0.0) - 2018-05-25

- Updated for PureScript 0.12

## [v2.0.1](https://github.com/purescript-contrib/purescript-avar/releases/tag/v2.0.1) - 2017-09-20

- Fixes issue with `purs bundle` aggressively eliminating core functionality.

## [v2.0.0](https://github.com/purescript-contrib/purescript-avar/releases/tag/v2.0.0) - 2017-08-31

- Changed argument order
- Added `AVarStatus` rather than just `isEmptyVar`.

## [v1.0.0](https://github.com/purescript-contrib/purescript-avar/releases/tag/v1.0.0) - 2017-07-18

- Initial release

5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing to AVar

Thanks for your interest in contributing to `avar`! 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.
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
# purescript-avar
# AVar

[![Latest release](http://img.shields.io/github/release/slamdata/purescript-avar.svg)](https://github.com/slamdata/purescript-avar/releases)
[![Build status](https://travis-ci.org/slamdata/purescript-avar.svg?branch=master)](https://travis-ci.org/slamdata/purescript-avar)
[![CI](https://github.com/purescript-contrib/purescript-avar/workflows/CI/badge.svg?branch=main)](https://github.com/purescript-contrib/purescript-avar/actions?query=workflow%3ACI+branch%3Amain)
[![Release](https://img.shields.io/github/release/purescript-contrib/purescript-avar.svg)](https://github.com/purescript-contrib/purescript-avar/releases)
[![Pursuit](https://pursuit.purescript.org/packages/purescript-avar/badge)](https://pursuit.purescript.org/packages/purescript-avar)
[![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)

Low-level interface for asynchronous variables.

## Installation

Install `avar` with [Spago](https://github.com/purescript/spago):

```sh
spago install avar
```
bower install purescript-avar
```

## Quick start

The quick start hasn't been written yet (contributions are welcome!). The quick start covers a common, minimal use case for the library, whereas longer examples and tutorials are kept in the [docs directory](./docs).

## Documentation

Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-avar).
`avar` documentation is stored in a few places:

1. Module documentation is [published on Pursuit](https://pursuit.purescript.org/packages/purescript-avar).
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-avar/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 `avar` in several ways:

1. If you encounter a problem or have a question, please [open an issue](https://github.com/purescript-contrib/purescript-avar/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.

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.
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "eslint src && pulp build -- --censor-lib --strict",
"test": "pulp test"
"build": "eslint src && spago build --purs-args '--censor-lib --strict'",
"test": "spago test --no-install"
},
"devDependencies": {
"eslint": "^4.19.1",
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be removing purescript-psa here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point; it's not normally included because we normally don't even have a package.json file, and Spago is assumed as a requirement for all libraries. But in this case you're already going to npm i and then use a build command that explicitly relies on psa, so we may as well include it.

"purescript": "slamdata/node-purescript#0.12",
"rimraf": "^2.6.2"
"eslint": "^7.6.0",
"purescript-psa": "^0.8.0"
}
}
4 changes: 4 additions & 0 deletions packages.dhall
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ name = "avar"
, dependencies =
[ "aff"
, "assert"
, "console"
, "effect"
, "either"
, "exceptions"
, "functions"
, "maybe"
, "psci-support"
, "refs"
, "transformers"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
}
Loading