Skip to content

Commit abad13a

Browse files
Merge branch 'release/1.3.0'
2 parents fe34a96 + 9fc2cbe commit abad13a

File tree

12 files changed

+255
-62
lines changed

12 files changed

+255
-62
lines changed

.auto-changelog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commitLimit": false,
3+
"ignoreCommitPattern": "Bump .* version|Merge tag .+ into develop",
4+
"package": true,
5+
"sortCommits": "date-desc",
6+
"startingVersion": "1.1.0",
7+
"template": "keepachangelog"
8+
}

.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"airbnb-base",
66
"plugin:jest/recommended",
77
"plugin:@typescript-eslint/recommended",
8-
"prettier",
9-
"prettier/@typescript-eslint"
8+
"prettier"
109
],
1110
"parserOptions": {
1211
"ecmaVersion": 2018

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
7+
day: 'saturday'
8+
assignees:
9+
- 'wimpyprogrammer'
10+
11+
- package-ecosystem: 'npm'
12+
directory: '/'
13+
schedule:
14+
interval: 'weekly'
15+
day: 'saturday'
16+
assignees:
17+
- 'wimpyprogrammer'
18+
versioning-strategy: 'widen'

.github/workflows/tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [10.x, 14.x]
21+
node-version: [12.x, 16.x, lts/*]
2222

2323
steps:
2424
- name: Checkout repository
@@ -27,22 +27,24 @@ jobs:
2727
fetch-depth: '2'
2828

2929
- name: Test on Node ${{ matrix.node-version }}
30-
uses: actions/setup-node@v1
30+
uses: actions/setup-node@v2.5.0
3131
with:
3232
node-version: ${{ matrix.node-version }}
3333

3434
- run: npm install
35+
- run: npx prettier --check .
3536
- run: npm run lint
3637
- run: npm run build
3738
- run: npm run test
38-
- run: npx testpack-cli --keep={ts-jest,typescript} src/e2e.spec.ts
39+
- run: npx testpack-cli --keep=@types/jest,ts-jest,typescript src/e2e.spec.ts
3940

4041
- name: Upload test coverage report to Codecov
41-
uses: codecov/codecov-action@v1
42+
uses: codecov/codecov-action@v2.1.0
4243
with:
4344
fail_ci_if_error: true
4445

4546
- name: Run Snyk to check for vulnerabilities
47+
if: ${{ github.actor != 'dependabot[bot]' }}
4648
uses: snyk/actions/node@master
4749
env:
4850
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.publishrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.release-it.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"hooks": {
3+
"before:init": ["npm run lint", "npm test"],
4+
"after:bump": "npm run build"
5+
},
6+
"git": {
7+
"changelog": false,
8+
"commit": false,
9+
"requireBranch": "main",
10+
"tagName": "${version}"
11+
}
12+
}

CHANGELOG.md

Lines changed: 172 additions & 0 deletions
Large diffs are not rendered by default.

demo/index.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<!-- Google Tag Manager -->
2020
<script>
21-
(function(w, d, s, l, i) {
21+
(function (w, d, s, l, i) {
2222
w[l] = w[l] || [];
2323
w[l].push({
2424
'gtm.start': new Date().getTime(),
@@ -52,7 +52,7 @@
5252
src="https://www.googletagmanager.com/ns.html?id=GTM-W4BK9P"
5353
height="0"
5454
width="0"
55-
style="display:none;visibility:hidden"
55+
style="display: none; visibility: hidden"
5656
>
5757
</iframe>
5858
</noscript>
@@ -97,9 +97,7 @@
9797

9898
<div class="form-inline">
9999
<div class="form-group">
100-
<label for="delimiter">
101-
Words/phrases are separated by:
102-
</label>
100+
<label for="delimiter"> Words/phrases are separated by: </label>
103101
<select
104102
id="delimiter"
105103
class="form-control js-delimiter track-field"
@@ -117,9 +115,7 @@
117115
id="case"
118116
class="form-check-input js-case track-field"
119117
/>
120-
<label class="form-check-label" for="case">
121-
Case-sensitive
122-
</label>
118+
<label class="form-check-label" for="case"> Case-sensitive </label>
123119
</div>
124120

125121
<div class="form-group form-check">
@@ -149,9 +145,7 @@
149145
<div class="container">
150146
<section class="output">
151147
<div class="form-group">
152-
<label for="output">
153-
Matching Regular Expression:
154-
</label>
148+
<label for="output"> Matching Regular Expression: </label>
155149
<textarea
156150
readonly="readonly"
157151
id="output"

demo/src/utils/wordList.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const { Preserve, TrimLeadingAndTrailing } = WhitespaceHandling;
55
describe('parseString', () => {
66
it.each(['', null, undefined])(
77
'returns an empty array when input string is %p',
8-
input => {
8+
(input) => {
99
const wordList = parseString(input as string, ',', Preserve);
1010
expect(wordList).toEqual([]);
1111
}
1212
);
1313

1414
it.each(['', null, undefined])(
1515
'returns entire input string in array when delimiter is %p',
16-
testDelimiter => {
16+
(testDelimiter) => {
1717
const delimiter = testDelimiter as string;
1818
const wordList = parseString(' some input string ', delimiter, Preserve);
1919
expect(wordList).toEqual([' some input string ']);
@@ -22,7 +22,7 @@ describe('parseString', () => {
2222

2323
it.each([',', '\n', '\t'])(
2424
'returns entire input string in array when delimiter %p is not present in input string',
25-
delimiter => {
25+
(delimiter) => {
2626
const wordList = parseString(' some input string ', delimiter, Preserve);
2727
expect(wordList).toEqual([' some input string ']);
2828
}
@@ -40,10 +40,13 @@ describe('parseString', () => {
4040
it.each([
4141
['foo Bar b@z ', ' '],
4242
['foo Bar b@z ', ' '],
43-
])('splits input string %p by delimiter %p', (inputString, delimiter) => {
44-
const wordList = parseString(inputString, delimiter, Preserve);
45-
expect(wordList).toEqual(['foo', 'Bar', 'b@z', '']);
46-
});
43+
])(
44+
'splits input string %p by whitespace delimiter %p',
45+
(inputString, delimiter) => {
46+
const wordList = parseString(inputString, delimiter, Preserve);
47+
expect(wordList).toEqual(['foo', 'Bar', 'b@z', '']);
48+
}
49+
);
4750

4851
it('splits multiline input string by newline delimiter', () => {
4952
const input = `foo

demo/src/utils/wordList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function parseString(
1919
let words = raw.split(delimiter);
2020

2121
if (whitespaceHandling === WhitespaceHandling.TrimLeadingAndTrailing) {
22-
words = words.map(word => word.trim());
22+
words = words.map((word) => word.trim());
2323
}
2424

2525
return words;

package.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
{
22
"name": "strings-to-regex",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/wimpyprogrammer/strings-to-regex.git"
77
},
88
"description": "Condense a set of words into a regular expression pattern",
99
"author": "Drew Keller <[email protected]>",
1010
"license": "MIT",
11+
"publishConfig": {
12+
"registry": "https://registry.npmjs.org/"
13+
},
1114
"main": "lib/index.js",
1215
"types": "./lib/index.d.ts",
1316
"files": [
1417
"lib/"
1518
],
1619
"sideEffects": false,
1720
"engines": {
18-
"node": ">=10"
21+
"node": ">=12"
1922
},
2023
"scripts": {
2124
"build": "run-s clean build:*",
2225
"build:src": "babel src -d lib --extensions '.js,.ts'",
2326
"build:demo": "wp --config demo/webpack.config.js",
2427
"build:types": "tsc -p ./tsconfig.types.json",
28+
"changelog": "npx auto-changelog",
2529
"clean": "rimraf lib/*",
26-
"format": "prettier --write 'src/**'",
30+
"format": "prettier --write 'src/**' 'demo/**'",
2731
"lint": "run-s lint:*",
2832
"lint:src": "tsc -p ./tsconfig.json && eslint ./src --report-unused-disable-directives --ext .js,.ts --parser-options=project:./tsconfig.json",
2933
"lint:demo": "tsc -p ./demo/tsconfig.json && eslint ./demo --report-unused-disable-directives --ext .js,.ts --parser-options=project:./demo/tsconfig.json",
30-
"precommit": "pretty-quick --staged",
31-
"prepublish": "npx publish-please guard",
32-
"publish-please": "npx publish-please",
33-
"publish-please-prereqs": "run-s lint test build",
34+
"release": "npx release-it --no-increment",
3435
"test": "jest --coverage"
3536
},
3637
"jest": {
@@ -47,26 +48,24 @@
4748
"@babel/core": "^7.5.5",
4849
"@babel/preset-env": "^7.5.5",
4950
"@babel/preset-typescript": "^7.5.5",
50-
"@types/jest": "^26.0.0",
51+
"@types/jest": "^27.0.1",
5152
"@types/jest-when": "^2.7.0",
52-
"@typescript-eslint/eslint-plugin": "^4.14.0",
53-
"@typescript-eslint/parser": "^4.14.0",
54-
"eslint": "7.19.0",
55-
"eslint-config-airbnb-base": "14.2.1",
56-
"eslint-config-prettier": "^7.2.0",
57-
"eslint-import-resolver-typescript": "^2.3.0",
58-
"eslint-plugin-import": "^2.18.2",
59-
"eslint-plugin-jest": "^24.1.3",
60-
"husky": "^4.3.8",
61-
"jest": "^26.0.0",
53+
"@typescript-eslint/eslint-plugin": "^5.6.0",
54+
"@typescript-eslint/parser": "^5.6.0",
55+
"eslint": "8.4.1",
56+
"eslint-config-airbnb-base": "15.0.0",
57+
"eslint-config-prettier": "^8.3.0",
58+
"eslint-import-resolver-typescript": "^2.5.0",
59+
"eslint-plugin-import": "^2.25.3",
60+
"eslint-plugin-jest": "^25.2.1",
61+
"jest": "^27.0.1",
6262
"jest-when": "^3.1.0",
6363
"npm-run-all": "^4.1.5",
64-
"prettier": "^2.2.1",
65-
"pretty-quick": "^3.1.0",
64+
"prettier": "2.2.1",
6665
"regex-to-strings": "^2.0.1",
6766
"rimraf": "^3.0.2",
68-
"ts-jest": "^26.4.4",
69-
"ts-loader": "^8.0.15",
67+
"ts-jest": "^27.0.1",
68+
"ts-loader": "^9.1.2",
7069
"typescript": "^4.1.3",
7170
"webpack": "^5.0.0",
7271
"webpack-nano": "^1.1.1"

src/types/charTrie.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ interface CharTrieData {
44

55
export type Char = string;
66

7+
// eslint-disable-next-line no-use-before-define
78
export class CharTrie extends Map<Char, CharTrie> {
89
public static create(trieData: CharTrieData): CharTrie {
910
const trieDataPairs = Object.entries(trieData);

0 commit comments

Comments
 (0)