Skip to content

Commit

Permalink
feat: migrate to spago@next
Browse files Browse the repository at this point in the history
  • Loading branch information
srghma committed Oct 10, 2024
1 parent 87a8ffc commit 5ae6047
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 113 deletions.
49 changes: 10 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,29 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up PureScript toolchain
- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purescript: "latest"
purs-tidy: "latest"
spago: "unstable"

- name: Cache PureScript dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }}
path: |
.spago
output
- name: Set up Node toolchain
uses: actions/setup-node@v2
with:
node-version: "14.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: Build source
run: spago build --censor-stats --strict --pedantic-packages

- name: Run tests
run: npm run test
run: spago test --offline --censor-stats --strict --pedantic-packages -- --censor-codes=UserDefinedWarning

- name: Check formatting
- name: Verify formatting
run: purs-tidy check src test

- name: Verify Bower & Pulp
run: |
npm install bower pulp@16.0.0-0
npx bower install
npx pulp build -- --censor-lib --strict
if [ -d "test" ]; then
npx pulp test
fi
33 changes: 1 addition & 32 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,5 @@
"bower.json",
"gulpfile.js",
"package.json"
],
"dependencies": {
"purescript-aff": "^7.0.0",
"purescript-argonaut-core": "^7.0.0",
"purescript-arraybuffer-types": "^3.0.2",
"purescript-arrays": "^7.0.0",
"purescript-console": "^6.0.0",
"purescript-control": "^6.0.0",
"purescript-datetime": "^6.0.0",
"purescript-effect": "^4.0.0",
"purescript-either": "^6.0.0",
"purescript-exceptions": "^6.0.0",
"purescript-foldable-traversable": "^6.0.0",
"purescript-foreign": "^7.0.0",
"purescript-foreign-object": "^4.0.0",
"purescript-form-urlencoded": "^7.0.0",
"purescript-functions": "^6.0.0",
"purescript-http-methods": "^6.0.0",
"purescript-lists": "^7.0.0",
"purescript-maybe": "^6.0.0",
"purescript-media-types": "^6.0.0",
"purescript-newtype": "^5.0.0",
"purescript-nullable": "^6.0.0",
"purescript-prelude": "^6.0.0",
"purescript-transformers": "^6.0.0",
"purescript-web-dom": "^6.0.0",
"purescript-web-file": "^4.0.0",
"purescript-web-xhr": "^5.0.0"
},
"devDependencies": {
"purescript-psci-support": "^6.0.0"
}
]
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"private": true,
"scripts": {
"build": "eslint src && spago build --purs-args '--censor-lib --strict'"
"build": "eslint src && spago build --censor-stats --strict --pedantic-packages"
},
"devDependencies": {
"body-parser": "^1.19.0",
"eslint": "^7.10.0",
"express": "^4.17.1",
"purescript-psa": "^0.8.2",
"xhr2": "^0.2.0"
"body-parser": "^1.20.3",
"eslint": "^9.12.0",
"express": "^4.21.1",
"purescript-psa": "^0.9.0",
"xhr2": "^0.2.1"
}
}
4 changes: 0 additions & 4 deletions packages.dhall

This file was deleted.

32 changes: 0 additions & 32 deletions spago.dhall

This file was deleted.

36 changes: 36 additions & 0 deletions spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package:
name: affjax
publish:
license: Apache-2.0
version: 13.0.0
location:
githubOwner: purescript-contrib
githubRepo: purescript-affjax
dependencies:
- aff
- argonaut-core
- arraybuffer-types
- arrays
- control
- datetime
- either
- exceptions
- foldable-traversable
- foreign
- form-urlencoded
- functions
- http-methods
- lists
- maybe
- media-types
- newtype
- nullable
- prelude
- transformers
- web-dom
- web-file
- web-xhr
workspace:
extraPackages: {}
packageSet:
registry: 60.5.0
11 changes: 11 additions & 0 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Test.Main where

import Prelude

import Effect (Effect)
import Effect.Class.Console (log)

main :: Effect Unit
main = do
log "🍕"
log "You should add some tests."

0 comments on commit 5ae6047

Please sign in to comment.