Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c475110

Browse files
committedMar 29, 2025
feat: add github ci and spago and more tests
1 parent 120c82b commit c475110

File tree

8 files changed

+98
-52
lines changed

8 files changed

+98
-52
lines changed
 

Diff for: ‎.github/ISSUE_TEMPLATE/bug-report.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Bug report
3+
about: Report an issue
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of the bug.
11+
12+
**To Reproduce**
13+
A minimal code example (preferably a runnable example on [Try PureScript](https://try.purescript.org)!) or steps to reproduce the issue.
14+
15+
**Expected behavior**
16+
A clear and concise description of what you expected to happen.
17+
18+
**Additional context**
19+
Add any other context about the problem here.

Diff for: ‎.github/ISSUE_TEMPLATE/change-request.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Change request
3+
about: Propose an improvement to this library
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Is your change request related to a problem? Please describe.**
10+
A clear and concise description of the problem.
11+
12+
Examples:
13+
14+
- It's frustrating to have to [...]
15+
- I was looking for a function to [...]
16+
17+
**Describe the solution you'd like**
18+
A clear and concise description of what a good solution to you looks like, including any solutions you've already considered.
19+
20+
**Additional context**
21+
Add any other context about the change request here.

Diff for: ‎.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: PureScript Discourse
4+
url: https://discourse.purescript.org/
5+
about: Ask and answer questions on the PureScript discussion forum.
6+
- name: PureScript Discord
7+
url: https://purescript.org/chat
8+
about: Ask and answer questions on the PureScript chat.

Diff for: ‎.github/PULL_REQUEST_TEMPLATE.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**Description of the change**
2+
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.
3+
4+
---
5+
6+
**Checklist:**
7+
8+
- [ ] Added the change to the changelog's "Unreleased" section with a link to this PR and your username
9+
- [ ] Linked any existing issues or proposals that this pull request should close
10+
- [ ] Updated or added relevant documentation in the README and/or documentation directory
11+
- [ ] Added a test for the contribution (if applicable)

Diff for: ‎.github/workflows/ci.yml

+15-34
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,36 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [master, main]
66
pull_request:
7-
branches: [main]
7+
branches: [master, main]
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
1312
steps:
14-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1514

16-
- name: Set up PureScript toolchain
15+
- name: Set up a PureScript toolchain
1716
uses: purescript-contrib/setup-purescript@main
1817
with:
19-
purescript: "0.15.0"
18+
purescript: "latest"
19+
purs-tidy: "latest"
20+
spago: "unstable"
2021

2122
- name: Cache PureScript dependencies
22-
uses: actions/cache@v2
23+
uses: actions/cache@v4
2324
with:
24-
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
25+
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }}
2526
path: |
2627
.spago
2728
output
2829
29-
- name: Set up Node toolchain
30-
uses: actions/setup-node@v2
31-
with:
32-
node-version: "14.x"
33-
34-
- name: Cache NPM dependencies
35-
uses: actions/cache@v2
36-
env:
37-
cache-name: cache-node-modules
38-
with:
39-
path: ~/.npm
40-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
41-
restore-keys: |
42-
${{ runner.os }}-build-${{ env.cache-name }}-
43-
${{ runner.os }}-build-
44-
${{ runner.os }}-
45-
46-
- name: Install NPM dependencies
47-
run: npm install
48-
49-
- name: Install spago deps
50-
run: npm run deps
30+
- name: Build source
31+
run: spago build --censor-stats --strict --ensure-ranges --pedantic-packages
5132

52-
- name: Build the project
53-
run: npm run build
33+
- name: Run tests
34+
run: spago test --offline --censor-stats --strict --pedantic-packages
5435

55-
- name: Test the project
56-
run: npm run test
36+
- name: Verify formatting
37+
run: purs-tidy check src test

Diff for: ‎spago.lock

+16-16
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"foldable-traversable",
6565
"foreign",
6666
"foreign-object",
67-
"function s",
67+
"functions",
6868
"functors",
6969
"gen",
7070
"identity",
@@ -139,7 +139,7 @@
139139
"foreign-object",
140140
"fork",
141141
"free",
142-
"function s",
142+
"functions",
143143
"functors",
144144
"gen",
145145
"identity",
@@ -341,7 +341,7 @@
341341
"freeap": "7.0.0",
342342
"freer-free": "0.0.1",
343343
"freet": "7.0.0",
344-
"function s": "6.0.0",
344+
"functions": "6.0.0",
345345
"functor1": "3.0.0",
346346
"functors": "5.0.0",
347347
"fuzzy": "0.4.0",
@@ -733,7 +733,7 @@
733733
"either",
734734
"exceptions",
735735
"foldable-traversable",
736-
"function s",
736+
"functions",
737737
"maybe",
738738
"newtype",
739739
"parallel",
@@ -781,7 +781,7 @@
781781
"control",
782782
"either",
783783
"foreign-object",
784-
"function s",
784+
"functions",
785785
"gen",
786786
"maybe",
787787
"nonempty",
@@ -804,7 +804,7 @@
804804
"bifunctors",
805805
"control",
806806
"foldable-traversable",
807-
"function s",
807+
"functions",
808808
"maybe",
809809
"nonempty",
810810
"partial",
@@ -826,7 +826,7 @@
826826
"effect",
827827
"either",
828828
"exceptions",
829-
"function s",
829+
"functions",
830830
"maybe"
831831
]
832832
},
@@ -906,7 +906,7 @@
906906
"either",
907907
"enums",
908908
"foldable-traversable",
909-
"function s",
909+
"functions",
910910
"gen",
911911
"integers",
912912
"lists",
@@ -1018,7 +1018,7 @@
10181018
"integrity": "sha256-1ORiqoS3HW+qfwSZAppHPWy4/6AQysxZ2t29jcdUMNA=",
10191019
"dependencies": [
10201020
"either",
1021-
"function s",
1021+
"functions",
10221022
"identity",
10231023
"integers",
10241024
"lists",
@@ -1035,7 +1035,7 @@
10351035
"dependencies": [
10361036
"arrays",
10371037
"foldable-traversable",
1038-
"function s",
1038+
"functions",
10391039
"gen",
10401040
"lists",
10411041
"maybe",
@@ -1076,7 +1076,7 @@
10761076
"unsafe-coerce"
10771077
]
10781078
},
1079-
"function s": {
1079+
"functions": {
10801080
"type": "registry",
10811081
"version": "6.0.0",
10821082
"integrity": "sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI=",
@@ -1253,7 +1253,7 @@
12531253
"dependencies": [
12541254
"effect",
12551255
"either",
1256-
"function s",
1256+
"functions",
12571257
"maybe",
12581258
"nullable",
12591259
"prelude",
@@ -1270,7 +1270,7 @@
12701270
"either",
12711271
"enums",
12721272
"exceptions",
1273-
"function s",
1273+
"functions",
12741274
"integers",
12751275
"js-date",
12761276
"maybe",
@@ -1357,7 +1357,7 @@
13571357
"integrity": "sha256-yiGBVl3AD+Guy4kNWWeN+zl1gCiJK+oeIFtZtPCw4+o=",
13581358
"dependencies": [
13591359
"effect",
1360-
"function s",
1360+
"functions",
13611361
"maybe"
13621362
]
13631363
},
@@ -1366,7 +1366,7 @@
13661366
"version": "9.0.1",
13671367
"integrity": "sha256-/9M6aeMDBdB4cwYDeJvLFprAHZ49EbtKQLIJsneXLIk=",
13681368
"dependencies": [
1369-
"function s",
1369+
"functions",
13701370
"maybe"
13711371
]
13721372
},
@@ -1533,7 +1533,7 @@
15331533
"version": "4.0.0",
15341534
"integrity": "sha256-Za5U85bTRJEfGK5Sk4hM41oXy84YQI0I8TL3WUn1Qzg=",
15351535
"dependencies": [
1536-
"function s",
1536+
"functions",
15371537
"prelude",
15381538
"unsafe-coerce"
15391539
]

Diff for: ‎spago.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package:
44
license: Apache-2.0
55
version: 7.0.0
66
location:
7-
githubOwner: lumihq
7+
githubOwner: purescript-react
88
githubRepo: purescript-react-basic-dom
99
dependencies:
1010
- arrays: ">=7.3.0 <8.0.0"

Diff for: ‎test/Main.purs

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Test.Main where
33
import Prelude
44

55
import Effect (Effect)
6-
import Effect.Aff (launchAff_)
6+
import React.Basic.DOM as RD
77
import React.Basic.DOM.Server (renderToString)
88
import Test.Spec (Spec, describe, it)
99
import Test.Spec.Assertions (shouldEqual)
@@ -19,3 +19,9 @@ spec = do
1919
describe "react-basic-dom-server" do
2020
it "imports properly" do
2121
renderToString mempty `shouldEqual` ""
22+
it "imports properly" do
23+
renderToString (RD.text "asdf") `shouldEqual` "asdf"
24+
it "imports properly" do
25+
renderToString (RD.div_ []) `shouldEqual` "<div></div>"
26+
it "imports properly" do
27+
renderToString (RD.div_ [ RD.text "asdf" ]) `shouldEqual` "<div>asdf</div>"

0 commit comments

Comments
 (0)
Please sign in to comment.