From 5aeb158d0b18e361d0a676540ec1b5c7301e36ab Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Tue, 8 Dec 2020 22:24:47 -0800 Subject: [PATCH 1/3] Migrate to GitHub Actions and update installation instructions. --- .eslintrc | 39 --------------------------------------- .eslintrc.json | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 3 ++- .travis.yml | 23 ----------------------- README.md | 19 ++++++++++++------- package.json | 9 +++++---- 7 files changed, 76 insertions(+), 74 deletions(-) delete mode 100644 .eslintrc create mode 100644 .eslintrc.json create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 1a45f8b..0000000 --- a/.eslintrc +++ /dev/null @@ -1,39 +0,0 @@ -{ - "env": { - "node": true, - }, - "rules": { - "valid-jsdoc": [2, { - "prefer": { "return": "returns" }, - "requireReturn": true, - "requireParamDescription": true, - "requireReturnDescription": false - }], - "camelcase": 1, - "no-multi-spaces": 0, - "comma-spacing": 1, - "comma-style": [2, "first"], - "consistent-return": 0, - "eol-last": 1, - "indent": [1, 4], - "no-use-before-define": [2, "nofunc"], - "no-process-exit": 0, - "no-trailing-spaces": 1, - "no-underscore-dangle": 0, - "no-unused-vars": 1, - "space-infix-ops": 1, - "quotes": [1, "single"], - "semi": [1, "always"], - "semi-spacing": 1, - "strict": [2, "global"], - "yoda": [1, "never"] - }, - "globals": { - "describe": true, - "it": true, - "before": true, - "beforeEach": true, - "after": true, - "afterEach": true - } -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..84cef4f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "parserOptions": { + "ecmaVersion": 5 + }, + "extends": "eslint:recommended", + "env": { + "commonjs": true + }, + "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"] + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..49aff92 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: purescript-contrib/setup-purescript@main + + - uses: actions/setup-node@v1 + with: + node-version: "10" + + - name: Install dependencies + run: | + npm install -g bower + npm install + bower install --production + + - name: Build source + run: npm run-script build + + - name: Run tests + run: | + bower install + npm run-script test --if-present diff --git a/.gitignore b/.gitignore index 6a969a8..48b4a42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /.* !/.gitignore -!/.travis.yml +!/.eslintrc.json +!/.github/ /bower_components/ /node_modules/ /tmp/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b14646..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=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p') - - wget -O $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/README.md b/README.md index 5e2a837..7073dae 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,24 @@ # purescript-node-fs-aff [![Latest release](http://img.shields.io/github/release/purescript-node/purescript-node-fs-aff.svg)](https://github.com/purescript-node/purescript-node-fs-aff/releases) -[![Build Status](https://travis-ci.org/purescript-node/purescript-node-fs-aff.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-fs-aff) +[![Build status](https://github.com/purescript-node/purescript-node-fs-aff/workflows/CI/badge.svg?branch=master)](https://github.com/purescript-node/purescript-node-fs-aff/actions?query=workflow%3ACI+branch%3Amaster) +[![Pursuit](https://pursuit.purescript.org/packages/purescript-node-fs-aff/badge)](https://pursuit.purescript.org/packages/purescript-node-fs-aff) -[Node.FS][Node.FS] Wrappers for [purescript-aff][aff] +[Node.FS][node.fs] wrappers for [purescript-aff][aff]. -The `Aff` monad lets you write async code with ease, and `node-fs-aff` -lets you easily access the filesystem within `Aff`. +The `Aff` monad lets you write async code with ease, and `node-fs-aff` lets you easily access the filesystem within `Aff`. + +## Installation + +``` +spago install node-fs-aff +``` ## Example Consider asynchronously listing only non-hidden directories: -``` purescript +```purescript main = launchAff do files <- FS.readdir "." files' <- flip filterM files \file -> do @@ -29,6 +35,5 @@ That was easy. Run `npm run example` to see it work. Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-node-fs-aff). - -[Node.FS]: http://github.com/purescript-node/purescript-node-fs +[node.fs]: http://github.com/purescript-node/purescript-node-fs [aff]: https://github.com/slamdata/purescript-aff diff --git a/package.json b/package.json index 5a4bff0..fd4391e 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,13 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build -- --censor-lib --strict", + "build": "eslint src && pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { - "pulp": "^12.2.0", - "purescript-psa": "^0.6.0", - "rimraf": "^2.6.2" + "eslint": "^7.15.0", + "pulp": "^15.0.0", + "purescript-psa": "^0.8.0", + "rimraf": "^3.0.2" } } From 14d69c9f38c7949cfb0222da710da7a730df8c70 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 9 Dec 2020 11:59:56 -0800 Subject: [PATCH 2/3] Update ci.yml --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49aff92..063845e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI -on: push +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: build: From 370e9c13ae42e46510d778e37fd1fbf6675eda24 Mon Sep 17 00:00:00 2001 From: milesfrain Date: Wed, 9 Dec 2020 12:38:02 -0800 Subject: [PATCH 3/3] Remove eslint (#26) --- .eslintrc.json | 28 ---------------------------- .gitignore | 1 - package.json | 3 +-- 3 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 84cef4f..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 5 - }, - "extends": "eslint:recommended", - "env": { - "commonjs": true - }, - "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"] - } -} diff --git a/.gitignore b/.gitignore index 48b4a42..7bd330e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /.* !/.gitignore -!/.eslintrc.json !/.github/ /bower_components/ /node_modules/ diff --git a/package.json b/package.json index fd4391e..d3602c1 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,10 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "eslint src && pulp build -- --censor-lib --strict", + "build": "pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { - "eslint": "^7.15.0", "pulp": "^15.0.0", "purescript-psa": "^0.8.0", "rimraf": "^3.0.2"