Skip to content

Commit

Permalink
Replace TSDX with Other Tooling (#33)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
BrianMitchL authored Mar 13, 2023
1 parent b3e06ef commit 2f79d5f
Show file tree
Hide file tree
Showing 12 changed files with 3,535 additions and 12,434 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,38 @@ name: CI
on: [push]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }}
name: Build and test on Node ${{ matrix.node }}
runs-on: ubuntu-latest

strategy:
matrix:
node: ['12.x', '14.x', '16.x']
node: ["16.x", "18.x"]

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

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

- name: Lint
run: npm run lint

- name: Check Formatting
run: npm run prettier -- --check

- name: Build
run: npm run build

- name: Test
run: npm run test -- --ci --coverage --maxWorkers=2
run: npm run test:coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: npm run build
12 changes: 0 additions & 12 deletions .github/workflows/size.yml

This file was deleted.

48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ possible matches, and many people, this will block the thread. To avoid this,
it is recommended to run the script in a WebWorker.

```typescript
import { calculate, Person } from 'gift-exchange';
import { calculate, Person } from "gift-exchange";

const people: Person[] = [
{
name: 'Brian'
name: "Brian",
},
{
name: 'Freja'
}
name: "Freja",
},
];

try {
const matches = calculate(people);
const pairs: { from: string; to: string }[] = people.map((person, i) => ({
from: person.name,
to: matches[i].name
to: matches[i].name,
}));
console.table(pairs);
} catch (e) {
Expand Down Expand Up @@ -95,43 +95,43 @@ a selector for any number of people that have the given `type` equal to the
`subject`.

```typescript
import { Person, Exclusion } from 'gift-exchange';
import { Person, Exclusion } from "gift-exchange";

const people: Person[] = [
{
name: 'Brian',
group: 'Mitchell'
name: "Brian",
group: "Mitchell",
},
{
name: 'Freja',
group: 'Andersen'
}
name: "Freja",
group: "Andersen",
},
];
const exclusions: Exclusion[] = [
// a person with the name "Brian" cannot be assigned to a person with the name
// "Freja" (but "Freja" could still be assigned to "Brian")
{
type: 'name',
subject: 'Brian',
excludedType: 'name',
excludedSubject: 'Freja'
type: "name",
subject: "Brian",
excludedType: "name",
excludedSubject: "Freja",
},
// anyone with the group "Andersen" cannot be assigned to a person with the
// name "Brian"
{
type: 'group',
subject: 'Andersen',
excludedType: 'name',
excludedSubject: 'Brian'
type: "group",
subject: "Andersen",
excludedType: "name",
excludedSubject: "Brian",
},
// anyone with the group "Andersen" cannot be assigned to a person with the
// group "Mitchell"
{
type: 'group',
subject: 'Andersen',
excludedType: 'group',
excludedSubject: 'Mitchell'
}
type: "group",
subject: "Andersen",
excludedType: "group",
excludedSubject: "Mitchell",
},
];
```

Expand Down
Loading

0 comments on commit 2f79d5f

Please sign in to comment.