-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCONTRIBUTING.mz
117 lines (83 loc) · 2.12 KB
/
CONTRIBUTING.mz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Contributing
## Dependencies
Lists projects dependencies and the versions.
```bash bash
npm --version # Dependency management
node --version # Testing and implementation
bash --version | head -n 1 # For usage examples
# Examples on how to use server
curl --version | head -n 1 | cut -f -2 -d ' '
```
Other:
- [markatzea][markatzea]
## Development
First clone the project and then run `npm link`.
```bash bash &> /dev/null
npm ci
npm link
furver --version
```
You should now be able to run the bin scripts and tests.
## Tests
```bash bash
npm t -- -R classic
# or with code coverage
# npx c8 npm t
```
## Formatting
```bash bash
npx standard
```
## Client Bundle
```bash bash
set -euo pipefail
# Install dependencies without storing them in the package.json
npm install --no-save rollup \
@rollup/plugin-babel \
@rollup/plugin-commonjs \
@rollup/plugin-terser \
@rollup/plugin-node-resolve
# Uses the .babelrc and the rollup.config.mjs configs
npx rollup -c
git add ./client.min.js
```
## Documentation
```bash bash
set -euo pipefail
# Install dependencies for the examples.
npm install ramda --no-save > /dev/null
# Spawn a server to demonstrate examples.
export PORT=8999
npx furver server ./example/api.mjs&
# And spawn one for the getting-started examples
npx furver server ./example/getting-started.mjs --port 5000&
# Could use pinging instead to wait for the server to start.
sleep 4
for mz in *.mz ;do
test "$mz" = "CONTRIBUTING.mz" && continue
name="${mz%.*}"
md="${name}.md"
echo "Generating docs for: $mz > $md"
rm "$md" || true
markatzea "$mz" | tee "$md" 1>&2
chmod -x "$md"
done
# Add a TOC
npx markdown-toc -i README.md
npx markdown-toc -i client.md
npx markdown-toc -i lisp.md
npx markdown-toc -i server.md
# Remove tmp files created in the mz files.
rm -v .tmp.*
# Stop the server
pkill furver
```
## Changelog
The [changelog][changelog] is generated using the useful
[auto-changelog][auto-changelog] project.
```bash bash > /dev/null
npx auto-changelog -p
```
[changelog]:./CHANGELOG.md
[auto-changelog]:https://www.npmjs.com/package/auto-changelog
[markatzea]:https://github.com/bas080/markatzea