Skip to content

Commit ff66c7f

Browse files
committed
feat(config): parserPreset
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 9bd1060 commit ff66c7f

20 files changed

+1487
-2
lines changed

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"failFast": false,
1414
"flagWords": [],
1515
"ignorePaths": [
16+
"**/*.log",
1617
"**/*.snap",
1718
"**/.*ignore",
1819
"**/.gitconfig",

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ codecov
5858
# ------------------------------------------------------------------------------
5959
**/.temp/
6060
**/dist/
61+
!**/__fixtures__/**/*.log
6162
!**/__fixtures__/**/dist/
6263
!**/typings/**/dist/
6364

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
"yaml"
182182
],
183183
"files.associations": {
184+
"*.log": "log",
184185
"*.snap": "jest-snapshot",
185186
".env.zsh": "shellscript",
186187
".markdownlintignore": "ignore",

__fixtures__/ext-regex.git.log

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
revert(deps-dev)!: flex-development/ext-regex@43ced89ca2404e855ab3aedddce445f4e9309ebf
2+
3+
Signed-off-by: dependabot[bot] <support@github.com>
4+
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5+
-hash-
6+
4b2abcd5d75e9075d0cece6d9b971ca0e64beeb4
7+
-shortHash-
8+
4b2abcd
9+
-gitTags-
10+
11+
-committerDate-
12+
2023-02-19 01:47:12 -0500
13+
14+
revert(deps-dev): flexdevelopment@ff495037a1a5537bf386530ca540c4c073b47c79
15+
16+
Signed-off-by: dependabot[bot] <support@github.com>
17+
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
18+
-hash-
19+
ecafaf2f1431cecf1d326fe7cad3cb0bbaf30cfb
20+
-shortHash-
21+
ecafaf2
22+
-gitTags-
23+
24+
-committerDate-
25+
2023-02-18 21:58:00 +0000
26+
27+
revert: be8b47e536c91bb0940b7bcfb0aae9cd53f794bd
28+
29+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
30+
31+
-hash-
32+
cb2eca7ec86eaa45bc89e61d7a3fbfbb7a695c0f
33+
-shortHash-
34+
cb2eca7
35+
-gitTags-
36+
37+
-committerDate-
38+
2023-02-18 17:00:24 -0500
39+
40+
build(deps-dev): bump @flex-development/mkbuild from 1.0.0-alpha.11 to 1.0.0-alpha.13
41+
42+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
43+
44+
-hash-
45+
0c1a3f9ca18806d9ec06504fd5fff8fc55c4568e
46+
-shortHash-
47+
0c1a3f9
48+
-gitTags-
49+
50+
-committerDate-
51+
2023-02-18 16:45:34 -0500
52+
53+
ci(workflows): [`ci`] use `github.event.pull_request.head.sha` for codecov
54+
55+
- codecov/codecov-bash#83
56+
- https://github.com/codecov/codecov-bash/issues/83#issuecomment-997761125
57+
- https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
58+
59+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
60+
61+
-hash-
62+
0d60f394051cda7368c5dced0fccd794e16e395c
63+
-shortHash-
64+
0d60f39
65+
-gitTags-
66+
67+
-committerDate-
68+
2023-02-18 16:37:45 -0500
69+
70+
release: 1.0.0 (#3)
71+
72+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
73+
-hash-
74+
4a04c8afb2b4ba1dfea3ff11e7a14d2850896e2d
75+
-shortHash-
76+
4a04c8a
77+
-gitTags-
78+
(tag: 1.0.0)
79+
-committerDate-
80+
2023-02-15 18:32:31 -0500
81+
82+
docs: api
83+
84+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
85+
86+
-hash-
87+
126e1b2d7d8ab5d2629718efc567cf96f29a8819
88+
-shortHash-
89+
126e1b2
90+
-gitTags-
91+
92+
-committerDate-
93+
2023-02-15 04:05:56 -0500
94+
95+
chore(tests): [codecov] label critical files
96+
97+
- https://docs.codecov.com/docs/manual-critical-file-labelling
98+
99+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
100+
101+
-hash-
102+
8e2432c3cfb9adfb5c725d120a1144096a11e69d
103+
-shortHash-
104+
8e2432c
105+
-gitTags-
106+
107+
-committerDate-
108+
2023-02-15 00:21:49 -0500
109+
110+
feat(utils): `extRegex`
111+
112+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
113+
114+
-hash-
115+
eb850cff64d86eadbcb238b3af7cae702b7ab405
116+
-shortHash-
117+
eb850cf
118+
-gitTags-
119+
120+
-committerDate-
121+
2023-02-15 00:09:30 -0500
122+
123+
ci(workflows): [`ci`] upload coverage report to codecov
124+
125+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
126+
127+
-hash-
128+
d8fe2fb256564dda77a1cb2fac78804a709e3e21
129+
-shortHash-
130+
d8fe2fb
131+
-gitTags-
132+
133+
-committerDate-
134+
2023-02-14 15:24:18 -0500
135+
136+
ci: [@dependabot] add config
137+
138+
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
139+
140+
-hash-
141+
c7dfaab6fec3eba06d486b11bd6d9f1280c5b3f6
142+
-shortHash-
143+
c7dfaab
144+
-gitTags-
145+
146+
-committerDate-
147+
2023-02-14 15:11:12 -0500

__tests__/setup/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*/
55

66
import './chai'
7+
import './serializers'

__tests__/setup/serializers/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @file Entry Point - Snapshot Serializers
3+
* @module tests/setup/serializers
4+
* @see https://vitest.dev/guide/snapshot.html#custom-serializer
5+
*/
6+
7+
import './regex-array'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @file Snapshot Serializers - RegExpArray
3+
* @module tests/setup/serializers/regex-array
4+
*/
5+
6+
import type { RegExpArray } from '#tests/types'
7+
import { isNumber, isString, type Fn } from '@flex-development/tutils'
8+
import { get, omit } from 'radash'
9+
10+
expect.addSnapshotSerializer({
11+
/**
12+
* Prints the given `value`.
13+
*
14+
* @param {unknown} value - Value to print
15+
* @param {Fn<[unknown], string>} printer - Print function
16+
* @return {string} `value` as printable string
17+
*/
18+
print(value: unknown, printer: Fn<[unknown], string>): string {
19+
return printer(omit(value as RegExpArray, ['index', 'input']))
20+
},
21+
/**
22+
* Checks if the given `value` is a {@linkcode RegExpArray}.
23+
*
24+
* @param {unknown} value - Value to check
25+
* @return {value is RegExpArray} `true` if `value` is {@linkcode RegExpArray}
26+
*/
27+
test(value: unknown): value is RegExpArray {
28+
return (
29+
Array.isArray(value) &&
30+
isNumber(get(value, 'index')) &&
31+
isString(get(value, 'input'))
32+
)
33+
}
34+
})

__tests__/ts/v4/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"outDir": "../../../dist",
3131
"paths": {
3232
"#src": ["src/index"],
33-
"#src/*": ["src/*"]
33+
"#src/*": ["src/*"],
34+
"#tests/*": ["__tests__/*"]
3435
},
3536
"preserveConstEnums": true,
3637
"preserveSymlinks": false,

__tests__/types/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @file Entry Point - Test Type Definitions
3+
* @module tests/types
4+
*/
5+
6+
export type { default as RegExpArray } from './reg-exp-array'

__tests__/types/reg-exp-array.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @file Test Type Definitions - RegExpArray
3+
* @module tests/types/RegExpArray
4+
*/
5+
6+
/**
7+
* A {@linkcode RegExpExecArray} or {@linkcode RegExpMatchArray}.
8+
*/
9+
type RegExpArray = RegExpExecArray | RegExpMatchArray
10+
11+
export type { RegExpArray as default }
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* @file Utilities - createCommitStream
3+
* @module tests/utils/createCommitStream
4+
*/
5+
6+
import parserPreset from '#src/config/parser-preset'
7+
import pathe from '@flex-development/pathe'
8+
import fs from 'node:fs'
9+
import stream from 'node:stream'
10+
import split from 'split2'
11+
12+
/**
13+
* Creates a commit transform stream.
14+
*
15+
* @see {@linkcode stream.Transform}
16+
*
17+
* @param {string} log - Commit log basename
18+
* @param {split.Matcher?} [separator] - Commit separator
19+
* @return {stream.Transform} Commit transform stream
20+
*/
21+
const createCommitStream = (
22+
log: string,
23+
separator: split.Matcher = /(?<=[+-]\d+)\n\n/
24+
): stream.Transform => {
25+
/**
26+
* Path to commit log.
27+
*
28+
* @const {string} path
29+
*/
30+
const path: string = pathe.resolve('__fixtures__', log + '.git.log')
31+
32+
return fs
33+
.createReadStream(path)
34+
.on('error', (error: Error): void => {
35+
const { warn } = parserPreset.parserOpts
36+
return void warn(`Failed to read file ${path}`, error)
37+
})
38+
.pipe(split(separator))
39+
}
40+
41+
export default createCommitStream

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"@commitlint/types": "17.4.4",
7777
"@flex-development/tutils": "6.0.0-alpha.10",
7878
"@types/conventional-commits-parser": "3.0.3",
79+
"consola": "2.15.3",
7980
"conventional-changelog-conventionalcommits": "5.0.0"
8081
},
8182
"devDependencies": {
@@ -98,6 +99,8 @@
9899
"@types/node-notifier": "8.0.2",
99100
"@types/prettier": "2.7.2",
100101
"@types/semver": "7.3.13",
102+
"@types/split2": "3.2.1",
103+
"@types/stream-to-array": "2.3.0",
101104
"@typescript-eslint/eslint-plugin": "5.53.0",
102105
"@typescript-eslint/parser": "5.53.0",
103106
"@vates/toggle-scripts": "1.0.0",
@@ -138,8 +141,11 @@
138141
"node-notifier": "10.0.1",
139142
"prettier": "2.8.4",
140143
"prettier-plugin-sh": "0.12.8",
144+
"radash": "10.7.0",
141145
"sade": "1.8.1",
142146
"serve": "14.2.0",
147+
"split2": "4.1.0",
148+
"stream-to-array": "2.3.0",
143149
"tempfile": "5.0.0",
144150
"trash-cli": "5.0.0",
145151
"ts-dedent": "2.2.0",

0 commit comments

Comments
 (0)