patroon 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +25 -0
- package/CHANGELOG.md +15 -1
- package/CONTRIBUTING.md +8 -8
- package/CONTRIBUTING.mz +7 -7
- package/README.md +7 -7
- package/README.mz +4 -4
- package/package.json +3 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Publish Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write # Required for OIDC
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v6
|
|
19
|
+
with:
|
|
20
|
+
node-version: '24'
|
|
21
|
+
registry-url: 'https://registry.npmjs.org'
|
|
22
|
+
- run: npm ci
|
|
23
|
+
- run: npm run build --if-present
|
|
24
|
+
- run: npm test
|
|
25
|
+
- run: npm publish
|
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v1.5.4](https://github.com/bas080/patroon/compare/v1.5.3...v1.5.4)
|
|
8
|
+
|
|
9
|
+
- Update tape to version 5.9.0 [`8535ee8`](https://github.com/bas080/patroon/commit/8535ee8cd5b94e7565bd9a2e556978bac72a043d)
|
|
10
|
+
- Update tape to 5.9.9 [`2960b63`](https://github.com/bas080/patroon/commit/2960b633fb96ea56c5f50e25ac7d6bb9256ac5d8)
|
|
11
|
+
- Setup publish github workflow [`4496eaf`](https://github.com/bas080/patroon/commit/4496eaf05b3af9c221aaabf09c6c60b812b69d70)
|
|
12
|
+
|
|
7
13
|
#### [v1.5.3](https://github.com/bas080/patroon/compare/v1.5.2...v1.5.3)
|
|
8
14
|
|
|
15
|
+
> 10 October 2023
|
|
16
|
+
|
|
9
17
|
- Remove snyk badge [`63aa85e`](https://github.com/bas080/patroon/commit/63aa85ed19b7bb728b80038196a7554de4763f52)
|
|
10
18
|
|
|
11
19
|
#### [v1.5.2](https://github.com/bas080/patroon/compare/v1.5.1...v1.5.2)
|
|
@@ -235,8 +243,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
235
243
|
|
|
236
244
|
- Fix spelling mistakes [`1bd9975`](https://github.com/bas080/patroon/commit/1bd9975a02d97603ccbda0c96f8da5968beabb09)
|
|
237
245
|
|
|
238
|
-
#### v0.0.1
|
|
246
|
+
#### [v0.0.1](https://github.com/bas080/patroon/compare/v0.0.0...v0.0.1)
|
|
239
247
|
|
|
240
248
|
> 1 October 2021
|
|
241
249
|
|
|
242
250
|
- Initiate project [`0da801e`](https://github.com/bas080/patroon/commit/0da801e15901036022bc3af4ef2232c98e7cf851)
|
|
251
|
+
|
|
252
|
+
#### v0.0.0
|
|
253
|
+
|
|
254
|
+
> 1 October 2021
|
|
255
|
+
|
|
256
|
+
- Initiate project [`fe55348`](https://github.com/bas080/patroon/commit/fe55348033f102c489a2a86f8e11708334007299)
|
package/CONTRIBUTING.md
CHANGED
|
@@ -21,14 +21,14 @@ npx standard
|
|
|
21
21
|
|
|
22
22
|
## Documentation
|
|
23
23
|
|
|
24
|
-
We generate the contributors list using node and store it in [
|
|
24
|
+
We generate the contributors list using node and store it in [woven][7].
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
27
|
require('./package.json').contributors.reduce((acc, {name, url, email}) =>
|
|
28
28
|
`${acc}- **${name}** *${url}*\n`, '')
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
We also generate the table of contents and store it in
|
|
31
|
+
We also generate the table of contents and store it in woven.
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
npx markdown-toc --no-firsth1 --maxdepth 4 README.mz
|
|
@@ -42,23 +42,23 @@ npm link patroon
|
|
|
42
42
|
```
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
up to date, audited 3 packages in
|
|
45
|
+
up to date, audited 3 packages in 587ms
|
|
46
46
|
|
|
47
47
|
found 0 vulnerabilities
|
|
48
48
|
|
|
49
|
-
added 1 package, and audited
|
|
49
|
+
added 1 package, and audited 127 packages in 794ms
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
85 packages are looking for funding
|
|
52
52
|
run `npm fund` for details
|
|
53
53
|
|
|
54
54
|
found 0 vulnerabilities
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
We then use
|
|
57
|
+
We then use woven to template the README. Then we run [markatzea][6] to run
|
|
58
58
|
the examples and show the output of those.
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
|
|
61
|
+
woven < README.mz | markatzea > README.md
|
|
62
62
|
echo 'Documentation generated successfully.' 1>&2
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -76,6 +76,6 @@ npx auto-changelog -p
|
|
|
76
76
|
[3]:https://github.com/bas080/patroon/blob/master/src/index.js
|
|
77
77
|
[4]:https://github.com/bas080/patroon/blob/master/src/helpers.js
|
|
78
78
|
[6]:https://github.com/bas080/markatzea
|
|
79
|
-
[7]:https://github.com/bas080/
|
|
79
|
+
[7]:https://github.com/bas080/woven
|
|
80
80
|
[changelog]:./CHANGELOG.md
|
|
81
81
|
[auto-changelog]:https://www.npmjs.com/package/auto-changelog
|
package/CONTRIBUTING.mz
CHANGED
|
@@ -21,16 +21,16 @@ npx standard
|
|
|
21
21
|
|
|
22
22
|
## Documentation
|
|
23
23
|
|
|
24
|
-
We generate the contributors list using node and store it in [
|
|
24
|
+
We generate the contributors list using node and store it in [woven][7].
|
|
25
25
|
|
|
26
|
-
```js node -p |
|
|
26
|
+
```js node -p | woven contributors
|
|
27
27
|
require('./package.json').contributors.reduce((acc, {name, url, email}) =>
|
|
28
28
|
`${acc}- **${name}** *${url}*\n`, '')
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
We also generate the table of contents and store it in
|
|
31
|
+
We also generate the table of contents and store it in woven.
|
|
32
32
|
|
|
33
|
-
```bash bash |
|
|
33
|
+
```bash bash | woven toc
|
|
34
34
|
npx markdown-toc --no-firsth1 --maxdepth 4 README.mz
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -41,11 +41,11 @@ npm link
|
|
|
41
41
|
npm link patroon
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
We then use
|
|
44
|
+
We then use woven to template the README. Then we run [markatzea][6] to run
|
|
45
45
|
the examples and show the output of those.
|
|
46
46
|
|
|
47
47
|
```bash bash
|
|
48
|
-
|
|
48
|
+
woven < README.mz | markatzea > README.md
|
|
49
49
|
echo 'Documentation generated successfully.' 1>&2
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -63,6 +63,6 @@ npx auto-changelog -p
|
|
|
63
63
|
[3]:https://github.com/bas080/patroon/blob/master/src/index.js
|
|
64
64
|
[4]:https://github.com/bas080/patroon/blob/master/src/helpers.js
|
|
65
65
|
[6]:https://github.com/bas080/markatzea
|
|
66
|
-
[7]:https://github.com/bas080/
|
|
66
|
+
[7]:https://github.com/bas080/woven
|
|
67
67
|
[changelog]:./CHANGELOG.md
|
|
68
68
|
[auto-changelog]:https://www.npmjs.com/package/auto-changelog
|
package/README.md
CHANGED
|
@@ -569,12 +569,12 @@ const oneIsTwo = patroon(1, 2)
|
|
|
569
569
|
oneIsTwo(3)
|
|
570
570
|
```
|
|
571
571
|
```
|
|
572
|
-
/home/
|
|
572
|
+
/home/blue/project/patroon/src/index.js:96
|
|
573
573
|
throw error
|
|
574
574
|
^
|
|
575
575
|
|
|
576
576
|
NoMatchError: Not able to match any pattern for arguments
|
|
577
|
-
at /home/
|
|
577
|
+
at /home/blue/project/patroon/src/index.js:90:21
|
|
578
578
|
```
|
|
579
579
|
|
|
580
580
|
#### UnevenArgumentCountError
|
|
@@ -585,12 +585,12 @@ Another error that occurs is when the patroon function is not used correctly.
|
|
|
585
585
|
patroon(1)
|
|
586
586
|
```
|
|
587
587
|
```
|
|
588
|
-
/home/
|
|
588
|
+
/home/blue/project/patroon/src/index.js:82
|
|
589
589
|
if (!isEven(list.length)) { throw new UnevenArgumentCountError('Patroon should have an even amount of arguments.') }
|
|
590
590
|
^
|
|
591
591
|
|
|
592
592
|
UnevenArgumentCountError: Patroon should have an even amount of arguments.
|
|
593
|
-
at patroon (/home/
|
|
593
|
+
at patroon (/home/blue/project/patroon/src/index.js:82:37)
|
|
594
594
|
```
|
|
595
595
|
|
|
596
596
|
#### PatroonError
|
|
@@ -634,7 +634,7 @@ npx nyc npm t | npx tap-nyc
|
|
|
634
634
|
npx nyc check-coverage
|
|
635
635
|
```
|
|
636
636
|
```
|
|
637
|
-
> patroon@1.5.
|
|
637
|
+
> patroon@1.5.4 test
|
|
638
638
|
> tape ./src/index.test.js
|
|
639
639
|
-------------|---------|----------|---------|---------|-------------------
|
|
640
640
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
@@ -648,7 +648,7 @@ npx nyc check-coverage
|
|
|
648
648
|
total: 31
|
|
649
649
|
passing: 31
|
|
650
650
|
|
|
651
|
-
duration:
|
|
651
|
+
duration: 8.2s
|
|
652
652
|
|
|
653
653
|
```
|
|
654
654
|
|
|
@@ -677,4 +677,4 @@ polite and read the [CONTRIBUTING.md][10].
|
|
|
677
677
|
[9]:https://www.npmjs.com/package/patroon
|
|
678
678
|
[10]:./CONTRIBUTING.md
|
|
679
679
|
[changelog]:./CHANGELOG.md
|
|
680
|
-
[runkit]:https://
|
|
680
|
+
[runkit]:https://runkit.com/npm/patroon
|
package/README.mz
CHANGED
|
@@ -8,7 +8,7 @@ Pattern matching in JavaScript without additional syntax.
|
|
|
8
8
|
[](https://standardjs.com)
|
|
9
9
|
[](./LICENSE)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
<<toc
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -329,7 +329,7 @@ A helper that makes it easy to check if a value passes all patterns.
|
|
|
329
329
|
|
|
330
330
|
```js ./tape-test
|
|
331
331
|
const gte200 = x => x >= 200
|
|
332
|
-
const lt300 = x => x
|
|
332
|
+
const lt300 = x => x < 300
|
|
333
333
|
|
|
334
334
|
patroon(
|
|
335
335
|
every(gte200, lt300), 'Is a 200 status code'
|
|
@@ -510,7 +510,7 @@ polite and read the [CONTRIBUTING.md][10].
|
|
|
510
510
|
|
|
511
511
|
### Contributors
|
|
512
512
|
|
|
513
|
-
|
|
513
|
+
<<contributors
|
|
514
514
|
|
|
515
515
|
[1]:https://developer.mozilla.org/en-US/docs/Glossary/Primitive
|
|
516
516
|
[2]:https://en.wikipedia.org/wiki/Multiple_dispatch
|
|
@@ -521,4 +521,4 @@ polite and read the [CONTRIBUTING.md][10].
|
|
|
521
521
|
[9]:https://www.npmjs.com/package/patroon
|
|
522
522
|
[10]:./CONTRIBUTING.md
|
|
523
523
|
[changelog]:./CHANGELOG.md
|
|
524
|
-
[runkit]:https://
|
|
524
|
+
[runkit]:https://runkit.com/npm/patroon
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "patroon",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "Pattern matching library",
|
|
5
5
|
"repository": "github:bas080/patroon",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "tape ./src/index.test.js",
|
|
9
|
-
"version": "markatzea CONTRIBUTING.mz | tee CONTRIBUTING.md && git add *.md"
|
|
9
|
+
"version": "WOVEN_PREFIX='<<' markatzea CONTRIBUTING.mz | tee CONTRIBUTING.md && git add *.md"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"array",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"author": "Bassim Huis",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"tape": "^5.
|
|
31
|
+
"tape": "^5.9.0",
|
|
32
32
|
"tape-check": "^1.0.0-rc.0"
|
|
33
33
|
},
|
|
34
34
|
"contributors": [
|