Skip to content

Commit 2f79d5f

Browse files
authored
Replace TSDX with Other Tooling (#33)
* Replace tsdx with rollup, eslint, prettier, and vitest This also upgrades TypeScript to v4.9.5 Minimum node version to v14 * Upgrade to prettier 2 and use default settings * Bump minimum node version to 16 * Generate coverage data with additional reporters
1 parent b3e06ef commit 2f79d5f

File tree

12 files changed

+3535
-12434
lines changed

12 files changed

+3535
-12434
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,38 @@ name: CI
22
on: [push]
33
jobs:
44
build:
5-
name: Build, lint, and test on Node ${{ matrix.node }}
5+
name: Build and test on Node ${{ matrix.node }}
66
runs-on: ubuntu-latest
77

88
strategy:
99
matrix:
10-
node: ['12.x', '14.x', '16.x']
10+
node: ["16.x", "18.x"]
1111

1212
steps:
1313
- name: Checkout repo
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Use Node ${{ matrix.node }}
17-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v3
1818
with:
1919
node-version: ${{ matrix.node }}
2020

21-
- name: Install deps and build (with cache)
22-
uses: bahmutov/npm-install@v1
21+
- name: Install deps
22+
run: npm ci
2323

2424
- name: Lint
2525
run: npm run lint
2626

27+
- name: Check Formatting
28+
run: npm run prettier -- --check
29+
30+
- name: Build
31+
run: npm run build
32+
2733
- name: Test
28-
run: npm run test -- --ci --coverage --maxWorkers=2
34+
run: npm run test:coverage
2935

3036
- name: Coveralls
3137
uses: coverallsapp/github-action@master
3238
with:
3339
github-token: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- name: Build
36-
run: npm run build

.github/workflows/size.yml

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

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ possible matches, and many people, this will block the thread. To avoid this,
4545
it is recommended to run the script in a WebWorker.
4646

4747
```typescript
48-
import { calculate, Person } from 'gift-exchange';
48+
import { calculate, Person } from "gift-exchange";
4949

5050
const people: Person[] = [
5151
{
52-
name: 'Brian'
52+
name: "Brian",
5353
},
5454
{
55-
name: 'Freja'
56-
}
55+
name: "Freja",
56+
},
5757
];
5858

5959
try {
6060
const matches = calculate(people);
6161
const pairs: { from: string; to: string }[] = people.map((person, i) => ({
6262
from: person.name,
63-
to: matches[i].name
63+
to: matches[i].name,
6464
}));
6565
console.table(pairs);
6666
} catch (e) {
@@ -95,43 +95,43 @@ a selector for any number of people that have the given `type` equal to the
9595
`subject`.
9696

9797
```typescript
98-
import { Person, Exclusion } from 'gift-exchange';
98+
import { Person, Exclusion } from "gift-exchange";
9999

100100
const people: Person[] = [
101101
{
102-
name: 'Brian',
103-
group: 'Mitchell'
102+
name: "Brian",
103+
group: "Mitchell",
104104
},
105105
{
106-
name: 'Freja',
107-
group: 'Andersen'
108-
}
106+
name: "Freja",
107+
group: "Andersen",
108+
},
109109
];
110110
const exclusions: Exclusion[] = [
111111
// a person with the name "Brian" cannot be assigned to a person with the name
112112
// "Freja" (but "Freja" could still be assigned to "Brian")
113113
{
114-
type: 'name',
115-
subject: 'Brian',
116-
excludedType: 'name',
117-
excludedSubject: 'Freja'
114+
type: "name",
115+
subject: "Brian",
116+
excludedType: "name",
117+
excludedSubject: "Freja",
118118
},
119119
// anyone with the group "Andersen" cannot be assigned to a person with the
120120
// name "Brian"
121121
{
122-
type: 'group',
123-
subject: 'Andersen',
124-
excludedType: 'name',
125-
excludedSubject: 'Brian'
122+
type: "group",
123+
subject: "Andersen",
124+
excludedType: "name",
125+
excludedSubject: "Brian",
126126
},
127127
// anyone with the group "Andersen" cannot be assigned to a person with the
128128
// group "Mitchell"
129129
{
130-
type: 'group',
131-
subject: 'Andersen',
132-
excludedType: 'group',
133-
excludedSubject: 'Mitchell'
134-
}
130+
type: "group",
131+
subject: "Andersen",
132+
excludedType: "group",
133+
excludedSubject: "Mitchell",
134+
},
135135
];
136136
```
137137

0 commit comments

Comments
 (0)