From 43a03d31a28e52df01ecbea634e60fc5e026b64b Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Tue, 8 Dec 2020 22:30:30 -0800 Subject: [PATCH 1/3] Migrate to GitHub Actions and update installation instructions. --- .eslintrc.json | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 5 ++--- .jscsrc | 17 ----------------- .jshintrc | 19 ------------------- .travis.yml | 21 --------------------- README.md | 5 +++-- package.json | 11 +++++------ 8 files changed, 67 insertions(+), 68 deletions(-) create mode 100644 .eslintrc.json create mode 100644 .github/workflows/ci.yml delete mode 100644 .jscsrc delete mode 100644 .jshintrc delete mode 100644 .travis.yml 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 21904d5..b846b63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ /.* !/.gitignore -!/.jscsrc -!/.jshintrc -!/.travis.yml +!/.eslintrc.json +!/.github/ /bower_components/ /node_modules/ /output/ diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 2561ce9..0000000 --- a/.jscsrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "preset": "grunt", - "disallowSpacesInFunctionExpression": null, - "requireSpacesInFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInAnonymousFunctionExpression": null, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInsideObjectBrackets": null, - "requireSpacesInsideObjectBrackets": "all", - "validateQuoteMarks": "\"", - "requireCurlyBraces": null -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 94a944d..0000000 --- a/.jshintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "bitwise": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "funcscope": true, - "futurehostile": true, - "strict": "global", - "latedef": true, - "noarg": true, - "nocomma": true, - "nonew": true, - "notypeof": true, - "singleGroups": true, - "undef": true, - "unused": true, - "eqnull": true, - "node": true -} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 98ef0d0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -dist: trusty -sudo: required -node_js: 6 -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 -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 a3edd39..4fa388e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # purescript-node-url [![Latest release](http://img.shields.io/github/release/purescript-node/purescript-node-url.svg)](https://github.com/purescript-node/purescript-node-url/releases) -[![Build Status](https://travis-ci.org/purescript-node/purescript-node-url.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-url) +[![Build status](https://github.com/purescript-node/purescript-node-url/workflows/CI/badge.svg?branch=master)](https://github.com/purescript-node/purescript-node-url/actions?query=workflow%3ACI+branch%3Amaster) +[![Pursuit](https://pursuit.purescript.org/packages/purescript-node-url/badge)](https://pursuit.purescript.org/packages/purescript-node-url) A wrapper for Node's `URL` and `QueryString` APIs ## Installation ``` -bower install purescript-node-url +spago install node-url ``` ## Documentation diff --git a/package.json b/package.json index 2e21753..fd4391e 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,13 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "jshint src && jscs src && pulp build -- --censor-lib --strict", + "build": "eslint src && pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { - "jscs": "^3.0.7", - "jshint": "^2.9.5", - "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 4192aa4533d94609c55ec40b69d011c00b93b38e Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 9 Dec 2020 11:57:19 -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 f09e48c1c7aa6206c9be54d2acf5b387574435ce Mon Sep 17 00:00:00 2001 From: JordanMartinez Date: Wed, 9 Dec 2020 12:17:58 -0800 Subject: [PATCH 3/3] Remove test script from package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index fd4391e..1c67b54 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,7 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "eslint src && pulp build -- --censor-lib --strict", - "test": "pulp test" + "build": "eslint src && pulp build -- --censor-lib --strict" }, "devDependencies": { "eslint": "^7.15.0",